From 604e74632093219b1eb972876b6bb0c3350f82eb Mon Sep 17 00:00:00 2001 From: Markus Mirz Date: Tue, 26 Mar 2024 20:45:21 +0100 Subject: [PATCH 1/9] remove arabica submodule Signed-off-by: Markus Mirz --- .gitmodules | 3 --- thirdparty/CMakeLists.txt | 10 ---------- thirdparty/arabica | 1 - 3 files changed, 14 deletions(-) delete mode 100644 .gitmodules delete mode 100644 thirdparty/CMakeLists.txt delete mode 160000 thirdparty/arabica diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 2f8fa4620..000000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule "thirdparty/arabica"] - path = thirdparty/arabica - url = https://github.com/RWTH-ACS/arabica diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt deleted file mode 100644 index 225d6940e..000000000 --- a/thirdparty/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ -# include arabica -set(BUILD_ARABICA_EXAMPLES OFF CACHE BOOL "Build arabica with examples") -if (NOT ARABICA_XML_BACKEND) - if(WIN32) - set(ARABICA_XML_BACKEND USE_MSXML) - else() - set(ARABICA_XML_BACKEND USE_LIBXML2) - endif() -endif() -add_subdirectory(arabica) diff --git a/thirdparty/arabica b/thirdparty/arabica deleted file mode 160000 index 17ad68394..000000000 --- a/thirdparty/arabica +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 17ad68394e443d778948dd707af2201a05f614f4 From bb0c5cea7be7a4620c621efd7394ba414bfb1ac5 Mon Sep 17 00:00:00 2001 From: Markus Mirz Date: Tue, 26 Mar 2024 21:19:36 +0100 Subject: [PATCH 2/9] add required arabica code Signed-off-by: Markus Mirz --- CMakeLists.txt | 2 +- arabica/.gitignore | 103 + arabica/CMakeLists.txt | 152 + arabica/LICENSE | 32 + arabica/include/Arabica/StringAdaptor.hpp | 252 ++ arabica/include/Arabica/getparam.hpp | 54 + arabica/include/Arabica/mbstate.hpp | 23 + arabica/include/Arabica/stringadaptortag.hpp | 13 + arabica/include/SAX/ArabicaConfig.hpp.in | 12 + arabica/include/SAX/AttributeList.hpp | 193 ++ arabica/include/SAX/Attributes.hpp | 272 ++ arabica/include/SAX/ContentHandler.hpp | 341 ++ arabica/include/SAX/DTDHandler.hpp | 127 + arabica/include/SAX/DocumentHandler.hpp | 76 + arabica/include/SAX/EntityResolver.hpp | 117 + arabica/include/SAX/ErrorHandler.hpp | 123 + arabica/include/SAX/HandlerBase.hpp | 291 ++ arabica/include/SAX/IStreamHandle.hpp | 452 +++ arabica/include/SAX/InputSource.hpp | 337 ++ arabica/include/SAX/Locator.hpp | 131 + arabica/include/SAX/Parser.hpp | 166 + arabica/include/SAX/ParserConfig.hpp | 91 + arabica/include/SAX/SAXException.hpp | 68 + .../include/SAX/SAXNotRecognizedException.hpp | 54 + .../include/SAX/SAXNotSupportedException.hpp | 56 + arabica/include/SAX/SAXParseException.hpp | 170 + arabica/include/SAX/XMLFilter.hpp | 71 + arabica/include/SAX/XMLReader.hpp | 450 +++ arabica/include/SAX/ext/Attributes2.hpp | 79 + arabica/include/SAX/ext/DeclHandler.hpp | 135 + arabica/include/SAX/ext/LexicalHandler.hpp | 202 ++ arabica/include/SAX/ext/Locator2.hpp | 75 + .../include/SAX/helpers/AttributeDefaults.hpp | 34 + .../include/SAX/helpers/AttributeListImpl.hpp | 296 ++ .../include/SAX/helpers/AttributeTypes.hpp | 48 + .../include/SAX/helpers/AttributesImpl.hpp | 587 ++++ .../include/SAX/helpers/DefaultHandler.hpp | 603 ++++ arabica/include/SAX/helpers/FeatureNames.hpp | 95 + .../SAX/helpers/InputSourceResolver.hpp | 63 + .../include/SAX/helpers/NamespaceSupport.hpp | 390 +++ arabica/include/SAX/helpers/PropertyNames.hpp | 53 + arabica/include/SAX/helpers/XMLFilterImpl.hpp | 608 ++++ arabica/include/SAX/saxfwd.hpp | 89 + arabica/include/SAX/wrappers/saxlibxml2.hpp | 955 ++++++ arabica/include/Taggle/Taggle.hpp | 13 + arabica/include/Taggle/impl/Element.hpp | 363 ++ arabica/include/Taggle/impl/ElementType.hpp | 333 ++ arabica/include/Taggle/impl/Parser.hpp | 1389 ++++++++ arabica/include/Taggle/impl/ScanHandler.hpp | 108 + arabica/include/Taggle/impl/Scanner.hpp | 47 + arabica/include/Taggle/impl/Schema.hpp | 44 + arabica/include/Taggle/impl/SchemaImpl.hpp | 182 + .../include/Taggle/impl/html/HTMLModels.hpp | 49 + .../include/Taggle/impl/html/HTMLScanner.hpp | 707 ++++ .../include/Taggle/impl/html/HTMLSchema.hpp | 2955 +++++++++++++++++ arabica/include/XML/QName.hpp | 194 ++ arabica/include/XML/XMLCharacterClasses.hpp | 28 + arabica/include/XML/strings.hpp | 77 + .../convert/impl/codecvt_specialisations.hpp | 131 + arabica/include/convert/impl/ucs2_utf16.hpp | 27 + arabica/include/convert/impl/ucs2_utf8.hpp | 23 + arabica/include/convert/utf8ucs2codecvt.hpp | 70 + arabica/include/io/convertstream.hpp | 282 ++ arabica/include/io/socket_stream.hpp | 436 +++ arabica/include/io/uri.hpp | 84 + arabica/include/text/UnicodeCharacters.hpp | 292 ++ arabica/include/text/normalize_whitespace.hpp | 50 + .../src/SAX/helpers/InputSourceResolver.cpp | 143 + arabica/src/SAX/wrappers/saxlibxml2.cpp | 249 ++ arabica/src/XML/XMLCharacterClasses.cpp | 288 ++ arabica/src/arabica.cpp | 9 + arabica/src/convert/impl/ucs2_utf16.cpp | 57 + arabica/src/convert/impl/ucs2_utf8.cpp | 103 + arabica/src/convert/utf8ucs2codecvt.cpp | 85 + arabica/src/io/uri.cpp | 197 ++ arabica/src/taggle/Schema.cpp | 14 + 76 files changed, 17569 insertions(+), 1 deletion(-) create mode 100644 arabica/.gitignore create mode 100644 arabica/CMakeLists.txt create mode 100644 arabica/LICENSE create mode 100644 arabica/include/Arabica/StringAdaptor.hpp create mode 100644 arabica/include/Arabica/getparam.hpp create mode 100644 arabica/include/Arabica/mbstate.hpp create mode 100644 arabica/include/Arabica/stringadaptortag.hpp create mode 100644 arabica/include/SAX/ArabicaConfig.hpp.in create mode 100644 arabica/include/SAX/AttributeList.hpp create mode 100644 arabica/include/SAX/Attributes.hpp create mode 100644 arabica/include/SAX/ContentHandler.hpp create mode 100644 arabica/include/SAX/DTDHandler.hpp create mode 100644 arabica/include/SAX/DocumentHandler.hpp create mode 100644 arabica/include/SAX/EntityResolver.hpp create mode 100644 arabica/include/SAX/ErrorHandler.hpp create mode 100644 arabica/include/SAX/HandlerBase.hpp create mode 100644 arabica/include/SAX/IStreamHandle.hpp create mode 100644 arabica/include/SAX/InputSource.hpp create mode 100644 arabica/include/SAX/Locator.hpp create mode 100644 arabica/include/SAX/Parser.hpp create mode 100644 arabica/include/SAX/ParserConfig.hpp create mode 100644 arabica/include/SAX/SAXException.hpp create mode 100644 arabica/include/SAX/SAXNotRecognizedException.hpp create mode 100644 arabica/include/SAX/SAXNotSupportedException.hpp create mode 100644 arabica/include/SAX/SAXParseException.hpp create mode 100644 arabica/include/SAX/XMLFilter.hpp create mode 100644 arabica/include/SAX/XMLReader.hpp create mode 100644 arabica/include/SAX/ext/Attributes2.hpp create mode 100644 arabica/include/SAX/ext/DeclHandler.hpp create mode 100644 arabica/include/SAX/ext/LexicalHandler.hpp create mode 100644 arabica/include/SAX/ext/Locator2.hpp create mode 100644 arabica/include/SAX/helpers/AttributeDefaults.hpp create mode 100644 arabica/include/SAX/helpers/AttributeListImpl.hpp create mode 100644 arabica/include/SAX/helpers/AttributeTypes.hpp create mode 100644 arabica/include/SAX/helpers/AttributesImpl.hpp create mode 100644 arabica/include/SAX/helpers/DefaultHandler.hpp create mode 100644 arabica/include/SAX/helpers/FeatureNames.hpp create mode 100644 arabica/include/SAX/helpers/InputSourceResolver.hpp create mode 100644 arabica/include/SAX/helpers/NamespaceSupport.hpp create mode 100644 arabica/include/SAX/helpers/PropertyNames.hpp create mode 100644 arabica/include/SAX/helpers/XMLFilterImpl.hpp create mode 100644 arabica/include/SAX/saxfwd.hpp create mode 100644 arabica/include/SAX/wrappers/saxlibxml2.hpp create mode 100644 arabica/include/Taggle/Taggle.hpp create mode 100755 arabica/include/Taggle/impl/Element.hpp create mode 100755 arabica/include/Taggle/impl/ElementType.hpp create mode 100644 arabica/include/Taggle/impl/Parser.hpp create mode 100755 arabica/include/Taggle/impl/ScanHandler.hpp create mode 100755 arabica/include/Taggle/impl/Scanner.hpp create mode 100644 arabica/include/Taggle/impl/Schema.hpp create mode 100644 arabica/include/Taggle/impl/SchemaImpl.hpp create mode 100644 arabica/include/Taggle/impl/html/HTMLModels.hpp create mode 100644 arabica/include/Taggle/impl/html/HTMLScanner.hpp create mode 100644 arabica/include/Taggle/impl/html/HTMLSchema.hpp create mode 100644 arabica/include/XML/QName.hpp create mode 100644 arabica/include/XML/XMLCharacterClasses.hpp create mode 100755 arabica/include/XML/strings.hpp create mode 100644 arabica/include/convert/impl/codecvt_specialisations.hpp create mode 100644 arabica/include/convert/impl/ucs2_utf16.hpp create mode 100644 arabica/include/convert/impl/ucs2_utf8.hpp create mode 100644 arabica/include/convert/utf8ucs2codecvt.hpp create mode 100644 arabica/include/io/convertstream.hpp create mode 100644 arabica/include/io/socket_stream.hpp create mode 100644 arabica/include/io/uri.hpp create mode 100644 arabica/include/text/UnicodeCharacters.hpp create mode 100644 arabica/include/text/normalize_whitespace.hpp create mode 100644 arabica/src/SAX/helpers/InputSourceResolver.cpp create mode 100644 arabica/src/SAX/wrappers/saxlibxml2.cpp create mode 100644 arabica/src/XML/XMLCharacterClasses.cpp create mode 100644 arabica/src/arabica.cpp create mode 100644 arabica/src/convert/impl/ucs2_utf16.cpp create mode 100644 arabica/src/convert/impl/ucs2_utf8.cpp create mode 100644 arabica/src/convert/utf8ucs2codecvt.cpp create mode 100644 arabica/src/io/uri.cpp create mode 100644 arabica/src/taggle/Schema.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 70b5371c8..35a36ec29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,7 @@ if(CIMPP_BUILD_DOC) add_subdirectory(doc) endif() -add_subdirectory(thirdparty) +add_subdirectory(arabica) if(NOT USE_CIM_VERSION) set(USE_CIM_VERSION "CGMES_2.4.15_27JAN2020" CACHE STRING "Define CIM Version") diff --git a/arabica/.gitignore b/arabica/.gitignore new file mode 100644 index 000000000..3c415b35c --- /dev/null +++ b/arabica/.gitignore @@ -0,0 +1,103 @@ +*.o +*~ +*.tar.gz +*.tar.bz2 +*.zip +*.ilk +*.pdb +*.exp +*.lib +*.bsc +*.exe +*.lo +*.la +*.ncb +*.suo +*.lnk +*.dll +*.log +*.trs +*.sdf +*.opensdf +*.DS_Store* + +lib +doc/html + +.libs +.deps +.dirstamp +arabica.pc + +include/SAX/ArabicaConfig.hpp +include/SAX/stamp-h1 +tests/XSLT/test_path.hpp + +*/Debug* +*/Release* + +# IDE files +vs9/mangle.sln +vs9/*.user +vs10/mangle.sln +*.vcxproj.filters +*.vcxproj.user + +.idea + +# Examples +examples/DOM/dom2pyx +examples/DOM/domwriter +examples/SAX/pyx +examples/SAX/simple_handler +examples/SAX/writer +examples/SAX/xmlbase +examples/Taggle/taggle +examples/Utils/transcode +examples/XPath/xgrep +examples/XSLT/mangle +fractal*.html +tests/SAX/filter_test* +tests/DOM/dom_test* +tests/XPath/xpath_test* +tests/Taggle/taggle_test +tests/Utils/utils_test* +tests/XSLT/xslt_test* +bin/mandelbrot-*.html + +# Autoconf +m4/lt~obsolete.m4 +m4/ltversion.m4 +m4/ltsugar.m4 +m4/ltoptions.m4 +m4/libtool.m4 +test-driver +libtool +ltmain.sh +config.log +config.status +config.cache +configure +compile +autom4te.cache +missing +Makefile +Makefile.in +aclocal.m4 + +# CMake +CMakeCache.txt +CMakeFiles +CMakeFiles/* +cmake_install.cmake + +build/* +cmake-build-debug/ + +# Misc +*.stackdump + +spec +gmon.out +ipch +test_path.hpp diff --git a/arabica/CMakeLists.txt b/arabica/CMakeLists.txt new file mode 100644 index 000000000..ed4eff2fb --- /dev/null +++ b/arabica/CMakeLists.txt @@ -0,0 +1,152 @@ +cmake_minimum_required(VERSION 3.5) + +project(arabica) + +# Enable C++11 support +set(CMAKE_CXX_STANDARD 11) + +set(LIB_NAME arabica) + +set(ARABICA_MAJOR_VERSION 2016) +set(ARABICA_MINOR_VERSION January) + +# +# Build as shared library +# +option(BUILD_SHARED_LIBS "Build as shared libaries" OFF) + +# +# Set the used xml backend +# options: USE_MSXML, USE_EXPAT, USE_LIBXML2, USE_XERCES +set(ARABICA_XML_BACKEND USE_LIBXML2) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/include/SAX/ArabicaConfig.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/include/SAX/ArabicaConfig.hpp) + +# +# find libxml2: LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES +if(ARABICA_XML_BACKEND STREQUAL USE_LIBXML2) + find_package(LibXml2) + set(ADDITIONAL_INC ${LIBXML2_INCLUDE_DIR}) + set(ADDITIONAL_LIB ${LIBXML2_LIBRARIES}) +endif() + +# +# platform check +set(BUILD_X64 TRUE) + +set(GENERATED_HEADER_FILES + ${CMAKE_CURRENT_BINARY_DIR}/include/SAX/ArabicaConfig.hpp +) +source_group("Generated Header Files" FILES ${GENERATED_HEADER_FILES}) + +set(PUBLIC_HEADER_FILES + include/SAX/AttributeList.hpp + include/SAX/Attributes.hpp + include/SAX/ContentHandler.hpp + include/SAX/DocumentHandler.hpp + include/SAX/DTDHandler.hpp + include/SAX/EntityResolver.hpp + include/SAX/ErrorHandler.hpp + include/SAX/HandlerBase.hpp + include/SAX/InputSource.hpp + include/SAX/IStreamHandle.hpp + include/SAX/Locator.hpp + include/SAX/Parser.hpp + include/SAX/ParserConfig.hpp + include/SAX/SAXException.hpp + include/SAX/saxfwd.hpp + include/SAX/SAXNotRecognizedException.hpp + include/SAX/SAXNotSupportedException.hpp + include/SAX/SAXParseException.hpp + include/SAX/XMLFilter.hpp + include/SAX/XMLReader.hpp + include/SAX/ext/Attributes2.hpp + include/SAX/ext/DeclHandler.hpp + include/SAX/ext/LexicalHandler.hpp + include/SAX/ext/Locator2.hpp + include/SAX/helpers/AttributeDefaults.hpp + include/SAX/helpers/AttributeListImpl.hpp + include/SAX/helpers/AttributesImpl.hpp + include/SAX/helpers/AttributeTypes.hpp + include/SAX/helpers/DefaultHandler.hpp + include/SAX/helpers/FeatureNames.hpp + include/SAX/helpers/InputSourceResolver.hpp + include/SAX/helpers/NamespaceSupport.hpp + include/SAX/helpers/PropertyNames.hpp + include/SAX/helpers/XMLFilterImpl.hpp + include/SAX/wrappers/saxlibxml2.hpp + include/Arabica/getparam.hpp + include/Arabica/StringAdaptor.hpp + include/XML/QName.hpp + include/XML/strings.hpp + include/XML/XMLCharacterClasses.hpp + include/io/convertstream.hpp + include/io/socket_stream.hpp + include/io/uri.hpp + include/convert/impl/codecvt_specialisations.hpp + include/convert/impl/ucs2_utf16.hpp + include/convert/impl/ucs2_utf8.hpp + include/convert/utf8ucs2codecvt.hpp + include/text/normalize_whitespace.hpp + include/text/UnicodeCharacters.hpp + include/Taggle/impl/Element.hpp + include/Taggle/impl/ElementType.hpp + include/Taggle/impl/html/HTMLModels.hpp + include/Taggle/impl/html/HTMLScanner.hpp + include/Taggle/impl/html/HTMLSchema.hpp + include/Taggle/impl/Parser.hpp + include/Taggle/impl/ScanHandler.hpp + include/Taggle/impl/Scanner.hpp + include/Taggle/impl/Schema.hpp + include/Taggle/impl/SchemaImpl.hpp + include/Taggle/Taggle.hpp + ) +source_group("Header Files" FILES ${PUBLIC_HEADER_FILES}) + +set(SOURCE_FILES + src/arabica.cpp + src/XML/XMLCharacterClasses.cpp + src/SAX/helpers/InputSourceResolver.cpp + src/io/uri.cpp + src/convert/impl/ucs2_utf16.cpp + src/convert/impl/ucs2_utf8.cpp + src/convert/utf8ucs2codecvt.cpp + src/taggle/Schema.cpp +) +source_group("Source Files" FILES ${SOURCE_FILES}) + + +add_library (${LIB_NAME} + ${GENERATED_HEADER_FILES} + ${PUBLIC_HEADER_FILES} + ${SOURCE_FILES} +) +target_compile_definitions(${LIB_NAME} PUBLIC "$<$:ARABICA_DEBUG>") +target_compile_definitions(${LIB_NAME} PUBLIC ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS) +target_include_directories(${LIB_NAME} PUBLIC $) +target_include_directories(${LIB_NAME} PUBLIC ${ADDITIONAL_INC} ${Boost_INCLUDE_DIRS}) +target_include_directories(${LIB_NAME} PUBLIC $) +# link backend +target_link_libraries(${LIB_NAME} ${ADDITIONAL_LIB}) + +set_target_properties(${LIB_NAME} PROPERTIES FOLDER "3rdparty/arabica") + +# +# Install library +# +install(TARGETS ${LIB_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static +) + +install(DIRECTORY include/ + DESTINATION include/${PROJECT_NAME} + FILES_MATCHING + PATTERN *.hpp + PATTERN *.h +) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/SAX/ArabicaConfig.hpp + DESTINATION include/${PROJECT_NAME}/SAX +) diff --git a/arabica/LICENSE b/arabica/LICENSE new file mode 100644 index 000000000..2cef36588 --- /dev/null +++ b/arabica/LICENSE @@ -0,0 +1,32 @@ +Copyright 2001-2017 Jez UK Ltd +All rights reserved. + +Redistribution and use in source and binary forms, with or +without modification, are permitted provided that the following +conditions are met: + + Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials + provided with the distribution. + Neither the name of Jez UK Ltd nor the names of + contributors may be used to endorse or promote products + derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND +CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR +TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +OF SUCH DAMAGE. diff --git a/arabica/include/Arabica/StringAdaptor.hpp b/arabica/include/Arabica/StringAdaptor.hpp new file mode 100644 index 000000000..5983f813e --- /dev/null +++ b/arabica/include/Arabica/StringAdaptor.hpp @@ -0,0 +1,252 @@ +#ifndef ARABICA_UTILS_STRING_ADAPTOR_H +#define ARABICA_UTILS_STRING_ADAPTOR_H + +#include +#include +#include +#include +#include + +namespace Arabica +{ + +template class default_string_adaptor; + +template +class default_string_adaptor_base +{ +public: + typedef stringT string_type; + typedef typename string_type::const_iterator const_iterator; + typedef typename string_type::iterator mutable_iterator; + typedef typename string_type::const_reverse_iterator const_reverse_iterator; + typedef typename string_type::iterator iterator; + typedef typename string_type::value_type value_type; + typedef typename string_type::size_type size_type; + + virtual ~default_string_adaptor_base() {} + + static size_type npos() + { + return static_cast(-1); + } + + //todo: is this safe? + template + static inline string_type construct(InputIterator from, InputIterator to) + { + return string_type(from, to); + } + + static inline string_type construct(const_iterator from, const_iterator to) + { + return string_type(from, to); + } + + static inline string_type construct(const std::basic_string& str) + { + return construct(str.begin(), str.end()); + } // construct + + static string_type construct(const value_type* str) + { + return str ? string_type(str) : string_type(); + } + + static const string_type& empty_string() { static string_type es; return es; } + + //todo: fix for utf8 + static size_type length(const string_type& str) { return str.length(); } + + // all these functions should operate as std::string member functions do + static bool empty(const string_type& str) { return str.empty(); } + static size_type find(const string_type& str, value_type what) { return str.find(what); } + static size_type find(const string_type& str, const string_type& what) { return str.find(what); } + static size_type find(const string_type& str, value_type what, size_type from) { return str.find(what, from); } + static size_type find(const string_type& str, const string_type& what, size_type from) { return str.find(what, from); } + static string_type substr(const string_type& str, const size_type& offset) { return str.substr(offset); } + static string_type substr(const string_type& str, const size_type& offset, const size_type& count) { return str.substr(offset, count); } + static void append(string_type& str, const string_type& a) { str.append(a); } + static void append(string_type& str, const value_type& a) { str += a; } + static string_type concat(const string_type& str, const string_type& a) { return str + a; } + static string_type concat(const string_type& str, const value_type& a) { return str + a; } + static void insert(string_type& str, size_type offset, const string_type& a) { str.insert(offset, a); } + static void replace(string_type& str, size_type offset, size_type count, const string_type& a) { str.replace(offset, count, a); } + + static const_iterator begin(const string_type& str) { return str.begin(); } + static const_iterator end(const string_type& str) { return str.end(); } + + static iterator begin(string_type& str) { return str.begin(); } + static iterator end(string_type& str) { return str.end(); } + + static const_reverse_iterator rbegin(const string_type& str) { return str.rbegin(); } + + // only used to constuct error strings - don't have to be highly efficient! + static std::string asStdString(const string_type& str); + +#ifndef ARABICA_NO_WCHAR_T + static string_type construct_from_utf16(const wchar_t* str); + static string_type construct_from_utf16(const wchar_t* str, int length); + static std::wstring asStdWString(const string_type& str); + + typedef Arabica::io::basic_iconvertstream, + char, std::char_traits > widener_t; + typedef Arabica::io::basic_oconvertstream, + char, std::char_traits > narrower_t; + + + static const std::locale& utf8ucs2_locale() + { + static const std::locale loc = std::locale(std::locale(), new Arabica::convert::utf8ucs2codecvt); + return loc; + } +#endif //ARABICA_NO_WCHAR_T + +}; // class default_string_adaptor_base + + +// specialize for std::string and std::wstring +template<> +class default_string_adaptor : + public string_adaptor_tag, + public default_string_adaptor_base +{ +public: + + static char convert_from_utf8(char c) { return c; } + + static std::string construct_from_utf8(const char* str) + { + return str ? std::string(str) : std::string(); + } // construct_from_utf8 + + static std::string construct_from_utf8(const char* str, int length) + { + return std::string(str, length); + } // construct_from_utf8 + + static const std::string& asStdString(const std::string& str) + { + return str; + } // asStdString + +#ifndef ARABICA_NO_WCHAR_T + static std::string construct_from_utf16(const wchar_t* str) + { + narrower_t n; + n.imbue(utf8ucs2_locale()); + n.str(str ? str : L""); + //n << str; + return n.str(); + } + + static std::string construct_from_utf16(const wchar_t* str, int length) + { + narrower_t n; + n.imbue(utf8ucs2_locale()); + n.str(std::wstring(str, length)); + //for(int i = 0; i < length; ++i) + // n << str[i]; + return n.str(); + } // construct_from_utf16 + + static std::wstring asStdWString(const std::string& str) + { + widener_t w; + w.imbue(utf8ucs2_locale()); + w.str(str); + return w.str(); + } // toStdWString +#endif //ARABICA_NO_WCHAR_T + +}; // class default_string_adaptor + + +#ifndef ARABICA_NO_WCHAR_T + +template<> +class default_string_adaptor : + public string_adaptor_tag, + public default_string_adaptor_base +{ +public: + + static wchar_t makeValueT(char c) + { + return static_cast(c); + } // makeValueT + + template + static inline string_type construct(InputIterator from, InputIterator to) + { + return string_type(from, to); + } + + static inline string_type construct(const_iterator from, const_iterator to) + { + return string_type(from, to); + } + + static inline string_type construct(const std::basic_string& str) + { + return construct(str.begin(), str.end()); + } // construct + + static string_type construct(const value_type* str) + { + return str ? string_type(str) : string_type(); + } + + static std::wstring construct(const std::string& str) + { + return construct_from_utf8(str.c_str()); + } + + static std::wstring construct_from_utf8(const char* str) + { + widener_t w; + w.imbue(utf8ucs2_locale()); + w.str(str ? str : ""); + return w.str(); + } + + static std::wstring construct_from_utf8(const char* str, int length) + { + widener_t w; + w.imbue(utf8ucs2_locale()); + w.str(std::string(str, length)); + return w.str(); + } + + static std::wstring construct_from_utf16(const wchar_t* str) + { + return str ? std::wstring(str) : std::wstring(); + } + + static std::wstring construct_from_utf16(const wchar_t* str, int length) + { + return std::wstring(str, length); + } + + static std::string asStdString(const std::wstring& str) + { + narrower_t n; + n.imbue(utf8ucs2_locale()); + n.str(str); + return n.str(); + } // toStdString + + static const std::wstring& asStdWString(const std::wstring& str) + { + return str; + } // toStdWString + +}; // class default_string_adaptor + + +#endif // ARABICA_NO_WCHAR_T + +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/Arabica/getparam.hpp b/arabica/include/Arabica/getparam.hpp new file mode 100644 index 000000000..3d54a645a --- /dev/null +++ b/arabica/include/Arabica/getparam.hpp @@ -0,0 +1,54 @@ +#ifndef ARABICA_UTILS_GET_PARAM_HPP +#define ARABICA_UTILS_GET_PARAM_HPP + +#ifdef ARABICA_HAVE_BOOST +#include +#include +#endif + +namespace Arabica +{ + +struct nil_t { }; + +#ifdef ARABICA_HAVE_BOOST +template +struct get_param +{ + typedef typename boost::mpl::if_< + boost::is_base_and_derived + , T0 + , typename boost::mpl::if_< + boost::is_base_and_derived + , T1 + , DefaultT + >::type + >::type type; +}; // get_param +#else +template +struct chosen_type { typedef T0 type; }; + +template +struct chosen_type { typedef DefaultT type; }; + +template +struct get_param +{ + typedef typename chosen_type::type type; +}; +#endif + +template +struct get_string_adaptor +{ + typedef typename get_param, + T0, + T1>::type type; +}; + +} // namespace Arabica + +#endif + diff --git a/arabica/include/Arabica/mbstate.hpp b/arabica/include/Arabica/mbstate.hpp new file mode 100644 index 000000000..6edf72688 --- /dev/null +++ b/arabica/include/Arabica/mbstate.hpp @@ -0,0 +1,23 @@ +#ifndef ARABICA_MBSTATE_T +#define ARABICA_MBSTATE_T + +#ifdef ARABICA_NO_STD_MBSTATE_T + +#ifndef ARABICA_NO_MBSTATE_T +#include +namespace std { + using ::mbstate_t; +} +#else +namespace std { + typedef struct + { + int dummy; /* So that {0} is a valid constant initializer. */ + } mbstate_t; +} +#endif + + +#endif + +#endif diff --git a/arabica/include/Arabica/stringadaptortag.hpp b/arabica/include/Arabica/stringadaptortag.hpp new file mode 100644 index 000000000..a9706d6a8 --- /dev/null +++ b/arabica/include/Arabica/stringadaptortag.hpp @@ -0,0 +1,13 @@ +#ifndef ARABICA_STRING_ADAPTOR_TAG_HPP +#define ARABICA_STRING_ADAPTOR_TAG_HPP + +namespace Arabica +{ + +struct string_adaptor_tag { + virtual ~string_adaptor_tag() {} +}; + +} // namespace Arabica + +#endif diff --git a/arabica/include/SAX/ArabicaConfig.hpp.in b/arabica/include/SAX/ArabicaConfig.hpp.in new file mode 100644 index 000000000..1934dc60f --- /dev/null +++ b/arabica/include/SAX/ArabicaConfig.hpp.in @@ -0,0 +1,12 @@ +#ifndef ARABICA_ARABICA_CONFIG_H +#define ARABICA_ARABICA_CONFIG_H + +#cmakedefine ARABICA_NO_WCHAR_T +#cmakedefine ARABICA_VS6_WORKAROUND +#cmakedefine ARABICA_NO_CODECVT_SPECIALISATIONS +#cmakedefine ARABICA_USE_WINSOCK +#cmakedefine ARABICA_WINDOWS +#cmakedefine ARABICA_HAVE_BOOST +#define ARABICA_@ARABICA_XML_BACKEND@ + +#endif // ARABICA_ARABICA_CONFIG_H diff --git a/arabica/include/SAX/AttributeList.hpp b/arabica/include/SAX/AttributeList.hpp new file mode 100644 index 000000000..99fc82fa8 --- /dev/null +++ b/arabica/include/SAX/AttributeList.hpp @@ -0,0 +1,193 @@ +#ifndef ARABICA_ATTRIBUTES_LIST_H +#define ARABICA_ATTRIBUTES_LIST_H + +// SAX Attribute List Interface. +// $Id$ + +#include + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Interface for an element's attribute specifications. + * + *

This is the original SAX1 interface for reporting an element's + * attributes. Unlike the new {@link Attributes Attributes} + * interface, it does not support Namespace-related information.

+ * + *

When an attribute list is supplied as part of a + * {@link DocumentHandler#startElement startElement} + * event, the list will return valid results only during the + * scope of the event; once the event handler returns control + * to the parser, the attribute list is invalid. To save a + * persistent copy of the attribute list, use the SAX1 + * {@link AttributeListImpl AttributeListImpl} + * helper class.

+ * + *

An attribute list includes only attributes that have been + * specified or defaulted: #IMPLIED attributes will not be included.

+ * + *

There are two ways for the SAX application to obtain information + * from the AttributeList. First, it can iterate through the entire + * list:

+ * + *
+ * void startElement(const stringT& name, const AttributeListT& atts) 
+ * {
+ *   for(int i = 0; i < atts.getLength(); ++i) 
+ *   {
+ *     stringT name = atts.getName(i);
+ *     stringT type = atts.getType(i);
+ *     stringT value = atts.getValue(i);
+ *     [...]
+ *   }
+ * }
+ * 
+ * + *

(Note that the result of getLength() will be zero if there + * are no attributes.) + * + *

As an alternative, the application can request the value or + * type of specific attributes:

+ * + *
+ * void startElement(const string& name, const AttributeListT& atts) 
+ * {
+ *   stringT identifier = atts.getValue("id");
+ *   stringT label = atts.getValue("label");
+ *   [...]
+ * }
+ * 
+ * + * @deprecated This interface has been replaced by the SAX2 + * {@link Attributes Attributes} + * interface, which includes Namespace support. + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see DocumentHandler#startElement startElement + * @see AttributeListImpl + */ +template +class AttributeList +{ +public: + typedef string_type stringT; + + virtual ~AttributeList() { } + + // + // Iteration methods. + // + /** + * Return the number of attributes in this list. + * + *

The SAX parser may provide attributes in any + * arbitrary order, regardless of the order in which they were + * declared or specified. The number of attributes may be + * zero.

+ * + * @return The number of attributes in the list. + */ + virtual int getLength() const = 0; + /** + * Return the name of an attribute in this list (by position). + * + *

The names must be unique: the SAX parser shall not include the + * same attribute twice. Attributes without values (those declared + * #IMPLIED without a value specified in the start tag) will be + * omitted from the list.

+ * + *

If the attribute name has a namespace prefix, the prefix + * will still be attached.

+ * + * @param i The index of the attribute in the list (starting at 0). + * @return The name of the indexed attribute, or an empty string + * if the index is out of range. + * @see #getLength + */ + virtual const stringT& getName(int i) const = 0; + /** + * Return the type of an attribute in the list (by position). + * + *

The attribute type is one of the strings "CDATA", "ID", + * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", + * or "NOTATION" (always in upper case).

+ * + *

If the parser has not read a declaration for the attribute, + * or if the parser does not report attribute types, then it must + * return the value "CDATA" as stated in the XML 1.0 Recommentation + * (clause 3.3.3, "Attribute-Value Normalization").

+ * + *

For an enumerated attribute that is not a notation, the + * parser will report the type as "NMTOKEN".

+ * + * @param i The index of the attribute in the list (starting at 0). + * @return The attribute type as a string, or + * an empty string if the index is out of range. + * @see #getLength + * @see #getType(const stringT&) + */ + virtual const stringT& getType(int i) const = 0; + /** + * Return the value of an attribute in the list (by position). + * + *

If the attribute value is a list of tokens (IDREFS, + * ENTITIES, or NMTOKENS), the tokens will be concatenated + * into a single string separated by whitespace.

+ * + * @param i The index of the attribute in the list (starting at 0). + * @return The attribute value as a string, or + * an empty string if the index is out of range. + * @see #getLength + * @see #getValue(stringT) + */ + virtual const stringT& getValue(int i) const = 0; + + // + // Lookup methods. + // + /** + * Return the type of an attribute in the list (by name). + * + *

The return value is the same as the return value for + * getType(int).

+ * + *

If the attribute name has a namespace prefix in the document, + * the application must include the prefix here.

+ * + * @param name The name of the attribute. + * @return The attribute type as a string, or an empty string if no + * such attribute exists. + * @see #getType(int) + */ + virtual const stringT& getType(const stringT& name) const = 0; + /** + * Return the value of an attribute in the list (by name). + * + *

The return value is the same as the return value for + * getValue(int).

+ * + *

If the attribute name has a namespace prefix in the document, + * the application must include the prefix here.

+ * + * @param name The name of the attribute in the list. + * @return The attribute value as a string, or an empty string if + * no such attribute exists. + * @see #getValue(int) + */ + virtual const stringT& getValue(const stringT& name) const = 0; + +}; // class AttributeList + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/Attributes.hpp b/arabica/include/SAX/Attributes.hpp new file mode 100644 index 000000000..da38c5771 --- /dev/null +++ b/arabica/include/SAX/Attributes.hpp @@ -0,0 +1,272 @@ +#ifndef ARABICA_ATTRIBUTES_H +#define ARABICA_ATTRIBUTES_H + +// Attributes.h +// $Id$ + +#include + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Interface for a list of XML attributes. + * + *

This interface allows access to a list of attributes in + * three different ways:

+ * + *
    + *
  1. by attribute index;
  2. + *
  3. by Namespace-qualified name; or
  4. + *
  5. by qualified (prefixed) name.
  6. + *
+ * + *

The list will not contain attributes that were declared + * #IMPLIED but not specified in the start tag. It will also not + * contain attributes used as Namespace declarations (xmlns*) unless + * the http://xml.org/sax/features/namespace-prefixes + * feature is set to true (it is false by + * default).

+ * + *

If the namespace-prefixes feature (see above) is false, + * access by qualified name may not be available; if the + * http://xml.org/sax/features/namespaces + * feature is false, access by Namespace-qualified names + * may not be available.

+ * + *

This interface replaces the now-deprecated SAX1 {@link + * AttributeList AttributeList} interface, which does not + * contain Namespace support. In addition to Namespace support, it + * adds the getIndex methods (below).

+ * + *

The order of attributes in the list is unspecified, and will + * vary from implementation to implementation.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see AttributesImpl + */ +template > +class AttributeType +{ +public: + static const string_type CDATA; + static const string_type ID; + static const string_type IDREF; + static const string_type IDREFS; + static const string_type NMTOKEN; + static const string_type NMTOKENS; + static const string_type ENTITY; + static const string_type ENTITIES; + static const string_type NOTATION; +}; // AttributeType + +template > +class Attributes +{ +public: + + typedef string_type stringT; + + virtual ~Attributes() { } + + // + // indexed access + // + /** + * Return the number of attributes in the list. + * + *

Once you know the number of attributes, you can iterate + * through the list.

+ * + * @return The number of attributes in the list. + * @see #getURI(unsigned int) + * @see #getLocalName(unsigned int) + * @see #getQName(unsigned int) + * @see #getType(unsigned int) + * @see #getValue(unsigned int) + */ + virtual int getLength() const = 0; + + /** + * Look up an attribute's Namespace URI by index. + * + * @param index The attribute index (zero-based). + * @return The Namespace URI, or the empty string if none + * is available, or if the index is out of range. + * @see #getLength + */ + virtual stringT getURI(unsigned int index) const = 0; + + /** + * Look up an attribute's local name by index. + * + * @param index The attribute index (zero-based). + * @return The local name, or the empty string if Namespace + * processing is not being performed, or + * if the index is out of range. + * @see #getLength + */ + virtual stringT getLocalName(unsigned int index) const = 0; + + /** + * Look up an attribute's XML 1.0 qualified name by index. + * + * @param index The attribute index (zero-based). + * @return The XML 1.0 qualified name, or the empty string + * if none is available, or if the index + * is out of range. + * @see #getLength + */ + virtual stringT getQName(unsigned int index) const = 0; + + /** + * Look up an attribute's type by index. + * + *

The attribute type is one of the strings "CDATA", "ID", + * "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", + * or "NOTATION" (always in upper case).

+ * + *

If the parser has not read a declaration for the attribute, + * or if the parser does not report attribute types, then it must + * return the value "CDATA" as stated in the XML 1.0 Recommentation + * (clause 3.3.3, "Attribute-Value Normalization").

+ * + *

For an enumerated attribute that is not a notation, the + * parser will report the type as "NMTOKEN".

+ * + * @param index The attribute index (zero-based). + * @return The attribute's type as a string, or an empty string if the + * index is out of range. + * @see #getLength + */ + virtual stringT getType(unsigned int index) const = 0; + + /** + * Look up an attribute's value by index. + * + *

If the attribute value is a list of tokens (IDREFS, + * ENTITIES, or NMTOKENS), the tokens will be concatenated + * into a single string with each token separated by a + * single space.

+ * + * @param index The attribute index (zero-based). + * @return The attribute's value as a string, or an empty string if the + * index is out of range. + * @see #getLength + */ + virtual stringT getValue(unsigned int index) const = 0; + + // + // name based query + // + /** + * Look up the index of an attribute by Namespace name. + * + * @param uri The Namespace URI, or the empty string if + * the name has no Namespace URI. + * @param localName The attribute's local name. + * @return The index of the attribute, or -1 if it does not + * appear in the list. + */ + virtual int getIndex(const stringT& uri, const stringT& localName) const = 0; + + /** + * Look up the index of an attribute by XML 1.0 qualified name. + * + * @param qName The qualified (prefixed) name. + * @return The index of the attribute, or -1 if it does not + * appear in the list. + */ + virtual int getIndex(const stringT& qName) const = 0; + + /** + * Look up an attribute's type by Namespace name. + * + *

See {@link #getType(unsigned int) getType(unsigned int)} for a description + * of the possible types.

+ * + * @param uri The Namespace URI, or the empty String if the + * name has no Namespace URI. + * @param localName The local name of the attribute. + * @return The attribute type as a string, or an empty string if the + * attribute is not in the list or if Namespace + * processing is not being performed. + */ + virtual stringT getType(const stringT& uri, const stringT& localName) const = 0; + + /** + * Look up an attribute's type by XML 1.0 qualified name. + * + *

See {@link #getType(unsigned int) getType(unsigned int)} for a description + * of the possible types.

+ * + * @param qName The XML 1.0 qualified name. + * @return The attribute type as a string, or an empty string if the + * attribute is not in the list or if qualified names + * are not available. + */ + virtual stringT getType(const stringT& qName) const = 0; + + /** + * Look up an attribute's value by Namespace name. + * + *

See {@link #getValue(unsigned int) getValue(unsigned int)} for a + * description of the possible values.

+ * + * @param uri The Namespace URI, or the empty String if the + * name has no Namespace URI. + * @param localName The local name of the attribute. + * @return The attribute value as a string, or an empty string if the + * attribute is not in the list. + */ + virtual stringT getValue(const stringT& uri, const stringT& localName) const = 0; + + /** + * Look up an attribute's value by XML 1.0 qualified name. + * + *

See {@link #getValue(unsigned int) getValue(unsigned int)} for a + * description of the possible values.

+ * + * @param qName The XML 1.0 qualified name. + * @return The attribute value as a string, or an empty string if the + * attribute is not in the list or if qualified names + * are not available. + */ + virtual stringT getValue(const stringT& qName) const = 0; + +private: + static AttributeType types_; +}; // class Attributes + +template +const string_type AttributeType::CDATA = string_adaptor::construct_from_utf8("CDATA"); +template +const string_type AttributeType::ID = string_adaptor::construct_from_utf8("ID"); +template +const string_type AttributeType::IDREF = string_adaptor::construct_from_utf8("IDREF"); +template +const string_type AttributeType::IDREFS = string_adaptor::construct_from_utf8("IDREFS"); +template +const string_type AttributeType::NMTOKEN = string_adaptor::construct_from_utf8("NMTOKEN"); +template +const string_type AttributeType::NMTOKENS = string_adaptor::construct_from_utf8("NMTOKENS"); +template +const string_type AttributeType::ENTITY = string_adaptor::construct_from_utf8("ENTITY"); +template +const string_type AttributeType::ENTITIES = string_adaptor::construct_from_utf8("ENTITIES"); +template +const string_type AttributeType::NOTATION = string_adaptor::construct_from_utf8("NOTATION"); + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/ContentHandler.hpp b/arabica/include/SAX/ContentHandler.hpp new file mode 100644 index 000000000..f48e5af27 --- /dev/null +++ b/arabica/include/SAX/ContentHandler.hpp @@ -0,0 +1,341 @@ +#ifndef ARABICA_CONTENTHANDLER_H +#define ARABICA_CONTENTHANDLER_H + +// ContentHandler.h +// $Id$ + +#include + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +template class Locator; + +/** + * Receive notification of the logical content of a document. + * + *

This is the main interface that most SAX applications + * implement: if the application needs to be informed of basic parsing + * events, it implements this interface and registers an instance with + * the SAX parser using the {@link XMLReader#setContentHandler + * setContentHandler} method. The parser uses the instance to report + * basic document-related events like the start and end of elements + * and character data.

+ * + *

The order of events in this interface is very important, and + * mirrors the order of information in the document itself. For + * example, all of an element's content (character data, processing + * instructions, and/or subelements) will appear, in order, between + * the startElement event and the corresponding endElement event.

+ * + *

This interface is similar to the now-deprecated SAX 1.0 + * DocumentHandler interface, but it adds support for Namespaces + * and for reporting skipped entities (in non-validating XML + * processors).

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see XMLReader + * @see DTDHandler + * @see ErrorHandler + */ +template > +class ContentHandler +{ +public: + typedef Locator LocatorT; + typedef Attributes AttributesT; + + virtual ~ContentHandler() { } + + /** + * Receive an object for locating the origin of SAX document events. + * + *

SAX parsers are strongly encouraged (though not absolutely + * required) to supply a locator: if it does so, it must supply + * the locator to the application by invoking this method before + * invoking any of the other methods in the ContentHandler + * interface.

+ * + *

The locator allows the application to determine the end + * position of any document-related event, even if the parser is + * not reporting an error. Typically, the application will + * use this information for reporting its own errors (such as + * character content that does not match an application's + * business rules). The information returned by the locator + * is probably not sufficient for use with a search engine.

+ * + *

Note that the locator will return correct information only + * during the invocation of the events in this interface. The + * application should not attempt to use it at any other time.

+ * + * @param locator An object that can return the location of + * any SAX document event. + * @see Locator + */ + virtual void setDocumentLocator(const LocatorT& locator) = 0; + + /** + * Receive notification of the beginning of a document. + * + *

The SAX parser will invoke this method only once, before any + * other methods in this interface or in {@link DTDHandler + * DTDHandler} (except for {@link #setDocumentLocator + * setDocumentLocator}).

+ * + * @exception SAXException Any SAX exception. + * @see #endDocument + */ + virtual void startDocument() = 0; + /** + * Receive notification of the end of a document. + * + *

The SAX parser will invoke this method only once, and it will + * be the last method invoked during the parse. The parser shall + * not invoke this method until it has either abandoned parsing + * (because of an unrecoverable error) or reached the end of + * input.

+ * + * @exception SAXException Any SAX exception. + * @see #startDocument + */ + virtual void endDocument() = 0; + + /** + * Begin the scope of a prefix-URI Namespace mapping. + * + *

The information from this event is not necessary for + * normal Namespace processing: the SAX XML reader will + * automatically replace prefixes for element and attribute + * names when the http://xml.org/sax/features/namespaces + * feature is true (the default).

+ * + *

There are cases, however, when applications need to + * use prefixes in character data or in attribute values, + * where they cannot safely be expanded automatically; the + * start/endPrefixMapping event supplies the information + * to the application to expand prefixes in those contexts + * itself, if necessary.

+ * + *

Note that start/endPrefixMapping events are not + * guaranteed to be properly nested relative to each-other: + * all startPrefixMapping events will occur before the + * corresponding {@link #startElement startElement} event, + * and all {@link #endPrefixMapping endPrefixMapping} + * events will occur after the corresponding {@link #endElement + * endElement} event, but their order is not otherwise + * guaranteed.

+ * + *

There should never be start/endPrefixMapping events for the + * "xml" prefix, since it is predeclared and immutable.

+ * + * @param prefix The Namespace prefix being declared. + * @param uri The Namespace URI the prefix is mapped to. + * @exception SAXException The client may throw + * an exception during processing. + * @see #endPrefixMapping + * @see #startElement + */ + virtual void startPrefixMapping(const string_type& prefix, const string_type& uri) = 0; + /** + * End the scope of a prefix-URI mapping. + * + *

See {@link #startPrefixMapping startPrefixMapping} for + * details. This event will always occur after the corresponding + * {@link #endElement endElement} event, but the order of + * {@link #endPrefixMapping endPrefixMapping} events is not otherwise + * guaranteed.

+ * + * @param prefix The prefix that was being mapping. + * @exception SAXException The client may throw + * an exception during processing. + * @see #startPrefixMapping + * @see #endElement + */ + virtual void endPrefixMapping(const string_type& prefix) = 0; + + /** + * Receive notification of the beginning of an element. + * + *

The Parser will invoke this method at the beginning of every + * element in the XML document; there will be a corresponding + * {@link #endElement endElement} event for every startElement event + * (even when the element is empty). All of the element's content will be + * reported, in order, before the corresponding endElement + * event.

+ * + *

This event allows up to three name components for each + * element:

+ * + *
    + *
  1. the Namespace URI;
  2. + *
  3. the local name; and
  4. + *
  5. the qualified (prefixed) name.
  6. + *
+ * + *

Any or all of these may be provided, depending on the + * values of the http://xml.org/sax/features/namespaces + * and the http://xml.org/sax/features/namespace-prefixes + * properties:

+ * + *
    + *
  • the Namespace URI and local name are required when + * the namespaces property is true (the default), and are + * optional when the namespaces property is false (if one is + * specified, both must be);
  • + *
  • the qualified name is required when the namespace-prefixes property + * is true, and is optional when the namespace-prefixes property + * is false (the default).
  • + *
+ * + *

Note that the attribute list provided will contain only + * attributes with explicit values (specified or defaulted): + * #IMPLIED attributes will be omitted. The attribute list + * will contain attributes used for Namespace declarations + * (xmlns* attributes) only if the + * http://xml.org/sax/features/namespace-prefixes + * property is true (it is false by default, and support for a + * true value is optional).

+ * + * @param namespaceURI The Namespace URI, or the empty string if the + * element has no Namespace URI or if Namespace + * processing is not being performed. + * @param localName The local name (without prefix), or the + * empty string if Namespace processing is not being + * performed. + * @param qName The qualified name (with prefix), or the + * empty string if qualified names are not available. + * @param atts The attributes attached to the element. If + * there are no attributes, it shall be an empty + * Attributes object. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see #endElement + * @see Attributes + */ + virtual void startElement(const string_type& namespaceURI, const string_type& localName, + const string_type& qName, const AttributesT& atts) = 0; + /** + * Receive notification of the end of an element. + * + *

The SAX parser will invoke this method at the end of every + * element in the XML document; there will be a corresponding + * {@link #startElement startElement} event for every endElement + * event (even when the element is empty).

+ * + *

For information on the names, see startElement.

+ * + * @param namespaceURI The Namespace URI, or the empty string if the + * element has no Namespace URI or if Namespace + * processing is not being performed. + * @param localName The local name (without prefix), or the + * empty string if Namespace processing is not being + * performed. + * @param qName The qualified XML 1.0 name (with prefix), or the + * empty string if qualified names are not available. + * @exception SAXException Any SAX exception. + */ + virtual void endElement(const string_type& namespaceURI, const string_type& localName, + const string_type& qName) = 0; + + /** + * Receive notification of character data. + * + *

The Parser will call this method to report each chunk of + * character data. SAX parsers may return all contiguous character + * data in a single chunk, or they may split it into several + * chunks; however, all of the characters in any single event + * must come from the same external entity so that the Locator + * provides useful information.

+ * + *

The application must not attempt to read from the array + * outside of the specified range.

+ * + *

Note that some parsers will report whitespace in element + * content using the {@link #ignorableWhitespace ignorableWhitespace} + * method rather than this one (validating parsers must + * do so).

+ * + * @param ch The characters from the XML document. + * @exception SAXException Any SAX exception. + * @see #ignorableWhitespace + * @see Locator + */ + virtual void characters(const string_type& ch) = 0; + /** + * Receive notification of ignorable whitespace in element content. + * + *

Validating Parsers must use this method to report each chunk + * of whitespace in element content (see the W3C XML 1.0 recommendation, + * section 2.10): non-validating parsers may also use this method + * if they are capable of parsing and using content models.

+ * + *

SAX parsers may return all contiguous whitespace in a single + * chunk, or they may split it into several chunks; however, all of + * the characters in any single event must come from the same + * external entity, so that the Locator provides useful + * information.

+ * + *

The application must not attempt to read from the array + * outside of the specified range.

+ * + * @param ch The characters from the XML document. + * @exception SAXException Any SAX exception. + * @see #characters + */ + virtual void ignorableWhitespace(const string_type& ch) = 0; + + /** + * Receive notification of a processing instruction. + * + *

The Parser will invoke this method once for each processing + * instruction found: note that processing instructions may occur + * before or after the main document element.

+ * + *

A SAX parser must never report an XML declaration (XML 1.0, + * section 2.8) or a text declaration (XML 1.0, section 4.3.1) + * using this method.

+ * + * @param target The processing instruction target. + * @param data The processing instruction data, or an empty string if + * none was supplied. The data does not include any + * whitespace separating it from the target. + * @exception SAXException Any SAX exception. + */ + virtual void processingInstruction(const string_type& target, const string_type& data) = 0; + + /** + * Receive notification of a skipped entity. + * + *

The Parser will invoke this method once for each entity + * skipped. Non-validating processors may skip entities if they + * have not seen the declarations (because, for example, the + * entity was declared in an external DTD subset). All processors + * may skip external entities, depending on the values of the + * http://xml.org/sax/features/external-general-entities + * and the + * http://xml.org/sax/features/external-parameter-entities + * properties.

+ * + * @param name The name of the skipped entity. If it is a + * parameter entity, the name will begin with '%', and if + * it is the external DTD subset, it will be the string + * "[dtd]". + * @exception SAXException Any SAX exception. + */ + virtual void skippedEntity(const string_type& name) = 0; +}; // class ContentHandler + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/DTDHandler.hpp b/arabica/include/SAX/DTDHandler.hpp new file mode 100644 index 000000000..51f53d44c --- /dev/null +++ b/arabica/include/SAX/DTDHandler.hpp @@ -0,0 +1,127 @@ +#ifndef ARABICA_DTDHANDLER_H +#define ARABICA_DTDHANDLER_H + +// DTDHandler.h +// $Id$ + +#include + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Receive notification of basic DTD-related events. + * + *

If a SAX application needs information about notations and + * unparsed entities, then the application implements this + * interface and registers an instance with the SAX parser using + * the parser's setDTDHandler method. The parser uses the + * instance to report notation and unparsed entity declarations to + * the application.

+ * + *

Note that this interface includes only those DTD events that + * the XML recommendation requires processors to report: + * notation and unparsed entity declarations.

+ * + *

The SAX parser may report these events in any order, regardless + * of the order in which the notations and unparsed entities were + * declared; however, all DTD events must be reported after the + * document handler's startDocument event, and before the first + * startElement event. + * (If the {@link LexicalHandler LexicalHandler} is + * used, these events must also be reported before the endDTD event.) + *

+ * + *

It is up to the application to store the information for + * future use (perhaps in a hash table or object tree). + * If the application encounters attributes of type "NOTATION", + * "ENTITY", or "ENTITIES", it can use the information that it + * obtained through this interface to find the entity and/or + * notation corresponding with the attribute value.

+ * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version $Id$ + * @see XMLReader#setDTDHandler + */ + +template > +class DTDHandler +{ +public: + virtual ~DTDHandler() { } + + + /** + * Receive notification of a notation declaration event. + * + *

It is up to the application to record the notation for later + * reference, if necessary; + * notations may appear as attribute values and in unparsed entity + * declarations, and are sometime used with processing instruction + * target names. + * When a system identifier is present, applications are responsible + * for knowing if it is used as a URL, and absolutizing it against + * the appropriate URI when appropriate. + * That base URI is available from {@link Locator#getSystemId} during + * this callback, assuming the parser provides a Locator.

+ * + *

At least one of publicId and systemId must be non-empty.

+ * + *

There is no guarantee that the notation declaration will be + * reported before any unparsed entities that use it.

+ * + * @param name The notation name. + * @param publicId The notation's public identifier, or an empty string if + * none was given. + * @param systemId The notation's system identifier, or an empty string if + * none was given. + * @exception SAXException Any SAX exception. + * @see #unparsedEntityDecl + * @see Attributes + */ + virtual void notationDecl(const string_type& name, + const string_type& publicId, + const string_type& systemId) = 0; + + + /** + * Receive notification of an unparsed entity declaration event. + * + *

Note that the notation name corresponds to a notation + * reported by the {@link #notationDecl notationDecl} event. + * It is up to the application to record the entity for later + * reference, if necessary; + * unparsed entities may appear as attribute values. + *

+ * + *

If the system identifier is a URL, the parser must resolve it + * fully before passing it to the application.

+ * + * @exception SAXException Any SAX exception. + * @param name The unparsed entity's name. + * @param publicId The entity's public identifier, or an empty string if none + * was given. + * @param systemId The entity's system identifier. + * @param notationName The name of the associated notation. + * @see #notationDecl + * @see Attributes + */ + virtual void unparsedEntityDecl(const string_type& name, + const string_type& publicId, + const string_type& systemId, + const string_type& notationName) = 0; + +}; // class DTDHandler + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/DocumentHandler.hpp b/arabica/include/SAX/DocumentHandler.hpp new file mode 100644 index 000000000..eddd39651 --- /dev/null +++ b/arabica/include/SAX/DocumentHandler.hpp @@ -0,0 +1,76 @@ +#ifndef ARABICA_DOCUMENTHANDLER_H +#define ARABICA_DOCUMENTHANDLER_H +// SAX document handler. +// $Id$ + +#include + +namespace Arabica +{ +namespace SAX +{ + +template class Locator; +template class AttributeList; + +/** + * Receive notification of general document events. + * + * This is the main interface that most SAX applications + * implement: if the application needs to be informed of basic parsing + * events, it implements this interface and registers an instance with + * the SAX parser using the setDocumentHandler method. The parser + * uses the instance to report basic document-related events like + * the start and end of elements and character data. + * + * The order of events in this interface is very important, and + * mirrors the order of information in the document itself. For + * example, all of an element's content (character data, processing + * instructions, and/or subelements) will appear, in order, between + * the startElement event and the corresponding endElement event. + * + * Application writers who do not want to implement the entire + * interface can derive a class from HandlerBase, which implements + * the default functionality; parser writers can instantiate + * HandlerBase to obtain a default handler. The application can find + * the location of any document event using the Locator interface + * supplied by the Parser through the setDocumentLocator method. + * + * @author Jez Higgins, jez@jezuk.co.uk + * @version 0.1 + * @see Parser#setDocumentHandler + * @see Locator + * @see HandlerBase + */ +template +class DocumentHandler +{ +public: + typedef string_type stringT; + typedef Locator LocatorT; + typedef AttributeList AttributeListT; + + virtual ~DocumentHandler() { } + + virtual void setDocumentLocator(const LocatorT& locator) = 0; + + virtual void startDocument() = 0; + virtual void endDocument() = 0; + + virtual void startElement(const stringT& name, + const AttributeListT& atts) = 0; + virtual void endElement(const stringT& name) = 0; + + virtual void characters(const stringT& ch) = 0; + + virtual void ignorableWhitespace(const stringT& ch) = 0; + + virtual void processingInstruction(const stringT& target, + const stringT& data) = 0; +}; // class DocumentHandler + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/EntityResolver.hpp b/arabica/include/SAX/EntityResolver.hpp new file mode 100644 index 000000000..c9e1744ff --- /dev/null +++ b/arabica/include/SAX/EntityResolver.hpp @@ -0,0 +1,117 @@ +#ifndef ARABICA_ENTITYRESOLVER_H +#define ARABICA_ENTITYRESOLVER_H + +// EntityResolver.h +// $Id$ + +#include + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Basic interface for resolving entities. + * + *

If a SAX application needs to implement customized handling + * for external entities, it must implement this interface and + * register an instance with the SAX driver using the + * {@link XMLReader#setEntityResolver setEntityResolver} + * method.

+ * + *

The XML reader will then allow the application to intercept any + * external entities (including the external DTD subset and external + * parameter entities, if any) before including them.

+ * + *

Many SAX applications will not need to implement this interface, + * but it will be especially useful for applications that build + * XML documents from databases or other specialised input sources, + * or for applications that use URI types other than URLs.

+ * + *

The following resolver would provide the application + * with a special character stream for the entity with the system + * identifier "http://www.myhost.com/today":

+ * + *
+ * #include <EntityResolver>
+ * #include <InputSource>
+ *
+ * public class MyResolver implements SAX::EntityResolver 
+ * {
+ *   public InputSource resolveEntity (const std::string& publicId, const std::string& systemId)
+ *   {
+ *     if(systemId == "http://www.myhost.com/today") 
+ *     {
+ *       // return a special input source
+ *       MyStream* reader = new MyStream();
+ *       return SAX::InputSource(stream);
+ *     } else {
+ *       // request default behaviour
+ *       return SAX::InputSource();
+ *     }
+ *   }
+ * }
+ * 
+ * + *

The application can also use this interface to redirect system + * identifiers to local URIs or to look up replacements in a catalog + * (possibly by using the public identifier).

+ * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see Parser#setEntityResolver + * @see InputSource + */ +template > +class EntityResolver +{ +public: + typedef InputSource InputSourceT; + + virtual ~EntityResolver() { }; + + /** + * Allow the application to resolve external entities. + * + *

The Parser will call this method before opening any external + * entity except the top-level document entity (including the + * external DTD subset, external entities referenced within the + * DTD, and external entities referenced within the document + * element): the application may request that the parser resolve + * the entity itself, that it use an alternative URI, or that it + * use an entirely different input source.

+ * + *

Application writers can use this method to redirect external + * system identifiers to secure and/or local URIs, to look up + * public identifiers in a catalogue, or to read an entity from a + * database or other input source (including, for example, a dialog + * box).

+ * + *

If the system identifier is a URL, the SAX parser must + * resolve it fully before reporting it to the application.

+ * + * @param publicId The public identifier of the external entity + * being referenced, or an empty string if none was supplied. + * @param systemId The system identifier of the external entity + * being referenced. + * @return An InputSource object describing the new input source, + * or a default-constructed InputSource to request that + * the parser open a regular URI connection to the system identifier. + * @exception SAXException Any SAX exception. + * @see InputSource + */ + virtual InputSourceT resolveEntity(const string_type& publicId, const string_type& systemId) = 0; +}; // class EntityResolver + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/ErrorHandler.hpp b/arabica/include/SAX/ErrorHandler.hpp new file mode 100644 index 000000000..bc280e068 --- /dev/null +++ b/arabica/include/SAX/ErrorHandler.hpp @@ -0,0 +1,123 @@ +#ifndef ARABICA_ERRORHANDLER_H +#define ARABICA_ERRORHANDLER_H + +// EntityResolver.h +// $Id$ + +#include + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Basic interface for SAX error handlers. + * + *

If a SAX application needs to implement customized error + * handling, it must implement this interface and then register an + * instance with the XML reader using the + * {@link XMLReader#setErrorHandler setErrorHandler} + * method. The parser will then report all errors and warnings + * through this interface.

+ * + *

WARNING: If an application does not + * register an ErrorHandler, XML parsing errors will go unreported + * and bizarre behaviour may result.

+ * + *

For XML processing errors, a SAX driver must use this interface + * instead of throwing an exception: it is up to the application + * to decide whether to throw an exception for different types of + * errors and warnings. Note, however, that there is no requirement that + * the parser continue to provide useful information after a call to + * {@link #fatalError fatalError} (in other words, a SAX driver class + * could catch an exception and report a fatalError).

+ * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see Parser#setErrorHandler + * @see SAXParseException + */ +template > +class ErrorHandler +{ +public: + typedef SAXParseException SAXParseExceptionT; + + virtual ~ErrorHandler() { }; + + /** + * Receive notification of a warning. + * + *

SAX parsers will use this method to report conditions that + * are not errors or fatal errors as defined by the XML 1.0 + * recommendation. The default behaviour is to take no action.

+ * + *

The SAX parser must continue to provide normal parsing events + * after invoking this method: it should still be possible for the + * application to process the document through to the end.

+ * + *

Filters may use this method to report other, non-XML warnings + * as well.

+ * + * @param exception The warning information encapsulated in a + * SAX parse exception. + * @see SAXParseException + */ + virtual void warning(const SAXParseExceptionT& exception) = 0; + /** + * Receive notification of a recoverable error. + * + *

This corresponds to the definition of "error" in section 1.2 + * of the W3C XML 1.0 Recommendation. For example, a validating + * parser would use this callback to report the violation of a + * validity constraint. The default behaviour is to take no + * action.

+ * + *

The SAX parser must continue to provide normal parsing events + * after invoking this method: it should still be possible for the + * application to process the document through to the end. If the + * application cannot do so, then the parser should report a fatal + * error even if the XML 1.0 recommendation does not require it to + * do so.

+ * + *

Filters may use this method to report other, non-XML errors + * as well.

+ * + * @param exception The error information encapsulated in a + * SAX parse exception. + * @see SAXParseException + */ + virtual void error(const SAXParseExceptionT& exception) = 0; + /** + * Receive notification of a non-recoverable error. + * + *

This corresponds to the definition of "fatal error" in + * section 1.2 of the W3C XML 1.0 Recommendation. For example, a + * parser would use this callback to report the violation of a + * well-formedness constraint.

+ * + *

The application must assume that the document is unusable + * after the parser has invoked this method, and should continue + * (if at all) only for the sake of collecting addition error + * messages: in fact, SAX parsers are free to stop reporting any + * other events once this method has been invoked.

+ * + * @param exception The error information encapsulated in a + * SAX parse exception. + * @see SAXParseException + */ + virtual void fatalError(const SAXParseExceptionT& exception) = 0; +}; // class ErrorHandler + +} // namespace SAX +} // namespace Arabica + +#endif +//end of file diff --git a/arabica/include/SAX/HandlerBase.hpp b/arabica/include/SAX/HandlerBase.hpp new file mode 100644 index 000000000..ed1dc9e7c --- /dev/null +++ b/arabica/include/SAX/HandlerBase.hpp @@ -0,0 +1,291 @@ +#ifndef ARABICA_HANDLERBASE_H +#define ARABICA_HANDLERBASE_H +// SAX default handler base class. +// $Id$ + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Default base class for handlers. + * + *

This class implements the default behaviour for four SAX1 + * interfaces: EntityResolver, DTDHandler, DocumentHandler, + * and ErrorHandler. It is now obsolete, but is included in SAX2 to + * support legacy SAX1 applications. SAX2 applications should use + * the {@link DefaultHandler DefaultHandler} + * class instead.

+ * + *

Application writers can extend this class when they need to + * implement only part of an interface; parser writers can + * instantiate this class to provide default handlers when the + * application has not supplied its own.

+ * + *

Note that the use of this class is optional.

+ * + * @deprecated This class works with the deprecated + * {@link DocumentHandler DocumentHandler} + * interface. It has been replaced by the SAX2 + * {@link DefaultHandler DefaultHandler} + * class. + * @since SAX 1.0 + * @author Jez Higgins, jez@jezuk.co.uk + * @version 1.0 + * @see EntityResolver + * @see DTDHandler + * @see DocumentHandler + * @see ErrorHandler + */ +template +class HandlerBase : public EntityResolver, + public DTDHandler, + public DocumentHandler, + public ErrorHandler +{ +public: + typedef string_name stringT; + typedef Locator LocatorT; + typedef AttributeList AttributeListT; + typedef InputSource InputSourceT; + typedef ErrorHandler::SAXParseExceptionT SAXParseExceptionT; + + virtual ~HandlerBase() { } + + ////////////////////////////////////////////////////////////////////// + // Default implementation of the EntityResolver interface. + ////////////////////////////////////////////////////////////////////// + /** + * Resolve an external entity. + * + *

Always return a default-constructed InputSourceT, so that + * the parser will use the system identifier provided in the XML document. + * This method implements the SAX default behaviour: application writers can + * override it in a subclass to do special translations such as catalog + * lookups or URI redirection.

+ * + * @param publicId The public identifer, or an empty string if none is + * available. + * @param systemId The system identifier provided in the XML + * document. + * @return The new input source, or an empty string to require the + * default behaviour. + * @see EntityResolver#resolveEntity + */ + virtual InputSourceT resolveEntity(const stringT& publicId, + const stringT& systemId) + { + return InputSourceT(); + } // resolverEntity + + ////////////////////////////////////////////////////////////////////// + // Default implementation of DTDHandler interface. + ////////////////////////////////////////////////////////////////////// + /** + * Receive notification of a notation declaration. + * + *

By default, do nothing. Application writers may override this + * method in a subclass if they wish to keep track of the notations + * declared in a document.

+ * + * @param name The notation name. + * @param publicId The notation public identifier, or an empty string if not + * available. + * @param systemId The notation system identifier. + * @see DTDHandler#notationDecl + */ + virtual void notationDecl(const stringT& name, + const stringT& publicId, + const stringT& systemId) { } + + /** + * Receive notification of an unparsed entity declaration. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to keep track of the unparsed entities + * declared in a document.

+ * + * @param name The entity name. + * @param publicId The entity public identifier, or an empty string if not + * available. + * @param systemId The entity system identifier. + * @param notationName The name of the associated notation. + * @see DTDHandler#unparsedEntityDecl + */ + virtual void unparsedEntityDecl(const stringT& name, + const stringT& publicId, + const stringT& systemId, + const stringT& notationName) { } + + ////////////////////////////////////////////////////////////////////// + // Default implementation of DocumentHandler interface. + ////////////////////////////////////////////////////////////////////// + /** + * Receive a Locator object for document events. + * + *

By default, do nothing. Application writers may override this + * method in a subclass if they wish to store the locator for use + * with other document events.

+ * + * @param locator A locator for all SAX document events. + * @see DocumentHandler#setDocumentLocator + * @see Locator + */ + virtual void setDocumentLocator(const LocatorT& locator) { } + + /** + * Receive notification of the beginning of the document. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the beginning + * of a document (such as allocating the root node of a tree or + * creating an output file).

+ * + * @see DocumentHandler#startDocument + */ + virtual void startDocument() { } + /** + * Receive notification of the end of the document. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the beginning + * of a document (such as finalising a tree or closing an output + * file).

+ * + * @see DocumentHandler#endDocument + */ + virtual void endDocument() { } + + /** + * Receive notification of the start of an element. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the start of + * each element (such as allocating a new tree node or writing + * output to a file).

+ * + * @param name The element type name. + * @param attributes The specified or defaulted attributes. + * @see DocumentHandler#startElement + */ + virtual void startElement(const stringT& name, + const AttributeListT& attributes) { } + /** + * Receive notification of the end of an element. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the end of + * each element (such as finalising a tree node or writing + * output to a file).

+ * + * @param name The element type name. + * @see DocumentHandler#endElement + */ + virtual void endElement(const stringT& name) { } + + /** + * Receive notification of character data inside an element. + * + *

By default, do nothing. Application writers may override this + * method to take specific actions for each chunk of character data + * (such as adding the data to a node or buffer, or printing it to + * a file).

+ * + * @param ch The characters. + * @see DocumentHandler#characters + */ + virtual void characters(const stringT& ch) { } + /** + * Receive notification of ignorable whitespace in element content. + * + *

By default, do nothing. Application writers may override this + * method to take specific actions for each chunk of ignorable + * whitespace (such as adding data to a node or buffer, or printing + * it to a file).

+ * + * @param ch The whitespace characters. + * @see DocumentHandler#ignorableWhitespace + */ + virtual void ignorableWhitespace(const stringT& ch) { } + + /** + * Receive notification of a processing instruction. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions for each + * processing instruction, such as setting status variables or + * invoking other methods.

+ * + * @param target The processing instruction target. + * @param data The processing instruction data, or an empty string if + * none is supplied. + * @see DocumentHandler#processingInstruction + */ + virtual void processingInstruction(const stringT& target, + const stringT& data) { } + + ////////////////////////////////////////////////////////////////////// + // Default implementation of the ErrorHandler interface. + ////////////////////////////////////////////////////////////////////// + /** + * Receive notification of a parser warning. + * + *

The default implementation does nothing. Application writers + * may override this method in a subclass to take specific actions + * for each warning, such as inserting the message in a log file or + * printing it to the console.

+ * + * @param e The warning information encoded as an exception. + * @see ErrorHandler#warning + * @see SAXParseException + */ + virtual void warning(const SAXParseExceptionT& e) { } + /** + * Receive notification of a recoverable parser error. + * + *

The default implementation does nothing. Application writers + * may override this method in a subclass to take specific actions + * for each error, such as inserting the message in a log file or + * printing it to the console.

+ * + * @param e The warning information encoded as an exception. + * @see ErrorHandler#warning + * @see SAXParseException + */ + virtual void error(const SAXParseExceptionT& e) { } + /** + * Report a fatal XML parsing error. + * + *

The default implementation throws a SAXParseException. + * Application writers may override this method in a subclass if + * they need to take specific actions for each fatal error (such as + * collecting all of the errors into a single report): in any case, + * the application must stop all regular processing when this + * method is invoked, since the document is no longer reliable, and + * the parser may no longer report parsing events.

+ * + * @param e The error information encoded as an exception. + * @see ErrorHandler#fatalError + * @see SAXParseException + */ + virtual void fatalError(const SAXParseExceptionT& e) { throw e; } +}; // class HandlerBase + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/IStreamHandle.hpp b/arabica/include/SAX/IStreamHandle.hpp new file mode 100644 index 000000000..11cdbf8d1 --- /dev/null +++ b/arabica/include/SAX/IStreamHandle.hpp @@ -0,0 +1,452 @@ +/* $Id$ + * + * + */ + +#ifndef ARABICA_ISTREAMHANDLE_H +#define ARABICA_ISTREAMHANDLE_H + +#include +#include +#include +#include + +// If we've been asked to debug, enforce post-conditions on all public API +// methods. All post-conditions which do not relate to direct in-method +// assignment are tested. (Those which relate to a direct assignment of a POD +// within the same method are not tested.) +#ifdef ARABICA_DEBUG +#define ISTREAMHANDLE_POSTCONDITION(x) assert(x) +#else +#define ISTREAMHANDLE_POSTCONDITION(x) do {} while (false) +#endif + +namespace Arabica { +namespace SAX { + +/** Reference-counting pointer to std::istream. + * + * \par Summary: + * This works much like any other reference-counted pointer, + * except that it only optionally owns the pointee. That + * is, it will not necessarily delete the pointee when the + * reference count goes to zero. + * + * \par + * Ownership of a std::istream is passed to an IStreamHandle via a + * std::auto_ptr. Ownership of a + * std::istream is passed between IStreamHandle by assignment. + * + * \see IStreamHandle(std::auto_ptr) for passing + * ownership at construction. + * \see IStreamHandle::operator=(std::auto_ptr) for + * passing ownership after construction. + * \see IStreamHandle(std::istream&) for constructing without + * passing ownership + * \see IStreamHandle::operator=(std::istream&) for assigning + * without passing ownership. + * + * \par Justification: + * + * \par + * This class is needed to fix an ownership problem between the + * InputSource and EntityResovler classes. InputSource is a SAX + * class designed to wrap stream objects. Normally, an + * InputSource is constructed with reference to a std::istream + * object. There are two separate use-cases for InputSource which + * lead to conflicting models of std::istream ownership. + * + * \par + * -# When an InputSource is constructed to pass to a parser + * parse() method, the InputSource is owned by + * the client code. When parse() returns, the + * InputSource is no-longer needed and it's stream can be + * destroyed by the client code. This will most likely + * happen when the variable goes out of scope). + * -# When an EntityResolver responds to a + * resolveEntity() request, it must return an + * InputSource. In this case the InputSource, and more + * importantly, the std::istream, is needed by the parser for + * some time after resolveEntity() has returned. + * + * \par + * In case 1, the std::istream in question may be local variable, + * and so the InputSource simply cannot own it. + * + * \par + * In case 2, the std::istream in question cannot be a local + * variable because it must be returned from a method. Since it + * must be destroyed at some time known only to the parser, there + * is no alternative but for the InputSource to own it. + * + * \par Solution: + * + * \par + * To solve this issue, I have created the IStreamHandle and + * modified InputSource. IStreamHandle can behave either as a + * std::istream* or as a reference-counting std::istream*. + * The difference is in ownership: + * + * \par + * If an IStreamHandle is constructed with or assigned a + * std::auto_ptr, it takes ownership of + * the pointee. If an IStreamHandle is constructed with or + * assigned a std::istream&, it does not take + * ownership of the pointee. + * + * \par + * Upon destruction or re-assignment, an IStreamHandle checks + * whether it is the last reference to its pointee, and + * whether it owns its pointee. If both conditions + * are met, the IStreamHandle deletes its pointee. + * + * @author Philip Walford + * \par Created: + * 21/05/2003 + * + * + * + * + * + * \internal + * \par Pre- and Post-Conditions + * All public API methods of IStreamHandle conform to the following + * post-condition: + * - counter_ points to a valid heap-allocated integer greater + * than 0. + * + * \par + * All public API methods of IStreamHandle that take an + * auto_ptr parameter conform to the follow post-conditions. + * For the purposes of these post-conditions, rhs will represent + * the std::auto_ptr parameter. + * - is_ contains the value returned by rhs.release(). + * - rhs.get() == 0 (ownership has been transfered). + * - owner_ = true + * + * \par + * All public API methods of IStreamHandle that take a std::istream& + * parameter conform to the follow post-conditions. For the purposes of + * these post-conditions, rhs will represent the std::istream& + * parameter. + * - is_ = &rhs + * - owner_ = false + * + * \par + * The default constructor and release() methods of IStreamHandle conform to + * the following post-conditions: + * - is_ = 0 + * - owner_ = false + * + * \par + * Further post-conditions are documented under the appropriate methods. + */ +class IStreamHandle +{ +public: + /** Create an IStreamHandle which does not point to any std::istream. + * + * \internal + * \post is_ == 0 + * \post owner_ == false + */ + IStreamHandle(); + + /** Create an IStreamHandle which does not own it's std::istream. + * + * \par Ownership: + * The IStreamHandle constructed in this manner does not own the + * std::istream to which it points. + * + */ + IStreamHandle(std::istream& is); + + /** Create an IStreamHandle taking ownership of a std::istream. + * + * \par Ownership: + * The IStreamHandle constructed in this manner owns the std::istream to + * which is pointed. This ownership may then be shared with + * other IStreamHandle objects. + * + */ + explicit IStreamHandle(std::auto_ptr is); + explicit IStreamHandle(std::auto_ptr is); + + /** Construct an IStreamHandle sharing a std::istream with rhs. + * + * \par Ownership + * The IStreamHandle constructed in this manner will share ownership of + * the std::istream to which it points if-and-only-if rhs + * shares ownership of the std::istream. + * + * \internal + * \post is_ == rhs.is_ + * \post counter_ == rhs.counter_ + * \post *counter_ == (old value of *(rhs.counter_)) + 1 + * \post owner_ == rhs.owner_ + */ + IStreamHandle(const IStreamHandle& rhs); + + /** Destroy an IStreamHandle, destroying the internal std::istream if + * this owns the istream and is the last reference. + * + * \internal + * \post is_ == 0 + * \post counter_ == 0 + * \post owner_ == false + */ + ~IStreamHandle(); + + /** Assign another IStreamHandle to this. This destroys the + * std::istream held by this if this owns + * the istream and is the last reference. + * + * \par Ownership: + * After this operation, the IStreamHandle this will share + * ownership of the std::istream to which it points if-and-only-if + * rhs shares ownership of the std::istream. + * + * \internal + * \post is_ == rhs.is_ + * \post counter_ == rhs.counter_ + * \post *counter_ == (old value of *(rhs.counter_)) + 1 + * \post owner_ == rhs.owner_ + */ + IStreamHandle& operator=(const IStreamHandle& rhs); + + /** Assign a new std::istream to this. This destroys the + * std::istream held by this if this owns + * the istream and is the last reference. Ownership of the istream is + * transfered to this. + * + * \par Ownership: + * After this operation, the IStreamHandle this owns the + * std::istream to which rhs pointed. This ownership may then be + * shared with other IStreamHandle objects. + * + */ + IStreamHandle& operator=(std::auto_ptr rhs); + IStreamHandle& operator=(std::auto_ptr rhs); + + /** Assign a new std::istream to this. This destroys the + * std::istream held by this if this owns + * the istream and is the last reference. + * + * \par Ownership: + * After this operation, the IStreamHandle this does not own + * the std::istream to which rhs points. + * + */ + IStreamHandle& operator=(std::istream& rhs); + + /** Return the std::istream contained by this. */ + std::istream* get() const; + + /** Release the std::istream held by this. This will destroy + * the internal std::istream if this owns the istream + * and is the last reference. + * + * \internal + * \post is_ == 0 + * \post owner_ == false + */ + void release(); + +private: + std::istream* is_; + int* counter_; + bool owner_; + + // Set the internal pointer and ownership + // \post is_ == is + // \post owner_ == own + void set(std::istream* is, bool own); + + // Increment the counter. + // \pre counter_ != 0 + // \post *counter_ = (old value of *counter_) + 1 + void addRef() const; + + // Decrement the counter and free memory if zero references remain and we + // own the std::istream. Clears internal pointers either way. + // \post is_ == 0 + // \post counter_ == 0 + // \post owner_ = false + void removeRef(); +}; + +inline +IStreamHandle::IStreamHandle() +: is_(0), + counter_(new int(0)), + owner_(false) +{ + addRef(); + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); +} + +inline +IStreamHandle::IStreamHandle(std::istream& is) +: is_(&is), + counter_(new int(0)), + owner_(false) +{ + addRef(); + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); +} + +inline +IStreamHandle::IStreamHandle(std::auto_ptr is) +: is_(is.release()), + counter_(new int(0)), + owner_(true) +{ + addRef(); + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); + ISTREAMHANDLE_POSTCONDITION(is.get() == 0); +} + +inline +IStreamHandle::IStreamHandle(std::auto_ptr is) +: is_(is.release()), + counter_(new int(0)), + owner_(true) +{ + addRef(); + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); + ISTREAMHANDLE_POSTCONDITION(is.get() == 0); +} + +inline +IStreamHandle::IStreamHandle(const IStreamHandle& rhs) +: is_(rhs.is_), + counter_(rhs.counter_), + owner_(rhs.owner_) +{ + addRef(); + ISTREAMHANDLE_POSTCONDITION(*counter_ >= 2); +} + +inline +IStreamHandle::~IStreamHandle() +{ + removeRef(); + ISTREAMHANDLE_POSTCONDITION(is_ == 0); + ISTREAMHANDLE_POSTCONDITION(counter_ == 0); + ISTREAMHANDLE_POSTCONDITION(owner_ == false); +} + +inline +IStreamHandle& IStreamHandle::operator=(const IStreamHandle& rhs) +{ + // Add to rhs first to avoid self-assignment bug. + rhs.addRef(); + removeRef(); + is_ = rhs.is_; + counter_ = rhs.counter_; + owner_ = rhs.owner_; + + ISTREAMHANDLE_POSTCONDITION(*counter_ >= 1); + + return *this; +} + +inline +IStreamHandle& IStreamHandle::operator=(std::auto_ptr rhs) +{ + removeRef(); + set(rhs.release(), true); + + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); + ISTREAMHANDLE_POSTCONDITION(owner_ == true); + ISTREAMHANDLE_POSTCONDITION(rhs.get() == 0); + + return *this; +} + +inline +IStreamHandle& IStreamHandle::operator=(std::auto_ptr rhs) +{ + removeRef(); + set(rhs.release(), true); + + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); + ISTREAMHANDLE_POSTCONDITION(owner_ == true); + ISTREAMHANDLE_POSTCONDITION(rhs.get() == 0); + + return *this; +} + +inline +IStreamHandle& IStreamHandle::operator=(std::istream& rhs) +{ + removeRef(); + set(&rhs, false); + + ISTREAMHANDLE_POSTCONDITION(*counter_ == 1); + ISTREAMHANDLE_POSTCONDITION(owner_ == false); + + return *this; +} + +inline +std::istream* IStreamHandle::get() const +{ + return is_; +} + +inline +void IStreamHandle::set(std::istream* is, bool own) +{ + is_ = is; + owner_ = own; + counter_ = new int(0); + addRef(); +} + +inline +void IStreamHandle::release() +{ + removeRef(); + // We're pretending to have a counted reference to 0, this ensures internal + // consistency. + set(0, false); +} + +// Increment the counter. +inline +void IStreamHandle::addRef() const +{ + ++(*counter_); + ISTREAMHANDLE_POSTCONDITION(*counter_ >= 1); +} + +// Decrement the counter and free memory if zero references remain and we own +// the std::istream. Clears internal pointers either way and resets counter_ +// to a new int. +inline +void IStreamHandle::removeRef() +{ + // counter_ may be 0 if we are default-constructed or if someone has + // called release(). + if (counter_) + { + if (--(*counter_) == 0) + { + if (owner_) + { + delete is_; + } + delete counter_; + } + } + is_ = 0; + owner_ = false; + counter_ = 0; +} + +} // namespace SAX +} // namespace Arabica + +#endif /* SAX_ISTREAMHANDLE_H */ + diff --git a/arabica/include/SAX/InputSource.hpp b/arabica/include/SAX/InputSource.hpp new file mode 100644 index 000000000..1933cd7ec --- /dev/null +++ b/arabica/include/SAX/InputSource.hpp @@ -0,0 +1,337 @@ +#ifndef ARABICA_INPUTSOURCE_H +#define ARABICA_INPUTSOURCE_H + +// InputSource.h +// $Id$ + +#include +#include + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * A single input source for an XML entity. + * + *

This class allows a SAX application to encapsulate information + * about an input source in a single object, which may include + * a public identifier, a system identifier, a byte stream (possibly + * with a specified encoding).

+ * + *

There are two places that the application will deliver this + * input source to the parser: as the argument to the Parser.parse + * method, or as the return value of the EntityResolver.resolveEntity + * method.

+ * + *

The SAX parser will use the InputSource object to determine + * how to read XML input. If there is a byte stream available, + * the parser will read that stream directly; if a byte stream is + * not available, the parser will attempt to open a URI connection + * to the resource identified by the system identifier.

+ * + *

An InputSource object belongs to the application: the SAX parser + * shall never modify it in any way (it may modify a copy if + * necessary).

+ * + * InputSource is still under active consideration, and its + * interface may change. + * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see Parser#parse + * @see EntityResolver#resolveEntity + */ +template > +class InputSource +{ +public: + /** + * Zero-argument default constructor. + * + * @see #setPublicId + * @see #setSystemId + * @see #setByteStream + * @see #setEncoding + */ + InputSource() : + byteStream_(), + publicId_(), + systemId_(), + encoding_() + { } + /** + * Create a new input source with a system identifier. + * + *

Applications may use setPublicId to include a + * public identifier as well, or setEncoding to specify + * the character encoding, if known.

+ * + *

If the system identifier is a URL, it must be full resolved.

+ * + * @param systemId The system identifier (URI). + * @see #setPublicId + * @see #setSystemId + * @see #setByteStream + * @see #setEncoding + */ + InputSource(const string_type& systemId) : + byteStream_(), + publicId_(), + systemId_(systemId), + encoding_() + { } + InputSource(const InputSource& rhs) : + byteStream_(rhs.byteStream_), + publicId_(rhs.publicId_), + systemId_(rhs.systemId_), + encoding_(rhs.encoding_) + { } + /** + * Create a new input source with a byte stream. + * + *

Application writers may use setSystemId to provide a base + * for resolving relative URIs, setPublicId to include a + * public identifier, and/or setEncoding to specify the object's + * character encoding.

+ * + * @param byteStream The raw byte stream containing the document. The + * InputSource does not assume ownership of + * this byteStream. + * @see #InputSource(std::auto_ptr) + * @see #setPublicId + * @see #setSystemId + * @see #setEncoding + * @see #setByteStream + */ + InputSource(std::istream& byteStream) : + byteStream_(byteStream), + publicId_(), + systemId_(), + encoding_() + { } + + + /** + * Create a new input source with a byte stream. + * + *

Application writers may use setSystemId to provide a base + * for resolving relative URIs, setPublicId to include a + * public identifier, and/or setEncoding to specify the object's + * character encoding.

+ * + * @param byteStream The raw byte stream containing the document. The + * InputSource assumes ownership of the byteStream + * and will delete it when no-longer required. + * @see InputSource(std::istream&) + * @see #setPublicId + * @see #setSystemId + * @see #setEncoding + * @see #setByteStream + */ + InputSource(std::auto_ptr byteStream) : + byteStream_(byteStream), + publicId_(), + systemId_(), + encoding_() + { } + + InputSource(std::auto_ptr byteStream) : + byteStream_(byteStream), + publicId_(), + systemId_(), + encoding_() + { } + + + virtual ~InputSource() { } + + InputSource& operator=(const InputSource& rhs) + { + byteStream_ = rhs.byteStream_; + publicId_ = rhs.publicId_; + systemId_ = rhs.systemId_; + encoding_ = rhs.encoding_; + + return *this; + } // operator= + + /** + * Set the public identifier for this input source. + * + *

The public identifier is always optional: if the application + * writer includes one, it will be provided as part of the + * location information.

+ * + * @param publicId The public identifier as a string. + * @see #getPublicId + * @see Locator#getPublicId + * @see SAXParseException#getPublicId + */ + void setPublicId(const string_type& publicId) { publicId_ = publicId; } + /** + * Get the public identifier for this input source. + * + * @return The public identifier, or an empty string if none was supplied. + * @see #setPublicId + */ + const string_type& getPublicId() const { return publicId_; } + + /** + * Set the system identifier for this input source. + * + *

The system identifier is optional if there is a byte + * stream but it is still useful to provide one, since the + * application can use it to resolve relative URIs and can + * include it in error messages and warnings (the parser will + * attempt to open a connection to the URI only if there is no + * byte stream specified).

+ * + *

If the application knows the character encoding of the + * object pointed to by the system identifier, it can register + * the encoding using the setEncoding method.

+ * + *

If the system ID is a URL, it must be fully resolved.

+ * + * @param systemId The system identifier as a string. + * @see #setEncoding + * @see #getSystemId + * @see Locator#getSystemId + * @see SAXParseException#getSystemId + */ + void setSystemId(const string_type& systemId) { systemId_ = systemId; } + /** + * Get the system identifier for this input source. + * + *

The getEncoding method will return the character encoding + * of the object pointed to, or an empty string if unknown.

+ * + *

If the system ID is a URL, it will be fully resolved.

+ * + * @return The system identifier. + * @see #setSystemId + * @see #getEncoding + */ + const string_type& getSystemId() const { return systemId_; } + + /** + * Set the byte stream for this input source. + * + *

The SAX parser will use a byte stream in preference + * to opening a URI connection itself.

+ * + *

If the application knows the character encoding of the + * byte stream, it should set it with the setEncoding method.

+ * + * @param byteStream A byte stream containing an XML document or + * other entity. The InputSource does not assume + * ownership of byteStream. + * @see #setByteStream(std::auto_ptr) To transfer ownership of + * an std::istream to an InputSource + * @see #setEncoding + * @see #getByteStream + * @see #getEncoding + */ + void setByteStream(std::istream& byteStream) + { + byteStream_ = byteStream; + } // setByteStream + + /** + * Set the byte stream for this input source. + * + *

The SAX parser will use a byte stream in preference to + * opening a URI connection itself.

+ * + *

If the application knows the character encoding of the + * byte stream, it should set it with the setEncoding method.

+ * + * @param byteStream A byte stream containing an XML document or + * other entity. The InputSource assumes + * ownership of byteStream. + * @see #setByteStream(std::istream&) + * @see #setEncoding + * @see #getByteStream + * @see #getEncoding + */ + void setByteStream(std::auto_ptr byteStream) + { + byteStream_ = byteStream; + } // setByteStream + + /** + * Get the byte stream for this input source as a std::istream*. + * + *

The getEncoding method will return the character + * encoding for this byte stream, or an empty string if unknown.

+ * + * @return The byte stream, or null if none was supplied. No ownership is + * transfered. + * @see #getEncoding + * @see #setByteStream + */ + std::istream* getByteStream() const + { + return byteStream_.get(); + } // getByteStream + + /** + * Get the byte stream for this input source as an IStreamHandle. + * + *

The getEncoding method will return the character + * encoding for this byte stream, or null if unknown.

+ * + * @return The byte stream, or null if none was supplied. Ownership is + * shared between this and the client code. + * @see #getEncoding + * @see #setByteStream + */ + IStreamHandle getByteStreamHandle() const + { + return byteStream_; + } + /** + * Set the character encoding, if known. + * + *

The encoding must be a string acceptable for an + * XML encoding declaration (see section 4.3.3 of the XML 1.0 + * recommendation).

+ * + * @param encoding A string describing the character encoding. + * @see #setSystemId + * @see #setByteStream + * @see #getEncoding + */ + void setEncoding(const string_type& encoding) { encoding_ = encoding; } + /** + * Get the character encoding for a byte stream or URI. + * + * @return The encoding, or an empty string if none was supplied. + * @see #setByteStream + * @see #getSystemId + * @see #getByteStream + */ + const string_type& getEncoding() const { return encoding_; } + + /////////////////////////////////////////////////////////// +private: + IStreamHandle byteStream_; + string_type publicId_; + string_type systemId_; + string_type encoding_; + + bool operator==(const InputSource&); // no implementation +}; // class InputSource + +} // namespace SAX +} // namespace Arabica + +#endif // #define InputSourceH +// end of file diff --git a/arabica/include/SAX/Locator.hpp b/arabica/include/SAX/Locator.hpp new file mode 100644 index 000000000..b2fe4e484 --- /dev/null +++ b/arabica/include/SAX/Locator.hpp @@ -0,0 +1,131 @@ +#ifndef ARABICA_LOCATOR_H +#define ARABICA_LOCATOR_H + +// Locator.h + +#include + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Interface for associating a SAX event with a document location. + * + *

If a SAX parser provides location information to the SAX + * application, it does so by implementing this interface and then + * passing an instance to the application using the content + * handler's {@link ContentHandler#setDocumentLocator + * setDocumentLocator} method. The application can use the + * object to obtain the location of any other content handler event + * in the XML source document.

+ * + *

Note that the results returned by the object will be valid only + * during the scope of each content handler method: the application + * will receive unpredictable results if it attempts to use the + * locator at any other time.

+ * + *

SAX parsers are not required to supply a locator, but they are + * very strongly encouraged to do so. If the parser supplies a + * locator, it must do so before reporting any other document events. + * If no locator has been set by the time the application receives + * the {@link ContentHandler#startDocument startDocument} + * event, the application should assume that a locator is not + * available.

+ * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see ContentHandler#setDocumentLocator + */ +template > +class Locator +{ +public: + typedef string_type stringT; + + virtual ~Locator() { } + + /** + * Return the public identifier for the current document event. + * + *

The return value is the public identifier of the document + * entity or of the external parsed entity in which the markup + * triggering the event appears.

+ * + * @return A string containing the public identifier, or + * an empty string if none is available. + * @see #getSystemId + */ + virtual stringT getPublicId() const = 0; + /** + * Return the system identifier for the current document event. + * + *

The return value is the system identifier of the document + * entity or of the external parsed entity in which the markup + * triggering the event appears.

+ * + *

If the system identifier is a URL, the parser must resolve it + * fully before passing it to the application.

+ * + * @return A string containing the public identifier, or + * an empty string if none is available. + * @see #getPublicId + */ + virtual stringT getSystemId() const = 0; + /** + * Return the line number where the current document event ends. + * + *

Warning: The return value from the method + * is intended only as an approximation for the sake of error + * reporting; it is not intended to provide sufficient information + * to edit the character content of the original XML document.

+ * + *

The return value is an approximation of the line number + * in the document entity or external parsed entity where the + * markup triggering the event appears.

+ * + *

If possible, the SAX driver should provide the line position + * of the first character after the text associated with the document + * event. The first line in the document is line 1.

+ * + * @return The line number, or -1 if none is available. + * @see #getColumnNumber + */ + virtual size_t getLineNumber() const = 0; + /** + * Return the column number where the current document event ends. + * + *

Warning: The return value from the method + * is intended only as an approximation for the sake of error + * reporting; it is not intended to provide sufficient information + * to edit the character content of the original XML document.

+ * + *

The return value is an approximation of the column number + * in the document entity or external parsed entity where the + * markup triggering the event appears.

+ * + *

If possible, the SAX driver should provide the line position + * of the first character after the text associated with the document + * event.

+ * + *

If possible, the SAX driver should provide the line position + * of the first character after the text associated with the document + * event. The first column in each line is column 1.

+ * + * @return The column number, or -1 if none is available. + * @see #getLineNumber + */ + virtual size_t getColumnNumber() const = 0; +}; // class Locator + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/Parser.hpp b/arabica/include/SAX/Parser.hpp new file mode 100644 index 000000000..d85d47aed --- /dev/null +++ b/arabica/include/SAX/Parser.hpp @@ -0,0 +1,166 @@ +#ifndef ARABICA_PARSER_H +#define ARABICA_PARSER_H + +// Parser.h +// $Id$ + +#pragma message("Parser is a SAX1 class. Consider using XMLReader instead.") + +#include + +#include + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Basic interface for SAX (Simple API for XML) parsers. + * + *

This was the main event supplier interface for SAX1; it has + * been replaced in SAX2 by {@link XMLReader XMLReader}, + * which includes Namespace support and sophisticated configurability + * and extensibility.

+ * + *

All SAX1 parsers must implement this basic interface: it allows + * applications to register handlers for different types of events + * and to initiate a parse from a URI, or a character stream.

+ * + *

All SAX1 parsers must also implement a zero-argument constructor + * (though other constructors are also allowed).

+ * + *

SAX1 parsers are reusable but not re-entrant: the application + * may reuse a parser object (possibly with a different input source) + * once the first parse has completed successfully, but it may not + * invoke the parse() methods recursively within a parse.

+ * + * @deprecated This interface has been replaced by the SAX2 + * {@link XMLReader XMLReader} + * interface, which includes Namespace support. + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see EntityResolver + * @see DTDHandler + * @see DocumentHandler + * @see ErrorHandler + * @see HandlerBase + * @see InputSource + */ +template +class Parser +{ +public: + typedef string_name stringT; + typedef EntityResolver EntityResolverT; + typedef DTDHandler DTDHandlerT; + typedef DocumentHandler DocumentHandlerT; + ypedef InputSource InputSourceT; + + virtual ~Parser() { } + + // virtual void setLocale(Locale locale) throws SAXException = 0; + /** + * Allow an application to register a custom entity resolver. + * + *

If the application does not register an entity resolver, the + * SAX parser will resolve system identifiers and open connections + * to entities itself (this is the default behaviour implemented in + * HandlerBase).

+ * + *

Applications may register a new or different entity resolver + * in the middle of a parse, and the SAX parser must begin using + * the new resolver immediately.

+ * + * @param resolver The object for resolving entities. + * @see EntityResolver + * @see HandlerBase + */ + virtual void setEntityResolver(EntityResolverT& resolver) = 0; + /** + * Allow an application to register a DTD event handler. + * + *

If the application does not register a DTD handler, all DTD + * events reported by the SAX parser will be silently + * ignored (this is the default behaviour implemented by + * HandlerBase).

+ * + *

Applications may register a new or different + * handler in the middle of a parse, and the SAX parser must + * begin using the new handler immediately.

+ * + * @param handler The DTD handler. + * @see DTDHandler + * @see HandlerBase + */ + virtual void setDTDHandler(DTDHandlerT& handler) = 0; + /** + * Allow an application to register a document event handler. + * + *

If the application does not register a document handler, all + * document events reported by the SAX parser will be silently + * ignored (this is the default behaviour implemented by + * HandlerBase).

+ * + *

Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.

+ * + * @param handler The document handler. + * @see DocumentHandler + * @see HandlerBase + */ + virtual void setDocumentHandler(DocumentHandlerT& handler) = 0; + /** + * Allow an application to register an error event handler. + * + *

If the application does not register an error event handler, + * all error events reported by the SAX parser will be silently + * ignored, except for fatalError, which will throw a SAXException + * (this is the default behaviour implemented by HandlerBase).

+ * + *

Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.

+ * + * @param handler The error handler. + * @see ErrorHandler + * @see SAXException + * @see HandlerBase + */ + virtual void setErrorHandler(ErrorHandler& handler) = 0; + + /** + * Parse an XML document. + * + *

The application can use this method to instruct the SAX parser + * to begin parsing an XML document from any valid input + * source (a character stream, a byte stream, or a URI).

+ * + *

Applications may not invoke this method while a parse is in + * progress (they should create a new Parser instead for each + * additional XML document). Once a parse is complete, an + * application may reuse the same Parser object, possibly with a + * different input source.

+ * + * @param source The input source for the top-level of the + * XML document. + * @see InputSource + * @see #setEntityResolver + * @see #setDTDHandler + * @see #setDocumentHandler + * @see #setErrorHandler + */ + virtual void parse(InputSourceT& source) = 0; +}; // class Parser + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file + diff --git a/arabica/include/SAX/ParserConfig.hpp b/arabica/include/SAX/ParserConfig.hpp new file mode 100644 index 000000000..ff44c5a6d --- /dev/null +++ b/arabica/include/SAX/ParserConfig.hpp @@ -0,0 +1,91 @@ +#ifndef ARABICA_PARSERCONFIG_H +#define ARABICA_PARSERCONFIG_H + +#ifdef ARABICA_USE_LIBXML2 +#include +#undef DEF_SAX_P +#define DEF_SAX_P libxml2_wrapper +#ifdef _MSC_VER +#pragma message("Including libxml2") +#pragma comment(lib, "libxml2.lib") +#endif +#endif + +#ifdef ARABICA_USE_MSXML +#ifndef _MSC_VER +#error "Can only use MSXML on Windows" +#endif +#pragma message("Including MSXML") +#include +#undef DEF_SAX_P +#define DEF_SAX_P msxml2_wrapper +#endif + +#ifdef ARABICA_USE_XERCES +#include +#undef DEF_SAX_P +#define DEF_SAX_P xerces_wrapper +#ifndef ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS +#ifdef _MSC_VER +#pragma message("Including Xerces v3") +#ifdef _DEBUG +#pragma comment(lib, "xerces-c_3D.lib") +#else +#pragma comment(lib, "xerces-c_3.lib") +#endif +#endif +#endif +#endif + +#ifdef ARABICA_USE_GARDEN +#ifdef _MSC_VER +#pragma message("Including Garden") +#endif +#include +#undef DEF_SAX_P +#define DEF_SAX_P Garden +#endif + +#ifdef ARABICA_USE_EXPAT +#include +#undef DEF_SAX_P +#define DEF_SAX_P expat_wrapper +#ifdef _MSC_VER +#ifndef ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS +#pragma message("Including Expat") +#ifndef XML_STATIC +#pragma comment(lib, "libexpat.lib") +#else +#pragma comment(lib, "libexpatMT.lib") +#endif +#endif +#endif +#endif + +#ifdef _MSC_VER +#ifndef ARABICA_NOT_USE_PRAGMA_LINKER_OPTIONS +#pragma comment(lib, "wsock32.lib") +#endif +#endif + + +#ifndef NO_DEFAULT_PARSER +#ifdef DEF_SAX_P +namespace Arabica +{ +namespace SAX +{ +template + class XMLReader : public DEF_SAX_P { }; +} // namespace SAX +} // namespace Arabica +#else +#error "No default parser defined." +#endif +#endif + +#undef DEF_P + +#endif + + diff --git a/arabica/include/SAX/SAXException.hpp b/arabica/include/SAX/SAXException.hpp new file mode 100644 index 000000000..3712d476e --- /dev/null +++ b/arabica/include/SAX/SAXException.hpp @@ -0,0 +1,68 @@ +#ifndef ARABICA_SAXEXCEPTION_H +#define ARABICA_SAXEXCEPTION_H + +// SAXParseException.h +// $Id$ + +#include + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Encapsulate a general SAX error or warning. + * + *

This class can contain basic error or warning information from + * either the XML parser or the application: a parser writer or + * application writer can subclass it to provide additional + * functionality. SAX handlers may throw this exception or + * any exception subclassed from it.

+ * + *

If the parser or application needs to include information about a + * specific location in an XML document, it should use the + * {@link SAXParseException SAXParseException} subclass.

+ * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see SAXParseException + */ +class SAXException : public std::runtime_error +{ +public: + SAXException() : std::runtime_error("Unspecified SAX Exception") + { + } // SAXException + + SAXException(const std::string& message) : + std::runtime_error(message) + { + } // SAXException + + SAXException(const SAXException& rhs) : + std::runtime_error(rhs.what()) + { + } // SAXException + + virtual ~SAXException() throw() { } + + SAXException& operator=(const SAXException& rhs) + { + std::runtime_error* re = static_cast(this); + *re = rhs; + return *this; + } // operator= + +private: + bool operator==(const SAXException&); +}; // class SAXException + +} // namespace SAX +} // namespace Arabica + +#endif // SAXExceptionH diff --git a/arabica/include/SAX/SAXNotRecognizedException.hpp b/arabica/include/SAX/SAXNotRecognizedException.hpp new file mode 100644 index 000000000..77e4a0f9a --- /dev/null +++ b/arabica/include/SAX/SAXNotRecognizedException.hpp @@ -0,0 +1,54 @@ +#ifndef ARABICA_SAXNOTRECOGNIZEDEXCEPTION_H +#define ARABICA_SAXNOTRECOGNIZEDEXCEPTION_H + +// SAXNotRecognizedException.h +// $Id$ + + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Exception class for an unrecognized identifier. + * + *

An XMLReader will throw this exception when it finds an + * unrecognized feature or property identifier; SAX applications and + * extensions may use this class for other, similar purposes.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see SAXNotSupportedException + */ +class SAXNotRecognizedException : public SAXException +{ +public: + SAXNotRecognizedException(const std::string& message) : + SAXException(message) + { + } // SAXNotRecognizedException + + SAXNotRecognizedException(const SAXNotRecognizedException& rhs) : + SAXException(rhs) + { + } // SAXNotRecognizedException + + SAXNotRecognizedException& operator=(const SAXNotRecognizedException& rhs) + { + SAXException::operator =(rhs); + return *this; + } // operator= + + virtual ~SAXNotRecognizedException() throw() { } +}; // class SAXNotRecognizedException + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/SAXNotSupportedException.hpp b/arabica/include/SAX/SAXNotSupportedException.hpp new file mode 100644 index 000000000..8d0cf5bbe --- /dev/null +++ b/arabica/include/SAX/SAXNotSupportedException.hpp @@ -0,0 +1,56 @@ +#ifndef ARARBICA_SAXNOTSUPPORTEDEXCEPTION_H +#define ARARBICA_SAXNOTSUPPORTEDEXCEPTION_H + +// SAXNotSupportedException.h +// $Id$ + + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Exception class for an unsupported operation. + * + *

An XMLReader will throw this exception when it recognizes a + * feature or property identifier, but cannot perform the requested + * operation (setting a state or value). Other SAX2 applications and + * extensions may use this class for similar purposes.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see SAXNotRecognizedException + */ +class SAXNotSupportedException : public SAXException +{ +public: + SAXNotSupportedException(const std::string& message) : + SAXException(message) + { + } // SAXNotSupportedException + + SAXNotSupportedException(const SAXNotSupportedException& rhs) : + SAXException(rhs) + { + } // SAXNotSupportedException + + SAXNotSupportedException& operator=(const SAXNotSupportedException& rhs) + { + SAXException::operator =(rhs); + return *this; + } // operator= + + virtual ~SAXNotSupportedException() throw() { } + +}; // class SAXNotSupportedException + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/SAXParseException.hpp b/arabica/include/SAX/SAXParseException.hpp new file mode 100644 index 000000000..fd82e5248 --- /dev/null +++ b/arabica/include/SAX/SAXParseException.hpp @@ -0,0 +1,170 @@ +#ifndef ARABICA_SAXPARSEEXCEPTION_H +#define ARABICA_SAXPARSEEXCEPTION_H + +// SAXParseException.h +// $Id$ + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Encapsulate an XML parse error or warning. + * + *

This exception will include information for locating the error + * in the original XML document. Note that although the application + * will receive a SAXParseException as the argument to the handlers + * in the {@link ErrorHandler ErrorHandler} interface, + * the application is not actually required to throw the exception; + * instead, it can simply read the information in it and take a + * different action.

+ * + *

Since this exception is a subclass of {@link SAXException + * SAXException}, it inherits the ability to wrap another exception.

+ * + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see SAXException + * @see Locator + * @see ErrorHandler + */ +template > +class SAXParseException : public SAXException +{ +public: + typedef Locator LocatorT; + + SAXParseException(const std::string& message) : + SAXException(message), + publicId_(), + systemId_(), + lineNumber_(-1), + columnNumber_(-1) + { + setMsg(); + } // SAXParseException + + SAXParseException(const std::string& message, + const LocatorT& locator) : + SAXException(message), + publicId_(locator.getPublicId()), + systemId_(locator.getSystemId()), + lineNumber_(locator.getLineNumber()), + columnNumber_(locator.getColumnNumber()) + { + setMsg(); + } // SAXParseException + + SAXParseException(const std::string& message, + const string_type& publicId, + const string_type& systemId, + size_t lineNumber, + size_t columnNumber) : + SAXException(message), + publicId_(publicId), + systemId_(systemId), + lineNumber_(lineNumber), + columnNumber_(columnNumber) + { + setMsg(); + } // SAXParseException + + SAXParseException(const SAXParseException& rhs) : + SAXException(rhs), + msg_(rhs.msg_), + publicId_(rhs.publicId_), + systemId_(rhs.systemId_), + lineNumber_(rhs.lineNumber_), + columnNumber_(rhs.columnNumber_) + { + } // SAXParseException + + SAXParseException& operator=(const SAXParseException& rhs) + { + SAXException::operator=(rhs); + + msg_ = rhs.msg_; + publicId_ = rhs.publicId_; + systemId_ = rhs.systemId_; + lineNumber_ = rhs.lineNumber_; + columnNumber_ = rhs.columnNumber_; + + return *this; + } // operator= + + virtual ~SAXParseException() throw() { } + + /** + * Get the public identifier of the entity where the exception occurred. + * + * @return A string containing the public identifier, or an empty string + * if none is available. + * @see Locator#getPublicId + */ + const string_type& getPublicId() const { return publicId_; } + /** + * Get the system identifier of the entity where the exception occurred. + * + *

If the system identifier is a URL, it will be resolved + * fully.

+ * + * @return A string containing the system identifier, or an empty string + * if none is available. + * @see Locator#getSystemId + */ + const string_type& getSystemId() const { return systemId_; } + /** + * The line number of the end of the text where the exception occurred. + * + * @return An integer representing the line number, or -1 + * if none is available. + * @see Locator#getLineNumber + */ + size_t getLineNumber() const { return lineNumber_; } + /** + * The column number of the end of the text where the exception occurred. + * + *

The first column in a line is position 1.

+ * + * @return An integer representing the column number, or -1 + * if none is available. + * @see Locator#getColumnNumber + */ + size_t getColumnNumber() const { return columnNumber_; } + + virtual const char* what() const throw() + { + return msg_.c_str(); + } // what + +private: + void setMsg() + { + std::ostringstream str; + str << "Parse exception at " << lineNumber_ << "," << columnNumber_ << std::endl; + str << SAXException::what(); + msg_ = str.str(); + } // setMsg + + std::string msg_; + + string_type publicId_; + string_type systemId_; + size_t lineNumber_; + size_t columnNumber_; + + SAXParseException(); +}; // class SAXParseException + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/XMLFilter.hpp b/arabica/include/SAX/XMLFilter.hpp new file mode 100644 index 000000000..ea5f1273a --- /dev/null +++ b/arabica/include/SAX/XMLFilter.hpp @@ -0,0 +1,71 @@ +#ifndef ARABICA_XML_FILTER_H +#define ARABICA_XML_FILTER_H + +// XMLFilter.h + +#include +#include + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Interface for an XML filter. + * + *

An XML filter is like an XML reader, except that it obtains its + * events from another XML reader rather than a primary source like + * an XML document or database. Filters can modify a stream of + * events as they pass on to the final application.

+ * + *

The XMLFilterImpl helper class provides a convenient base + * for creating SAX2 filters, by passing on all {@link EntityResolver + * EntityResolver}, {@link DTDHandler DTDHandler}, + * {@link ContentHandler ContentHandler} and {@link ErrorHandler + * ErrorHandler} events automatically.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see XMLFilterImpl + */ +template +class XMLFilter : public XMLReaderInterface +{ +public: + typedef XMLReaderInterface XMLReaderT; + typedef typename XMLReaderT::string_adaptor string_adaptor; + + virtual ~XMLFilter() { } + + /** + * Set the parent reader. + * + *

This method allows the application to link the filter to + * a parent reader (which may be another filter).

+ * + * @param parent The parent reader. + */ + virtual void setParent(XMLReaderT& parent) = 0; + /** + * Get the parent reader. + * + *

This method allows the application to query the parent + * reader (which may be another filter). It is generally a + * bad idea to perform any operations on the parent reader + * directly: they should all pass through this filter.

+ * + * @return The parent filter, or 0 if none has been set. + */ + virtual XMLReaderT* getParent() const = 0; +}; // class XMLFilter + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/XMLReader.hpp b/arabica/include/SAX/XMLReader.hpp new file mode 100644 index 000000000..159d096d4 --- /dev/null +++ b/arabica/include/SAX/XMLReader.hpp @@ -0,0 +1,450 @@ +#ifndef ARABICA_XML_READER_H +#define ARABICA_XML_READER_H + +// XMLReader.h +// $Id$ + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Interface for reading an XML document using callbacks. + * + *

XMLReader is the interface that an XML parser's SAX2 driver must + * implement. This interface allows an application to set and + * query features and properties in the parser, to register + * event handlers for document processing, and to initiate + * a document parse.

+ * + *

All SAX interfaces are assumed to be synchronous: the + * {@link #parse parse} methods must not return until parsing + * is complete, and readers must wait for an event-handler callback + * to return before reporting the next event.

+ * + *

This interface replaces the (now deprecated) SAX 1.0 {@link + * Parser Parser} interface. The XMLReader interface + * contains two important enhancements over the old Parser + * interface:

+ * + *
    + *
  1. it adds a standard way to query and set features and + * properties; and
  2. + *
  3. it adds Namespace support, which is required for many + * higher-level XML standards.
  4. + *
+ * + *

There are adapters available to convert a SAX1 Parser to + * a SAX2 XMLReader and vice-versa.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see XMLFilter + * @see helpers.ParserAdapter + * @see helpers.XMLReaderAdapter + */ +class XMLReaderInterface_tag { }; + +template +class XMLReaderInterface : public XMLReaderInterface_tag +{ +public: + typedef string_adaptor_type string_adaptor; + typedef EntityResolver EntityResolverT; + typedef DTDHandler DTDHandlerT; + typedef ContentHandler ContentHandlerT; + typedef InputSource InputSourceT; + typedef ErrorHandler ErrorHandlerT; + typedef DeclHandler DeclHandlerT; + typedef LexicalHandler LexicalHandlerT; + + virtual ~XMLReaderInterface() { } + + ///////////////////////////////////////////////// + // Configuration + /** + * Look up the value of a feature. + * + *

The feature name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a feature name but + * to be unable to return its value; this is especially true + * in the case of an adapter for a SAX1 Parser, which has + * no way of knowing whether the underlying parser is + * performing validation or expanding external entities.

+ * + *

All XMLReaders are required to recognize the + * http://xml.org/sax/features/namespaces and the + * http://xml.org/sax/features/namespace-prefixes feature names.

+ * + *

Some feature values may be available only in specific + * contexts, such as before, during, or after a parse.

+ * + *

Typical usage is something like this:

+ * + *
+   * XMLReader r = new MySAXDriver();
+   *
+   *                         // try to activate validation
+   * try {
+   *   r.setFeature("http://xml.org/sax/features/validation", true);
+   * } catch (SAXException e) {
+   *   System.err.println("Cannot activate validation."); 
+   * }
+   *
+   *                         // register event handlers
+   * r.setContentHandler(new MyContentHandler());
+   * r.setErrorHandler(new MyErrorHandler());
+   *
+   *                         // parse the first document
+   * try {
+   *   r.parse("http://www.foo.com/mydoc.xml");
+   * } catch (IOException e) {
+   *   System.err.println("I/O exception reading XML document");
+   * } catch (SAXException e) {
+   *   System.err.println("XML exception reading document.");
+   * }
+   * 
+ * + *

Implementors are free (and encouraged) to invent their own features, + * using names built on their own URIs.

+ * + * @param name The feature name, which is a fully-qualified URI. + * @return The current state of the feature (true or false). + * @see #setFeature + */ + virtual bool getFeature(const string_type& name) const = 0; + /** + * Set the state of a feature. + * + *

The feature name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a feature name but + * to be unable to set its value; this is especially true + * in the case of an adapter for a SAX1 {@link Parser Parser}, + * which has no way of affecting whether the underlying parser is + * validating, for example.

+ * + *

All XMLReaders are required to support setting + * http://xml.org/sax/features/namespaces to true and + * http://xml.org/sax/features/namespace-prefixes to false.

+ * + *

Some feature values may be immutable or mutable only + * in specific contexts, such as before, during, or after + * a parse.

+ * + * @param name The feature name, which is a fully-qualified URI. + * @param value The requested value of the feature (true or false). + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the feature name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the feature name but + * cannot set the requested value. + * @see #getFeature + * @see FeatureNames + * @see http://www.saxproject.org/apidoc/org/xml/sax/package-summary.html#package_description for a list of SAX2 features. + */ + virtual void setFeature(const string_type& name, bool value) = 0; + + ///////////////////////////////////////////////// + // Event Handlers + /** + * Allow an application to register an entity resolver. + * + *

If the application does not register an entity resolver, + * the XMLReader will perform its own default resolution.

+ * + *

Applications may register a new or different resolver in the + * middle of a parse, and the SAX parser must begin using the new + * resolver immediately.

+ * + * @param resolver The entity resolver. + * @see #getEntityResolver + */ + virtual void setEntityResolver(EntityResolverT& resolver) = 0; + /** + * Return the current entity resolver. + * + * @return The current entity resolver, or null if none + * has been registered. + * @see #setEntityResolver + */ + virtual EntityResolverT* getEntityResolver() const = 0; + + /** + * Allow an application to register a DTD event handler. + * + *

If the application does not register a DTD handler, all DTD + * events reported by the SAX parser will be silently ignored.

+ * + *

Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.

+ * + * @param handler The DTD handler. + * @see #getDTDHandler + */ + virtual void setDTDHandler(DTDHandlerT& handler) = 0; + /** + * Return the current DTD handler. + * + * @return The current DTD handler, or null if none + * has been registered. + * @see #setDTDHandler + */ + virtual DTDHandlerT* getDTDHandler() const = 0; + + /** + * Allow an application to register a content event handler. + * + *

If the application does not register a content handler, all + * content events reported by the SAX parser will be silently + * ignored.

+ * + *

Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.

+ * + * @param handler The content handler. + * @see #getContentHandler + */ + virtual void setContentHandler(ContentHandlerT& handler) = 0; + /** + * Return the current content handler. + * + * @return The current content handler, or null if none + * has been registered. + * @see #setContentHandler + */ + virtual ContentHandlerT* getContentHandler() const = 0; + + /** + * Allow an application to register an error event handler. + * + *

If the application does not register an error handler, all + * error events reported by the SAX parser will be silently + * ignored; however, normal processing may not continue. It is + * highly recommended that all SAX applications implement an + * error handler to avoid unexpected bugs.

+ * + *

Applications may register a new or different handler in the + * middle of a parse, and the SAX parser must begin using the new + * handler immediately.

+ * + * @param handler The error handler. + * @see #getErrorHandler + */ + virtual void setErrorHandler(ErrorHandlerT& handler) = 0; + /** + * Return the current error handler. + * + * @return The current error handler, or null if none + * has been registered. + * @see #setErrorHandler + */ + virtual ErrorHandlerT* getErrorHandler() const = 0; + + virtual void setDeclHandler(DeclHandlerT& handler) = 0; + /** + * Return the current decl handler. + * + * @return The current decl handler, or 0 if none has been registered + * @see #setDeclHandler + */ + virtual DeclHandlerT* getDeclHandler() const = 0; + + virtual void setLexicalHandler(LexicalHandlerT& handler) = 0; + /** + * Return the current lexical handler. + * + * @return The current lexical handler, or 0 if none has been registered + * @see #setLexicalHandler + */ + virtual LexicalHandlerT* getLexicalHandler() const = 0; + + ////////////////////////////////////////////////// + // Parsing + /** + * Parse an XML document from a system identifier (URI). + * + *

This method is a shortcut for the common case of reading a + * document from a system identifier. It is the exact + * equivalent of the following:

+ * + *
+   * InputSource is(systemId);
+   * parse(is);
+   * 
+ * + *

If the system identifier is a URL, it must be fully resolved + * by the application before it is passed to the parser.

+ * + * @param systemId The system identifier (URI). + * @see #parse(InputSource&) + */ + void parse(const string_type& systemId) + { + InputSourceT is(systemId); + parse(is); + } // parser + /** + * Parse an XML document. + * + *

The application can use this method to instruct the XML + * reader to begin parsing an XML document from any valid input + * source (a character stream, a byte stream, or a URI).

+ * + *

Applications may not invoke this method while a parse is in + * progress (they should create a new XMLReader instead for each + * nested XML document). Once a parse is complete, an + * application may reuse the same XMLReader object, possibly with a + * different input source.

+ * + *

During the parse, the XMLReader will provide information + * about the XML document through the registered event + * handlers.

+ * + *

This method is synchronous: it will not return until parsing + * has ended. If a client application wants to terminate + * parsing early, it should throw an exception.

+ * + * @param input The input source for the top-level of the + * XML document. + * @see InputSource + * @see #parse(const string_type&) + * @see #setEntityResolver + * @see #setDTDHandler + * @see #setContentHandler + * @see #setErrorHandler + */ + virtual void parse(InputSourceT& input) = 0; + + //////////////////////////////////////////////////// + // property implementation +protected: + class PropertyBase + { + public: + virtual ~PropertyBase() { } + }; // PropertyBase + + template + class Property : public PropertyBase + { + public: + Property(propertyTypeT wrappee) : wrappee_(wrappee) { } + + propertyTypeT get() { return wrappee_; } + + private: + propertyTypeT wrappee_; + }; // class Property + +public: + virtual std::auto_ptr doGetProperty(const string_type& name) = 0; + virtual void doSetProperty(const string_type& name, std::auto_ptr value) = 0; + + /** + * Look up the value of a property. + * + *

The property name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a property name but + * to be unable to return its state; this is especially true + * in the case of an adapter for a SAX1 {@link Parser + * Parser}.

+ * + *

XMLReaders are not required to recognize any specific + * property names, though an initial core set is documented for + * SAX2.

+ * + *

Some property values may be available only in specific + * contexts, such as before, during, or after a parse.

+ * + *

Implementors are free (and encouraged) to invent their own properties, + * using names built on their own URIs.

+ * + * @param name The property name, which is a fully-qualified URI. + * @return The current value of the property. + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the property name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the property name but + * cannot determine its value at this time. + * @see #setProperty + */ + template + propertyTypeT& getProperty(const string_type& name) const + { + std::auto_ptr pb = doGetProperty(name); + Property* prop = dynamic_cast* >(pb.get()); + + if(!prop) + throw SAX::SAXNotSupportedException("Property " + name + " is wrong type."); + + return prop->get(); + } // getProperty + + /** + * Set the value of a property. + * + *

The property name is any fully-qualified URI. It is + * possible for an XMLReader to recognize a property name but + * to be unable to set its value; this is especially true + * in the case of an adapter for a SAX1 {@link Parser + * Parser}.

+ * + *

XMLReaders are not required to recognize setting + * any specific property names, though a core set is provided with + * SAX2.

+ * + *

Some property values may be immutable or mutable only + * in specific contexts, such as before, during, or after + * a parse.

+ * + *

This method is also the standard mechanism for setting + * extended handlers.

+ * + * @param name The property name, which is a fully-qualified URI. + * @param value The requested value for the property. + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the property name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the property name but + * cannot set the requested value. + */ + template + void setProperty(const string_type& name, propertyTypeT& value) + { + Property* prop = new Property(value); + doSetProperty(name, std::auto_ptr(prop)); + } // setProperty +}; // class XMLReaderInterface + +} // namespace SAX +} // namespace Arabica + +/* Included to ensure that #include defines a class called + * XMLReader. + */ +#include + +#endif +// end of file diff --git a/arabica/include/SAX/ext/Attributes2.hpp b/arabica/include/SAX/ext/Attributes2.hpp new file mode 100644 index 000000000..30f96d801 --- /dev/null +++ b/arabica/include/SAX/ext/Attributes2.hpp @@ -0,0 +1,79 @@ +#ifndef ARABICA_ATTRIBUTES2_H +#define ARABICA_ATTRIBUTES2_H + +// Attributes2.h +// $Id$ + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * SAX2 extension to augment the per-attribute information provided though Attributes. + * + * If an implementation supports + * this extension, the attributes provided in + * ContentHandler.startElement() will implement this + * interface, and the http://xml.org/sax/features/use-attributes2 + * feature flag will have the value true. + * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see Attributes + * @see Attributes2Impl + */ +template +class Attributes2 : public Attributes +{ + +public: + typedef string_type stringT; + virtual ~Attributes2() { } + + /** + * Returns true unless the attribute value was provided by DTD defaulting. + * + * @param index The attribute index (zero-based). + * @return true if the value was found in the XML text, + * false if the value was provided by DTD defaulting. + * @throws std::out_of_range exception when the supplied index + * does not identify an attribute + */ + virtual bool isSpecified(unsigned int index) const = 0; + + /** + * Returns true unless the attribute value was provided by DTD defaulting. + * + * @param qName The XML 1.0 qualified name. + * @return true if the value was found in the XML text, + * false if the value was provided by DTD defaulting. + * @throws std::invalid_argument exception when the supplied name + * does not identify an attribute + */ + virtual bool isSpecified(const stringT& qName) const = 0; + + /** + * Returns true unless the attribute value was provided by DTD defaulting. + * + * @param uri The Namespace URI, or the empty string if the name has no + * Namespace URI. + * @param localName The attribute's local name. + * @return true if the value was found in the XML text, + * false if the value was provided by DTD defaulting. + * @throws std::invalid_argument exception when the supplied names + * does not identify an attribute + */ + virtual bool isSpecified(const stringT& uri, const stringT& localName) const = 0; +}; // class Attributes2 + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/ext/DeclHandler.hpp b/arabica/include/SAX/ext/DeclHandler.hpp new file mode 100644 index 000000000..29125a910 --- /dev/null +++ b/arabica/include/SAX/ext/DeclHandler.hpp @@ -0,0 +1,135 @@ +#ifndef ARABICA_DECL_HANDLER_H +#define ARABICA_DECL_HANDLER_H + +// DeclHandler.h +// $Id$ + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * SAX2 extension handler for DTD declaration events. + * + *

This is an optional extension handler for SAX2 to provide + * information about DTD declarations in an XML document. XML + * readers are not required to support this handler, and this + * handler is not included in the core SAX2 distribution.

+ * + *

Note that data-related DTD declarations (unparsed entities and + * notations) are already reported through the {@link + * DTDHandler DTDHandler} interface.

+ * + *

If you are using the declaration handler together with a lexical + * handler, all of the events will occur between the + * {@link LexicalHandler#startDTD startDTD} and the + * {@link LexicalHandler#endDTD endDTD} events.

+ * + *

To set the DeclHandler for an XML reader, use the + * {@link XMLReader#setProperty setProperty} method + * with the propertyId "http://xml.org/sax/properties/declaration-handler". + * If the reader does not support declaration events, it will throw a + * {@link SAXNotRecognizedException SAXNotRecognizedException} + * or a + * {@link SAXNotSupportedException SAXNotSupportedException} + * when you attempt to register the handler.

+ * + * @since 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 1.0 + * @see XMLReader + */ +template > +class DeclHandler +{ +public: + virtual ~DeclHandler() { } + + /** + * Report an element type declaration. + * + *

The content model will consist of the string "EMPTY", the + * string "ANY", or a parenthesised group, optionally followed + * by an occurrence indicator. The model will be normalized so + * that all parameter entities are fully resolved and all whitespace + * is removed,and will include the enclosing parentheses. Other + * normalization (such as removing redundant parentheses or + * simplifying occurrence indicators) is at the discretion of the + * parser.

+ * + * @param name The element type name. + * @param model The content model as a normalized string. + */ + virtual void elementDecl(const string_type& name, const string_type& model) = 0; + /** + * Report an attribute type declaration. + * + *

Only the effective (first) declaration for an attribute will + * be reported. The type will be one of the strings "CDATA", + * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", + * "ENTITIES", a parenthesized token group with + * the separator "|" and all whitespace removed, or the word + * "NOTATION" followed by a space followed by a parenthesized + * token group with all whitespace removed.

+ * + *

Any parameter entities in the attribute value will be + * expanded, but general entities will not.

+ * + * @param elementName The name of the associated element. + * @param attributeName The name of the attribute. + * @param type A string representing the attribute type. + * @param valueDefault A string representing the attribute default + * ("#IMPLIED", "#REQUIRED", or "#FIXED") or empty string if + * none of these applies. + * @param value A string representing the attribute's default value, + * or empty string if there is none. + */ + virtual void attributeDecl(const string_type& elementName, + const string_type& attributeName, + const string_type& type, + const string_type& valueDefault, + const string_type& value) = 0; + /** + * Report an internal entity declaration. + * + *

Only the effective (first) declaration for each entity + * will be reported. All parameter entities in the value + * will be expanded, but general entities will not.

+ * + * @param name The name of the entity. If it is a parameter + * entity, the name will begin with '%'. + * @param value The replacement text of the entity. + * @see #externalEntityDecl + * @see DTDHandler#unparsedEntityDecl + */ + virtual void internalEntityDecl(const string_type& name, const string_type& value) = 0; + /** + * Report a parsed external entity declaration. + * + *

Only the effective (first) declaration for each entity + * will be reported.

+ * + * @param name The name of the entity. If it is a parameter + * entity, the name will begin with '%'. + * @param publicId The declared public identifier of the entity, or + * an empty string if none was declared. + * @param systemId The declared system identifier of the entity. + * @see #internalEntityDecl + * @see DTDHandler#unparsedEntityDecl + */ + virtual void externalEntityDecl(const string_type& name, + const string_type& publicId, + const string_type& systemId) = 0; +}; // class DeclHandler + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/ext/LexicalHandler.hpp b/arabica/include/SAX/ext/LexicalHandler.hpp new file mode 100644 index 000000000..3e57576ab --- /dev/null +++ b/arabica/include/SAX/ext/LexicalHandler.hpp @@ -0,0 +1,202 @@ +#ifndef ARABICA_LEXICAL_HANDLER_H +#define ARABICA_LEXICAL_HANDLER_H + +// LexicalHandler.h +// $Id$ + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * SAX2 extension handler for lexical events. + * + *

This is an optional extension handler for SAX2 to provide + * lexical information about an XML document, such as comments + * and CDATA section boundaries; XML readers are not required to + * support this handler, and it is not part of the core SAX2 + * distribution.

+ * + *

The events in the lexical handler apply to the entire document, + * not just to the document element, and all lexical handler events + * must appear between the content handler's startDocument and + * endDocument events.

+ * + *

To set the LexicalHandler for an XML reader, use the + * {@link XMLReader#setProperty setProperty} method + * with the propertyId "http://xml.org/sax/properties/lexical-handler". + * If the reader does not support lexical events, it will throw a + * {@link SAXNotRecognizedException SAXNotRecognizedException} + * or a + * {@link SAXNotSupportedException SAXNotSupportedException} + * when you attempt to register the handler.

+ * + * @since 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 1.0 + * @see XMLReader#setProperty + * @see SAXNotRecognizedException + * @see SAXNotSupportedException + */ +template > +class LexicalHandler +{ +public: + virtual ~LexicalHandler() { } + + /** + * Report the start of DTD declarations, if any. + * + *

This method is intended to report the beginning of the + * DOCTYPE declaration; if the document has no DOCTYPE declaration, + * this method will not be invoked.

+ * + *

All declarations reported through + * {@link DTDHandler DTDHandler} or + * {@link DeclHandler DeclHandler} events must appear + * between the startDTD and {@link #endDTD endDTD} events. + * Declarations are assumed to belong to the internal DTD subset + * unless they appear between {@link #startEntity startEntity} + * and {@link #endEntity endEntity} events. Comments and + * processing instructions from the DTD should also be reported + * between the startDTD and endDTD events, in their original + * order of (logical) occurrence; they are not required to + * appear in their correct locations relative to DTDHandler + * or DeclHandler events, however.

+ * + *

Note that the start/endDTD events will appear within + * the start/endDocument events from ContentHandler and + * before the first + * {@link ContentHandler#startElement startElement} + * event.

+ * + * @param name The document type name. + * @param publicId The declared public identifier for the + * external DTD subset, or an empty string if none was declared. + * @param systemId The declared system identifier for the + * external DTD subset, or an empty string if none was declared. + * @see #endDTD + * @see #startEntity + */ + virtual void startDTD(const string_type& name, + const string_type& publicId, + const string_type& systemId) = 0; + /** + * Report the end of DTD declarations. + * + *

This method is intended to report the end of the + * DOCTYPE declaration; if the document has no DOCTYPE declaration, + * this method will not be invoked.

+ * + * @see #startDTD + */ + virtual void endDTD() = 0; + + /** + * Report the beginning of some internal and external XML entities. + * + *

The reporting of parameter entities (including + * the external DTD subset) is optional, and SAX2 drivers that + * support LexicalHandler may not support it; you can use the + * http://xml.org/sax/features/lexical-handler/parameter-entities + * feature to query or control the reporting of parameter entities.

+ * + *

General entities are reported with their regular names, + * parameter entities have '%' prepended to their names, and + * the external DTD subset has the pseudo-entity name "[dtd]".

+ * + *

When a SAX2 driver is providing these events, all other + * events must be properly nested within start/end entity + * events. There is no additional requirement that events from + * {@link DeclHandler DeclHandler} or + * {@link DTDHandler DTDHandler} be properly ordered.

+ * + *

Note that skipped entities will be reported through the + * {@link ContentHandler#skippedEntity skippedEntity} + * event, which is part of the ContentHandler interface.

+ * + *

Because of the streaming event model that SAX uses, some + * entity boundaries cannot be reported under any + * circumstances:

+ * + *
    + *
  • general entities within attribute values
  • + *
  • parameter entities within declarations
  • + *
+ * + *

These will be silently expanded, with no indication of where + * the original entity boundaries were.

+ * + *

Note also that the boundaries of character references (which + * are not really entities anyway) are not reported.

+ * + *

All start/endEntity events must be properly nested. + * + * @param name The name of the entity. If it is a parameter + * entity, the name will begin with '%', and if it is the + * external DTD subset, it will be "[dtd]". + * @see #endEntity + * @see DeclHandler#internalEntityDecl + * @see DeclHandler#externalEntityDecl + */ + virtual void startEntity(const string_type& name) = 0; + /** + * Report the end of an entity. + * + * @param name The name of the entity that is ending. + * @see #startEntity + */ + virtual void endEntity(const string_type& name) = 0; + + /** + * Report the start of a CDATA section. + * + *

The contents of the CDATA section will be reported through + * the regular {@link ContentHandler#characters + * characters} event; this event is intended only to report + * the boundary.

+ * + * @see #endCDATA + */ + virtual void startCDATA() = 0; + /** + * Report the end of a CDATA section. + * + * @see #startCDATA + */ + virtual void endCDATA() = 0; + + /** + * Report an XML comment anywhere in the document. + * + *

This callback will be used for comments inside or outside the + * document element, including comments in the external DTD + * subset (if read). Comments in the DTD must be properly + * nested inside start/endDTD and start/endEntity events (if + * used).

+ * + * @param text A string holding the comment. + */ + virtual void comment(const string_type& text) = 0; + + const string_type dtd_pseudo_entity; + + protected: + LexicalHandler() : + dtd_pseudo_entity(string_adaptor::construct_from_utf8("[dtd]")) + { + } +}; // class LexicalHandler + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/ext/Locator2.hpp b/arabica/include/SAX/ext/Locator2.hpp new file mode 100644 index 000000000..4642d5fe6 --- /dev/null +++ b/arabica/include/SAX/ext/Locator2.hpp @@ -0,0 +1,75 @@ +#ifndef ARABICA_LOCATOR2_H +#define ARABICA_LOCATOR2_H + +// Locator2.h +// $Id$ + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * SAX2 extension to augment the entity information provided though a Locator. + *

+ * If an implementation supports this extension, the Locator provided in + * ContentHandler.setDocumentLocator() will implement this interface, + * and the http://xml.org/sax/features/use-locator2 feature flag will have + * the value true. + *

+ * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + */ +template +class Locator2 : public Locator +{ +public: + typedef string_type stringT; + + virtual ~Locator2() { } + + /** + * Returns the version of XML used for the entity. This will normally + * be the identifier from the current entity's + * declaration, or be defaulted by the parser. + *

+ * At this writing, only one version ("1.0") is defined, but it seems + * likely that a new version will be defined which has slightly different + * rules about which characters are legal in XML names. + *

+ * @return Identifier for the XML version being used to interpret the entity's text. + */ + virtual stringT getXMLVersion() const = 0; + + /** + * Returns the name of the character encoding for the entity. If the encoding was + * declared externally (for example, in a MIME Content-Type header), that will be + * the name returned. Else if there was an declaration at + * the start of the document, that encoding name will be returned. Otherwise the + * encoding will been inferred (norally to be UTF-8, or some UTF-16 variant), and + * that inferred name will be returned. + *

+ * Note that some recent W3C specifications require that text in some encodings + * be normalized, using Unicode Normalization Form C, before processing. Such + * normalization must be performed by applications, and would normally be triggered + * based on the value returned by this method. + *

+ * Encoding names may be those used by the underlying implementation, and + * comparisons should be case-insensitive. + * + * @return Name of the character encoding being used to interpret the entity's text. + */ + virtual stringT getEncoding() const = 0; +}; // class Locator2 + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file + diff --git a/arabica/include/SAX/helpers/AttributeDefaults.hpp b/arabica/include/SAX/helpers/AttributeDefaults.hpp new file mode 100644 index 000000000..abf57859a --- /dev/null +++ b/arabica/include/SAX/helpers/AttributeDefaults.hpp @@ -0,0 +1,34 @@ +#ifndef ARABICA_ATTRIBUTE_DEFAULTS_H +#define ARABICA_ATTRIBUTE_DEFAULTS_H +/* + * $Id$ + */ + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +template > +struct AttributeDefaults +{ + const string_type required; + const string_type implied; + const string_type fixed; + + AttributeDefaults() : + required(string_adaptor::construct_from_utf8("#REQUIRED")), + implied(string_adaptor::construct_from_utf8("#IMPLIED")), + fixed(string_adaptor::construct_from_utf8("#FIXED")) + { + } // AttributeDefaults +}; // struct AttributeDefaults + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/helpers/AttributeListImpl.hpp b/arabica/include/SAX/helpers/AttributeListImpl.hpp new file mode 100644 index 000000000..dbe270e02 --- /dev/null +++ b/arabica/include/SAX/helpers/AttributeListImpl.hpp @@ -0,0 +1,296 @@ +#ifndef ARABICA_ATTRIBUTES_LIST_IMPL_H +#define ARABICA_ATTRIBUTES_LIST_IMPL_H +// SAX default implementation for AttributeList. +// $Id$ + +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +template +class Attribute +{ +public: + Attribute(const string_type& name, const string_adaptor& type, const string_adaptor& value) + : name_(name), type_(type), value_(value) + {} + virtual ~Attribute() { } + +public: + string_type name_; + const string_type& type_; + string_type value_; +}; + +static const std::string empty_; +const std::string const types[] = { empty_, "CDATA", "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", "ENTITIES", "NOTATION" }; // TV + +/** + * Default implementation for AttributeList. + * + *

AttributeList implements the deprecated SAX1 {@link + * AttributeList AttributeList} interface, and has been + * replaced by the new SAX2 {@link AttributesImpl + * AttributesImpl} interface.

+ * + *

This class provides a convenience implementation of the SAX + * {@link AttributeList AttributeList} interface. This + * implementation is useful both for SAX parser writers, who can use + * it to provide attributes to the application, and for SAX application + * writers, who can use it to create a persistent copy of an element's + * attribute specifications:

+ * + *
+ * private AttributeList myatts;
+ *
+ * void startElement(const string_type& name, const AttributeList& atts)
+ * {
+ *   // create a persistent copy of the attribute list
+ *   // for use outside this method
+ *   AttributeListImpl myatts(atts);
+ *   [...]
+ * }
+ * 
+ * + *

Please note that SAX parsers are not required to use this + * class to provide an implementation of AttributeList; it is + * supplied only as an optional convenience. In particular, + * parser writers are encouraged to invent more efficient + * implementations.

+ * + * @deprecated This class implements a deprecated interface, + * {@link AttributeList AttributeList}; + * that interface has been replaced by + * {@link Attributes Attributes}, + * which is implemented in the + * {@link AttributesImpl + * AttributesImpl} helper class. + * @since SAX 1.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see AttributeList + * @see DocumentHandler#startElement + */ +template +class AttributeListImpl : public AttributeList +{ +public: + AttributeListImpl() : atts_() { } + AttributeListImpl(const AttributeList& atts) + : atts_(atts.getLength()) + { + setAttributeList(atts); + } // AttributeListImpl + + AttributeListImpl& operator=(const AttributeList& atts) + { + setAttributeList(atts); + + return *this; + } // operator= + + virtual ~AttributeListImpl() { clear(); } + + ////////////////////////////////////////////////////////////////////// + // Methods specific to this class. + ////////////////////////////////////////////////////////////////////// + /** + * Set the attribute list, discarding previous contents. + * + *

This method allows an application writer to reuse an + * attribute list easily.

+ * + * @param atts The attribute list to copy. + */ + void setAttributeList(const AttributeList& atts) + { + int count = atts.getLength(); + + clear(); + + for (int i = 0; i < count; ++i) + addAttribute(atts.getName(i), atts.getType(i), atts.getValue(i)); + } // setAttributeList + + /** + * Add an attribute to an attribute list. + * + *

This method is provided for SAX parser writers, to allow them + * to build up an attribute list incrementally before delivering + * it to the application.

+ * + * @param name The attribute name. + * @param type The attribute type ("NMTOKEN" for an enumeration). + * @param value The attribute value. + * @see #removeAttribute + * @see DocumentHandler#startElement + */ + void addAttribute(const string_type& name, const string_adaptor& type, const string_adaptor& value) + { + atts_.push_back(new Attribute(name, type, value)); // TV + } // addAttribute + + /** + * Remove an attribute from the list. + * + *

SAX application writers can use this method to filter an + * attribute out of an AttributeList. Note that invoking this + * method will change the length of the attribute list and + * some of the attribute's indices.

+ * + *

If the requested attribute is not in the list, this is + * a no-op.

+ * + * @param name The attribute name. + * @see #addAttribute + */ + void removeAttribute(const string_type& name) + { + int i = index(name); + + if(i < 0) return; + delete atts_[i]; + atts_.erase(atts_.begin() + i); + } // removeAttribute + + /** + * Clear the attribute list. + * + *

SAX parser writers can use this method to reset the attribute + * list between DocumentHandler.startElement events. Normally, + * it will make sense to reuse the same AttributeListImpl object + * rather than allocating a new one each time.

+ * + * @see DocumentHandler#startElement + */ + void clear() + { + while(!atts_.empty()) + { + delete atts_.back(); + atts_.pop_back(); + } + } // clear + + ////////////////////////////////////////////////////////////////////// + // Implementation of AttributeList + ////////////////////////////////////////////////////////////////////// + /** + * Return the number of attributes in the list. + * + * @return The number of attributes in the list. + * @see AttributeList#getLength + */ + virtual int getLength() const + { + return atts_.size(); + } // getLength + + /** + * Get the name of an attribute (by position). + * + * @param i The position of the attribute in the list. + * @return The attribute name as a string, or an empty string if there + * is no attribute at that position. + * @see AttributeList#getName(int) + */ + virtual const string_type& getName(int i) const + { + if(i > atts_.size()) + return empty_; + return atts_[i]->name_; + } // getName + + /** + * Get the type of an attribute (by position). + * + * @param i The position of the attribute in the list. + * @return The attribute type as a string ("NMTOKEN" for an + * enumeration, and "CDATA" if no declaration was + * read), or an empty string if there is no attribute at + * that position. + * @see AttributeList#getType(int) + */ + virtual const string_type& getType(int i) const + { + if(i > atts_.size()) + return empty_; + return atts_[i]->type_; + } // getType + + /** + * Get the value of an attribute (by position). + * + * @param i The position of the attribute in the list. + * @return The attribute value as a string, or an empty string if + * there is no attribute at that position. + * @see AttributeList#getValue(int) + */ + virtual const string_type& getValue(int i) const + { + if(i > atts_.size()) + return empty_; + return atts_[i]->value_; + } // getValue + + /** + * Get the type of an attribute (by name). + * + * @param name The attribute name. + * @return The attribute type as a string ("NMTOKEN" for an + * enumeration, and "CDATA" if no declaration was + * read). + * @see AttributeList#getType(java.lang.String) + */ + virtual const string_type& getType(const string_adaptor& name) const + { + int i = index(name); + return i < 0 ? empty_ : getType(i); + } // getType + + /** + * Get the value of an attribute (by name). + * + * @param name The attribute name. + * @see AttributeList#getValue(java.lang.String) + */ + virtual const string_type& getValue(const string_adaptor& name) const + { + int i = index(name); + return i < 0 ? empty_ : getValue(i); + } // getValue + +private: + ////////////////////////////////////////////////////////////////////// + // Internal state. + ////////////////////////////////////////////////////////////////////// + std::vector *> atts_; + + int index(const string_type& name) const + { + int i = 0, res = -1; + std::vector*>::const_iterator iter; + for (iter = atts_.begin() ; iter != atts_.end() ; i++, iter++) + if ((*iter)->name_ == name) { + res = i; + break; + } + return res; + } // index + + bool operator==(const AttributeList&) const; // not implemented +}; // class AttributeListImpl + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file + diff --git a/arabica/include/SAX/helpers/AttributeTypes.hpp b/arabica/include/SAX/helpers/AttributeTypes.hpp new file mode 100644 index 000000000..ec153f93a --- /dev/null +++ b/arabica/include/SAX/helpers/AttributeTypes.hpp @@ -0,0 +1,48 @@ +#ifndef ARABICA_ATTRIBUTE_TYPES_H +#define ARABICA_ATTRIBUTE_TYPES_H +/* + * $Id$ + */ + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +template > +struct AttributeTypes +{ + const string_type cdata; + const string_type nmtoken; + const string_type nmtokens; + const string_type enumeration; + const string_type entity; + const string_type entities; + const string_type id; + const string_type idref; + const string_type idrefs; + const string_type notation; + + AttributeTypes() : + cdata(string_adaptor::construct_from_utf8("CDATA")), + nmtoken(string_adaptor::construct_from_utf8("NMTOKEN")), + nmtokens(string_adaptor::construct_from_utf8("NMTOKENS")), + enumeration(string_adaptor::construct_from_utf8("ENUMERATION")), + entity(string_adaptor::construct_from_utf8("ENTITY")), + entities(string_adaptor::construct_from_utf8("ENTITIES")), + id(string_adaptor::construct_from_utf8("ID")), + idref(string_adaptor::construct_from_utf8("IDREF")), + idrefs(string_adaptor::construct_from_utf8("IDREFS")), + notation(string_adaptor::construct_from_utf8("NOTATION")) + { + } // AttributeTypes +}; // struct AttributeTypes + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/helpers/AttributesImpl.hpp b/arabica/include/SAX/helpers/AttributesImpl.hpp new file mode 100644 index 000000000..12ae708da --- /dev/null +++ b/arabica/include/SAX/helpers/AttributesImpl.hpp @@ -0,0 +1,587 @@ +#ifndef ARABICA_ATTRIBUTES_IMPL_H +#define ARABICA_ATTRIBUTES_IMPL_H + +// AttributesImpl.h - default implementation of Attributes. +// $Id$ + +#include +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Default implementation of the Attributes interface. + * + *

This class provides a default implementation of the SAX2 + * {@link Attributes Attributes} interface, with the + * addition of manipulators so that the list can be modified or + * reused.

+ * + *

There are two typical uses of this class:

+ * + *
    + *
  1. to take a persistent snapshot of an Attributes object + * in a {@link ContentHandler#startElement startElement} event; or
  2. + *
  3. to construct or modify an Attributes object in a SAX2 driver or filter.
  4. + *
+ * + *

This class replaces the now-deprecated SAX1 {@link + * AttributeListImpl AttributeListImpl} + * class.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + */ +template > +class AttributesImpl : public Attributes +{ +public: + typedef Attributes AttributesT; + + struct Attr + { + Attr(const string_type& uri, + const string_type& localName, + const string_type& qName, + const string_type& type, + const string_type& value) : + uri_(uri), localName_(localName), qName_(qName), type_(type), value_(value) + { } + Attr() { } + Attr& operator=(const Attr& rhs) + { + uri_ = rhs.uri_; + localName_ = rhs.localName_; + qName_ = rhs.qName_; + type_ = rhs.type_; + value_ = rhs.value_; + + return *this; + } // operator= + bool operator==(const Attr& rhs) const + { + return (uri_ == rhs.uri_) && + (localName_ == rhs.localName_) && + (qName_ == rhs.qName_) && + (type_ == rhs.type_) && + (value_ == rhs.value_); + } // operator== + + string_type uri_; + string_type localName_; + string_type qName_; + string_type type_; + string_type value_; + }; // Attr + + //////////////////////////////////////////////////////////////////// + // Constructors. + AttributesImpl() { } + AttributesImpl(const AttributesT& rhs) + { + setAttributes(rhs); + } // AttributesImpl + + AttributesImpl& operator=(const AttributesT& rhs) + { + setAttributes(rhs); + } // operator= + + bool operator==(const AttributesImpl& rhs) const + { + return attributes_ == rhs.attributes_; + } // operator== + + //////////////////////////////////////////////////////////////////// + // Implementation of SAX::Attributes. + /** + * Return the number of attributes in the list. + * + * @return The number of attributes in the list. + * @see Attributes#getLength + */ + virtual int getLength() const + { + return static_cast(attributes_.size()); + } // getLength + + /** + * Return an attribute's Namespace URI. + * + * @param index The attribute's index (zero-based). + * @return The Namespace URI, the empty string if none is + * available, or if the index is out of range. + * @see Attributes#getURI + */ + virtual string_type getURI(unsigned int index) const + { + if(index < attributes_.size()) + return attributes_[index].uri_; + return emptyString_; + } // getUri + + /** + * Return an attribute's local name. + * + * @param index The attribute's index (zero-based). + * @return The attribute's local name, the empty string if + * none is available, or if the index if out of range. + * @see Attributes#getLocalName + */ + virtual string_type getLocalName(unsigned int index) const + { + if(index < attributes_.size()) + return attributes_[index].localName_; + + return emptyString_; + } // getLocalName + + /** + * Return an attribute's qualified (prefixed) name. + * + * @param index The attribute's index (zero-based). + * @return The attribute's qualified name, the empty string if + * none is available, or if the index is out of bounds. + * @see Attributes#getQName + */ + virtual string_type getQName(unsigned int index) const + { + if(index < attributes_.size()) + return attributes_[index].qName_; + + return emptyString_; + } // getQName + + /** + * Return an attribute's type by index. + * + * @param index The attribute's index (zero-based). + * @return The attribute's type, "CDATA" if the type is unknown, or an empty + * string if the index is out of bounds. + * @see Attributes#getType(int) + */ + virtual string_type getType(unsigned int index) const + { + if(index < attributes_.size()) + return attributes_[index].type_; + + return emptyString_; + } // getType + + /** + * Return an attribute's value by index. + * + * @param index The attribute's index (zero-based). + * @return The attribute's value or an empty string if the index is out of bounds. + * @see Attributes#getValue(int) + */ + virtual string_type getValue(unsigned int index) const + { + if(index < attributes_.size()) + return attributes_[index].value_; + + return emptyString_; + } // getValue + + /** + * Look up an attribute's index by Namespace name. + * + *

In many cases, it will be more efficient to look up the name once and + * use the index query methods rather than using the name query methods + * repeatedly.

+ * + * @param uri The attribute's Namespace URI, or the empty + * string if none is available. + * @param localName The attribute's local name. + * @return The attribute's index, or -1 if none matches. + * @see Attributes#getIndex(const string_type&,const string_type&) + */ + virtual int getIndex(const string_type& uri, const string_type& localName) const + { + typename AttrList::const_iterator a = std::find_if(attributes_.begin(), attributes_.end(), AttributeNamed(uri, localName)); + if(a != attributes_.end()) + return static_cast(std::distance(attributes_.begin(), a)); + return -1; + } // getIndex + + /** + * Look up an attribute's index by qualified (prefixed) name. + * + * @param qName The qualified name. + * @return The attribute's index, or -1 if none matches. + * @see Attributes#getIndex(const string_type&) + */ + virtual int getIndex(const string_type& qName) const + { + size_t max = attributes_.size(); + for(size_t i = 0; i < max; ++i) + { + if(attributes_[i].qName_ == qName) + return static_cast(i); + } + return -1; + } // getIndex + + /** + * Look up an attribute's type by Namespace-qualified name. + * + * @param uri The Namespace URI, or the empty string for a name + * with no explicit Namespace URI. + * @param localName The local name. + * @return The attribute's type, or an empty string if there is no + * matching attribute. + * @see Attributes#getType(const string_type&,const string_type&) + */ + virtual string_type getType(const string_type& uri, const string_type& localName) const + { + typename AttrList::const_iterator a = std::find_if(attributes_.begin(), attributes_.end(), AttributeNamed(uri, localName)); + if(a != attributes_.end()) + return a->type_; + return emptyString_; + } // getType + + /** + * Look up an attribute's type by qualified (prefixed) name. + * + * @param qName The qualified name. + * @return The attribute's type, or an empty string if there is no + * matching attribute. + * @see Attributes#getType(const string_type&) + */ + virtual string_type getType(const string_type& qName) const + { + size_t max = attributes_.size(); + for(size_t i = 0; i < max; ++i) + { + if(attributes_[i].qName_ == qName) + return attributes_[i].type_; + } // for ... + return emptyString_; + } // getType + + /** + * Look up an attribute's value by Namespace-qualified name. + * + * @param uri The Namespace URI, or the empty string for a name + * with no explicit Namespace URI. + * @param localName The local name. + * @return The attribute's value, or an empty string if there is no + * matching attribute. + * @see Attributes#getValue(const string_type&,const string_type&) + */ + virtual string_type getValue(const string_type& uri, const string_type& localName) const + { + typename AttrList::const_iterator a = std::find_if(attributes_.begin(), attributes_.end(), AttributeNamed(uri, localName)); + if(a != attributes_.end()) + return a->value_; + return emptyString_; + } // getType + + /** + * Look up an attribute's value by qualified (prefixed) name. + * + * @param qName The qualified name. + * @return The attribute's value, or an empty string if there is no + * matching attribute. + * @see Attributes#getValue(const string_type&) + */ + virtual string_type getValue(const string_type& qName) const + { + size_t max = attributes_.size(); + for(size_t i = 0; i < max; ++i) + { + if(attributes_[i].qName_ == qName) + return attributes_[i].value_; + } // for ... + return emptyString_; + } // getValue + + //////////////////////////////////////////////////////////////////// + // Manipulators. + /** + * Clear the attribute list for reuse. + */ + void clear() + { + attributes_.erase(attributes_.begin(), attributes_.end()); + } // clear + + /** + * Copy an entire Attributes object. + * + *

It may be more efficient to reuse an existing object + * rather than constantly allocating new ones.

+ * + * @param atts The attributes to copy. + */ + void setAttributes(const AttributesT& atts) + { + clear(); + + int max = atts.getLength(); + for(int i = 0; i < max; ++i) + attributes_.push_back(Attr(atts.getURI(i), + atts.getLocalName(i), + atts.getQName(i), + atts.getType(i), + atts.getValue(i))); + } // setAttributes + + /** + * Add an attribute to the end of the list. + * + *

For the sake of speed, this method does no checking + * to see if the attribute is already in the list: that is + * the responsibility of the application.

+ * + * @param uri The Namespace URI, or the empty string if + * none is available or Namespace processing is not + * being performed. + * @param localName The local name, or the empty string if + * Namespace processing is not being performed. + * @param qName The qualified (prefixed) name, or the empty string + * if qualified names are not available. + * @param type The attribute type as a string. + * @param value The attribute value. + */ + void addAttribute(const string_type& uri, + const string_type& localName, + const string_type& qName, + const string_type& type, + const string_type& value) + { + attributes_.push_back(Attr(uri, localName, qName, type, value)); + } // addAttribute + + void addAttribute(const Attr& attr) + { + attributes_.push_back(attr); + } // addAttribute + + /** + * Add an attribute to the end of the list. + * + * @param uri The Namespace URI, or the empty string if + * none is available or Namespace processing is not + * being performed. + * @param localName The local name, or the empty string if + * Namespace processing is not being performed. + * @param qName The qualified (prefixed) name, or the empty string + * if qualified names are not available. + * @param type The attribute type as a string. + * @param value The attribute value. + */ + void addOrReplaceAttribute(const string_type& uri, + const string_type& localName, + const string_type& qName, + const string_type& type, + const string_type& value) + { + typename AttrList::iterator a = std::find_if(attributes_.begin(), attributes_.end(), AttributeNamed(uri, localName)); + if(a != attributes_.end()) + { + a->value_ = value; + return; + } // if ... + + attributes_.push_back(Attr(uri, localName, qName, type, value)); + } // addOrReplaceAttribute + + /** + * Set an attribute in the list. + * + *

For the sake of speed, this method does no checking + * for name conflicts or well-formedness: such checks are the + * responsibility of the application.

+ * + * @param index The index of the attribute (zero-based). + * @param uri The Namespace URI, or the empty string if + * none is available or Namespace processing is not + * being performed. + * @param localName The local name, or the empty string if + * Namespace processing is not being performed. + * @param qName The qualified name, or the empty string + * if qualified names are not available. + * @param type The attribute type as a string. + * @param value The attribute value. + * @exception java.lang.ArrayIndexOutOfBoundsException When the + * supplied index does not point to an attribute + * in the list. + */ + void setAttribute(unsigned int index, + const string_type& uri, + const string_type& localName, + const string_type& qName, + const string_type& type, + const string_type& value) + { + if(index < attributes_.size()) + { + Attr& a = attributes_[index]; + a.uri_ = uri; + a.localName_ = localName; + a.qName_ = qName; + a.type_ = type; + a.value_ = value; + } + else + badIndex(index); + } // setAttribute + + /** + * Remove an attribute from the list. + * + * @param index The index of the attribute (zero-based). + * @exception std::out_of_range When the + * supplied index does not point to an attribute + * in the list. + */ + void removeAttribute(unsigned int index) + { + if(index < attributes_.size()) + attributes_.erase(attributes_.begin() + index); + else + badIndex(index); + } // removeAttribute + + /** + * Set the Namespace URI of a specific attribute. + * + * @param index The index of the attribute (zero-based). + * @param uri The attribute's Namespace URI, or the empty + * string for none. + * @exception std::out_of_range When the + * supplied index does not point to an attribute + * in the list. + */ + void setURI(unsigned int index, const string_type& uri) + { + if(index < attributes_.size()) + attributes_[index].uri_ = uri; + else + badIndex(index); + } // setURI + + /** + * Set the local name of a specific attribute. + * + * @param index The index of the attribute (zero-based). + * @param localName The attribute's local name, or the empty + * string for none. + * @exception std::out_of_range When the + * supplied index does not point to an attribute + * in the list. + */ + void setLocalName(unsigned int index, const string_type& localName) + { + if(index < attributes_.size()) + attributes_[index].localName_ = localName; + else + badIndex(index); + } // setLocalName + + /** + * Set the qualified name of a specific attribute. + * + * @param index The index of the attribute (zero-based). + * @param qName The attribute's qualified name, or the empty + * string for none. + * @exception std::out_of_range When the + * supplied index does not point to an attribute + * in the list. + */ + void setQName(unsigned int index, const string_type& qName) + { + if(index >= 0 && index < attributes_.size()) + attributes_[index].qName_ = qName; + else + badIndex(index); + } // setQName + + /** + * Set the type of a specific attribute. + * + * @param index The index of the attribute (zero-based). + * @param type The attribute's type. + * @exception std::out_of_range When the + * supplied index does not point to an attribute + * in the list. + */ + void setType(unsigned int index, const string_type& type) + { + if(index >= 0 && index < attributes_.size()) + attributes_[index].type_ = type; + else + badIndex(index); + } // setType + + /** + * Set the value of a specific attribute. + * + * @param index The index of the attribute (zero-based). + * @param value The attribute's value. + * @exception std::out_of_range When the + * supplied index does not point to an attribute + * in the list. + */ + void setValue(unsigned int index, const string_type& value) + { + if(index < attributes_.size()) + attributes_[index].value_ = value; + else + badIndex(index); + } // setURI + +private: + //////////////////////////////////////////////////////////////////// + // Internal methods. + //////////////////////////////////////////////////////////////////// + void badIndex(unsigned int index) + { + // sort out + std::stringstream msg; + msg << "Attempt to modify attribute at illegal index: " << index; + throw std::out_of_range(msg.str()); + } + + class AttributeNamed + { + public: + AttributeNamed(const string_type& uri, const string_type& localName) : + uri_(uri), localName_(localName) { } + AttributeNamed(const AttributeNamed& rhs) : + uri_(rhs.uri_), localName_(rhs.localName_) { } + ~AttributeNamed() { } + + bool operator()(const Attr& attr) const + { + return (attr.uri_ == uri_) && (attr.localName_ == localName_); + } // operator() + + private: + const string_type& uri_; + const string_type& localName_; + + AttributeNamed& operator=(const AttributeNamed&); + bool operator==(const AttributeNamed&) const; + }; // class AttributeNamed + + typedef typename std::deque AttrList; + AttrList attributes_; + + string_type emptyString_; +}; // class AttributesImpl + +} // namespace SAX +} // namespace Arabica + +#endif + diff --git a/arabica/include/SAX/helpers/DefaultHandler.hpp b/arabica/include/SAX/helpers/DefaultHandler.hpp new file mode 100644 index 000000000..c7ffd3612 --- /dev/null +++ b/arabica/include/SAX/helpers/DefaultHandler.hpp @@ -0,0 +1,603 @@ +#ifndef ARABICA_DEFAULT_HANDLER_H +#define ARABICA_DEFAULT_HANDLER_H + +// DefaultHandler.h +// $Id$ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Default base class for SAX2 event handlers. + * + *

This class is available as a convenience base class for SAX2 + * applications: it provides default implementations for all of the + * callbacks in the four core SAX2 handler classes:

+ * + *
    + *
  • {@link EntityResolver EntityResolver}
  • + *
  • {@link DTDHandler DTDHandler}
  • + *
  • {@link ContentHandler ContentHandler}
  • + *
  • {@link ErrorHandler ErrorHandler}
  • + *
+ * + *

Application writers can extend this class when they need to + * implement only part of an interface; parser writers can + * instantiate this class to provide default handlers when the + * application has not supplied its own.

+ * + *

This class replaces the deprecated SAX1 + * {@link HandlerBase HandlerBase} class.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see EntityResolver + * @see DTDHandler + * @see ContentHandler + * @see ErrorHandler + */ +template > +class DefaultHandler : public EntityResolver, + public DTDHandler, + public ContentHandler, + public ErrorHandler, + public LexicalHandler, + public DeclHandler +{ +public: + typedef InputSource InputSourceT; + typedef Locator LocatorT; + typedef Attributes AttributesT; + typedef SAXParseException SAXParseExceptionT; + + DefaultHandler() { } + virtual ~DefaultHandler() { } + + ////////////////////////////////////////////// + // EntityResolver + /** + * Resolve an external entity. + * + *

Always return a default-constructed InputSourceT, so that + * the parser will use the system identifier provided in the XML document. + * This method implements the SAX default behaviour: application writers can + * override it in a subclass to do special translations such as catalog + * lookups or URI redirection.

+ * + * @param publicId The public identifer, or an empty string if none is + * available. + * @param systemId The system identifier provided in the XML + * document. + * @return The new input source, (empty to require the + * default behaviour). + * @exception SAXException Any SAX exception. + * @see EntityResolver#resolveEntity + */ + virtual InputSourceT resolveEntity(const string_type& /* publicId */, const string_type& /* systemId */) + { + return InputSourceT(); + } // resolveEntity + + ////////////////////////////////////////////// + // DTDHandler + /** + * Receive notification of a notation declaration. + * + *

By default, do nothing. Application writers may override this + * method in a subclass if they wish to keep track of the notations + * declared in a document.

+ * + * @param name The notation name. + * @param publicId The notation public identifier, or an empty string if not + * available. + * @param systemId The notation system identifier. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see DTDHandler#notationDecl + */ + virtual void notationDecl(const string_type& /* name */, + const string_type& /* publicId */, + const string_type& /* systemId */) + { + } // notationDecl + + /** + * Receive notification of an unparsed entity declaration. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to keep track of the unparsed entities + * declared in a document.

+ * + * @param name The entity name. + * @param publicId The entity public identifier, or an empty string if not + * available. + * @param systemId The entity system identifier. + * @param notationName The name of the associated notation. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see DTDHandler#unparsedEntityDecl + */ + virtual void unparsedEntityDecl(const string_type& /* name */, + const string_type& /* publicId */, + const string_type& /* systemId */, + const string_type& /* notationName */) + { + } // unparsedEntityDecl + + //////////////////////////////////////////////////// + // ContentHandler + /** + * Receive a Locator object for document events. + * + *

By default, do nothing. Application writers may override this + * method in a subclass if they wish to store the locator for use + * with other document events.

+ * + * @param locator A locator for all SAX document events. + * @see ContentHandler#setDocumentLocator + * @see Locator + */ + virtual void setDocumentLocator(const LocatorT& /* locator */) { } + + /** + * Receive notification of the beginning of the document. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the beginning + * of a document (such as allocating the root node of a tree or + * creating an output file).

+ * + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#startDocument + */ + virtual void startDocument() { } + /** + * Receive notification of the end of the document. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the end + * of a document (such as finalising a tree or closing an output + * file).

+ * + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#endDocument + */ + virtual void endDocument() { } + + /** + * Receive notification of the start of a Namespace mapping. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the start of + * each Namespace prefix scope (such as storing the prefix mapping).

+ * + * @param prefix The Namespace prefix being declared. + * @param uri The Namespace URI mapped to the prefix. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#startPrefixMapping + */ + virtual void startPrefixMapping(const string_type& /* prefix */, const string_type& /* uri */) { } + /** + * Receive notification of the end of a Namespace mapping. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the end of + * each prefix mapping.

+ * + * @param prefix The Namespace prefix being declared. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#endPrefixMapping + */ + virtual void endPrefixMapping(const string_type& /* prefix */) { } + + /** + * Receive notification of the start of an element. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the start of + * each element (such as allocating a new tree node or writing + * output to a file).

+ * + * @param namespaceURI The Namespace URI, or the empty string if the element + * has no Namespace URI or if Namespace processing is not + * being performed. + * @param localName The local name (without prefix), or the empty string if + * Namespace processing is not being performed. + * @param qName The qualified name (with prefix), or the empty string if + * qualified names are not available. + * @param atts The attributes attached to the element. If there are no + * attributes, it shall be an empty Attributes object. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#startElement + */ + virtual void startElement(const string_type& /* namespaceURI */, const string_type& /* localName */, + const string_type& /* qName */, const AttributesT& /* atts */) { } + /** + * Receive notification of the end of an element. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions at the end of + * each element (such as finalising a tree node or writing + * output to a file).

+ * + * @param namespaceURI The Namespace URI, or the empty string if the element + * has no Namespace URI or if Namespace processing is not + * being performed. + * @param localName The local name (without prefix), or the empty string if + * Namespace processing is not being performed. + * @param qName The qualified name (with prefix), or the empty string if + * qualified names are not available. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#endElement + */ + virtual void endElement(const string_type& /* namespaceURI */, const string_type& /* localName */, + const string_type& /* qName */) { } + + /** + * Receive notification of character data inside an element. + * + *

By default, do nothing. Application writers may override this + * method to take specific actions for each chunk of character data + * (such as adding the data to a node or buffer, or printing it to + * a file).

+ * + * @param ch The characters. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#characters + */ + virtual void characters(const string_type& /* ch */) { } + /** + * Receive notification of ignorable whitespace in element content. + * + *

By default, do nothing. Application writers may override this + * method to take specific actions for each chunk of ignorable + * whitespace (such as adding data to a node or buffer, or printing + * it to a file).

+ * + * @param ch The whitespace characters. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#ignorableWhitespace + */ + virtual void ignorableWhitespace(const string_type& /* ch */) { } + + /** + * Receive notification of a processing instruction. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions for each + * processing instruction, such as setting status variables or + * invoking other methods.

+ * + * @param target The processing instruction target. + * @param data The processing instruction data, or an empty string if + * none is supplied. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#processingInstruction + */ + virtual void processingInstruction(const string_type& /* target */, const string_type& /* data */) { } + + /** + * Receive notification of a skipped entity. + * + *

By default, do nothing. Application writers may override this + * method in a subclass to take specific actions for each + * processing instruction, such as setting status variables or + * invoking other methods.

+ * + * @param name The name of the skipped entity. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ContentHandler#processingInstruction + */ + virtual void skippedEntity(const string_type& /* name */) { } + + ///////////////////////////////////////////////////// + // ErrorHandler + /** + * Receive notification of a parser warning. + * + *

The default implementation does nothing. Application writers + * may override this method in a subclass to take specific actions + * for each warning, such as inserting the message in a log file or + * printing it to the console.

+ * + * @param e The warning information encoded as an exception. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ErrorHandler#warning + * @see SAXParseException + */ + virtual void warning(const SAXParseExceptionT& /* e */) { } + /** + * Receive notification of a recoverable parser error. + * + *

The default implementation does nothing. Application writers + * may override this method in a subclass to take specific actions + * for each error, such as inserting the message in a log file or + * printing it to the console.

+ * + * @param e The warning information encoded as an exception. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ErrorHandler#error + * @see SAXParseException + */ + virtual void error(const SAXParseExceptionT& /* e */) { } + /** + * Report a fatal XML parsing error. + * + *

The default implementation throws a SAXParseException. + * Application writers may override this method in a subclass if + * they need to take specific actions for each fatal error (such as + * collecting all of the errors into a single report): in any case, + * the application must stop all regular processing when this + * method is invoked, since the document is no longer reliable, and + * the parser may no longer report parsing events.

+ * + * @param e The error information encoded as an exception. + * @exception SAXException Any SAX exception, possibly + * wrapping another exception. + * @see ErrorHandler#fatalError + * @see SAXParseException + */ + virtual void fatalError(const SAXParseExceptionT& e) + { + throw SAXParseExceptionT(e); + // VS.NET refuses throw e; saying the copy constructor is inaccessible + // GCC likes throw e; + // one of them, I presume, is wrong + } // fatalError + + ////////////////////////////////////////////////////////// + // LexicalHandler + /** + * Report the start of DTD declarations, if any. + * + *

This method is intended to report the beginning of the + * DOCTYPE declaration; if the document has no DOCTYPE declaration, + * this method will not be invoked.

+ * + *

All declarations reported through + * {@link DTDHandler DTDHandler} or + * {@link DeclHandler DeclHandler} events must appear + * between the startDTD and {@link #endDTD endDTD} events. + * Declarations are assumed to belong to the internal DTD subset + * unless they appear between {@link #startEntity startEntity} + * and {@link #endEntity endEntity} events. Comments and + * processing instructions from the DTD should also be reported + * between the startDTD and endDTD events, in their original + * order of (logical) occurrence; they are not required to + * appear in their correct locations relative to DTDHandler + * or DeclHandler events, however.

+ * + *

Note that the start/endDTD events will appear within + * the start/endDocument events from ContentHandler and + * before the first + * {@link ContentHandler#startElement startElement} + * event.

+ * + * @param name The document type name. + * @param publicId The declared public identifier for the + * external DTD subset, or an empty string if none was declared. + * @param systemId The declared system identifier for the + * external DTD subset, or an empty string if none was declared. + * @see #endDTD + * @see #startEntity + */ + virtual void startDTD(const string_type& /*name*/, + const string_type& /*publicId*/, + const string_type& /*systemId*/) { } + + /** + * Report the end of DTD declarations. + * + *

This method is intended to report the end of the + * DOCTYPE declaration; if the document has no DOCTYPE declaration, + * this method will not be invoked.

+ * + * @see #startDTD + */ + virtual void endDTD() { } + + /** + * Report the beginning of some internal and external XML entities. + * + *

The reporting of parameter entities (including + * the external DTD subset) is optional, and SAX2 drivers that + * support LexicalHandler may not support it; you can use the + * http://xml.org/sax/features/lexical-handler/parameter-entities + * feature to query or control the reporting of parameter entities.

+ * + *

General entities are reported with their regular names, + * parameter entities have '%' prepended to their names, and + * the external DTD subset has the pseudo-entity name "[dtd]".

+ * + *

When a SAX2 driver is providing these events, all other + * events must be properly nested within start/end entity + * events. There is no additional requirement that events from + * {@link DeclHandler DeclHandler} or + * {@link DTDHandler DTDHandler} be properly ordered.

+ * + *

Note that skipped entities will be reported through the + * {@link ContentHandler#skippedEntity skippedEntity} + * event, which is part of the ContentHandler interface.

+ * + *

Because of the streaming event model that SAX uses, some + * entity boundaries cannot be reported under any + * circumstances:

+ * + *
    + *
  • general entities within attribute values
  • + *
  • parameter entities within declarations
  • + *
+ * + *

These will be silently expanded, with no indication of where + * the original entity boundaries were.

+ * + *

Note also that the boundaries of character references (which + * are not really entities anyway) are not reported.

+ * + *

All start/endEntity events must be properly nested. + * + * @param name The name of the entity. If it is a parameter + * entity, the name will begin with '%', and if it is the + * external DTD subset, it will be "[dtd]". + * @see #endEntity + * @see DeclHandler#internalEntityDecl + * @see DeclHandler#externalEntityDecl + */ + virtual void startEntity(const string_type& /*name*/) { } + /** + * Report the end of an entity. + * + * @param name The name of the entity that is ending. + * @see #startEntity + */ + virtual void endEntity(const string_type& /*name*/) { } + + /** + * Report the start of a CDATA section. + * + *

The contents of the CDATA section will be reported through + * the regular {@link ContentHandler#characters + * characters} event; this event is intended only to report + * the boundary.

+ * + * @see #endCDATA + */ + virtual void startCDATA() { } + /** + * Report the end of a CDATA section. + * + * @see #startCDATA + */ + virtual void endCDATA() { } + + /** + * Report an XML comment anywhere in the document. + * + *

This callback will be used for comments inside or outside the + * document element, including comments in the external DTD + * subset (if read). Comments in the DTD must be properly + * nested inside start/endDTD and start/endEntity events (if + * used).

+ * + * @param text A string holding the comment. + */ + virtual void comment(const string_type& /*text*/) { } + + //////////////////////////////////////////////////////////// + // DeclHandler + /** + * Report an element type declaration. + * + *

The content model will consist of the string "EMPTY", the + * string "ANY", or a parenthesised group, optionally followed + * by an occurrence indicator. The model will be normalized so + * that all parameter entities are fully resolved and all whitespace + * is removed,and will include the enclosing parentheses. Other + * normalization (such as removing redundant parentheses or + * simplifying occurrence indicators) is at the discretion of the + * parser.

+ * + * @param name The element type name. + * @param model The content model as a normalized string. + */ + virtual void elementDecl(const string_type& /*name*/, const string_type& /*model*/) { } + /** + * Report an attribute type declaration. + * + *

Only the effective (first) declaration for an attribute will + * be reported. The type will be one of the strings "CDATA", + * "ID", "IDREF", "IDREFS", "NMTOKEN", "NMTOKENS", "ENTITY", + * "ENTITIES", a parenthesized token group with + * the separator "|" and all whitespace removed, or the word + * "NOTATION" followed by a space followed by a parenthesized + * token group with all whitespace removed.

+ * + *

Any parameter entities in the attribute value will be + * expanded, but general entities will not.

+ * + * @param elementName The name of the associated element. + * @param attributeName The name of the attribute. + * @param type A string representing the attribute type. + * @param valueDefault A string representing the attribute default + * ("#IMPLIED", "#REQUIRED", or "#FIXED") or empty string if + * none of these applies. + * @param value A string representing the attribute's default value, + * or empty string if there is none. + */ + virtual void attributeDecl(const string_type& /*elementName*/, + const string_type& /*attributeName*/, + const string_type& /*type*/, + const string_type& /*valueDefault*/, + const string_type& /*value*/) { } + /** + * Report an internal entity declaration. + * + *

Only the effective (first) declaration for each entity + * will be reported. All parameter entities in the value + * will be expanded, but general entities will not.

+ * + * @param name The name of the entity. If it is a parameter + * entity, the name will begin with '%'. + * @param value The replacement text of the entity. + * @see #externalEntityDecl + * @see DTDHandler#unparsedEntityDecl + */ + virtual void internalEntityDecl(const string_type& /*name*/, const string_type& /*value*/) { } + /** + * Report a parsed external entity declaration. + * + *

Only the effective (first) declaration for each entity + * will be reported.

+ * + * @param name The name of the entity. If it is a parameter + * entity, the name will begin with '%'. + * @param publicId The declared public identifier of the entity, or + * an empty string if none was declared. + * @param systemId The declared system identifier of the entity. + * @see #internalEntityDecl + * @see DTDHandler#unparsedEntityDecl + */ + virtual void externalEntityDecl(const string_type& /*name*/, + const string_type& /*publicId*/, + const string_type& /*systemId*/) { } +private: + DefaultHandler(const DefaultHandler&); + DefaultHandler& operator=(const DefaultHandler&); + bool operator==(const DefaultHandler&); +}; // class DefaultHandler + +} // namespace SAX +} // namespace Arabica + +#endif diff --git a/arabica/include/SAX/helpers/FeatureNames.hpp b/arabica/include/SAX/helpers/FeatureNames.hpp new file mode 100644 index 000000000..86bb1b8b9 --- /dev/null +++ b/arabica/include/SAX/helpers/FeatureNames.hpp @@ -0,0 +1,95 @@ +#ifndef ARABICA_FEATURE_NAMES_H +#define ARABICA_FEATURE_NAMES_H +/* + * $Id$ + */ + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +template > +struct FeatureNames +{ + /** Reports whether this parser processes external general entities; always + * true if validating. */ + const string_type external_general; + /** Reports whether this parser processes external parameter entities; always + * true if validating. */ + const string_type external_parameter; + /** May be examined only during a parse, after the startDocument() callback has + * been completed; read-only. The value is true if the document specified the + * "standalone" flag in its XML declaration, and otherwise is false. */ + const string_type is_standalone; + /** True indicates that the LexicalHandler will report the beginning and end + * of parameter entities. */ + const string_type lexical_parameter; + /** True indicates namespace URIs and unprefixed local names for element and + * attribute names will be available.*/ + const string_type namespaces; + /** True indicates XML 1.0 names (with prefixes) and attributes (including + * xmlns* attributes) will be available. */ + const string_type namespace_prefixes; + /** A value of "true" indicates that system IDs in declarations will be + * absolutized (relative to their base URIs) before reporting. (That is the + * default behavior for all SAX2 XML parsers.) A value of "false" indicates + * those IDs will not be absolutized; parsers will provide the base URI from + * Locator.getSystemId(). This applies to system IDs passed in + * + * - DTDHandler.notationDecl(), + * - DTDHandler.unparsedEntityDecl(), and + * - DeclHandler.externalEntityDecl(). + * + *It does not apply to EntityResolver.resolveEntity(), which is not used to + report declarations, or to LexicalHandler.startDTD(), which already provides + the non-absolutized URI. */ + const string_type resolve_dtd_uris; + /** Returns true if the Attributes objects passed by this parser in + * ContentHandler.startElement() implement the org.xml.sax.ext.Attributes2 + * interface. That interface exposes additional DTD-related information, such + * as whether the attribute was specified in the source text rather than + * defaulted. */ + const string_type use_attributes2; + /** Returns true if the Locator objects passed by this parser in + * ContentHandler.setDocumentLocator() implement the org.xml.sax.ext.Locator2 + * interface. That interface exposes additional entity information, such as + * the character encoding and XML version used. */ + const string_type use_locator2; + /** Controls whether the parser is reporting all validity errors; if true, + * all external entities will be read. */ + const string_type validation; + /** Controls whether, when the namespace-prefixes feature is set, the parser + * treats namespace declaration attributes as being in the + * http://www.w3.org/2000/xmlns/ namespace. By default, SAX2 conforms to the + * original "Namespaces in XML" Recommendation, which explicitly states that + * such attributes are not in any namespace. Setting this optional flag to + * true makes the SAX2 events conform to a later backwards-incompatible + * revision of that recommendation, placing those attributes in a namespace. + * */ + const string_type xmlns_uris; + + FeatureNames() : + external_general(string_adaptor::construct_from_utf8("http://xml.org/sax/features/external-general-entities")), + external_parameter(string_adaptor::construct_from_utf8("http://xml.org/sax/features/external-parameter-entities")), + is_standalone(string_adaptor::construct_from_utf8("http://xml.org/sax/features/is-standalone")), + lexical_parameter(string_adaptor::construct_from_utf8("http://xml.org/sax/features/lexical-handler/parameter-entities")), + namespaces(string_adaptor::construct_from_utf8("http://xml.org/sax/features/namespaces")), + namespace_prefixes(string_adaptor::construct_from_utf8("http://xml.org/sax/features/namespace-prefixes")), + resolve_dtd_uris(string_adaptor::construct_from_utf8("http://xml.org/sax/features/resolve-dtd-uris")), + use_attributes2(string_adaptor::construct_from_utf8("http://xml.org/sax/features/use-attributes2")), + use_locator2(string_adaptor::construct_from_utf8("http://xml.org/sax/features/use-locator2")), + validation(string_adaptor::construct_from_utf8("http://xml.org/sax/features/validation")), + xmlns_uris(string_adaptor::construct_from_utf8("http://xml.org/sax/features/xmlns-uris")) + { + } // FeatureNames +}; // class FeatureNames + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/helpers/InputSourceResolver.hpp b/arabica/include/SAX/helpers/InputSourceResolver.hpp new file mode 100644 index 000000000..5ff7e1185 --- /dev/null +++ b/arabica/include/SAX/helpers/InputSourceResolver.hpp @@ -0,0 +1,63 @@ +#ifndef ARABICA_INPUT_SOURCE_RESOLVER_H +#define ARABICA_INPUT_SOURCE_RESOLVER_H + +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +class InputSourceResolver +{ +public: + template + InputSourceResolver(const SAX::InputSource& inputSource, + const stringAdaptorT& /*SA*/) : + deleteStream_(false), + byteStream_(0) + { + open(stringAdaptorT::asStdString(inputSource.getPublicId()), + stringAdaptorT::asStdString(inputSource.getSystemId()), + inputSource.getByteStream()); + } // InputSourceResolver + ~InputSourceResolver(); + + std::istream* resolve() const { return byteStream_; } + + typedef std::istream* (*URIResolver)(const std::string& url); + static bool registerResolver(const std::string& method, URIResolver resolver); + static bool unRegisterResolver(const std::string& method); + +private: + // no impl + InputSourceResolver(const InputSourceResolver&); + InputSourceResolver& operator=(const InputSourceResolver&); + bool operator==(const InputSourceResolver&); + + // instance variables + bool deleteStream_; + std::istream* byteStream_; + + void open(const std::string& publicId, + const std::string& systemId, + std::istream* byteStream); + + // class variables + static URIResolver findResolver(std::string method); + + typedef std::map resolverMapT; + static resolverMapT& resolverMap() + { + static resolverMapT theMap; + return theMap; + } // resolverMap +}; // class InputSourceResolver + +} // namespace SAX +} // namespace Arabica +#endif + diff --git a/arabica/include/SAX/helpers/NamespaceSupport.hpp b/arabica/include/SAX/helpers/NamespaceSupport.hpp new file mode 100644 index 000000000..4f9998cd0 --- /dev/null +++ b/arabica/include/SAX/helpers/NamespaceSupport.hpp @@ -0,0 +1,390 @@ +#ifndef ARABICA_NAMESPACE_SUPPORT_H +#define ARABICA_NAMESPACE_SUPPORT_H + +#include +#include +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +template +struct NamespaceConstants +{ + const string_type xml; + const string_type xmlns; + const string_type xml_uri; + const string_type xmlns_uri; + const string_type xmlns11_uri; + const string_type colon; + + NamespaceConstants() : + xml(string_adaptor::construct_from_utf8("xml")), + xmlns(string_adaptor::construct_from_utf8("xmlns")), + xml_uri(string_adaptor::construct_from_utf8("http://www.w3.org/XML/1998/namespace")), + xmlns_uri(), + xmlns11_uri(string_adaptor::construct_from_utf8("http://www.w3.org/2000/xmlns/")), + colon(string_adaptor::construct_from_utf8(":")) + { + } // NamespaceConstants +}; // struct NamespaceContants + +/** + * Encapsulate Namespace logic for use by SAX drivers. + * + *

This class encapsulates the logic of Namespace processing: + * it tracks the declarations currently in force for each context + * and automatically processes qualified XML 1.0 names into their + * Namespace parts; it can also be used in reverse for generating + * XML 1.0 from Namespaces.

+ * + *

Namespace support objects are reusable, but the reset method + * must be invoked between each session.

+ * + *

Here is a simple session:

+ * + *
+ * NamespaceSupport support;
+ *
+ * support.pushContext();
+ * support.declarePrefix("", "http://www.w3.org/1999/xhtml");
+ * support.declarePrefix("dc", "http://www.purl.org/dc#");
+ *
+ * NamespaceSupport parts = support.processName("p", parts, false);
+ * std::cout << "Namespace URI: " << parts.URI << std::endl;
+ * std::cout << "Local name: " << parts.localName << std::endl;
+ * std::cout << "Raw name: " << parts.rawName << std::endl;
+
+ * parts = support.processName("dc:title", parts, false);
+ * std::cout << "Namespace URI: " << parts.URI << std::endl;
+ * std::cout << "Local name: " << parts.localName << std::endl;
+ * std::cout << "Raw name: " << parts.rawName << std::endl;
+
+ * support.popContext();
+ * 
+ * + *

Note that this class is optimized for the use case where most + * elements do not contain Namespace declarations: if the same + * prefix/URI mapping is repeated for each context (for example), this + * class will be somewhat less efficient.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + */ +template +class NamespaceSupport +{ + public: + typedef std::vector stringListT; + + // functions + NamespaceSupport() + { + reset(); + } // NamespaceSupport + + /** + * Reset this Namespace support object for reuse. + * + *

It is necessary to invoke this method before reusing the + * Namespace support object for a new session.

+ */ + void reset() + { + contexts_.clear(); + contexts_.push_back(Context()); + contexts_.back().insert(std::make_pair(nsc_.xml, nsc_.xml_uri)); + } // reset + + //////////////////////////////////////////////////////////////////// + // Context management. + //////////////////////////////////////////////////////////////////// + /** + * Start a new Namespace context. + * + *

Normally, you should push a new context at the beginning + * of each XML element: the new context will automatically inherit + * the declarations of its parent context, but it will also keep + * track of which declarations were made within this context.

+ * + *

The Namespace support object always starts with a base context + * already in force: in this context, only the "xml" prefix is + * declared.

+ * + * @see #popContext + */ + void pushContext() + { + contexts_.push_back(Context()); + } // pushContext + + /** + * Revert to the previous Namespace context. + * + *

Normally, you should pop the context at the end of each + * XML element. After popping the context, all Namespace prefix + * mappings that were previously in force are restored.

+ * + *

You must not attempt to declare additional Namespace + * prefixes after popping a context, unless you push another + * context first.

+ * + * @see #pushContext + */ + void popContext() + { + contexts_.pop_back(); + } // popContext + + //////////////////////////////////////////////////////////////////// + // Operations within a context. + //////////////////////////////////////////////////////////////////// + /** + * Declare a Namespace prefix. + * + *

This method declares a prefix in the current Namespace + * context; the prefix will remain in force until this context + * is popped, unless it is shadowed in a descendant context.

+ * + *

To declare a default Namespace, use the empty string. The + * prefix must not be "xml" or "xmlns".

+ * + *

Note that you must not declare a prefix after + * you've pushed and popped another Namespace.

+ * + *

Note that there is an asymmetry in this library: while {@link + * #getPrefix getPrefix} will not return the default "" prefix, + * even if you have declared one; to check for a default prefix, + * you have to look it up explicitly using {@link #getURI getURI}. + * This asymmetry exists to make it easier to look up prefixes + * for attribute names, where the default prefix is not allowed.

+ * + * @param prefix The prefix to declare, or the empty string. + * @param uri The Namespace URI to associate with the prefix. + * @return true if the prefix was legal, false otherwise + * @see #processName + * @see #getURI + * @see #getPrefix + */ + bool declarePrefix(const string_type& prefix, const string_type& uri) + { + if((prefix == nsc_.xml) || (prefix == nsc_.xmlns)) + return false; + + contexts_.back().insert(std::make_pair(prefix, uri)); + return true; + } // declarePrefix + + /** + * Process a raw XML 1.0 name. + * + *

This method processes a raw XML 1.0 name in the current + * context by removing the prefix and looking it up among the + * prefixes currently declared. + * + *

If + * the raw name has a prefix that has not been declared, then + * the return value will be empty.

+ * + *

Note that attribute names are processed differently than + * element names: an unprefixed element name will received the + * default Namespace (if any), while an unprefixed attribute name + * will not.

+ * + * @param qName The raw XML 1.0 name to be processed. + * @param isAttribute A flag indicating whether this is an + * attribute name (true) or an element name (false). + * @return A Parts holding three strings representing the + * Namespace URI (or empty string), the local name, and the raw XML + * 1.0 name. + * @see #declarePrefix + */ + private: + class URIMapper + { + public: + URIMapper(const NamespaceSupport* ns) : ns_(ns) { } + string_type operator()(const string_type& prefix) const { return ns_->getURI(prefix); } + private: + const NamespaceSupport* const ns_; + }; // class URIMapper + + public: + XML::QualifiedName processName(const string_type& rawName, bool isAttribute) const + { + try + { + return XML::QualifiedName::parseQName(rawName, isAttribute, URIMapper(this)); + } // try + catch(const std::runtime_error& ex) + { + throw SAX::SAXException(ex.what()); + } // catch + } // processName + + /** + * Look up a prefix and get the currently-mapped Namespace URI. + * + *

This method looks up the prefix in the current context. + * Use the empty string ("") for the default Namespace.

+ * + * @param prefix The prefix to look up. + * @return The associated Namespace URI, or empty string if the prefix + * is undeclared in this context. + * @see #getPrefix + * @see #getPrefixes + */ + string_type getURI(const string_type& prefix) const + { + for(typename contextListT::const_reverse_iterator i = contexts_.rbegin(); i != contexts_.rend(); ++i) + { + typename stringMapT::const_iterator u = i->find(prefix); + if(u != i->end()) + return u->second; + } // for ... + + return string_type(); + } // getURI + + /** + * Return one of the prefixes mapped to a Namespace URI. + * + *

If more than one prefix is currently mapped to the same + * URI, this method will make an arbitrary selection; if you + * want all of the prefixes, use the {@link #getPrefixes} + * method instead.

+ * + *

Note: this will never return the empty (default) prefix; + * to check for a default prefix, use the {@link #getURI getURI} + * method with an argument of "".

+ * + * @param uri The Namespace URI. + * @return One of the prefixes currently mapped to the URI supplied, + * or an empty string if none is mapped or if the URI is assigned to + * the default Namespace. + * @see #getPrefixes(const string_type&) + * @see #getURI + */ + string_type getPrefix(const string_type& uri) const + { + for(typename contextListT::const_reverse_iterator i = contexts_.rbegin(); i != contexts_.rend(); ++i) + { + for(typename stringMapT::const_iterator u = i->begin(); u != i->end(); ++u) + if(u->second == uri) + return u->first; + } // for ... + + return string_type(); + } // getPrefix + + /** + * Returns all prefixes currently declared. + * + *

Note: if there is a default prefix, it will not be + * returned in this enumeration; check for the default prefix + * using the {@link #getURI getURI} with an argument of "".

+ * + * @return A list of all prefixes declared in the + * current context except for the empty (default) + * prefix. + * @see #getDeclaredPrefixes + * @see #getURI + */ + stringListT getPrefixes() const + { + stringListT prefixes; + + for(typename contextListT::const_reverse_iterator i = contexts_.rbegin(); i != contexts_.rend(); ++i) + { + for(typename stringMapT::const_iterator u = i->begin(); u != i->end(); ++u) + if(!string_adaptor::empty(u->first)) + prefixes.push_back(u->first); + } // for ... + + return prefixes; + } // getPrefixes + + /** + * Returns a list of all prefixes currently declared for a URI. + * + *

This method returns prefixes mapped to a specific Namespace + * URI. The xml: prefix will be included. If you want only one + * prefix that's mapped to the Namespace URI, and you don't care + * which one you get, use the {@link #getPrefix getPrefix} + * method instead.

+ * + *

Note: the empty (default) prefix is never included + * in this enumeration; to check for the presence of a default + * Namespace, use the {@link #getURI getURI} method with an + * argument of "".

+ * + * @param uri The Namespace URI. + * @return A list of all prefixes declared in the + * current context. + * @see #getPrefix + * @see #getDeclaredPrefixes + * @see #getURI + */ + stringListT getPrefixes(const string_type& uri) const + { + stringListT prefixes; + + for(typename contextListT::const_reverse_iterator i = contexts_.rbegin(); i != contexts_.rend(); ++i) + { + for(typename stringMapT::const_iterator u = i->begin(); u != i->end(); ++u) + if(u->second == uri) + prefixes.push_back(u->first); + } // for ... + + return prefixes; + } // getPrefixes + + /** + * Return an enumeration of all prefixes declared in this context. + * + *

The empty (default) prefix will be included in this + * enumeration; note that this behaviour differs from that of + * {@link #getPrefix} and {@link #getPrefixes}.

+ * + * @return An enumeration of all prefixes declared in this + * context. + * @see #getPrefixes + * @see #getURI + */ + stringListT getDeclaredPrefixes() const + { + stringListT prefixes; + + for(typename stringMapT::const_iterator u = contexts_.back().begin(); u != contexts_.back().end(); ++u) + prefixes.push_back(u->first); + + return prefixes; + } // getDeclaredPrefixes + + private: + typedef typename std::multimap stringMapT; + typedef stringMapT Context; + typedef typename std::vector contextListT; + + // member variables + contextListT contexts_; + + const NamespaceConstants nsc_; + + // no impl + NamespaceSupport(const NamespaceSupport&); + NamespaceSupport& operator=(const NamespaceSupport&); + bool operator==(const NamespaceSupport&) const; +}; // class NamespaceSupport + +} // namespace SAX +} // namespace Arabica + +#endif // NamespaceSupportH diff --git a/arabica/include/SAX/helpers/PropertyNames.hpp b/arabica/include/SAX/helpers/PropertyNames.hpp new file mode 100644 index 000000000..2d1f0d9ae --- /dev/null +++ b/arabica/include/SAX/helpers/PropertyNames.hpp @@ -0,0 +1,53 @@ +#ifndef ARABICA_PROPERTY_NAMES_H +#define ARABICA_PROPERTY_NAMES_H +/* + * $Id$ + */ + +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** The core SAX 2 parser properties. */ +template > +struct PropertyNames +{ + /** @name SAX 2 Properties + * @{ */ + /** Register a lexical handler. + * + * The Lexical Handler is used to see some syntax events that are essential + * in some applications: comments, CDATA delimiters, selected general + * entity inclusions, and the start and end of the DTD (and declaration of + * document element name). + * + * The value assigned must implement SAX::LexicalHandler. + */ + const string_type lexicalHandler; + /** Register a Declaration Handler. + * + * Used to see most DTD declarations except those treated as lexical + * ("document element name is ...") or which are mandatory for all SAX + * parsers (DTDHandler). + * + * The value assigned must implement SAX::DeclHandler */ + const string_type declHandler; + /** @} */ + + PropertyNames() : + lexicalHandler(string_adaptor_type::construct_from_utf8("http://xml.org/sax/handlers/LexicalHandler")), + declHandler(string_adaptor_type::construct_from_utf8("http://xml.org/sax/handlers/DeclHandler")) + { + } // PropertyNames +}; // struct PropertyNames + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/helpers/XMLFilterImpl.hpp b/arabica/include/SAX/helpers/XMLFilterImpl.hpp new file mode 100644 index 000000000..98abec276 --- /dev/null +++ b/arabica/include/SAX/helpers/XMLFilterImpl.hpp @@ -0,0 +1,608 @@ +#ifndef ARABICA_XML_FILTER_IMPL_H +#define ARABICA_XML_FILTER_IMPL_H + +// XMLFilterImpl.h + +#include +#include +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +/** + * Base class for deriving an XML filter. + * + *

This class is designed to sit between an {@link XMLReader + * XMLReader} and the client application's event handlers. By default, it + * does nothing but pass requests up to the reader and events + * on to the handlers unmodified, but subclasses can override + * specific methods to modify the event stream or the configuration + * requests as they pass through.

+ * + * @since SAX 2.0 + * @author Jez Higgins, + * jez@jezuk.co.uk + * @version 2.0 + * @see XMLFilter + * @see XMLReader + * @see EntityResolver + * @see DTDHandler + * @see ContentHandler + * @see ErrorHandler + */ +template +class XMLFilterImpl : public XMLFilter, + public EntityResolver, + public DTDHandler, + public ContentHandler, + public ErrorHandler, + public DeclHandler, + public LexicalHandler +{ +public: + typedef XMLReaderInterface XMLReaderT; + typedef EntityResolver EntityResolverT; + typedef DTDHandler DTDHandlerT; + typedef ContentHandler ContentHandlerT; + typedef InputSource InputSourceT; + typedef Locator LocatorT; + typedef ErrorHandler ErrorHandlerT; + typedef DeclHandler DeclHandlerT; + typedef LexicalHandler LexicalHandlerT; + typedef typename ErrorHandler::SAXParseExceptionT SAXParseExceptionT; + typedef DefaultHandler DefaultHandlerT; + + + XMLFilterImpl() : + parent_(0) + { + setDefaults(); + } // XMLFilterImpl + XMLFilterImpl(XMLReaderT& parent) : + parent_(&parent) + { + setDefaults(); + } // XMLFilterImpl + + virtual ~XMLFilterImpl() { } + + ///////////////////////////////////////////////// + // XMLFilter implementation + /** + * Set the parent reader. + * + *

This is the {@link XMLReader XMLReader} from which + * this filter will obtain its events and to which it will pass its + * configuration requests. The parent may itself be another filter.

+ * + *

If there is no parent reader set, any attempt to parse + * or to set or get a feature or property will fail.

+ * + * @param parent The parent XML reader. + * @see #getParent + */ + virtual void setParent(XMLReaderT& parent) { parent_ = &parent; } + /** + * Get the parent reader. + * + * @return The parent XML reader, or null if none is set. + * @see #setParent + */ + virtual XMLReaderT* getParent() const { return parent_; } + + ///////////////////////////////////////////////// + // XMLReader implementation + /** + * Set the state of a feature. + * + *

This will always fail if the parent is null.

+ * + * @param name The feature name. + * @param value The requested feature value. + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the feature name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the feature name but + * cannot set the requested value. + * @see XMLReader#setFeature + */ + virtual void setFeature(const string_type& name, bool value) + { + if(!parent_) + { + string_type ex = string_adaptor::construct_from_utf8("Feature: "); + string_adaptor::append(ex, name); + throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); + } // if ... + + parent_->setFeature(name, value); + } // setFeature + /** + * Look up the state of a feature. + * + *

This will always fail if the parent is null.

+ * + * @param name The feature name. + * @return The current state of the feature. + * @exception SAXNotRecognizedException When the + * XMLReader does not recognize the feature name. + * @exception SAXNotSupportedException When the + * XMLReader recognizes the feature name but + * cannot determine its state at this time. + * @see XMLReader#getFeature + */ + virtual bool getFeature(const string_type& name) const + { + if(!parent_) + { + string_type ex = string_adaptor::construct_from_utf8("Feature: "); + string_adaptor::append(ex, name); + throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); + } // if ... + + return parent_->getFeature(name); + } // setFeature + + /** + * Set the entity resolver. + * + * @param resolver The new entity resolver. + * @see XMLReader#setEntityResolver + */ + virtual void setEntityResolver(EntityResolverT& resolver) { entityResolver_ = &resolver; } + /** + * Get the current entity resolver. + * + * @return The current entity resolver, or null if none was set. + * @see XMLReader#getEntityResolver + */ + virtual EntityResolverT* getEntityResolver() const { return entityResolver_ ; } + /** + * Set the DTD event handler. + * + * @param handler The new DTD handler. + * @see XMLReader#setDTDHandler + */ + virtual void setDTDHandler(DTDHandlerT& handler) { dtdHandler_ = &handler; } + /** + * Get the current DTD event handler. + * + * @return The current DTD handler, or null if none was set. + * @see XMLReader#getDTDHandler + */ + virtual DTDHandlerT* getDTDHandler() const { return dtdHandler_; } + /** + * Set the content event handler. + * + * @param handler The new content handler. + * @see XMLReader#setContentHandler + */ + virtual void setContentHandler(ContentHandlerT& handler) { contentHandler_ = &handler; } + /** + * Get the content event handler. + * + * @return The current content handler, or null if none was set. + * @see XMLReader#getContentHandler + */ + virtual ContentHandlerT* getContentHandler() const { return contentHandler_; } + /** + * Set the error event handler. + * + * @param handler The new error handler. + * @see XMLReader#setErrorHandler + */ + virtual void setErrorHandler(ErrorHandlerT& handler) { errorHandler_ = &handler; } + /** + * Get the current error event handler. + * + * @return The current error handler, or null if none was set. + * @see XMLReader#getErrorHandler + */ + virtual ErrorHandlerT* getErrorHandler() const { return errorHandler_; } + + virtual void setDeclHandler(DeclHandlerT& handler) { declHandler_ = &handler; } + virtual DeclHandlerT* getDeclHandler() const { return declHandler_; } + virtual void setLexicalHandler(LexicalHandlerT& handler) { lexicalHandler_ = &handler; } + virtual LexicalHandlerT* getLexicalHandler() const { return lexicalHandler_; } + + /** + * Parse a document. + * + * @param input The input source for the document entity. + * @see XMLReader#parse(InputSource) + */ + virtual void parse(InputSourceT& input) + { + setupParse(); + parent_->parse(input); + } // parse + + virtual std::auto_ptr doGetProperty(const string_type& name) + { + if(parent_) + return parent_->doGetProperty(name); + + string_type ex = string_adaptor::construct_from_utf8("Property: "); + string_adaptor::append(ex, name); + throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); + } // doGetProperty + + virtual void doSetProperty(const string_type& name, typename std::auto_ptr value) + { + if(parent_) + { + parent_->doSetProperty(name, value); + return; + } // if(parent_) + + string_type ex = string_adaptor::construct_from_utf8("Property: "); + string_adaptor::append(ex, name); + throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); + } // doSetProperty + +public: + ////////////////////////////////////////////////// + // EntityResolver + /** + * Filter an external entity resolution. + * + * @param publicId The entity's public identifier, or an empty string. + * @param systemId The entity's system identifier. + * @return A new InputSource or a default-constructed + * InputSourceT for the default. + * @see EntityResolver#resolveEntity + */ + virtual InputSourceT resolveEntity(const string_type& publicId, const string_type& systemId) + { + if(entityResolver_) + return entityResolver_->resolveEntity(publicId, systemId); + return InputSourceT(); + } // resolveEntity + + ////////////////////////////////////////////////// + // DTDHandler + /** + * Filter a notation declaration event. + * + * @param name The notation name. + * @param publicId The notation's public identifier, or an empty string. + * @param systemId The notation's system identifier, or an empty string. + * @see DTDHandler#notationDecl + */ + virtual void notationDecl(const string_type& name, + const string_type& publicId, + const string_type& systemId) + { + dtdHandler_->notationDecl(name, publicId, systemId); + } // notationDecl + + /** + * Filter an unparsed entity declaration event. + * + * @param name The entity name. + * @param publicId The entity's public identifier, or an empty string. + * @param systemId The entity's system identifier, or an empty string. + * @param notationName The name of the associated notation. + * @see DTDHandler#unparsedEntityDecl + */ + virtual void unparsedEntityDecl(const string_type& name, + const string_type& publicId, + const string_type& systemId, + const string_type& notationName) + { + dtdHandler_->unparsedEntityDecl(name, publicId, systemId, notationName); + } // unparsedEntityDecl + + ////////////////////////////////////////////////// + // ContentHandler + /** + * Filter a new document locator event. + * + * @param locator The document locator. + * @see ContentHandler#setDocumentLocator + */ + virtual void setDocumentLocator(const LocatorT& locator) + { + contentHandler_->setDocumentLocator(locator); + } // setDocumentLocator + + /** + * Filter a start document event. + * + * @see ContentHandler#startDocument + */ + virtual void startDocument() + { + contentHandler_->startDocument(); + } // startDocument + + /** + * Filter an end document event. + * + * @see ContentHandler#endDocument + */ + virtual void endDocument() + { + contentHandler_->endDocument(); + } // endDocument + + /** + * Filter a start Namespace prefix mapping event. + * + * @param prefix The Namespace prefix. + * @param uri The Namespace URI. + * @see ContentHandler#startPrefixMapping + */ + virtual void startPrefixMapping(const string_type& prefix, const string_type& uri) + { + contentHandler_->startPrefixMapping(prefix, uri); + } // startPrefixMapping + + /** + * Filter an end Namespace prefix mapping event. + * + * @param prefix The Namespace prefix. + * @see ContentHandler#endPrefixMapping + */ + virtual void endPrefixMapping(const string_type& prefix) + { + contentHandler_->endPrefixMapping(prefix); + } // endPrefixMapping + + /** + * Filter a start element event. + * + * @param namespaceURI The element's Namespace URI, or the empty string. + * @param localName The element's local name, or the empty string. + * @param qName The element's qualified (prefixed) name, or the empty + * string. + * @param atts The element's attributes. + * @see ContentHandler#startElement + */ + virtual void startElement(const string_type& namespaceURI, const string_type& localName, + const string_type& qName, const typename ContentHandlerT::AttributesT& atts) + { + contentHandler_->startElement(namespaceURI, localName, qName, atts); + } // startElement + + /** + * Filter an end element event. + * + * @param namespaceURI The element's Namespace URI, or the empty string. + * @param localName The element's local name, or the empty string. + * @param qName The element's qualified (prefixed) name, or the empty + * string. + * @see ContentHandler#endElement + */ + virtual void endElement(const string_type& namespaceURI, const string_type& localName, + const string_type& qName) + { + contentHandler_->endElement(namespaceURI, localName, qName); + } // endElement + + /** + * Filter a character data event. + * + * @param ch The characters. + * @see ContentHandler#characters + */ + virtual void characters(const string_type& ch) + { + contentHandler_->characters(ch); + } // characters + + /** + * Filter an ignorable whitespace event. + * + * @param ch The whitespace + * @see ContentHandler#ignorableWhitespace + */ + virtual void ignorableWhitespace(const string_type& ch) + { + contentHandler_->ignorableWhitespace(ch); + } // ignorableWhitespace + + /** + * Filter a processing instruction event. + * + * @param target The processing instruction target. + * @param data The text following the target. + * @see ContentHandler#processingInstruction + */ + virtual void processingInstruction(const string_type& target, const string_type& data) + { + contentHandler_->processingInstruction(target, data); + } // processingInstruction + + /** + * Filter a skipped entity event. + * + * @param name The name of the skipped entity. + * @see ContentHandler#skippedEntity + */ + virtual void skippedEntity(const string_type& name) + { + contentHandler_->skippedEntity(name); + } // skippedEntity + + ////////////////////////////////////////////////// + // ErrorHandler + /** + * Filter a warning event. + * + * @param exception The warning as an exception. + * @see ErrorHandler#warning + */ + virtual void warning(const SAXParseExceptionT& exception) + { + errorHandler_->warning(exception); + } // warning + + /** + * Filter an error event. + * + * @param exception The error as an exception. + * @see ErrorHandler#error + */ + virtual void error(const SAXParseExceptionT& exception) + { + errorHandler_->error(exception); + } // error + + /** + * Filter a fatal error event. + * + * @param exception The error as an exception. + * @see ErrorHandler#fatalError + */ + virtual void fatalError(const SAXParseExceptionT& exception) + { + errorHandler_->fatalError(exception); + } // fatalError + + //////////////////////////////////////////////////////////// + // DeclHandler + /** + * Filter an element type declaration. + */ + virtual void elementDecl(const string_type& name, const string_type& model) + { + declHandler_->elementDecl(name, model); + } // elementDecl + + /** + * Filter an attribute type declaration. + */ + virtual void attributeDecl(const string_type& elementName, + const string_type& attributeName, + const string_type& type, + const string_type& valueDefault, + const string_type& value) + { + declHandler_->attributeDecl(elementName, attributeName, type, valueDefault, value); + } // attributeDecl + + /** + * Filter an internal entity declaration. + */ + virtual void internalEntityDecl(const string_type& name, const string_type& value) + { + declHandler_->internalEntityDecl(name, value); + } // internalEntityDecl + + /** + * Filter a parsed external entity declaration. + */ + virtual void externalEntityDecl(const string_type& name, + const string_type& publicId, + const string_type& systemId) + { + declHandler_->externalEntityDecl(name, publicId, systemId); + } // externalEntityDecl + + ////////////////////////////////////////////////////////// + // LexicalHandler + /** + * Filter the start of DTD declarations, if any. + */ + virtual void startDTD(const string_type& name, + const string_type& publicId, + const string_type& systemId) + { + lexicalHandler_->startDTD(name, publicId, systemId); + } // startDTD + + /** + * Filter the end of DTD declarations. + */ + virtual void endDTD() + { + lexicalHandler_->endDTD(); + } // endDTD + + /** + * Filter the beginning of some internal and external XML entities. + */ + virtual void startEntity(const string_type& name) + { + lexicalHandler_->startEntity(name); + } // startEntity + + /** + * Filter the end of an entity. + */ + virtual void endEntity(const string_type& name) + { + lexicalHandler_->endEntity(name); + } // endEntity + + /** + * Filter the start of a CDATA section. + */ + virtual void startCDATA() + { + lexicalHandler_->startCDATA(); + } // startCDATA + + /** + * Filter the end of a CDATA section. + */ + virtual void endCDATA() + { + lexicalHandler_->endCDATA(); + } // endCDATA + + /** + * Filter an XML comment anywhere in the document. + */ + virtual void comment(const string_type& text) + { + lexicalHandler_->comment(text); + } // comment + +private: + void setDefaults() + { + setEntityResolver(defaultHandler_); + setDTDHandler(defaultHandler_); + setContentHandler(defaultHandler_); + setErrorHandler(defaultHandler_); + setDeclHandler(defaultHandler_); + setLexicalHandler(defaultHandler_); + } // setDefaults + + void setupParse() + { + parent_->setEntityResolver(*this); + parent_->setDTDHandler(*this); + parent_->setContentHandler(*this); + parent_->setErrorHandler(*this); + parent_->setDeclHandler(*this); + parent_->setLexicalHandler(*this); + } // setupParse + + XMLFilterImpl(const XMLFilterImpl&); + XMLFilterImpl& operator=(const XMLFilterImpl&); // no impl + bool operator==(const XMLFilterImpl&); // no impl + + XMLReaderT* parent_; + EntityResolverT* entityResolver_; + DTDHandlerT* dtdHandler_; + ContentHandlerT* contentHandler_; + ErrorHandlerT* errorHandler_; + DeclHandlerT* declHandler_; + LexicalHandlerT* lexicalHandler_; + DefaultHandlerT defaultHandler_; +}; // class XMLFilter + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file diff --git a/arabica/include/SAX/saxfwd.hpp b/arabica/include/SAX/saxfwd.hpp new file mode 100644 index 000000000..983a67aa3 --- /dev/null +++ b/arabica/include/SAX/saxfwd.hpp @@ -0,0 +1,89 @@ +def ARABICA_SAX_FWD_H +#define ARABICA_SAX_FWD_H + +#include + +/** \mainpage Arabica XML Parser Toolkit + * + * \section intro Introduction + * + *

Arabica has a full SAX2, the Simple API for XML, implementation + * including the optional interfaces and helper classes. Layered on + * SAX is a W3C Document Object Model (DOM) Level 2.0 Core + * implementation, together with an XPath engine.

+ * + *

It delivers UTF-8 encoded std::strings or UCS-2 std::wstrings, + * but can also accommodate custom string types and alternative + * encodings.

+ * + *

It provides uniform SAX2 wrappers for the expat parser, + * Xerces, libxml + * and for the Microsoft XML parser COM component.

+ * + * \section license License + * + * Copyright (c) 2001-2012 Jez UK Ltd
+ * All rights reserved. + *

+ * Redistribution and use in source and binary forms, with or
+ * without modification, are permitted provided that the following
+ * conditions are met:
+ *

    + *
  • Redistributions of source code must retain the above
    + * copyright notice, this list of conditions and the following
    + * disclaimer.
  • + *
  • Redistributions in binary form must reproduce the above
    + * copyright notice, this list of conditions and the following
    + * disclaimer in the documentation and/or other materials
    + * provided with the distribution.
  • + *
  • Neither the name of Jez UK Ltd nor the names of
    + * contributors may be used to endorse or promote products
    + * derived from this software without specific prior written
    + * permission.
  • + *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ * CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
+ * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ * + */ + + +#include +#include + +/** + * + * SAX in C++ - A C++ implementation of the SAX2 interface. + * + */ +namespace Arabica +{ +namespace SAX +{ + +template class AttributeList; +template class DocumentHandler; +template class DTDHandler; +template class EntityResolver; +template class InputSource; +template class Locator; +template class Parser; +template class SAXParseException; +template class ErrorHandler; + +} // namespace SAX +} // namespace Arabica + +#endif +// end of file + diff --git a/arabica/include/SAX/wrappers/saxlibxml2.hpp b/arabica/include/SAX/wrappers/saxlibxml2.hpp new file mode 100644 index 000000000..76072d83b --- /dev/null +++ b/arabica/include/SAX/wrappers/saxlibxml2.hpp @@ -0,0 +1,955 @@ +#ifndef ARABICA_SAX_LIBXML2_H +#define ARABICA_SAX_LIBXML2_H +//////////////////////////////////////////////////////////////// +// A SAX2 Wrapper for libxml2 +//////////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +//////////////////////////////////////////////////////////////////////////// +// the callback functions for libxml +namespace libxml2_wrapper_impl_tiddle +{ + +extern "C" +{ + +void lwit_startDocument(void* user_data); +void lwit_endDocument(void* user_data); +void lwit_startElement(void *user_data, const xmlChar* name, const xmlChar** attrs); +void lwit_endElement(void *user_data, const xmlChar* name); +void lwit_characters(void* user_data, const xmlChar* ch, int len); +void lwit_cdata(void* user_data, const xmlChar* ch, int len); +void lwit_ignorableWhitespace(void *user_data, const xmlChar* ch, int len); +void lwit_processingInstruction(void *user_data, const xmlChar* target, const xmlChar* data); +void lwit_comment(void *user_data, const xmlChar* comment); +void lwit_warning(void *user_data, const char* fmt, ...); +void lwit_error(void* user_data, const char* fmt, ...); +void lwit_fatalError(void* user_data, const char* fmt, ...); +void lwit_locator(void* user_data, xmlSAXLocatorPtr locator); +void lwit_notationDecl(void* user_data, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); +void lwit_unparsedEntityDecl(void* user_data, + const xmlChar *name, const xmlChar *publicId, + const xmlChar *systemId, const xmlChar *notationName); +void lwit_elementDecl(void* user_date, const xmlChar *name, int type, xmlElementContentPtr content); +void lwit_attributeDecl(void *user_data, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); +void lwit_entityDecl(void* user_data, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); +void lwit_setFeature(xmlParserCtxtPtr context, const char* name, bool value); +bool lwit_getFeature(xmlParserCtxtPtr context, const char* name); +xmlEntityPtr lwit_getEntity(void* user_data, const xmlChar* name); +xmlParserInputPtr lwit_resolveEntity(void* user_data, const xmlChar* publicId, const xmlChar* systemId); +xmlSAXHandler* lwit_SaxHandler(); + +class libxml2_base +{ + protected: + virtual ~libxml2_base() { } + + private: + virtual void SAXstartDocument() = 0; + virtual void SAXendDocument() = 0; + virtual void SAXlocator(xmlSAXLocatorPtr locator) = 0; + virtual void SAXcharacters(const xmlChar* ch, int len) = 0; + virtual void SAXcdata(const xmlChar* ch, int len) = 0; + virtual void SAXignorableWhitespace(const xmlChar* ch, int len) = 0; + virtual void SAXwarning(const std::string& warning) = 0; + virtual void SAXerror(const std::string& error) = 0; + virtual void SAXfatalError(const std::string& fatal) = 0; + virtual void SAXprocessingInstruction(const xmlChar* target, const xmlChar* data) = 0; + virtual void SAXcomment(const xmlChar* comment) = 0; + virtual void SAXstartElement(const xmlChar* name, const xmlChar** attrs) = 0; + virtual void SAXendElement(const xmlChar* name) = 0; + virtual void SAXnotationDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) = 0; + virtual void SAXunparsedEntityDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName) = 0; + virtual void SAXelementDecl(const xmlChar* name, int type, xmlElementContentPtr content) = 0; + virtual void SAXattributeDecl(const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) = 0; + virtual void SAXentityDecl(const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) = 0; + virtual xmlParserInputPtr SAXresolveEntity(const xmlChar* publicId, const xmlChar* systemId) = 0; + virtual xmlParserCtxtPtr parserContext() = 0; + + virtual void SAXstartCdataSection() = 0; + virtual void SAXendCdataSection() = 0; + + friend void lwit_startDocument(void* user_data); + friend void lwit_endDocument(void* user_data); + friend void lwit_characters(void *user_data, const xmlChar* ch, int len); + friend void lwit_cdata(void *user_data, const xmlChar* ch, int len); + friend void lwit_ignorableWhitespace(void *user_data, const xmlChar* ch, int len); + friend void lwit_locator(void* user_data, xmlSAXLocatorPtr locator); + friend void lwit_warning(void *user_data, const char* fmt, ...); + friend void lwit_error(void* user_data, const char* fmt, ...); + friend void lwit_fatalError(void* user_data, const char* fmt, ...); + friend void lwit_processingInstruction(void *user_data, const xmlChar* target, const xmlChar* data); + friend void lwit_comment(void *user_data, const xmlChar* comment); + friend void lwit_startElement(void *user_data, const xmlChar* name, const xmlChar** attrs); + friend void lwit_endElement(void* user_data, const xmlChar* name); + friend void lwit_notationDecl(void* user_data, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); + friend void lwit_unparsedEntityDecl(void* user_data, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); + friend void lwit_elementDecl(void* user_data, const xmlChar *name, int type, xmlElementContentPtr content); + friend void lwit_attributeDecl(void* user_data, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); + friend void lwit_entityDecl(void* user_data, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); + friend xmlEntityPtr lwit_getEntity(void* user_data, const xmlChar* name); + friend xmlParserInputPtr lwit_resolveEntity(void* user_data, const xmlChar* publicId, const xmlChar* systemId); +}; // class libxml2_base + +} // extern "C" + +} // namespace libxml2_wrapper_impl_tiddle + +template +class libxml2_wrapper : + public SAX::XMLReaderInterface::type>, + public SAX::Locator::type>, + protected libxml2_wrapper_impl_tiddle::libxml2_base +{ + public: + typedef SAX::XMLReaderInterface::type> XMLReaderT; + typedef typename XMLReaderT::string_adaptor string_adaptor; + typedef SAX::EntityResolver entityResolverT; + typedef SAX::DTDHandler dtdHandlerT; + typedef SAX::ContentHandler contentHandlerT; + typedef SAX::Attributes attributesT; + typedef SAX::AttributeType attributeTypeT; + typedef SAX::DeclHandler declHandlerT; + typedef SAX::LexicalHandler lexicalHandlerT; + typedef SAX::InputSource inputSourceT; + typedef SAX::Locator locatorT; + typedef SAX::NamespaceSupport namespaceSupportT; + typedef SAX::ErrorHandler errorHandlerT; + typedef SAX::SAXParseException SAXParseExceptionT; + typedef typename XMLReaderT::PropertyBase PropertyBaseT; + typedef typename XMLReaderT::template Property getLexicalHandlerT; + typedef typename XMLReaderT::template Property setLexicalHandlerT; + typedef typename XMLReaderT::template Property getDeclHandlerT; + typedef typename XMLReaderT::template Property setDeclHandlerT; + typedef XML::QualifiedName qualifiedNameT; + + libxml2_wrapper(); + ~libxml2_wrapper(); + + //////////////////////////////////////////////// + // configuration + virtual bool getFeature(const string_type& name) const; + virtual void setFeature(const string_type& name, bool value); + + //////////////////////////////////////////////// + // Event Handlers + virtual void setEntityResolver(entityResolverT& resolver) { entityResolver_ = &resolver; } + virtual entityResolverT* getEntityResolver() const { return entityResolver_; } + virtual void setDTDHandler(dtdHandlerT& handler) { dtdHandler_ = &handler; } + virtual dtdHandlerT* getDTDHandler() const { return dtdHandler_; } + virtual void setContentHandler(contentHandlerT& handler) { contentHandler_ = &handler; } + virtual contentHandlerT* getContentHandler() const { return contentHandler_; } + virtual void setErrorHandler(errorHandlerT& handler) { errorHandler_ = &handler; } + virtual errorHandlerT* getErrorHandler() const { return errorHandler_; } + virtual void setDeclHandler(declHandlerT& handler) { declHandler_ = &handler; } + virtual declHandlerT* getDeclHandler() const { return declHandler_; } + virtual void setLexicalHandler(lexicalHandlerT& handler) { lexicalHandler_ = &handler; } + virtual lexicalHandlerT* getLexicalHandler() const { return lexicalHandler_; } + + //////////////////////////////////////////////// + // parsing + virtual void parse(inputSourceT& source); + + protected: + //////////////////////////////////////////////// + // properties + virtual std::auto_ptr doGetProperty(const string_type& name); + virtual void doSetProperty(const string_type& name, std::auto_ptr value); + + public: + virtual string_type getPublicId() const; + virtual string_type getSystemId() const; + virtual size_t getLineNumber() const; + virtual size_t getColumnNumber() const; + + private: + virtual void SAXstartDocument(); + virtual void SAXendDocument(); + virtual void SAXlocator(xmlSAXLocatorPtr locator) { locator_ = locator; } + virtual void SAXcharacters(const xmlChar* ch, int len); + virtual void SAXcdata(const xmlChar* ch, int len); + virtual void SAXignorableWhitespace(const xmlChar* ch, int len); + virtual void SAXwarning(const std::string& warning); + virtual void SAXerror(const std::string& error); + virtual void SAXfatalError(const std::string& fatal); + virtual void SAXprocessingInstruction(const xmlChar* target, const xmlChar* data); + virtual void SAXcomment(const xmlChar* comment); + virtual void SAXstartCdataSection(); + virtual void SAXendCdataSection(); + virtual void SAXstartElement(const xmlChar* name, const xmlChar** attrs); + virtual void SAXstartElementNoNS(const xmlChar* name, const xmlChar** attrs); + virtual void SAXendElement(const xmlChar* name); + virtual void SAXendElementNoNS(const xmlChar* name); + virtual void SAXnotationDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId); + virtual void SAXunparsedEntityDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName); + virtual void SAXelementDecl(const xmlChar* name, int type, xmlElementContentPtr content); + void convertXML_Content(std::ostream& os, int type, xmlElementContentPtr model, bool isChild) const; + virtual void SAXattributeDecl(const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree); + string_type stringAttrEnum(xmlEnumerationPtr tree, bool leadingSpace) const; + virtual void SAXentityDecl(const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content); + virtual xmlParserInputPtr SAXresolveEntity(const xmlChar* publicId, const xmlChar* systemId); + virtual xmlParserCtxtPtr parserContext() { return context_; } + + + qualifiedNameT processName(const string_type& qName, bool isAttribute); + void reportError(const std::string& message, bool fatal = false); + void checkNotParsing(const string_type& type, const string_type& name) const; + + private: + // member variables + entityResolverT* entityResolver_; + dtdHandlerT* dtdHandler_; + contentHandlerT* contentHandler_; + errorHandlerT* errorHandler_; + namespaceSupportT nsSupport_; + declHandlerT* declHandler_; + lexicalHandlerT* lexicalHandler_; + + xmlParserCtxtPtr context_; + xmlSAXLocatorPtr locator_; + + bool parsing_; + + bool namespaces_; + bool prefixes_; + bool isInCData_; + + string_type emptyString_; + const FeatureNames features_; + const PropertyNames properties_; + const NamespaceConstants nsc_; + const AttributeDefaults attrDefaults_; + const AttributeTypes attrTypes_; +}; // class libxml2_wrapper + +template +libxml2_wrapper::libxml2_wrapper() : + entityResolver_(0), + dtdHandler_(0), + contentHandler_(0), + errorHandler_(0), + declHandler_(0), + lexicalHandler_(0), + locator_(0), + parsing_(false), + isInCData_(false), + namespaces_(true), + prefixes_(true) +{ + context_ = xmlCreatePushParserCtxt(libxml2_wrapper_impl_tiddle::lwit_SaxHandler(), + reinterpret_cast(static_cast(this)), + 0, + 0, + 0); + xmlCtxtUseOptions(context_, XML_PARSE_DTDLOAD + + XML_PARSE_DTDVALID + + XML_PARSE_NOENT + + XML_PARSE_NOBLANKS); +} // libxml2_wrapper + +template +libxml2_wrapper::~libxml2_wrapper() +{ + xmlFreeParserCtxt(context_); +} // ~libxml2_wrapper + +template +bool libxml2_wrapper::getFeature(const string_type& name) const +{ + if(name == features_.namespaces) + return namespaces_; + + if(name == features_.namespace_prefixes) + return prefixes_; + + if(name == features_.validation) + return libxml2_wrapper_impl_tiddle::lwit_getFeature(context_, "validate"); + + if(name == features_.external_general) + return libxml2_wrapper_impl_tiddle::lwit_getFeature(context_, "fetch external entities"); + + if(name == features_.external_parameter) + { + throw SAX::SAXNotSupportedException(std::string("Feature not supported ") + string_adaptor::asStdString(name)); + } + else + { + throw SAX::SAXNotRecognizedException(std::string("Feature not recognized ") + string_adaptor::asStdString(name)); + } +} // getFeature + +template +void libxml2_wrapper::setFeature(const string_type& name, bool value) +{ + if(name == features_.namespaces) + { + checkNotParsing(string_adaptor::construct_from_utf8("feature"), name); + namespaces_ = value; + if(!namespaces_ && !prefixes_) + prefixes_ = true; + return; + } + + if(name == features_.namespace_prefixes) + { + checkNotParsing(string_adaptor::construct_from_utf8("feature"), name); + prefixes_ = value; + if(prefixes_ && !namespaces_) + namespaces_ = true; + return; + } + + if(name == features_.validation) + { + libxml2_wrapper_impl_tiddle::lwit_setFeature(context_, "validate", value); + return; + } // if ... + + if(name == features_.external_general) + { + libxml2_wrapper_impl_tiddle::lwit_setFeature(context_, "fetch external entities", value); + return; + } // if ... + + if(name == features_.external_parameter) + { + std::ostringstream os; + os << "Feature not supported " << string_adaptor::asStdString(name); + throw SAX::SAXNotSupportedException(os.str()); + } + else + { + std::ostringstream os; + os << "Feature not recognized " << string_adaptor::asStdString(name); + throw SAX::SAXNotRecognizedException(os.str()); + } +} // setFeature + +template +std::auto_ptr::PropertyBaseT> libxml2_wrapper::doGetProperty(const string_type& name) +{ + if(name == properties_.declHandler) + { + getDeclHandlerT* prop = new getDeclHandlerT(declHandler_); + return std::auto_ptr(prop); + } + if(name == properties_.lexicalHandler) + { + getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_); + return std::auto_ptr(prop); + } + + throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptor::asStdString(name)); +} // doGetProperty + +template +void libxml2_wrapper::doSetProperty(const string_type& name, std::auto_ptr value) +{ + if(name == properties_.declHandler) + { + setDeclHandlerT* prop = dynamic_cast(value.get()); + + if(!prop) + throw std::bad_cast(); + + declHandler_ = &(prop->get()); + } + if(name == properties_.lexicalHandler) + { + setLexicalHandlerT* prop = dynamic_cast(value.get()); + + if(!prop) + throw std::bad_cast(); + + lexicalHandler_ = &(prop->get()); + } + + throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptor::asStdString(name)); +} // doSetProperty + +template +typename XML::QualifiedName::string_adaptor> libxml2_wrapper::processName(const string_type& qName, bool isAttribute) +{ + qualifiedNameT p = nsSupport_.processName(qName, isAttribute); + if(string_adaptor::empty(p.namespaceUri()) && !string_adaptor::empty(p.prefix())) + reportError(std::string("Undeclared prefix ") + string_adaptor::asStdString(qName)); + return p; +} // processName + +template +void libxml2_wrapper::reportError(const std::string& message, bool fatal) +{ + if(!errorHandler_) + return; + + SAXParseExceptionT e(message, *this); + if(fatal) + errorHandler_->fatalError(e); + else + errorHandler_->error(e); +} // reportError + +template +void libxml2_wrapper::checkNotParsing(const string_type& type, const string_type& name) const +{ + if(parsing_) + { + std::ostringstream os; + os << "Can't change " << string_adaptor::asStdString(type) << " " << string_adaptor::asStdString(name) << " while parsing"; + throw SAX::SAXNotSupportedException(os.str()); + } // if(parsing_) +} // checkNotParsing + +template +string_type libxml2_wrapper::getPublicId() const +{ + if(locator_) + return string_adaptor::construct_from_utf8(reinterpret_cast(locator_->getPublicId(context_))); + return string_type(); +} // getPublicId + +template +string_type libxml2_wrapper::getSystemId() const +{ + if(locator_) + return string_adaptor::construct_from_utf8(reinterpret_cast(locator_->getSystemId(context_))); + return string_type(); +} // getSystemId + +template +size_t libxml2_wrapper::getLineNumber() const +{ + if(locator_) + return locator_->getLineNumber(context_); + return -1; +} // getLineNumber + +template +size_t libxml2_wrapper::getColumnNumber() const +{ + if(locator_) + return locator_->getColumnNumber(context_); + return -1; +} // getColumnNumber + +template +void libxml2_wrapper::parse(inputSourceT& source) +{ + if(contentHandler_) + contentHandler_->setDocumentLocator(*this); + + InputSourceResolver is(source, string_adaptor()); + if(is.resolve() == 0) + return; + + parsing_ = true; + + while(!is.resolve()->eof()) + { + char buffer[4096]; + is.resolve()->read(buffer, sizeof(buffer)); + xmlParseChunk(context_, buffer, (int)is.resolve()->gcount(), is.resolve()->eof()); + } // while(!in.eof()) + + xmlCtxtResetPush(context_, 0, 0, 0, 0); + + parsing_ = false; +} // parse + +template +void libxml2_wrapper::SAXstartDocument() +{ + if(isInCData_) + SAXendCdataSection(); + + if(contentHandler_) + contentHandler_->startDocument(); +} // SAXstartDocument + +template +void libxml2_wrapper::SAXendDocument() +{ + if(isInCData_) + SAXendCdataSection(); + + if(contentHandler_) + contentHandler_->endDocument(); +} // SAXendDocument + +template +void libxml2_wrapper::SAXcharacters(const xmlChar* ch, int len) +{ + if(isInCData_) + SAXendCdataSection(); + + if(contentHandler_) + contentHandler_->characters(string_adaptor::construct_from_utf8(reinterpret_cast(ch), len)); +} // SAXcharacters + +template +void libxml2_wrapper::SAXcdata(const xmlChar* ch, int len) +{ + if(contentHandler_) + contentHandler_->characters(string_adaptor::construct_from_utf8(reinterpret_cast(ch), len)); +} // SAXcdata + +template +void libxml2_wrapper::SAXignorableWhitespace(const xmlChar* ch, int len) +{ + if(contentHandler_) + contentHandler_->ignorableWhitespace(string_adaptor::construct_from_utf8(reinterpret_cast(ch), len)); +} // SAXignorableWhitespace + +template +void libxml2_wrapper::SAXwarning(const std::string& warning) +{ + if(errorHandler_) + errorHandler_->warning(SAXParseExceptionT(warning, *this)); +} // warning + +template +void libxml2_wrapper::SAXerror(const std::string& error) +{ + if(errorHandler_) + errorHandler_->error(SAXParseExceptionT(error, *this)); +} // error + +template +void libxml2_wrapper::SAXfatalError(const std::string& fatal) +{ + if(errorHandler_) + errorHandler_->fatalError(SAXParseExceptionT(fatal, *this)); +} // fatal + +template +void libxml2_wrapper::SAXprocessingInstruction(const xmlChar* target, const xmlChar* data) +{ + if(isInCData_) + SAXendCdataSection(); + + if(contentHandler_) + contentHandler_->processingInstruction(string_adaptor::construct_from_utf8(reinterpret_cast(target)), + string_adaptor::construct_from_utf8(reinterpret_cast(data))); +} // SAXprocessingInstruction + +template +void libxml2_wrapper::SAXcomment(const xmlChar* comment) +{ + if(isInCData_) + SAXendCdataSection(); + + if(lexicalHandler_) + lexicalHandler_->comment(string_adaptor::construct_from_utf8(reinterpret_cast(comment))); +} // SAXcomment + +template +void libxml2_wrapper::SAXstartCdataSection() +{ + if (isInCData_) + return; + + isInCData_ = true; + if(lexicalHandler_) + lexicalHandler_->startCDATA(); +} // startCdataSection + +template +void libxml2_wrapper::SAXendCdataSection() +{ + if (!isInCData_) + return; + + if(lexicalHandler_) + lexicalHandler_->endCDATA(); + isInCData_ = false; +} // endCdataSection + +template +void libxml2_wrapper::SAXstartElement(const xmlChar* qName, const xmlChar** atts) +{ + + if(isInCData_) + SAXendCdataSection(); + + if(!contentHandler_) + return; + + if(!namespaces_) + { + SAXstartElementNoNS(qName, atts); + return; + } // if(!namespaces) + + // OK we're doing Namespaces + nsSupport_.pushContext(); + SAX::AttributesImpl attributes; + + // take a first pass and copy all the attributes, noting any declarations + if(atts && *atts != 0) + { + const xmlChar** a1 = atts; + while(*a1 != 0) + { + string_type attQName = string_adaptor::construct_from_utf8(reinterpret_cast(*a1++)); + string_type value = string_adaptor::construct_from_utf8(reinterpret_cast(*a1++)); + + // declaration? + if(string_adaptor::find(attQName, nsc_.xmlns) == 0) + { + string_type prefix; + typename string_adaptor::size_type n = string_adaptor::find(attQName, nsc_.colon); + if(n != string_adaptor::npos()) + prefix = string_adaptor::construct(string_adaptor::begin(attQName) + n + 1, string_adaptor::end(attQName)); + if(!nsSupport_.declarePrefix(prefix, value)) + reportError(std::string("Illegal Namespace prefix ") + string_adaptor::asStdString(prefix)); + contentHandler_->startPrefixMapping(prefix, value); + if(prefixes_) + attributes.addAttribute(emptyString_, + emptyString_, + attQName, + attributeTypeT::CDATA, + value); + } + } // while + + while(*atts != 0) + { + string_type attQName = string_adaptor::construct_from_utf8(reinterpret_cast(*atts++)); + string_type value = string_adaptor::construct_from_utf8(reinterpret_cast(*atts++)); + + // declaration? + if(string_adaptor::find(attQName, nsc_.xmlns) != 0) + { + qualifiedNameT attName = processName(attQName, true); + attributes.addAttribute(attName.namespaceUri(), + attName.localName(), + attName.rawName(), + attributeTypeT::CDATA, + value); + } + } // while ... + } // if ... + + // at last! report the event + qualifiedNameT name = processName(string_adaptor::construct_from_utf8(reinterpret_cast(qName)), false); + contentHandler_->startElement(name.namespaceUri(), + name.localName(), + name.rawName(), + attributes); +} // SAXstartElement + +template +void libxml2_wrapper::SAXstartElementNoNS(const xmlChar* qName, const xmlChar** atts) +{ + SAX::AttributesImpl attributes; + + if(isInCData_) + SAXendCdataSection(); + + if(atts && *atts != 0) + { + while(*atts != 0) + { + string_type attQName = string_adaptor::construct_from_utf8(reinterpret_cast(*atts++)); + string_type value = string_adaptor::construct_from_utf8(reinterpret_cast(*atts++)); + + attributes.addAttribute(emptyString_, + emptyString_, + attQName, + attributeTypeT::CDATA, + value); + } // while .. + } // if ... + + contentHandler_->startElement(emptyString_, emptyString_, string_adaptor::construct_from_utf8((reinterpret_cast(qName))), attributes); +} // SAXstartElementNoNS + +template +void libxml2_wrapper::SAXendElement(const xmlChar* qName) +{ + if(isInCData_) + SAXendCdataSection(); + + if(!contentHandler_) + return; + + if(!namespaces_) + { + SAXendElementNoNS(qName); + return; + } // if(!namespaces_) + + qualifiedNameT name = processName(string_adaptor::construct_from_utf8(reinterpret_cast(qName)), false); + contentHandler_->endElement(name.namespaceUri(), + name.localName(), + name.rawName()); + typename NamespaceSupport::stringListT prefixes = nsSupport_.getDeclaredPrefixes(); + for(size_t i = 0, end = prefixes.size(); i < end; ++i) + contentHandler_->endPrefixMapping(prefixes[i]); + nsSupport_.popContext(); +} // SAXendElement + +template +void libxml2_wrapper::SAXendElementNoNS(const xmlChar* qName) +{ + if(isInCData_) + SAXendCdataSection(); + + if(contentHandler_) + contentHandler_->endElement(emptyString_, emptyString_, string_adaptor::construct_from_utf8(reinterpret_cast(qName))); +} // SAXendElementNoNS + +template +void libxml2_wrapper::SAXnotationDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) +{ + if(isInCData_) + SAXendCdataSection(); + + if(dtdHandler_) + dtdHandler_->notationDecl(string_adaptor::construct_from_utf8(reinterpret_cast(name)), + string_adaptor::construct_from_utf8(reinterpret_cast(publicId)), + string_adaptor::construct_from_utf8(reinterpret_cast(systemId))); +} // SAXnotationDecl + +template +void libxml2_wrapper::SAXunparsedEntityDecl(const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId, const xmlChar *notationName) +{ + if(isInCData_) + SAXendCdataSection(); + + if(dtdHandler_) + dtdHandler_->unparsedEntityDecl(string_adaptor::construct_from_utf8(reinterpret_cast(name)), + string_adaptor::construct_from_utf8(reinterpret_cast(publicId)), + string_adaptor::construct_from_utf8(reinterpret_cast(systemId)), + string_adaptor::construct_from_utf8(reinterpret_cast(notationName))); +} // SAXunparsedEntityDecl + +template +void libxml2_wrapper::SAXelementDecl(const xmlChar* name, int type, xmlElementContentPtr content) +{ + if(isInCData_) + SAXendCdataSection(); + + if(!declHandler_) + return; + + std::ostringstream os; + convertXML_Content(os, type, content, false); + declHandler_->elementDecl(string_adaptor::construct_from_utf8(reinterpret_cast(name)), string_adaptor::construct_from_utf8(os.str().c_str())); +} // elementDeclaration + +template +void libxml2_wrapper::convertXML_Content(std::ostream& os, int type, xmlElementContentPtr model, bool isChild) const +{ + char concatenator = ' '; + + switch(type) + { + case XML_ELEMENT_TYPE_EMPTY: + os << "EMPTY"; + break; + case XML_ELEMENT_TYPE_ANY: + os << "ANY"; + return; + case XML_ELEMENT_TYPE_MIXED: + if(model->c1 == 0) + os << "(#PCDATA)"; + else + os << "(#PCDATA"; + concatenator = '|'; + break; + case XML_ELEMENT_TYPE_ELEMENT: + break; + } // switch + + switch(model->type) + { + case XML_ELEMENT_CONTENT_ELEMENT: + if(!isChild) + os << '(' << model->name << ')'; + else + os << model->name; + break; + case XML_ELEMENT_CONTENT_SEQ: + concatenator = ','; + break; + case XML_ELEMENT_CONTENT_OR: + concatenator = '|'; + break; + case XML_ELEMENT_CONTENT_PCDATA: + break; + } // switch + + // do children here + if(model->c1 != 0) + { + if(!isChild) + os << '('; + convertXML_Content(os, XML_ELEMENT_TYPE_ELEMENT, model->c1, true); + if(model->c2 != 0) + { + os << concatenator; + convertXML_Content(os, XML_ELEMENT_TYPE_ELEMENT, model->c2, true); + } // if ... + if(!isChild) + os << ')'; + } // if ... + + switch(model->ocur) + { + case XML_ELEMENT_CONTENT_ONCE: + break; + case XML_ELEMENT_CONTENT_OPT: + os << "?"; + break; + case XML_ELEMENT_CONTENT_MULT: + os << "*"; + break; + case XML_ELEMENT_CONTENT_PLUS: + os << "+"; + break; + } // switch +} // convertXML_Content + +template +void libxml2_wrapper::SAXattributeDecl(const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) +{ + if(isInCData_) + SAXendCdataSection(); + + if(!declHandler_) + return; + + const string_type* defType = &attrDefaults_.implied; + if(def) + defType = (defaultValue) ? &attrDefaults_.fixed : &attrDefaults_.required; + + string_type typeStr; + switch(type) + { + case XML_ATTRIBUTE_CDATA: + typeStr = attrTypes_.cdata; + break; + case XML_ATTRIBUTE_ID: + typeStr = attrTypes_.id; + break; + case XML_ATTRIBUTE_IDREF : + typeStr = attrTypes_.idref; + break; + case XML_ATTRIBUTE_IDREFS: + typeStr = attrTypes_.idrefs; + break; + case XML_ATTRIBUTE_ENTITY: + typeStr = attrTypes_.entity; + break; + case XML_ATTRIBUTE_ENTITIES: + typeStr = attrTypes_.entities; + break; + case XML_ATTRIBUTE_NMTOKEN: + typeStr = attrTypes_.nmtoken; + break; + case XML_ATTRIBUTE_NMTOKENS: + typeStr = attrTypes_.nmtokens; + break; + case XML_ATTRIBUTE_ENUMERATION: + typeStr = stringAttrEnum(tree, false); + break; + case XML_ATTRIBUTE_NOTATION: + string_adaptor::append(typeStr, attrTypes_.notation); + string_adaptor::append(typeStr, stringAttrEnum(tree, true)); + break; + } // switch(type) + + declHandler_->attributeDecl(string_adaptor::construct_from_utf8(reinterpret_cast(elem)), + string_adaptor::construct_from_utf8(reinterpret_cast(fullname)), + typeStr, + *defType, + string_adaptor::construct_from_utf8(reinterpret_cast(defaultValue))); +} // SAXattributeDecl + +template +string_type libxml2_wrapper::stringAttrEnum(xmlEnumerationPtr tree, bool leadingSpace) const +{ + std::ostringstream os; + if(leadingSpace) + os << " "; + os << "("; + while(tree) + { + os << tree->name; + tree = tree->next; + if(tree) + os << " | "; + } // while + os << ")"; + + return string_adaptor::construct_from_utf8(os.str().c_str()); +} // stringAttrEnum + +template +void libxml2_wrapper::SAXentityDecl(const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) +{ + if(isInCData_) + SAXendCdataSection(); + + if(!declHandler_) + return; + + switch(type) + { + case 1: // internal + declHandler_->internalEntityDecl(string_adaptor::construct_from_utf8(reinterpret_cast(name)), + string_adaptor::construct_from_utf8(reinterpret_cast(content))); + break; + case 2: // external + declHandler_->externalEntityDecl(string_adaptor::construct_from_utf8(reinterpret_cast(name)), + string_adaptor::construct_from_utf8(reinterpret_cast(publicId)), + string_adaptor::construct_from_utf8(reinterpret_cast(systemId))); + break; + } // switch +} // SAXentityDecl + +template +xmlParserInputPtr libxml2_wrapper::SAXresolveEntity(const xmlChar* publicId, const xmlChar* systemId) +{ + if(!entityResolver_) + return xmlLoadExternalEntity(reinterpret_cast(systemId), + reinterpret_cast(publicId), + context_); + return 0; +} // SAXresolveEntity + + +} // namespace SAX +} // namespace Arabica + +#endif diff --git a/arabica/include/Taggle/Taggle.hpp b/arabica/include/Taggle/Taggle.hpp new file mode 100644 index 000000000..070e3a6e3 --- /dev/null +++ b/arabica/include/Taggle/Taggle.hpp @@ -0,0 +1,13 @@ +#ifndef ARABICA_TAGGLE_TAGGLE_HPP +#define ARABICA_TAGGLE_TAGGLE_HPP + +#include "impl/ScanHandler.hpp" +#include "impl/ElementType.hpp" +#include "impl/Element.hpp" +#include "impl/Schema.hpp" +#include "impl/html/HTMLModels.hpp" +#include "impl/html/HTMLScanner.hpp" +#include "impl/html/HTMLSchema.hpp" +#include "impl/Parser.hpp" + +#endif diff --git a/arabica/include/Taggle/impl/Element.hpp b/arabica/include/Taggle/impl/Element.hpp new file mode 100755 index 000000000..7b28ec6b8 --- /dev/null +++ b/arabica/include/Taggle/impl/Element.hpp @@ -0,0 +1,363 @@ +#ifndef ARABICA_SAX_TAGSOUP_ELEMENT_HPP +#define ARABICA_SAX_TAGSOUP_ELEMENT_HPP + +#include +#include +#include "ElementType.hpp" + +namespace Arabica +{ + +namespace SAX +{ + +/** + The internal representation of an actual element (not an element type). + An Element has an element type, attributes, and a successor Element + for use in constructing stacks and queues of Elements. + @see ElementType + @see AttributesImpl + + Based on code from John Cowan's super TagSoup package +*/ + +class Element_impl; + +class Element +{ +public: + static const Element Null; + + Element(ElementType& type, bool defaultAttributes); + Element(const Element& rhs); + ~Element(); + + Element& operator=(const Element& rhs); + bool operator==(const Element& rhs) const; + bool operator!=(const Element& rhs) const; + + /** + Return the element type. + @return The element type. + */ + const ElementType& type() const; + + /** + Return the attributes as an AttributesImpl object. + @return The attributes + @see AttributesImpl + */ + const AttributesImpl& atts() const; + + /** + return the next element in the element stack or queue + @return the next element + */ + Element next() const; + + /** + Change the next element in an element stack or queue. + @param next The new next element + */ + void setNext(const Element& next); + + /** + Return the name of the element's type. + Convenience method. + @return the element type name + */ + std::string name() const; + + + /** + Return the namespace name of the element's type. + Convenience method. + @return The element type namespace name + */ + std::string namespaceName() const; + + /** + Return the local name of the element's type. + Convenience method. + @return The element type local name + */ + std::string localName() const; + + /** + Return the content model vector of the element's type. + Convenience method. + @return The content model vector + */ + int model() const; + + + /** + Return the member-of vector of the element's type. + Convenience method. + @return The member-of vector + */ + int memberOf() const; + + /** + Return the flags vector of the element's type. + Convenience method. + @return The flags vector + */ + int flags() const; + + /** + Return the parent element type of the element's type + Convenience method + @return the parent element type + */ + ElementType& parent() const; + + /** + Return true if the type of this element can contain the type of + another element. + Convenience method. + @param other The other element + */ + bool canContain(const Element& other) const; + + /** + Set an attribute and its value into this element. + @param name The attribute name (Qname) + @param type The attribute type + @param value The attribute value + */ + void setAttribute(const std::string& name, const std::string& type, const std::string& value); + + /** + Make this element anonymous. + Remove any id or name attribute present + in the element's attributes. + */ + void anonymize(); + + /** + Clean the attributes of this element. + Attributes with null name (the name was ill-formed) + or null value (the attribute was present in the element type but + not in this actual element) are removed. + */ + void clean(); + + /** + Force this element to preclosed status, meaning that an end-tag has + been seen but the element cannot yet be closed for structural reasons. + */ + void preclose(); + + /** + Return true if this element has been preclosed. + */ + bool isPreclosed() const; + +private: + Element() : impl_(0) { } + bool is_null() const { return impl_ == 0; } + + Element_impl* impl_; + + friend class Element_impl; +}; // class Element + +class Element_impl +{ +private: + ElementType* type_; // type of element + AttributesImpl atts_; // attributes of element + Element next_; // successor of element + bool preclosed_; // this element has been preclosed + int refCount_; + +public: + /** + Return an Element from a specified ElementType. + @param type The element type of the newly constructed element + @param defaultAttributes True if default attributes are wanted + */ + Element_impl(ElementType& type, bool defaultAttributes) : + type_(&type), + atts_(), + next_(), + preclosed_(false), + refCount_(1) + { + if (defaultAttributes) + atts_ = type.atts(); + } // Element_impl + + const ElementType& type() const { return *type_; } + const AttributesImpl& atts() const { return atts_; } + + Element next() const + { + if(next_.is_null()) + return Element::Null; + return next_; + } // next() + void setNext(const Element& next) { next_ = next; } + + std::string name() const { return type_->name(); } + std::string namespaceName() const { return type_->namespaceName(); } + std::string localName() const { return type_->localName(); } + int model() const { return type_->model(); } + int memberOf() const { return type_->memberOf(); } + int flags() const { return type_->flags(); } + ElementType& parent() const { return type_->parent(); } + bool canContain(const Element_impl* const other) const { return type_->canContain(*(other->type_)); } + + void setAttribute(const std::string& name, const std::string& type, const std::string& value) + { + type_->setAttribute(atts_, name, type, value); + } // setAttribute + + void anonymize() + { + for (int i = atts_.getLength() - 1; i >= 0; i--) + { + if((atts_.getType(i) == "ID") || (atts_.getQName(i) == "name")) + atts_.removeAttribute(i); + } // for ... + } // anonymize + + void clean() + { + for (int i = atts_.getLength() - 1; i >= 0; i--) + { + const std::string& name = atts_.getLocalName(i); + if (atts_.getValue(i) == "" || name == "" || name.length() == 0) + { + atts_.removeAttribute(i); + continue; + } // if ... + } // for ... + } // clean + + void preclose() + { + preclosed_ = true; + } // preclose + + bool isPreclosed() const + { + return preclosed_; + } // isPreclosed + + void add_ref() + { + ++refCount_; + } // add_ref + + void remove_ref() + { + --refCount_; + if(refCount_ == 0) + delete this; + } // remove_ref + +private: + Element_impl(); + + ~Element_impl() + { + } // ~Element_impl + + + Element_impl(const Element_impl& rhs); + Element_impl& operator=(const Element_impl& rhs); + bool operator==(const Element_impl& rhs) const; + bool operator!=(const Element_impl& rhs) const; +}; // class Element_impl + +const Element Element::Null = Element(ElementType::Null, false); + +////////////////////////////////////////////// +Element::Element(const Element& rhs) : + impl_(rhs.impl_) +{ + impl_->add_ref(); +} // Element + +Element::Element(ElementType& type, bool defaultAttributes) : + impl_(new Element_impl(type, defaultAttributes)) +{ +} // Element + +Element::~Element() +{ + if(impl_) + impl_->remove_ref(); +} // ~Element + +Element& Element::operator=(const Element& rhs) +{ + if(impl_ == rhs.impl_) + return *this; + + if(impl_) + impl_->remove_ref(); + impl_ = rhs.impl_; + if(impl_) + impl_->add_ref(); + return *this; +} // operator= + +bool Element::operator==(const Element& rhs) const +{ + return impl_ == rhs.impl_; +} // operator== + +bool Element::operator!=(const Element& rhs) const +{ + return !(operator==(rhs)); +} // operator!= + +const ElementType& Element::type() const +{ + return impl_->type(); +} // type + +const AttributesImpl& Element::atts() const +{ + return impl_->atts(); +} // atts + +Element Element::next() const +{ + return impl_->next(); +} // next + +void Element::setNext(const Element& next) +{ + impl_->setNext(next); +} // setNext + +std::string Element::name() const { return impl_->name(); } +std::string Element::namespaceName() const { return impl_->namespaceName(); } +std::string Element::localName() const { return impl_->localName(); } + +int Element::model() const { return impl_->model(); } +int Element::memberOf() const { return impl_->memberOf(); } +int Element::flags() const { return impl_->flags(); } + +ElementType& Element::parent() const { return impl_->parent(); } +bool Element::canContain(const Element& other) const { return impl_->canContain(other.impl_); } + +void Element::setAttribute(const std::string& name, const std::string& type, const std::string& value) +{ + impl_->setAttribute(name, type, value); +} // setAttribute + +void Element::anonymize() { impl_->anonymize(); } +void Element::clean() { impl_->clean(); } +void Element::preclose() { impl_->preclose(); } +bool Element::isPreclosed() const { return impl_->isPreclosed(); } + +} // namespace SAX + +} // namespace Arabica + +#endif diff --git a/arabica/include/Taggle/impl/ElementType.hpp b/arabica/include/Taggle/impl/ElementType.hpp new file mode 100755 index 000000000..cff6e684f --- /dev/null +++ b/arabica/include/Taggle/impl/ElementType.hpp @@ -0,0 +1,333 @@ +#ifndef ARABICA_SAX_ELEMENT_TYPE_HPP +#define ARABICA_SAX_ELEMENT_TYPE_HPP + +#include +#include +#include "Schema.hpp" + +namespace Arabica +{ + +namespace SAX +{ + + +/** +This class represents an element type in the schema. +An element type has a name, a content model vector, a member-of vector, +a flags vector, default attributes, and a schema to which it belongs. + +Based on code from John Cowan's super TagSoup package +@see Schema +*/ +class ElementType +{ +private: + std::string name_; // element type name (Qname) + std::string namespace_; // element type namespace name + std::string localName_; // element type local name + int model_; // bitmap: what the element contains + int memberOf_; // bitmap: what element is contained in + int flags_; // bitmap: element flags + AttributesImpl atts_; // default attributes + ElementType* parent_; // parent of this element type + Schema* schema_; // schema to which this belongs + +public: + static ElementType Null; + +private: + ElementType() : + name_(""), + namespace_(""), + localName_(""), + model_(0), + memberOf_(0), + flags_(0), + atts_(), + parent_(0), + schema_(0) + { + } // ElementType + + /** + Construct an ElementType: + but it's better to use Schema.element() instead. + The content model, member-of, and flags vectors are specified as ints. + @param name The element type name + @param model ORed-together bits representing the content models + allowed in the content of this element type + @param memberOf ORed-together bits representing the content models + to which this element type belongs + @param flags ORed-together bits representing the flags associated + with this element type + @param schema The schema with which this element type will be + associated + */ + ElementType(const std::string& name, int model, int memberOf, int flags, Schema& schema) : + name_(name), + namespace_(), + localName_(), + model_(model), + memberOf_(memberOf), + flags_(flags), + parent_(0), + schema_(&schema) + { + namespace_ = namespaceName(name, false); + localName_ = localName(name); + } // ElementType + + ElementType(const ElementType& rhs) : + name_(rhs.name_), + namespace_(rhs.namespace_), + localName_(rhs.localName_), + model_(rhs.model_), + memberOf_(rhs.memberOf_), + flags_(rhs.flags_), + parent_(rhs.parent_), + schema_(rhs.schema_) + { + } // ElementType + + friend class SchemaImpl; + +public: + /** + Return a namespace name from a Qname. + The attribute flag tells us whether to return an empty namespace + name if there is no prefix, or use the schema default instead. + @param name The Qname + @param attribute True if name is an attribute name + @return The namespace name + **/ + std::string namespaceName(const std::string& name, bool attribute) const + { + size_t colon = name.find(':'); + if (colon == std::string::npos) + return attribute ? "" : schema_->getURI(); + + std::string prefix = name.substr(0, colon); + if (prefix == "xml") + return "http://www.w3.org/XML/1998/namespace"; + else + return "urn:x-prefix:" + prefix; + } // namespaceName + + /** + Return a local name from a Qname. + @param name The Qname + @return The local name + **/ + std::string localName(const std::string& name) const + { + size_t colon = name.find(':'); + if (colon == std::string::npos) + return name; + else + return name.substr(colon+1); + } // localName + + /** + Returns the name of this element type. + @return The name of the element type + */ + std::string name() const { return name_; } + + /** + Returns the namespace name of this element type. + @return The namespace name of the element type + */ + std::string namespaceName() const { return namespace_; } + + /** + Returns the local name of this element type. + @return The local name of the element type + */ + std::string localName() const { return localName_; } + + /** + Returns the content models of this element type. + @return The content models of this element type as a vector of bits + */ + int model() const { return model_; } + + /** + Returns the content models to which this element type belongs. + @return The content models to which this element type belongs as a + vector of bits + */ + int memberOf() const { return memberOf_; } + + /** + Returns the flags associated with this element type. + @return The flags associated with this element type as a vector of bits + */ + int flags() const { return flags_; } + + /** + Returns the default attributes associated with this element type. + Attributes of type CDATA that don't have default values are + typically not included. Other attributes without default values + have an internal value of null. + The return value is an AttributesImpl to allow the caller to mutate + the attributes. + */ + const AttributesImpl& atts() const { return atts_; } + + /** + Returns the parent element type of this element type. + @return The parent element type + */ + ElementType& parent() const + { + return *parent_; + } // parent + + /** + Returns the schema which this element type is associated with. + @return The schema + */ + Schema& schema() const + { + return *schema_; + } // schema + + + /** + Returns true if this element type can contain another element type. + That is, if any of the models in this element's model vector + match any of the models in the other element type's member-of + vector. + @param other The other element type + */ + bool canContain(const ElementType& other) const + { + return (model_ & other.memberOf_) != 0; + } // canContain + + + /** + Sets an attribute and its value into an AttributesImpl object. + Attempts to set a namespace declaration are ignored. + @param atts The AttributesImpl object + @param name The name (Qname) of the attribute + @param type The type of the attribute + @param value The value of the attribute + */ + void setAttribute(AttributesImpl& atts, + const std::string& name, + const std::string& type, + const std::string& value) + { + if (name == "xmlns" || name.find("xmlns:") == 0) + { + return; + } + + std::string namespaceN = namespaceName(name, true); + std::string localN = localName(name); + std::string actualType = type; + std::string actualValue = value; + + int i = atts.getIndex(name); + if (i == -1) + { + if (actualType == "") + actualType = "CDATA"; + if (actualType != "CDATA") + actualValue = Arabica::text::normalize_whitespace >(value); + atts.addAttribute(namespaceN, localN, name, actualType, actualValue); + } + else + { + if (actualType == "") + actualType = atts.getType(i); + if (actualType != ("CDATA")) + actualValue = Arabica::text::normalize_whitespace >(value); + atts.setAttribute(i, namespaceN, localN, name, actualType, actualValue); + } + } // setAttribute + + /** + Sets an attribute and its value into this element type. + @param name The name of the attribute + @param type The type of the attribute + @param value The value of the attribute + */ + void setAttribute(const std::string& name, const std::string& type, const std::string& value) + { + setAttribute(atts_, name, type, value); + } // setAttribute + + /** + Sets the models of this element type. + @param model The content models of this element type as a vector of bits + */ + void setModel(int model) + { + model_ = model; + } // setModel + + /** + Sets the content models to which this element type belongs. + @param memberOf The content models to which this element type belongs as a vector of bits + */ + void setMemberOf(int memberOf) + { + memberOf_ = memberOf; + } // setMemberOf + + /** + Sets the flags of this element type. + @param flags associated with this element type The flags as a vector of bits + */ + void setFlags(int flags) + { + flags_ = flags; + } // setFlags + + /** + Sets the parent element type of this element type. + @param parent The parent element type + */ + void setParent(ElementType& parent) + { + parent_ = &parent; + } // setParent + + bool operator==(const ElementType& rhs) const + { + return (name_ == rhs.name_) && + (namespace_ == rhs.namespace_) && + (localName_ == rhs.localName_) && + (model_ == rhs.model_) && + (memberOf_ == rhs.memberOf_) && + (flags_ == rhs.flags_) && + (parent_ == rhs.parent_) && + (schema_ == rhs.schema_); + } // operator == + + ElementType& operator=(const ElementType& rhs) + { + name_ = rhs.name_; + namespace_ = rhs.namespace_; + localName_ = rhs.localName_; + model_ = rhs.model_; + memberOf_ = rhs.memberOf_; + flags_ = rhs.flags_; + atts_ = rhs.atts_; + parent_ = rhs.parent_; + schema_ = rhs.schema_; + + return *this; + } // operator= +}; // class ElementType + +ElementType ElementType::Null; + +} // namespace SAX + +} // namespace Arabica + +#endif diff --git a/arabica/include/Taggle/impl/Parser.hpp b/arabica/include/Taggle/impl/Parser.hpp new file mode 100644 index 000000000..a6630540d --- /dev/null +++ b/arabica/include/Taggle/impl/Parser.hpp @@ -0,0 +1,1389 @@ +#ifndef ARABICA_SAX_TAGGLE_PARSER_HPP +#define ARABICA_SAX_TAGGLE_PARSER_HPP + + +#include +#include +#include +#include +#include +#include +#include +#include +#include "ScanHandler.hpp" + +namespace Arabica +{ + +namespace SAX +{ + +/** +The Taggle SAX parser class. + +Based on code from John Cowan's super TagSoup package +**/ +template > +class Taggle : + public XMLReaderInterface, + private DefaultHandler, + private ScanHandler +{ +public: + typedef XMLReaderInterface XMLReaderT; + typedef typename XMLReaderT::string_adaptor string_adaptor; + typedef ContentHandler ContentHandlerT; + typedef LexicalHandler LexicalHandlerT; + typedef DeclHandler DeclHandlerT; + typedef DTDHandler DTDHandlerT; + typedef ErrorHandler ErrorHandlerT; + typedef EntityResolver EntityResolverT; + typedef InputSource InputSourceT; + typedef Locator LocatorT; + + + /** + A value of "true" indicates namespace URIs and unprefixed local + names for element and attribute names will be available. + **/ + static const string_type namespacesFeature; + + /** + A value of "true" indicates that XML qualified names (with prefixes) + and attributes (including xmlns* attributes) will be available. + We don't support this value. + **/ + static const string_type namespacePrefixesFeature; + + /** + Reports whether this parser processes external general entities + (it doesn't). + **/ + static const string_type externalGeneralEntitiesFeature; + + /** + Reports whether this parser processes external parameter entities + (it doesn't). + **/ + static const string_type externalParameterEntitiesFeature; + + /** + May be examined only during a parse, after the startDocument() + callback has been completed; read-only. The value is true if + the document specified standalone="yes" in its XML declaration, + and otherwise is false. (It's always false.) + **/ + static const string_type isStandaloneFeature; + + /** + A value of "true" indicates that the LexicalHandler will report + the beginning and end of parameter entities (it won't). + **/ + static const string_type lexicalHandlerParameterEntitiesFeature; + + /** + A value of "true" indicates that system IDs in declarations will + be absolutized (relative to their base URIs) before reporting. + (This returns true but doesn't actually do anything.) + **/ + static const string_type resolveDTDURIsFeature; + + /** + Has a value of "true" if all XML names (for elements, + prefixes, attributes, entities, notations, and local + names), as well as Namespace URIs, will have been interned + using java.lang.String.intern. This supports fast testing of + equality/inequality against string constants, rather than forcing + slower calls to String.equals(). (We always intern.) + **/ + static const string_type stringInterningFeature; + + /** + Returns "true" if the Attributes objects passed by this + parser in ContentHandler.startElement() implement the + org.xml.sax.ext.Attributes2 interface. (They don't.) + **/ + static const string_type useAttributes2Feature; + + /** + Returns "true" if the Locator objects passed by this parser + in ContentHandler.setDocumentLocator() implement the + org.xml.sax.ext.Locator2 interface. (They don't.) + **/ + static const string_type useLocator2Feature; + + /** + Returns "true" if, when setEntityResolver is given an object + implementing the org.xml.sax.ext.EntityResolver2 interface, + those new methods will be used. (They won't be.) + **/ + static const string_type useEntityResolver2Feature; + + /** + Controls whether the parser is reporting all validity errors + (We don't report any validity errors.) + **/ + static const string_type validationFeature; + + /** + Controls whether the parser reports Unicode normalization + errors as described in section 2.13 and Appendix B of the XML + 1.1 Recommendation. (We don't normalize.) + **/ + static const string_type unicodeNormalizationCheckingFeature; + + /** + Controls whether, when the namespace-prefixes feature is set, + the parser treats namespace declaration attributes as being in + the http://www.w3.org/2000/xmlns/ namespace. (It doesn't.) + **/ + static const string_type xmlnsURIsFeature; + + /** + Returns "true" if the parser supports both XML 1.1 and XML 1.0. + (Always false.) + **/ + static const string_type XML11Feature; + + /** + A value of "true" indicates that the parser will ignore + unknown elements. + **/ + static const string_type ignoreBogonsFeature; + + /** + A value of "true" indicates that the parser will give unknown + elements a content model of EMPTY; a value of "false", a + content model of ANY. + **/ + static const string_type bogonsEmptyFeature; + + /** + A value of "true" indicates that the parser will allow unknown + elements to be the root element. + **/ + static const string_type rootBogonsFeature; + + /** + A value of "true" indicates that the parser will return default + attribute values for missing attributes that have default values. + **/ + static const string_type defaultAttributesFeature; + + /** + A value of "true" indicates that the parser will + translate colons into underscores in names. + **/ + static const string_type translateColonsFeature; + + /** + A value of "true" indicates that the parser will + attempt to restart the restartable elements. + **/ + static const string_type restartElementsFeature; + + /** + A value of "true" indicates that the parser will + transmit whitespace in element-only content via the SAX + ignorableWhitespace callback. Normally this is not done, + because HTML is an SGML application and SGML suppresses + such whitespace. + **/ + static const string_type ignorableWhitespaceFeature; + + /** + A value of "true" indicates that the parser will treat CDATA + elements specially. Normally true, since the input is by + default HTML. + **/ + static const string_type CDATAElementsFeature; + + /** + Used to see some syntax events that are essential in some + applications: comments, CDATA delimiters, selected general + entity inclusions, and the start and end of the DTD (and + declaration of document element name). The Object must implement + org.xml.sax.ext.LexicalHandler. + **/ + static const string_type lexicalHandlerProperty; + + /** + Specifies the Scanner object this Parser uses. + **/ + static const string_type scannerProperty; + + /** + Specifies the Schema object this Parser uses. + **/ + static const string_type schemaProperty; + + /** + Specifies the AutoDetector (for encoding detection) this Parser uses. + **/ + static const string_type autoDetectorProperty; + +private: + // Default values for feature flags + static bool DEFAULT_NAMESPACES; + static bool DEFAULT_IGNORE_BOGONS; + static bool DEFAULT_BOGONS_EMPTY; + static bool DEFAULT_ROOT_BOGONS; + static bool DEFAULT_DEFAULT_ATTRIBUTES; + static bool DEFAULT_TRANSLATE_COLONS; + static bool DEFAULT_RESTART_ELEMENTS; + static bool DEFAULT_IGNORABLE_WHITESPACE; + static bool DEFAULT_CDATA_ELEMENTS; + + static const string_type legal; + + typedef std::map FeatureMapT; + + // XMLReader implementation + ContentHandlerT* contentHandler_; + LexicalHandlerT* lexicalHandler_; + DTDHandlerT* dtdHandler_; + ErrorHandlerT* errorHandler_; + EntityResolverT* entityResolver_; + Schema* schema_; + bool ownSchema_; + Scanner* scanner_; + bool ownScanner_; + FeatureMapT features_; + Element newElement_; + std::string attributeName_; + bool doctypeIsPresent_; + std::string doctypePublicId_; + std::string doctypeSystemId_; + std::string doctypeName_; + std::string piTarget_; + Element stack_; + Element saved_; + Element pcdata_; + int entity_; + + // Feature flags. + bool namespaces; + bool ignoreBogons; + bool bogonsEmpty; + bool rootBogons; + bool defaultAttributes; + bool translateColons; + bool restartElements; + bool ignorableWhitespace; + bool CDATAElements; + bool virginStack; + +public: + Taggle() : + contentHandler_(0), + lexicalHandler_(0), + dtdHandler_(0), + errorHandler_(0), + entityResolver_(0), + schema_(0), + ownSchema_(false), + scanner_(0), + ownScanner_(false), + features_(initialFeatures()), + newElement_(Element::Null), + attributeName_(), + doctypeIsPresent_(false), + doctypePublicId_(), + doctypeSystemId_(), + doctypeName_(), + piTarget_(), + stack_(Element::Null), + saved_(Element::Null), + pcdata_(Element::Null), + entity_(0), + namespaces(DEFAULT_NAMESPACES), + ignoreBogons(DEFAULT_IGNORE_BOGONS), + bogonsEmpty(DEFAULT_BOGONS_EMPTY), + rootBogons(DEFAULT_ROOT_BOGONS), + defaultAttributes(DEFAULT_DEFAULT_ATTRIBUTES), + translateColons(DEFAULT_TRANSLATE_COLONS), + restartElements(DEFAULT_RESTART_ELEMENTS), + ignorableWhitespace(DEFAULT_IGNORABLE_WHITESPACE), + CDATAElements(DEFAULT_CDATA_ELEMENTS), + virginStack(true) + { + contentHandler_ = this; + lexicalHandler_ = this; + dtdHandler_ = this; + errorHandler_ = this; + entityResolver_ = this; + } // Taggle + + ~Taggle() + { + if(ownSchema_) + delete schema_; + if(ownScanner_) + delete scanner_; + } // ~Taggle + +private: + static FeatureMapT initialFeatures() + { + FeatureMapT features; + features[namespacesFeature] = DEFAULT_NAMESPACES; + features[namespacePrefixesFeature] = false; + features[externalGeneralEntitiesFeature] = false; + features[externalParameterEntitiesFeature] = false; + features[isStandaloneFeature] = false; + features[lexicalHandlerParameterEntitiesFeature] = false; + features[resolveDTDURIsFeature] = true; + features[stringInterningFeature] = true; + features[useAttributes2Feature] = false; + features[useLocator2Feature] = false; + features[useEntityResolver2Feature] = false; + features[validationFeature] = false; + features[xmlnsURIsFeature] = false; + features[xmlnsURIsFeature] = false; + features[XML11Feature] = false; + features[ignoreBogonsFeature] = DEFAULT_IGNORE_BOGONS; + features[bogonsEmptyFeature] = DEFAULT_BOGONS_EMPTY; + features[rootBogonsFeature] = DEFAULT_ROOT_BOGONS; + features[defaultAttributesFeature] = DEFAULT_DEFAULT_ATTRIBUTES; + features[translateColonsFeature] = DEFAULT_TRANSLATE_COLONS; + features[restartElementsFeature] = DEFAULT_RESTART_ELEMENTS; + features[ignorableWhitespaceFeature] = DEFAULT_IGNORABLE_WHITESPACE; + features[CDATAElementsFeature] = DEFAULT_CDATA_ELEMENTS; + return features; + } // initialFeatures + +public: + /////////////////////////////////////////////////// + // XMLReader + bool getFeature(const string_type& name) const + { + typename FeatureMapT::const_iterator b = features_.find(name); + if(b == features_.end()) + { + throw SAXNotRecognizedException("Unknown feature " + string_adaptor::asStdString(name)); + } + return b->second; + } // getFeature + + void setFeature(const string_type& name, bool value) + { + typename FeatureMapT::iterator b = features_.find(name); + if(b == features_.end()) + { + throw SAXNotRecognizedException("Unknown feature " + string_adaptor::asStdString(name)); + } + + features_[name] = value; + + if(name == namespacesFeature) + namespaces = value; + else if(name == ignoreBogonsFeature) + ignoreBogons = value; + else if(name == bogonsEmptyFeature) + bogonsEmpty = value; + else if(name == rootBogonsFeature) + rootBogons = value; + else if(name == defaultAttributesFeature) + defaultAttributes = value; + else if(name == translateColonsFeature) + translateColons = value; + else if(name == restartElementsFeature) + restartElements = value; + else if(name == ignorableWhitespaceFeature) + ignorableWhitespace = value; + else if(name == CDATAElementsFeature) + CDATAElements = value; + } // setFeature + + typedef typename XMLReaderInterface::PropertyBase PropertyBaseT; + virtual std::auto_ptr doGetProperty(const string_type& /*name*/) + { + return std::auto_ptr(0); + } // doGetProperty + + virtual void doSetProperty(const string_type& /*name*/, std::auto_ptr /*value*/) + { + } // doSetProperty + + /* + Object getProperty (std::string name) + { + if(name.equals(lexicalHandlerProperty)) + { + return lexicalHandler_ == this ? null : lexicalHandler_; + } + else if(name.equals(scannerProperty)) + { + return scanner_; + } + else if(name.equals(schemaProperty)) + { + return schema_; + } + else if(name.equals(autoDetectorProperty)) + { + return theAutoDetector; + } + else + { + throw new SAXNotRecognizedException("Unknown property " + name); + } + } // getProperty + + void setProperty (std::string name, Object value) + { + if(name.equals(lexicalHandlerProperty)) + { + if(value == null) + { + lexicalHandler_ = this; + } + else if(value instanceof LexicalHandler) + { + lexicalHandler_ = (LexicalHandler)value; + } + else + { + throw new SAXNotSupportedException("Your lexical handler is not a LexicalHandler"); + } + } + else if(name.equals(scannerProperty)) + { + if(value instanceof Scanner) { + scanner_ = (Scanner)value; + } + else { + throw new SAXNotSupportedException("Your scanner is not a Scanner"); + } + } + else if(name.equals(schemaProperty)) { + if(value instanceof Schema) { + schema_ = (Schema)value; + } + else { + throw new SAXNotSupportedException("Your schema is not a Schema"); + } + } + else if(name.equals(autoDetectorProperty)) { + if(value instanceof AutoDetector) { + theAutoDetector = (AutoDetector)value; + } + else { + throw new SAXNotSupportedException("Your auto-detector is not an AutoDetector"); + } + } + else { + throw new SAXNotRecognizedException("Unknown property " + name); + } + } +*/ + + virtual void setEntityResolver(EntityResolverT& resolver) + { + entityResolver_ = &resolver; + } // setEntityResolver + + virtual EntityResolverT* getEntityResolver() const + { + return (entityResolver_ == this) ? 0 : entityResolver_; + } // getEntityResolver + + virtual void setDTDHandler(DTDHandlerT& handler) + { + dtdHandler_ = &handler; + } // setDTDHandler + + virtual DTDHandlerT* getDTDHandler() const + { + return (dtdHandler_ == this) ? 0 : dtdHandler_; + } // getDTDHandler + + virtual void setContentHandler(ContentHandlerT& handler) + { + contentHandler_ = &handler; + } // setContentHandler + + virtual ContentHandlerT* getContentHandler() const + { + return (contentHandler_ == this) ? 0 : contentHandler_; + } // getContentHandler + + virtual void setErrorHandler(ErrorHandlerT& handler) + { + errorHandler_ = &handler; + } // setErrorHandler + + virtual ErrorHandlerT* getErrorHandler() const + { + return (errorHandler_ == this) ? 0 : errorHandler_; + } // getErrorHandler + + virtual void setDeclHandler(DeclHandlerT& /*handler*/) + { + } // setDeclHandler + + virtual DeclHandlerT* getDeclHandler() const + { + return 0; + } // getDeclHandler + + virtual void setLexicalHandler(LexicalHandlerT& handler) + { + lexicalHandler_ = &handler; + } // setLexicalHandler + + virtual LexicalHandlerT* getLexicalHandler() const + { + return (lexicalHandler_ == this) ? 0 : lexicalHandler_; + } // getLexicalHandler + + virtual void parse(InputSourceT& input) + { + setup(); + + InputSourceResolver is(input, string_adaptor()); + if(is.resolve() == 0) + { + reportError("Could not resolve XML document", true); + return; + } // if(is.resolver() == 0) + + contentHandler_->startDocument(); + scanner_->resetDocumentLocator(string_adaptor::asStdString(input.getPublicId()), string_adaptor::asStdString(input.getSystemId())); + + if(dynamic_cast(scanner_) != 0) + contentHandler_->setDocumentLocator(*(dynamic_cast(scanner_))); + + if(schema_->getURI() != "") + contentHandler_->startPrefixMapping(S(schema_->getPrefix()), + S(schema_->getURI())); + scanner_->scan(*is.resolve(), *this); + } // parse + +private: + // Sets up instance variables that haven't been set by setFeature + void setup() + { + if(schema_ && ownSchema_) + { + delete schema_; + schema_ = 0; + } // if ... + if(schema_ == 0) + { + schema_ = new HTMLSchema(); + ownSchema_ = true; + } // if ... + + if(scanner_ && ownScanner_) + { + delete scanner_; + scanner_ = 0; + } // if ... + if(scanner_ == 0) + { + scanner_ = new HTMLScanner(); + ownScanner_ = true; + } // if ... + + stack_ = Element(schema_->getElementType(""), defaultAttributes); + pcdata_ = Element(schema_->getElementType(""), defaultAttributes); + + newElement_ = Element::Null; + attributeName_ = ""; + piTarget_ = ""; + saved_ = Element::Null; + entity_ = 0; + virginStack = true; + doctypeName_ = doctypePublicId_ = doctypeSystemId_ = ""; + } // setup + + /////////////////////////////////////////////////////// + // ScanHandler implementation + virtual void adup(const std::string& /*buff*/) + { + // std::cerr << "adup(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ == Element::Null || attributeName_ == "") + return; + newElement_.setAttribute(attributeName_, "", attributeName_); + attributeName_ = ""; + } // adup + + virtual void aname(const std::string& buff) + { + // std::cerr << "aname(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ == Element::Null) + return; + // Currently we don't rely on Schema to canonicalize + // attribute names. + attributeName_ = lower_case(makeName(buff)); + } // aname + + virtual void aval(const std::string& buff) + { + // std::cerr << "aval(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ == Element::Null || attributeName_ == "") + return; + std::string value = expandEntities(buff); + newElement_.setAttribute(attributeName_, "", value); + attributeName_ = ""; + } // aval + + // Expand entity references in attribute values selectively. + // Currently we expand a reference iff it is properly terminated + // with a semicolon. + std::string expandEntities(std::string src) + { + size_t refStart = std::string::npos; + std::string dst; + for(std::string::const_iterator i = src.begin(), ie = src.end(); i != ie; ++i) + { + char ch = *i; + dst.push_back(ch); + if(ch == '&' && refStart == std::string::npos) + { + // start of a ref excluding & + refStart = dst.length(); + } + else if(refStart == std::string::npos) + { + // not in a ref + } + else if(Arabica::XML::is_letter_or_digit(ch) || ch == '#') + { + // valid entity char + } + else if(ch == ';') + { + // properly terminated ref + int ent = lookupEntity(dst.substr(refStart, dst.size() - refStart - 1)); + if(ent > 0xFFFF) + { + ent -= 0x10000; + dst[refStart - 1] = (char)((ent>>10) + 0xD800); + dst[refStart] = (char)((ent&0x3FF) + 0xDC00); + dst.erase(refStart + 1); + } + else if(ent != 0) + { + dst[refStart - 1] = (char)ent; + dst.erase(refStart); + } + refStart = std::string::npos; + } + else + { + // improperly terminated ref + refStart = std::string::npos; + } // if ... + } // for ... + return std::string(dst, 0, dst.size()); + } // expandEntities + + virtual void entity(const std::string& buff) + { + entity_ = lookupEntity(buff); + } // entity + + // Process numeric character references, + // deferring to the schema for named ones. + int lookupEntity(const std::string& buff) + { + int result = 0; + if(buff.length() < 1) + return result; + + if(buff[0] == '#') + { + const char* b = buff.c_str(); + char* end; + if(buff.length() > 1 && (buff[1] == 'x' || buff[1] == 'X')) + return strtol(b + 2, &end, 16); + return strtol(b + 1, &end, 10); + } + return schema_->getEntity(buff); + } // lookupEntity + + virtual void eof(const std::string& /*buff*/) + { + if(virginStack) + rectify(pcdata_); + while (stack_.next() != Element::Null) + { + pop(); + } + if(schema_->getURI() != "") + contentHandler_->endPrefixMapping(S(schema_->getPrefix())); + contentHandler_->endDocument(); + } // eof + + virtual void etag(const std::string& buff) + { + // std::cerr << "etag(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(etag_cdata(buff)) + return; + etag_basic(buff); + } // etag + + bool etag_cdata(const std::string& buff) + { + std::string currentName = stack_.name(); + // If this is a CDATA element and the tag doesn't match, + // or isn't properly formed (junk after the name), + // restart CDATA mode and process the tag as characters. + if(CDATAElements && (stack_.flags() & Schema::F_CDATA) != 0) + { + bool realTag = (buff.length() == currentName.length()); + if(realTag) + { + std::string buffl = lower_case(buff); + std::string currentl = lower_case(currentName); + for (size_t i = 0; i < buffl.length(); ++i) + { + if(buffl[i] != currentl[i]) + { + realTag = false; + break; + } // if ... + } // for ... + } // if ... + if(!realTag) + { + contentHandler_->characters(S("characters(S(buff)); + contentHandler_->characters(S(">")); + scanner_->startCDATA(); + return true; + } // if ... + } // if ... + return false; + } // etag_cdata + + void etag_basic(const std::string& buff) + { + newElement_ = Element::Null; + std::string name; + if(!buff.empty()) + { + // Canonicalize case of name + name = makeName(buff); + ElementType& type = schema_->getElementType(name); + if(type == ElementType::Null) + return; // mysterious end-tag + name = type.name(); + } + else + { + name = stack_.name(); + } + + Element sp = Element::Null; + bool inNoforce = false; + for (sp = stack_; sp != Element::Null; sp = sp.next()) + { + if(sp.name() == name) + break; + if((sp.flags() & Schema::F_NOFORCE) != 0) + inNoforce = true; + } // for ... + + if(sp == Element::Null) + return; // Ignore unknown etags + if(sp.next() == Element::Null || sp.next().next() == Element::Null) + return; + if(inNoforce) + { // inside an F_NOFORCE element? + sp.preclose(); // preclose the matching element + } + else + { // restartably pop everything above us + while (stack_ != sp) + restartablyPop(); + pop(); + } + // pop any preclosed elements now at the top + while (stack_.isPreclosed()) + pop(); + restart(Element::Null); + } // etag_basic + + // Push restartables on the stack if possible + // e is the next element to be started, if we know what it is + void restart(Element e) + { + while (saved_ != Element::Null && stack_.canContain(saved_) && + (e == Element::Null || saved_.canContain(e))) + { + Element next = saved_.next(); + push(saved_); + saved_ = next; + } // while ... + } // restart + + // Pop the stack irrevocably + void pop() + { + if(stack_ == Element::Null) + return; // empty stack + std::string name = stack_.name(); + std::string localName = stack_.localName(); + std::string namespaceName = stack_.namespaceName(); + std::string prefix = prefixOf(name); + + if(!namespaces) + namespaceName = localName = ""; + contentHandler_->endElement(S(namespaceName), + S(localName), + S(name)); + if(foreign(prefix, namespaceName)) + contentHandler_->endPrefixMapping(S(prefix)); + + const Attributes& atts = stack_.atts(); + for (int i = atts.getLength() - 1; i >= 0; i--) + { + std::string attNamespace = atts.getURI(i); + std::string attPrefix = prefixOf(atts.getQName(i)); + if(foreign(attPrefix, attNamespace)) + contentHandler_->endPrefixMapping(S(attPrefix)); + } // for ... + stack_ = stack_.next(); + } // pop + + // Pop the stack restartably + void restartablyPop() + { + Element popped = stack_; + pop(); + if(restartElements && (popped.flags() & Schema::F_RESTART) != 0) + { + popped.anonymize(); + popped.setNext(saved_); + saved_ = popped; + } // if ... + } // restartablyPop + + // Push element onto stack + void push(Element e) + { + std::string name = e.name(); + std::string localName = e.localName(); + std::string namespaceName = e.namespaceName(); + std::string prefix = prefixOf(name); + + e.clean(); + if(!namespaces) + namespaceName = localName = ""; + if(virginStack && (lower_case(localName) == lower_case(doctypeName_))) + entityResolver_->resolveEntity(S(doctypePublicId_), S(doctypeSystemId_)); + if(foreign(prefix, namespaceName)) + contentHandler_->startPrefixMapping(S(prefix), S(namespaceName)); + + AttributesImpl atts; + int len = e.atts().getLength(); + for (int i = 0; i != len; ++i) + { + std::string attNamespace = e.atts().getURI(i); + std::string attPrefix = prefixOf(e.atts().getQName(i)); + if(foreign(attPrefix, attNamespace)) + contentHandler_->startPrefixMapping(S(attPrefix), S(attNamespace)); + + atts.addAttribute(S(e.atts().getURI(i)), + S(e.atts().getLocalName(i)), + S(e.atts().getQName(i)), + S(e.atts().getType(i)), + S(e.atts().getValue(i))); + } // for ... + contentHandler_->startElement(S(namespaceName), S(localName), S(name), atts); + + e.setNext(stack_); + stack_ = e; + virginStack = false; + if(CDATAElements && (stack_.flags() & Schema::F_CDATA) != 0) + scanner_->startCDATA(); + } // push + + // Get the prefix from a QName + std::string prefixOf(std::string name) + { + size_t i = name.find(':'); + std::string prefix = ""; + if(i != std::string::npos) + prefix = name.substr(0, i); + return prefix; + } // prefixOf + + // Return true if we have a foreign name + bool foreign(std::string prefix, std::string namespaceName) + { + bool foreign = !((prefix == "") || (namespaceName == "") || (namespaceName == schema_->getURI())); + return foreign; + } // foreign + + /** + * Parsing the complete XML Document Type Definition is way too complex, + * but for many simple cases we can extract something useful from it. + * + * doctypedecl ::= '' + * DeclSep ::= PEReference | S + * intSubset ::= (markupdecl | DeclSep)* + * markupdecl ::= elementdecl | AttlistDecl | EntityDecl | NotationDecl | PI | Comment + * ExternalID ::= 'SYSTEM' S SystemLiteral | 'PUBLIC' S PubidLiteral S SystemLiteral + */ + + virtual void decl(const std::string& buff) + { + // std::cerr << "decl(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + std::string name; + std::string systemid; + std::string publicid; + std::vector v = split(buff); + if((v.size() > 0) && ("DOCTYPE" == v[0])) + { + if(doctypeIsPresent_) + return; // one doctype only! + doctypeIsPresent_ = true; + if(v.size() > 1) + { + name = v[1]; + if(v.size()>3 && "SYSTEM" == v[2]) + { + systemid = v[3]; + } + else if(v.size() > 3 && "PUBLIC" == v[2]) + { + publicid = v[3]; + if(v.size() > 4) + { + systemid = v[4]; + } + else + { + systemid = ""; + } + } + } + } + publicid = trimquotes(publicid); + systemid = trimquotes(systemid); + if(name != "") + { + publicid = cleanPublicid(publicid); + lexicalHandler_->startDTD(S(name), S(publicid), S(systemid)); + lexicalHandler_->endDTD(); + doctypeName_ = name; + doctypePublicId_ = publicid; + if(dynamic_cast(scanner_)) + { // Must resolve systemid + doctypeSystemId_ = string_adaptor::asStdString(dynamic_cast(scanner_)->getSystemId()); + doctypeSystemId_ = Arabica::io::URI(doctypeSystemId_, systemid).as_string(); + } // if ... + } // if ... + } // decl + + // If the String is quoted, trim the quotes. + static std::string trimquotes(const std::string& in) + { + size_t length = in.length(); + if(length == 0) + return in; + char s = in[0]; + char e = in[length - 1]; + if(s == e && (s == '\'' || s == '"')) + return in.substr(1, length - 1); + return in; + } // trimquotes + + // Split the supplied String into words or phrases seperated by spaces. + // Recognises quotes around a phrase and doesn't split it. + static std::vector split(const std::string& val) + { + std::vector splits; + + std::string v = Arabica::text::normalize_whitespace >(val); + if(v.length() == 0) + { + splits.push_back(v); + return splits; + } + + size_t s = 0; + size_t e = 0; + bool sq = false; // single quote + bool dq = false; // double quote + char lastc = 0; + size_t len = v.length(); + for(e=0; e < len; ++e) + { + char c = v[e]; + if(!dq && c == '\'' && lastc != '\\') + { + sq = !sq; + if(s == std::string::npos) + s = e; + } + else if(!sq && c == '\"' && lastc != '\\') + { + dq = !dq; + if(s == std::string::npos) + s = e; + } + else if(!sq && !dq) + { + if(Arabica::XML::is_space(c)) + { + splits.push_back(v.substr(s, e)); + s = std::string::npos; + } + else if(s == std::string::npos && c != ' ') + { + s = e; + } + } + lastc = c; + } // for ... + splits.push_back(v.substr(s, e)); + + return splits; + } // split + + // Replace junk in publicids with spaces + std::string cleanPublicid(const std::string& src) + { + std::string dst; + bool suppressSpace = true; + for(std::string::const_iterator i = src.begin(), ie = src.end(); i != ie; ++i) + { + if(legal.find(*i) != std::string::npos) + { + // legal but not whitespace + dst.push_back(*i); + suppressSpace = false; + } + else if(suppressSpace) + { // normalizable whitespace or junk + ; + } + else + { + dst.push_back(' '); + suppressSpace = true; + } + } + return dst; + } // cleanPublicId + + virtual void gi(const std::string& buff) + { + // std::cerr << "gi(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ != Element::Null) + return; + std::string name = makeName(buff); + if(name == "") + return; + ElementType* type = &schema_->getElementType(name); + if(*type == ElementType::Null) + { + // Suppress unknown elements if ignore-bogons is on + if(ignoreBogons) + return; + int bogonModel = bogonsEmpty ? Schema::M_EMPTY : Schema::M_ANY; + int bogonMemberOf = rootBogons ? Schema::M_ANY : (Schema::M_ANY & ~Schema::M_ROOT); + schema_->elementType(name, bogonModel, bogonMemberOf, 0); + if(!rootBogons) + schema_->parent(name, schema_->rootElementType().name()); + type = &schema_->getElementType(name); + } // if ... + + newElement_ = Element(*type, defaultAttributes); + } // gi + + virtual void cdsect(const std::string& buff) + { + // std::cerr << "cdsect(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + lexicalHandler_->startCDATA(); + pcdata(buff); + lexicalHandler_->endCDATA(); + } // cdsect + + virtual void pcdata(const std::string& buff) + { + // std::cerr << "pcdata(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(buff.empty()) + return; + bool allWhite = true; + for (std::string::const_iterator i = buff.begin(), ie = buff.end(); i != ie; ++i) + { + if(!Arabica::XML::is_space(*i)) + allWhite = false; + } // for ... + if(allWhite && !stack_.canContain(pcdata_)) + { + if(ignorableWhitespace) + contentHandler_->ignorableWhitespace(S(buff)); + } + else + { + rectify(pcdata_); + contentHandler_->characters(S(buff)); + } // if ... + } // pcdata + + virtual void pitarget(const std::string& buff) + { + // std::cerr << "pitarget(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ != Element::Null) + return; + std::string name = makeName(buff); + size_t colon = name.find(':'); + while(colon != std::string::npos) + { + name[colon] = '_'; + colon = name.find(':'); + } // while + piTarget_ = name; + } // pitarget + + virtual void pi(const std::string& buff) + { + // std::cerr << "pi(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ != Element::Null || piTarget_ == "") + return; + if("xml" == lower_case(piTarget_)) + return; + size_t length = buff.length(); + if((length > 0) && (buff[length - 1] == '?')) + length--; // remove trailing ? + contentHandler_->processingInstruction(S(piTarget_), + S(buff.substr(0, length))); + piTarget_ = ""; + } // pi + + virtual void stagc(const std::string& buff) + { + // std::cerr << "stagc(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ == Element::Null) + return; + rectify(newElement_); + if(stack_.model() == Schema::M_EMPTY) + { + // Force an immediate end tag + etag_basic(buff); + } // if ... + } // stagc + + virtual void stage(const std::string& buff) + { + // std::cerr << "stage(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + if(newElement_ == Element::Null) + return; + rectify(newElement_); + // Force an immediate end tag + etag_basic(buff); + } // stage + + // Comment buffer is twice the size of the output buffer + virtual void cmnt(const std::string& buff) + { + // std::cerr << "cmnt(\"" << buff.substr(offset, length) << "\", " << offset << ", " << length << ")" << std::endl; + lexicalHandler_->comment(S(buff)); + } // cmnt + + // Rectify the stack, pushing and popping as needed + // so that the argument can be safely pushed + void rectify(Element e) + { + Element sp = Element::Null; + while (true) + { + for (sp = stack_; sp != Element::Null; sp = sp.next()) + { + if(sp.canContain(e)) + break; + } // for ... + if(sp != Element::Null) + break; + ElementType& parentType = e.parent(); + if(parentType == ElementType::Null) + break; + Element parent = Element(parentType, defaultAttributes); + parent.setNext(e); + e = parent; + } // while ... + if(sp == Element::Null) + return; // don't know what to do + while (stack_ != sp) + { + if(stack_ == Element::Null || stack_.next() == Element::Null || stack_.next().next() == Element::Null) + break; + restartablyPop(); + } // while ... + while (e != Element::Null) + { + Element nexte = e.next(); + if(e.name() != "") + push(e); + e = nexte; + restart(e); + } // while ... + newElement_ = Element::Null; + } // rectify + + virtual int getEntity() + { + return entity_; + } // getEntity + + // Return the argument as a valid XML name + // This no longer lowercases the result: we depend on Schema to + // canonicalize case. + std::string makeName(const std::string& buff) + { + std::string dst; + bool seenColon = false; + bool start = true; +// String src = new String(buff, offset, length); // DEBUG + for(std::string::const_iterator ch = buff.begin(), che = buff.end(); ch != che; ++ch) + { + if(Arabica::XML::is_letter(*ch) || *ch == '_') + { + start = false; + dst.push_back(*ch); + } + else if(Arabica::XML::is_digit(*ch) || *ch == '-' || *ch == '.') + { + if(start) + dst.push_back('_'); + start = false; + dst.push_back(*ch); + } + else if(*ch == ':' && !seenColon) + { + seenColon = true; + if(start) + dst.push_back('_'); + start = true; + dst.push_back(translateColons ? '_' : *ch); + } + } // for ... + size_t dstLength = dst.length(); + if(dstLength == 0 || dst[dstLength - 1] == ':') + dst.push_back('_'); + return dst; + } // makeName + + static std::string lower_case(const std::string& str) + { + std::string lower; + std::transform(str.begin(), str.end(), std::back_inserter(lower), (int(*)(int))std::tolower); + return lower; + } // lower_case + + void reportError(const std::string& message, bool fatal) + { + SAXParseException e(message, + S(""), + S(""), + -1, + -1); + if(fatal) + errorHandler_->fatalError(e); + else + errorHandler_->error(e); + } // reportError + +public: + static string_type S(const std::string& s) + { + return string_adaptor::construct_from_utf8(s.c_str()); + } // S + + static string_type S(const char* s) + { + return string_adaptor::construct_from_utf8(s); + } // S +}; // class Taggle + +template +bool Taggle::DEFAULT_NAMESPACES = true; +template +bool Taggle::DEFAULT_IGNORE_BOGONS = false; +template +bool Taggle::DEFAULT_BOGONS_EMPTY = false; +template +bool Taggle::DEFAULT_ROOT_BOGONS = true; +template +bool Taggle::DEFAULT_DEFAULT_ATTRIBUTES = true; +template +bool Taggle::DEFAULT_TRANSLATE_COLONS = false; +template +bool Taggle::DEFAULT_RESTART_ELEMENTS = true; +template +bool Taggle::DEFAULT_IGNORABLE_WHITESPACE = false; +template +bool Taggle::DEFAULT_CDATA_ELEMENTS = true; + +template +const string_type Taggle::namespacesFeature = Taggle::S("http://xml.org/sax/features/namespaces"); +template +const string_type Taggle::namespacePrefixesFeature = Taggle::S("http://xml.org/sax/features/namespace-prefixes"); +template +const string_type Taggle::externalGeneralEntitiesFeature = Taggle::S("http://xml.org/sax/features/external-general-entities"); +template +const string_type Taggle::externalParameterEntitiesFeature = Taggle::S("http://xml.org/sax/features/external-parameter-entities"); +template +const string_type Taggle::isStandaloneFeature = Taggle::S("http://xml.org/sax/features/is-standalone"); +template +const string_type Taggle::lexicalHandlerParameterEntitiesFeature = Taggle::S("http://xml.org/sax/features/lexical-handler/parameter-entities"); +template +const string_type Taggle::resolveDTDURIsFeature = Taggle::S("http://xml.org/sax/features/resolve-dtd-uris"); +template +const string_type Taggle::stringInterningFeature = Taggle::S("http://xml.org/sax/features/string-interning"); +template +const string_type Taggle::useAttributes2Feature = Taggle::S("http://xml.org/sax/features/use-attributes2"); +template +const string_type Taggle::useLocator2Feature = Taggle::S("http://xml.org/sax/features/use-locator2"); +template +const string_type Taggle::useEntityResolver2Feature = Taggle::S("http://xml.org/sax/features/use-entity-resolver2"); +template +const string_type Taggle::validationFeature = Taggle::S("http://xml.org/sax/features/validation"); +template +const string_type Taggle::unicodeNormalizationCheckingFeature = Taggle::S("http://xml.org/sax/features/unicode-normalization-checking"); +template +const string_type Taggle::xmlnsURIsFeature = Taggle::S("http://xml.org/sax/features/xmlns-uris"); +template +const string_type Taggle::XML11Feature = Taggle::S("http://xml.org/sax/features/xml-1.1"); +template +const string_type Taggle::ignoreBogonsFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/ignore-bogons"); +template +const string_type Taggle::bogonsEmptyFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/bogons-empty"); +template +const string_type Taggle::rootBogonsFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/root-bogons"); +template +const string_type Taggle::defaultAttributesFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/default-attributes"); +template +const string_type Taggle::translateColonsFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/translate-colons"); +template +const string_type Taggle::restartElementsFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/restart-elements"); +template +const string_type Taggle::ignorableWhitespaceFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/ignorable-whitespace"); +template +const string_type Taggle::CDATAElementsFeature = Taggle::S("http://www.ccil.org/~cowan/tagsoup/features/cdata-elements"); +template +const string_type Taggle::lexicalHandlerProperty = Taggle::S("http://xml.org/sax/properties/lexical-handler"); +template +const string_type Taggle::scannerProperty = Taggle::S("http://www.ccil.org/~cowan/tagsoup/properties/scanner"); +template +const string_type Taggle::schemaProperty = Taggle::S("http://www.ccil.org/~cowan/tagsoup/properties/schema"); +template +const string_type Taggle::autoDetectorProperty = Taggle::S("http://www.ccil.org/~cowan/tagsoup/properties/auto-detector"); + +template +const string_type Taggle::legal = + Taggle::S("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-'()+,./:=?;!*#@$_%"); + +} // namespace SAX + +} // namespace Arabica +#endif + diff --git a/arabica/include/Taggle/impl/ScanHandler.hpp b/arabica/include/Taggle/impl/ScanHandler.hpp new file mode 100755 index 000000000..1f42c3b6c --- /dev/null +++ b/arabica/include/Taggle/impl/ScanHandler.hpp @@ -0,0 +1,108 @@ +#ifndef ARABICA_SCAN_HANDLER_HPP +#define ARABICA_SCAN_HANDLER_HPP + +#include + +namespace Arabica +{ + +namespace SAX +{ + +/** + An interface that Scanners use to report events in the input stream. + + This code is derived from John Cowan's splendid TagSoup package +*/ +class ScanHandler +{ +protected: + ~ScanHandler() {} + +public: + /** + Reports an attribute name without a value. + **/ + virtual void adup(const std::string& buff) = 0; + + /** + Reports an attribute name; a value will follow. + **/ + virtual void aname(const std::string& buff) = 0; + + /** + Reports an attribute value. + **/ + virtual void aval(const std::string& buff) = 0; + + /** + * Reports the content of a CDATA section (not a CDATA element) + */ + virtual void cdsect(const std::string& buff) = 0; + + /** + * Reports a declaration - typically a DOCTYPE + */ + virtual void decl(const std::string& buff) = 0; + + /** + Reports an entity reference or character reference. + **/ + virtual void entity(const std::string& buff) = 0; + + /** + Reports EOF. + **/ + virtual void eof(const std::string& buff) = 0; + + /** + Reports an end-tag. + **/ + virtual void etag(const std::string& buff) = 0; + + /** + Reports the general identifier (element type name) of a start-tag. + **/ + virtual void gi(const std::string& buff) = 0; + + /** + Reports character content. + **/ + virtual void pcdata(const std::string& buff) = 0; + + /** + Reports the data part of a processing instruction. + **/ + virtual void pi(const std::string& buff) = 0; + + /** + Reports the target part of a processing instruction. + **/ + virtual void pitarget(const std::string& buff) = 0; + + /** + Reports the close of a start-tag. + **/ + virtual void stagc(const std::string& buff) = 0; + + /** + Reports the close of an empty-tag. + **/ + virtual void stage(const std::string& buff) = 0; + + /** + Reports a comment. + **/ + virtual void cmnt(const std::string& buff) = 0; + + /** + Returns the value of the last entity or character reference reported. + **/ + virtual int getEntity() = 0; +}; // class ScanHandler + +} // namespace SAX + +} // namespace Arabica + +#endif diff --git a/arabica/include/Taggle/impl/Scanner.hpp b/arabica/include/Taggle/impl/Scanner.hpp new file mode 100755 index 000000000..efc6a591d --- /dev/null +++ b/arabica/include/Taggle/impl/Scanner.hpp @@ -0,0 +1,47 @@ +#ifndef ARABICA_SAX_SCANNER_HPP +#define ARABICA_SAX_SCANNER_HPP + +#include +#include + +namespace Arabica +{ +namespace SAX +{ + +class ScanHandler; + +/** + An interface allowing Parser to invoke scanners. + + This code is derived from John Cowan's splendid TagSoup package +*/ +class Scanner +{ +public: + virtual ~Scanner() {} + + /** + Invoke a scanner. + @param r A source of characters to scan + @param h A ScanHandler to report events to + **/ + virtual void scan(std::istream& r, ScanHandler& h) = 0; + + /** + Reset the embedded locator. + @param publicid The publicid of the source + @param systemid The systemid of the source + **/ + virtual void resetDocumentLocator(const std::string& publicid, const std::string& systemid) = 0; + + /** + Signal to the scanner to start CDATA content mode. + **/ + virtual void startCDATA() = 0; +}; // Scanner + + +} // namespace SAX +} // namespace Arabica +#endif diff --git a/arabica/include/Taggle/impl/Schema.hpp b/arabica/include/Taggle/impl/Schema.hpp new file mode 100644 index 000000000..0a4130c36 --- /dev/null +++ b/arabica/include/Taggle/impl/Schema.hpp @@ -0,0 +1,44 @@ +#ifndef ARABICA_SAX_TAGGLE_SCHEMA_HPP +#define ARABICA_SAX_TAGGLE_SCHEMA_HPP + +namespace Arabica +{ +namespace SAX +{ + +class ElementType; + +/** +Abstract class representing a TSSL schema. +Actual TSSL schemas are compiled into concrete subclasses of this class. + +Based on code from John Cowan's super TagSoup package +**/ +class Schema +{ +public: + static const int M_ANY; + static const int M_EMPTY; + static const int M_PCDATA; + static const int M_ROOT; + + static const int F_RESTART; + static const int F_CDATA; + static const int F_NOFORCE; + + virtual void elementType(const std::string& name, int model, int memberOf, int flags) = 0; + virtual ElementType& rootElementType() = 0; + virtual void parent(std::string name, std::string parentName) = 0; + + virtual ElementType& getElementType(const std::string& name) = 0; + virtual int getEntity(const std::string& name) const = 0; + virtual const std::string& getURI() const = 0; + virtual const std::string& getPrefix() const = 0; + + virtual ~Schema() { } +}; // class Schema + +} // namespace SAX + +} // namespace Arabica +#endif diff --git a/arabica/include/Taggle/impl/SchemaImpl.hpp b/arabica/include/Taggle/impl/SchemaImpl.hpp new file mode 100644 index 000000000..6e35994ca --- /dev/null +++ b/arabica/include/Taggle/impl/SchemaImpl.hpp @@ -0,0 +1,182 @@ +#ifndef ARABICA_SAX_TAGGLE_SCHEMAIMPL_HPP +#define ARABICA_SAX_TAGGLE_SCHEMAIMPL_HPP + +#include +#include +#include +#include +#include "ElementType.hpp" +#include "Schema.hpp" + +namespace Arabica +{ +namespace SAX +{ + +/** +Abstract class representing a TSSL schema. +Actual TSSL schemas are compiled into concrete subclasses of this class. + +Based on code from John Cowan's super TagSoup package +**/ +class SchemaImpl : public Schema +{ +private: + std::map entities_; + std::map elementTypes_; + + std::string URI_; + std::string prefix_; + ElementType* root_; + +public: + virtual ~SchemaImpl() + { + for(std::map::iterator i = elementTypes_.begin(), ie = elementTypes_.end(); i != ie; ++i) + delete i->second; + } // ~SchemaImpl + + /** + Add or replace an element type for this schema. + @param name Name (Qname) of the element + @param model Models of the element's content as a vector of bits + @param memberOf Models the element is a member of as a vector of bits + @param flags Flags for the element + **/ + void elementType(const std::string& name, int model, int memberOf, int flags) + { + ElementType* e = new ElementType(name, model, memberOf, flags, *this); + std::string lname = lower_case(name); + elementTypes_[lname] = e; + if(memberOf == M_ROOT) + root_ = elementTypes_[lname]; + } // elementType + + /** + Get the root element of this schema + **/ + ElementType& rootElementType() + { + return *root_; + } // rootElementType + + /** + Add or replace a default attribute for an element type in this schema. + @param elemName Name (Qname) of the element type + @param attrName Name (Qname) of the attribute + @param type Type of the attribute + @param value Default value of the attribute; null if no default + **/ + void attribute(const std::string& elemName, const std::string& attrName, const std::string& type, const std::string& value) + { + ElementType& e = getElementType(elemName); + if (e == ElementType::Null) + { + throw std::runtime_error("Attribute " + attrName + + " specified for unknown element type " + + elemName); + } + e.setAttribute(attrName, type, value); + } // attribute + + /** + Specify natural parent of an element in this schema. + @param name Name of the child element + @param parentName Name of the parent element + **/ + void parent(std::string name, std::string parentName) + { + ElementType& child = getElementType(name); + ElementType& parent = getElementType(parentName); + if (child == ElementType::Null) + { + throw std::runtime_error("No child " + name + " for parent " + parentName); + } + if (parent == ElementType::Null) + { + throw std::runtime_error("No parent " + parentName + " for child " + name); + } + child.setParent(parent); + } // parent + + /** + Add to or replace a character entity in this schema. + @param name Name of the entity + @param value Value of the entity + **/ + void entity(const std::string& name, int value) + { + entities_[name] = value; + } // entity + + /** + Get an ElementType by name. + @param name Name (Qname) of the element type + @return The corresponding ElementType + **/ + ElementType& getElementType(const std::string& name) + { + std::map::iterator elemType = elementTypes_.find(lower_case(name)); + if(elemType == elementTypes_.end()) + return ElementType::Null; + return *elemType->second; + } // getElementType + + /** + Get an entity value by name. + @param name Name of the entity + @return The corresponding character, or 0 if none + **/ + int getEntity(const std::string& name) const + { + std::map::const_iterator ent = entities_.find(name); + if(ent == entities_.end()) + return 0; + return ent->second; + } // getEntity + + /** + Return the URI (namespace name) of this schema. + **/ + const std::string& getURI() const + { + return URI_; + } // getURI + + /** + Return the prefix of this schema. + **/ + const std::string& getPrefix() const + { + return prefix_; + } // getPrefix + + /** + Change the URI (namespace name) of this schema. + **/ + void setURI(std::string uri) + { + URI_ = uri; + } // setURI + + /** + Change the prefix of this schema. + **/ + void setPrefix(std::string prefix) + { + prefix_ = prefix; + } // setPrefix + +private: + static std::string lower_case(const std::string& str) + { + std::string lower; + std::transform(str.begin(), str.end(), std::back_inserter(lower), (int(*)(int))std::tolower); + return lower; + } // lower_case +}; // class Schema + +} // namespace SAX + +} // namespace Arabica +#endif diff --git a/arabica/include/Taggle/impl/html/HTMLModels.hpp b/arabica/include/Taggle/impl/html/HTMLModels.hpp new file mode 100644 index 000000000..360fd40d1 --- /dev/null +++ b/arabica/include/Taggle/impl/html/HTMLModels.hpp @@ -0,0 +1,49 @@ +#ifndef ARABICA_SAX_TAGGLE_HTML_MODELS_HPP +#define ARABICA_SAX_TAGGLE_HTML_MODELS_HPP + +namespace Arabica +{ + +namespace SAX +{ + +/** +This interface contains generated constants representing HTML content +models. Logically, it is part of HTMLSchema, but it is more +convenient to generate the constants into a separate interface. + +Based on code from John Cowan's super TagSoup package +*/ +class HTMLModels +{ +protected: + // Start of model definitions + static const int M_AREA = 1 << 1; + static const int M_BLOCK = 1 << 2; + static const int M_BLOCKINLINE = 1 << 3; + static const int M_BODY = 1 << 4; + static const int M_CELL = 1 << 5; + static const int M_COL = 1 << 6; + static const int M_DEF = 1 << 7; + static const int M_FORM = 1 << 8; + static const int M_FRAME = 1 << 9; + static const int M_HEAD = 1 << 10; + static const int M_HTML = 1 << 11; + static const int M_INLINE = 1 << 12; + static const int M_LEGEND = 1 << 13; + static const int M_LI = 1 << 14; + static const int M_NOLINK = 1 << 15; + static const int M_OPTION = 1 << 16; + static const int M_OPTIONS = 1 << 17; + static const int M_P = 1 << 18; + static const int M_PARAM = 1 << 19; + static const int M_TABLE = 1 << 20; + static const int M_TABULAR = 1 << 21; + static const int M_TR = 1 << 22; +}; // namespace HTMLModels + +} // namespace SAX + +} // namespace Arabica +#endif + diff --git a/arabica/include/Taggle/impl/html/HTMLScanner.hpp b/arabica/include/Taggle/impl/html/HTMLScanner.hpp new file mode 100644 index 000000000..1001b2d7f --- /dev/null +++ b/arabica/include/Taggle/impl/html/HTMLScanner.hpp @@ -0,0 +1,707 @@ +#ifndef ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP +#define ARABICA_SAX_TAGGLE_HTML_SCANNER_HPP + +#include +#include +#include +#include +#include "../Scanner.hpp" + +namespace Arabica +{ + +namespace SAX +{ + +/** +This class implements a table-driven scanner for HTML, allowing for lots of +defects. It implements the Scanner interface, which accepts a Reader +object to fetch characters from and a ScanHandler object to report lexical +events to. + +Based on code from John Cowan's super TagSoup package +*/ +class HTMLScanner : public Scanner, public SAX::Locator +{ +private: + // Start of state table + static const int S_ANAME = 1; + static const int S_APOS = 2; + static const int S_AVAL = 3; + static const int S_BB = 4; + static const int S_BBC = 5; + static const int S_BBCD = 6; + static const int S_BBCDA = 7; + static const int S_BBCDAT = 8; + static const int S_BBCDATA = 9; + static const int S_CDATA = 10; + static const int S_CDATA2 = 11; + static const int S_CDSECT = 12; + static const int S_CDSECT1 = 13; + static const int S_CDSECT2 = 14; + static const int S_COM = 15; + static const int S_COM2 = 16; + static const int S_COM3 = 17; + static const int S_COM4 = 18; + static const int S_DECL = 19; + static const int S_DECL2 = 20; + static const int S_DONE = 21; + static const int S_EMPTYTAG = 22; + static const int S_ENT = 23; + static const int S_EQ = 24; + static const int S_ETAG = 25; + static const int S_GI = 26; + static const int S_NCR = 27; + static const int S_PCDATA = 28; + static const int S_PI = 29; + static const int S_PITARGET = 30; + static const int S_QUOT = 31; + static const int S_STAGC = 32; + static const int S_TAG = 33; + static const int S_TAGWS = 34; + static const int S_XNCR = 35; + static const int A_ADUP = 1; + static const int A_ADUP_SAVE = 2; + static const int A_ADUP_STAGC = 3; + static const int A_ANAME = 4; + static const int A_ANAME_ADUP = 5; + static const int A_ANAME_ADUP_STAGC = 6; + static const int A_AVAL = 7; + static const int A_AVAL_STAGC = 8; + static const int A_CDATA = 9; + static const int A_CMNT = 10; + static const int A_DECL = 11; + static const int A_EMPTYTAG = 12; + static const int A_ENTITY = 13; + static const int A_ENTITY_START = 14; + static const int A_ETAG = 15; + static const int A_GI = 16; + static const int A_GI_STAGC = 17; + static const int A_LT = 18; + static const int A_LT_PCDATA = 19; + static const int A_MINUS = 20; + static const int A_MINUS2 = 21; + static const int A_MINUS3 = 22; + static const int A_PCDATA = 23; + static const int A_PI = 24; + static const int A_PITARGET = 25; + static const int A_PITARGET_PI = 26; + static const int A_SAVE = 27; + static const int A_SKIP = 28; + static const int A_SP = 29; + static const int A_STAGC = 30; + static const int A_UNGET = 31; + static const int A_UNSAVE_PCDATA = 32; + static const int statetable[]; + static const std::string debug_actionnames[]; + static const std::string debug_statenames[]; + // End of state table + static const int WinCharMap[]; // Windows char map + static const std::string hexLetters; + + std::string publicId_; // Locator state + std::string systemId_; + size_t lastLine_; + size_t lastColumn_; + size_t currentLine_; + size_t currentColumn_; + + int state_; // Current state + int nextState_; // Next state + std::string outputBuffer_; // Output buffer + + // Compensate for bug in PushbackReader that allows + // pushing back EOF. + //void unread(PushbackReader r, int c) throws IOException { + // if (c != -1) r.unread(c); + // } + +public: + HTMLScanner() : + publicId_(), + systemId_(), + lastLine_(0), + lastColumn_(0), + currentLine_(0), + currentColumn_(0), + state_(0), + nextState_(0), + outputBuffer_() + { + outputBuffer_.reserve(200); + } // HTMLScanner + + // Locator implementation + size_t getLineNumber() const + { + return lastLine_; + } // getLineNumber + + size_t getColumnNumber() const + { + return lastColumn_; + } // getColumnNumber + + std::string getPublicId() const + { + return publicId_; + } // getPublicId + + std::string getSystemId() const + { + return systemId_; + } // getSystemId + + + // Scanner implementation + /** + Reset document locator, supplying systemid and publicid. + @param systemid System id + @param publicid Public id + */ + virtual void resetDocumentLocator(const std::string& publicid, const std::string& systemid) + { + publicId_ = publicid; + systemId_ = systemid; + lastLine_ = lastColumn_ = currentLine_ = currentColumn_ = 0; + } // resetDocumentLocator + + /** + Scan HTML source, reporting lexical events. + @param r0 Reader that provides characters + @param h ScanHandler that accepts lexical events. + */ + virtual void scan(std::istream& r, ScanHandler& h) + { + state_ = S_PCDATA; +/* PushbackReader r; + if (r0 instanceof PushbackReader) { + r = (PushbackReader)r0; + } + else if (r0 instanceof BufferedReader) { + r = new PushbackReader(r0); + } + else { + r = new PushbackReader(new BufferedReader(r0)); + } +*/ +// int firstChar = r.read(); // Remove any leading BOM +// if (firstChar != '\uFEFF') unread(r, firstChar); + + while (state_ != S_DONE) + { + int ch = r.get(); + + // Process control characters + //if (ch >= 0x80 && ch <= 0x9F) + //ch = WinCharMap[ch-0x80]; + + if (ch == '\r') + { + ch = r.get(); // expect LF next + if (ch != '\n') + { + r.unget(); + ch = '\n'; + } + } + + if (ch == '\n') + { + ++currentLine_; + currentColumn_ = 0; + } + else + { + ++currentColumn_; + } + + if (!(ch >= 0x20 || ch == '\n' || ch == '\t' || ch == -1)) + continue; + + // Search state table + int action = 0; + for (int i = 0; statetable[i] != -1; i += 4) + { + if (state_ != statetable[i]) + { + if (action != 0) + break; + continue; + } + if (statetable[i+1] == 0) + { + action = statetable[i+2]; + nextState_ = statetable[i+3]; + } + else if (statetable[i+1] == ch) + { + action = statetable[i+2]; + nextState_ = statetable[i+3]; + break; + } + } // for ... + + switch (action) + { + case 0: + { + std::ostringstream os; + os << "HTMLScanner can't cope with " << ch << " in state " << state_; + throw std::runtime_error(os.str()); + } + case A_ADUP: + h.adup(outputBuffer_); + outputBuffer_.clear(); + break; + case A_ADUP_SAVE: + h.adup(outputBuffer_); + outputBuffer_.clear(); + save(ch, h); + break; + case A_ADUP_STAGC: + h.adup(outputBuffer_); + outputBuffer_.clear(); + h.stagc(outputBuffer_); + break; + case A_ANAME: + h.aname(outputBuffer_); + outputBuffer_.clear(); + break; + case A_ANAME_ADUP: + h.aname(outputBuffer_); + outputBuffer_.clear(); + h.adup(outputBuffer_); + break; + case A_ANAME_ADUP_STAGC: + h.aname(outputBuffer_); + outputBuffer_.clear(); + h.adup(outputBuffer_); + h.stagc(outputBuffer_); + break; + case A_AVAL: + h.aval(outputBuffer_); + outputBuffer_.clear(); + break; + case A_AVAL_STAGC: + h.aval(outputBuffer_); + outputBuffer_.clear(); + h.stagc(outputBuffer_); + break; + case A_CDATA: + mark(); + // suppress the final "]]" in the buffer + if (outputBuffer_.size() > 1) + outputBuffer_.erase(outputBuffer_.size()-2); + h.pcdata(outputBuffer_); + outputBuffer_.clear(); + break; + case A_ENTITY_START: + h.pcdata(outputBuffer_); + outputBuffer_.clear(); + save(ch, h); + break; + case A_ENTITY: + { + mark(); + char ch1 = (char)ch; + // System.out.println("Got " + ch1 + " in state " + ((state_ == S_ENT) ? "S_ENT" : ((state_ == S_NCR) ? "S_NCR" : "UNK"))); + if (state_ == S_ENT && ch1 == '#') + { + nextState_ = S_NCR; + save(ch, h); + break; + } + else if (state_ == S_NCR && (ch1 == 'x' || ch1 == 'X')) + { + nextState_ = S_XNCR; + save(ch, h); + break; + } + else if (state_ == S_ENT && XML::is_letter_or_digit(ch1)) + { + save(ch, h); + break; + } + else if (state_ == S_NCR && XML::is_digit(ch1)) + { + save(ch, h); + break; + } + else if (state_ == S_XNCR && (XML::is_digit(ch1) || hexLetters.find(ch1) != std::string::npos)) + { + save(ch, h); + break; + } + + // The whole entity reference has been collected + h.entity(outputBuffer_.substr(1, outputBuffer_.size()-1)); + int ent = h.getEntity(); + if (ent != 0) + { + outputBuffer_.clear(); + if (ent >= 0x80 && ent <= 0x9F) + { + //ent = WinCharMap[ent-0x80]; + } + if (ent < 0x20) + { + // Control becomes space + ent = 0x20; + } + else if (ent >= 0xD800 && ent <= 0xDFFF) + { + // Surrogates get dropped + ent = 0; + } + else if (ent <= 0xFFFF) + { + // BMP character + save(ent, h); + } + else + { + // Astral converted to two surrogates + ent -= 0x10000; + save((ent>>10) + 0xD800, h); + save((ent&0x3FF) + 0xDC00, h); + } + if (ch != ';') + { + r.unget(); + currentColumn_--; + } + } + else + { + r.unget(); + currentColumn_--; + } + nextState_ = S_PCDATA; + } // case A_ENTITY: + break; + case A_ETAG: + h.etag(outputBuffer_); + outputBuffer_.clear(); + break; + case A_DECL: + h.decl(outputBuffer_); + outputBuffer_.clear(); + break; + case A_GI: + h.gi(outputBuffer_); + outputBuffer_.clear(); + break; + case A_GI_STAGC: + h.gi(outputBuffer_); + outputBuffer_.clear(); + h.stagc(outputBuffer_); + break; + case A_LT: + mark(); + save('<', h); + save(ch, h); + break; + case A_LT_PCDATA: + mark(); + save('<', h); + h.pcdata(outputBuffer_); + outputBuffer_.clear(); + break; + case A_PCDATA: + mark(); + h.pcdata(outputBuffer_); + outputBuffer_.clear(); + break; + case A_CMNT: + mark(); + h.cmnt(outputBuffer_); + outputBuffer_.clear(); + break; + case A_MINUS3: + save('-', h); + save(' ', h); + break; + case A_MINUS2: + save('-', h); + save(' ', h); + // fall through into A_MINUS + case A_MINUS: + save('-', h); + save(ch, h); + break; + case A_PI: + mark(); + h.pi(outputBuffer_); + outputBuffer_.clear(); + break; + case A_PITARGET: + h.pitarget(outputBuffer_); + outputBuffer_.clear(); + break; + case A_PITARGET_PI: + h.pitarget(outputBuffer_); + outputBuffer_.clear(); + h.pi(outputBuffer_); + break; + case A_SAVE: + save(ch, h); + break; + case A_SKIP: + break; + case A_SP: + save(' ', h); + break; + case A_STAGC: + h.stagc(outputBuffer_); + outputBuffer_.clear(); + break; + case A_EMPTYTAG: + mark(); + if (outputBuffer_.size() > 0) + h.gi(outputBuffer_); + outputBuffer_.clear(); + h.stage(outputBuffer_); + break; + case A_UNGET: + r.unget(); + currentColumn_--; + break; + case A_UNSAVE_PCDATA: + if (outputBuffer_.size() > 0) + outputBuffer_.erase(outputBuffer_.size()-1); + h.pcdata(outputBuffer_); + outputBuffer_.clear(); + break; + default: + throw std::runtime_error( + "Can't process state " + static_cast( + std::stringstream() << action).str()); + } // switch ... + state_ = nextState_; + } // while (state_ != S_DONE) + h.eof(""); + } // scan + + /** + A callback for the ScanHandler that allows it to force + the lexer state to CDATA content (no markup is recognized except + the end of element. + */ + void startCDATA() + { + nextState_ = S_CDATA; + } // startCDATA + +private: + /** + * Mark the current scan position as a "point of interest" - start of a tag, + * cdata, processing instruction etc. + */ + void mark() + { + lastColumn_ = currentColumn_; + lastLine_ = currentLine_; + } // mark + + void save(int ch, ScanHandler& h) + { + if (outputBuffer_.size() >= outputBuffer_.capacity() - 20) + { + if (state_ == S_PCDATA || state_ == S_CDATA) + { + // Return a buffer-sized chunk of PCDATA + h.pcdata(outputBuffer_); + outputBuffer_.clear(); + } + } + outputBuffer_ += static_cast(ch); + } // save + + static std::string nicechar(int in) + { + if (in == '\n') + return "\\n"; + std::ostringstream os; + if(in >= 32) + os << '\'' << static_cast(in) << '\''; + else + os << std::hex << std::showbase << in; + return os.str(); + } // nicechar + + HTMLScanner(const HTMLScanner&); + bool operator==(const HTMLScanner&) const; + HTMLScanner& operator=(const HTMLScanner&); +}; // class HTMLScanner + +const int HTMLScanner::statetable[] = { + S_ANAME, '/', A_ANAME_ADUP, S_EMPTYTAG, + S_ANAME, '=', A_ANAME, S_AVAL, + S_ANAME, '>', A_ANAME_ADUP_STAGC, S_PCDATA, + S_ANAME, 0, A_SAVE, S_ANAME, + S_ANAME, -1, A_ANAME_ADUP_STAGC, S_DONE, + S_ANAME, ' ', A_ANAME, S_EQ, + S_ANAME, '\n', A_ANAME, S_EQ, + S_ANAME, '\t', A_ANAME, S_EQ, + S_APOS, '\'', A_AVAL, S_TAGWS, + S_APOS, 0, A_SAVE, S_APOS, + S_APOS, -1, A_AVAL_STAGC, S_DONE, + S_APOS, ' ', A_SP, S_APOS, + S_APOS, '\n', A_SP, S_APOS, + S_APOS, '\t', A_SP, S_APOS, + S_AVAL, '\'', A_SKIP, S_APOS, + S_AVAL, '"', A_SKIP, S_QUOT, + S_AVAL, '>', A_AVAL_STAGC, S_PCDATA, + S_AVAL, 0, A_SAVE, S_STAGC, + S_AVAL, -1, A_AVAL_STAGC, S_DONE, + S_AVAL, ' ', A_SKIP, S_AVAL, + S_AVAL, '\n', A_SKIP, S_AVAL, + S_AVAL, '\t', A_SKIP, S_AVAL, + S_BB, 'C', A_SKIP, S_BBC, + S_BB, 0, A_SKIP, S_DECL, + S_BB, -1, A_SKIP, S_DONE, + S_BBC, 'D', A_SKIP, S_BBCD, + S_BBC, 0, A_SKIP, S_DECL, + S_BBC, -1, A_SKIP, S_DONE, + S_BBCD, 'A', A_SKIP, S_BBCDA, + S_BBCD, 0, A_SKIP, S_DECL, + S_BBCD, -1, A_SKIP, S_DONE, + S_BBCDA, 'T', A_SKIP, S_BBCDAT, + S_BBCDA, 0, A_SKIP, S_DECL, + S_BBCDA, -1, A_SKIP, S_DONE, + S_BBCDAT, 'A', A_SKIP, S_BBCDATA, + S_BBCDAT, 0, A_SKIP, S_DECL, + S_BBCDAT, -1, A_SKIP, S_DONE, + S_BBCDATA, '[', A_SKIP, S_CDSECT, + S_BBCDATA, 0, A_SKIP, S_DECL, + S_BBCDATA, -1, A_SKIP, S_DONE, + S_CDATA, '<', A_SAVE, S_CDATA2, + S_CDATA, 0, A_SAVE, S_CDATA, + S_CDATA, -1, A_PCDATA, S_DONE, + S_CDATA2, '/', A_UNSAVE_PCDATA, S_ETAG, + S_CDATA2, 0, A_SAVE, S_CDATA, + S_CDATA2, -1, A_UNSAVE_PCDATA, S_DONE, + S_CDSECT, ']', A_SAVE, S_CDSECT1, + S_CDSECT, 0, A_SAVE, S_CDSECT, + S_CDSECT, -1, A_SKIP, S_DONE, + S_CDSECT1, ']', A_SAVE, S_CDSECT2, + S_CDSECT1, 0, A_SAVE, S_CDSECT, + S_CDSECT1, -1, A_SKIP, S_DONE, + S_CDSECT2, '>', A_CDATA, S_PCDATA, + S_CDSECT2, 0, A_SAVE, S_CDSECT, + S_CDSECT2, -1, A_SKIP, S_DONE, + S_COM, '-', A_SKIP, S_COM2, + S_COM, 0, A_SAVE, S_COM2, + S_COM, -1, A_CMNT, S_DONE, + S_COM2, '-', A_SKIP, S_COM3, + S_COM2, 0, A_SAVE, S_COM2, + S_COM2, -1, A_CMNT, S_DONE, + S_COM3, '-', A_SKIP, S_COM4, + S_COM3, 0, A_MINUS, S_COM2, + S_COM3, -1, A_CMNT, S_DONE, + S_COM4, '-', A_MINUS3, S_COM4, + S_COM4, '>', A_CMNT, S_PCDATA, + S_COM4, 0, A_MINUS2, S_COM2, + S_COM4, -1, A_CMNT, S_DONE, + S_DECL, '-', A_SKIP, S_COM, + S_DECL, '[', A_SKIP, S_BB, + S_DECL, '>', A_SKIP, S_PCDATA, + S_DECL, 0, A_SAVE, S_DECL2, + S_DECL, -1, A_SKIP, S_DONE, + S_DECL2, '>', A_DECL, S_PCDATA, + S_DECL2, 0, A_SAVE, S_DECL2, + S_DECL2, -1, A_SKIP, S_DONE, + S_EMPTYTAG, '>', A_EMPTYTAG, S_PCDATA, + S_EMPTYTAG, 0, A_SAVE, S_ANAME, + S_EMPTYTAG, ' ', A_SKIP, S_TAGWS, + S_EMPTYTAG, '\n', A_SKIP, S_TAGWS, + S_EMPTYTAG, '\t', A_SKIP, S_TAGWS, + S_ENT, 0, A_ENTITY, S_ENT, + S_ENT, -1, A_ENTITY, S_DONE, + S_EQ, '=', A_SKIP, S_AVAL, + S_EQ, '>', A_ADUP_STAGC, S_PCDATA, + S_EQ, 0, A_ADUP_SAVE, S_ANAME, + S_EQ, -1, A_ADUP_STAGC, S_DONE, + S_EQ, ' ', A_SKIP, S_EQ, + S_EQ, '\n', A_SKIP, S_EQ, + S_EQ, '\t', A_SKIP, S_EQ, + S_ETAG, '>', A_ETAG, S_PCDATA, + S_ETAG, 0, A_SAVE, S_ETAG, + S_ETAG, -1, A_ETAG, S_DONE, + S_ETAG, ' ', A_SKIP, S_ETAG, + S_ETAG, '\n', A_SKIP, S_ETAG, + S_ETAG, '\t', A_SKIP, S_ETAG, + S_GI, '/', A_SKIP, S_EMPTYTAG, + S_GI, '>', A_GI_STAGC, S_PCDATA, + S_GI, 0, A_SAVE, S_GI, + S_GI, -1, A_SKIP, S_DONE, + S_GI, ' ', A_GI, S_TAGWS, + S_GI, '\n', A_GI, S_TAGWS, + S_GI, '\t', A_GI, S_TAGWS, + S_NCR, 0, A_ENTITY, S_NCR, + S_NCR, -1, A_ENTITY, S_DONE, + S_PCDATA, '&', A_ENTITY_START, S_ENT, + S_PCDATA, '<', A_PCDATA, S_TAG, + S_PCDATA, 0, A_SAVE, S_PCDATA, + S_PCDATA, -1, A_PCDATA, S_DONE, + S_PI, '>', A_PI, S_PCDATA, + S_PI, 0, A_SAVE, S_PI, + S_PI, -1, A_PI, S_DONE, + S_PITARGET, '>', A_PITARGET_PI, S_PCDATA, + S_PITARGET, 0, A_SAVE, S_PITARGET, + S_PITARGET, -1, A_PITARGET_PI, S_DONE, + S_PITARGET, ' ', A_PITARGET, S_PI, + S_PITARGET, '\n', A_PITARGET, S_PI, + S_PITARGET, '\t', A_PITARGET, S_PI, + S_QUOT, '"', A_AVAL, S_TAGWS, + S_QUOT, 0, A_SAVE, S_QUOT, + S_QUOT, -1, A_AVAL_STAGC, S_DONE, + S_QUOT, ' ', A_SP, S_QUOT, + S_QUOT, '\n', A_SP, S_QUOT, + S_QUOT, '\t', A_SP, S_QUOT, + S_STAGC, '>', A_AVAL_STAGC, S_PCDATA, + S_STAGC, 0, A_SAVE, S_STAGC, + S_STAGC, -1, A_AVAL_STAGC, S_DONE, + S_STAGC, ' ', A_AVAL, S_TAGWS, + S_STAGC, '\n', A_AVAL, S_TAGWS, + S_STAGC, '\t', A_AVAL, S_TAGWS, + S_TAG, '!', A_SKIP, S_DECL, + S_TAG, '?', A_SKIP, S_PITARGET, + S_TAG, '/', A_SKIP, S_ETAG, + S_TAG, '<', A_SAVE, S_TAG, + S_TAG, 0, A_SAVE, S_GI, + S_TAG, -1, A_LT_PCDATA, S_DONE, + S_TAG, ' ', A_LT, S_PCDATA, + S_TAG, '\n', A_LT, S_PCDATA, + S_TAG, '\t', A_LT, S_PCDATA, + S_TAGWS, '/', A_SKIP, S_EMPTYTAG, + S_TAGWS, '>', A_STAGC, S_PCDATA, + S_TAGWS, 0, A_SAVE, S_ANAME, + S_TAGWS, -1, A_STAGC, S_DONE, + S_TAGWS, ' ', A_SKIP, S_TAGWS, + S_TAGWS, '\n', A_SKIP, S_TAGWS, + S_TAGWS, '\t', A_SKIP, S_TAGWS, + S_XNCR, 0, A_ENTITY, S_XNCR, + S_XNCR, -1, A_ENTITY, S_DONE, + -1, -1, -1, -1 +}; // HTMLScanner::statetable + +const std::string HTMLScanner::debug_actionnames[] = { "", "A_ADUP", "A_ADUP_SAVE", "A_ADUP_STAGC", "A_ANAME", "A_ANAME_ADUP", "A_ANAME_ADUP_STAGC", "A_AVAL", "A_AVAL_STAGC", "A_CDATA", "A_CMNT", "A_DECL", "A_EMPTYTAG", "A_ENTITY", "A_ENTITY_START", "A_ETAG", "A_GI", "A_GI_STAGC", "A_LT", "A_LT_PCDATA", "A_MINUS", "A_MINUS2", "A_MINUS3", "A_PCDATA", "A_PI", "A_PITARGET", "A_PITARGET_PI", "A_SAVE", "A_SKIP", "A_SP", "A_STAGC", "A_UNGET", "A_UNSAVE_PCDATA"}; +const std::string HTMLScanner::debug_statenames[] = { "", "S_ANAME", "S_APOS", "S_AVAL", "S_BB", "S_BBC", "S_BBCD", "S_BBCDA", "S_BBCDAT", "S_BBCDATA", "S_CDATA", "S_CDATA2", "S_CDSECT", "S_CDSECT1", "S_CDSECT2", "S_COM", "S_COM2", "S_COM3", "S_COM4", "S_DECL", "S_DECL2", "S_DONE", "S_EMPTYTAG", "S_ENT", "S_EQ", "S_ETAG", "S_GI", "S_NCR", "S_PCDATA", "S_PI", "S_PITARGET", "S_QUOT", "S_STAGC", "S_TAG", "S_TAGWS", "S_XNCR"}; + +const int HTMLScanner::WinCharMap[] = { // Windows chars map + 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021, + 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFD, 0x017D, 0xFFFD, + 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014, + 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFD, 0x017E, 0x0178 +}; // HTMLScanner::WinCharMap + +const std::string HTMLScanner::hexLetters = "abcdefABCDEF"; + +} // namespace SAX + +} // namespace Arabica + +#endif + diff --git a/arabica/include/Taggle/impl/html/HTMLSchema.hpp b/arabica/include/Taggle/impl/html/HTMLSchema.hpp new file mode 100644 index 000000000..010714b93 --- /dev/null +++ b/arabica/include/Taggle/impl/html/HTMLSchema.hpp @@ -0,0 +1,2955 @@ +#ifndef ARABICA_SAX_TAGGLE_HTML_SCHEMA_HPP +#define ARABICA_SAX_TAGGLE_HTML_SCHEMA_HPP + +#include "../SchemaImpl.hpp" +#include "HTMLModels.hpp" + +namespace Arabica +{ +namespace SAX +{ + +/** +This class provides a Schema that has been preinitialized with HTML +elements, attributes, and character entity declarations. All the declarations +normally provided with HTML 4.01 are given, plus some that are IE-specific +and NS4-specific. Attribute declarations of type CDATA with no default +value are not included. + +Based on code from John Cowan's super TagSoup package +*/ +class HTMLSchema : public SchemaImpl, private HTMLModels +{ +public: + /** + Returns a newly constructed HTMLSchema object independent of + any existing ones. + */ + HTMLSchema() + { + // Start of Schema calls + setURI("http://www.w3.org/1999/xhtml"); + setPrefix("html"); + + // the original Java method body was generated automatically, + // and was huge. unfortunately, that sent gcc into a spin, + // so I've had to break it up + + elementTypes(); + + parents(); + + attributes(); + + entities(); + + } // HTMLSchema + +private: + void elementTypes() + { + elementType("", M_EMPTY, M_PCDATA, 0); + elementType("", M_ROOT, M_EMPTY, 0); + elementType("a", M_PCDATA|M_NOLINK|M_BLOCK, M_INLINE, 0); + elementType("abbr", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("acronym", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("address", M_PCDATA|M_INLINE|M_P, M_BLOCK, 0); + elementType("applet", M_PCDATA|M_PARAM|M_INLINE|M_BLOCK, M_INLINE|M_NOLINK, 0); + elementType("area", M_EMPTY, M_AREA, 0); + elementType("b", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("base", M_EMPTY, M_HEAD, 0); + elementType("basefont", M_EMPTY, M_INLINE|M_NOLINK, 0); + elementType("bdo", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("bgsound", M_EMPTY, M_HEAD, 0); + elementType("big", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("blink", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("blockquote", M_PCDATA|M_INLINE|M_BLOCK, M_BLOCK, 0); + elementType("body", M_PCDATA|M_INLINE|M_BLOCK, M_HTML|M_BODY, 0); + elementType("br", M_EMPTY, M_INLINE|M_NOLINK, 0); + elementType("button", M_PCDATA|M_INLINE|M_BLOCK, M_INLINE|M_NOLINK, 0); + elementType("canvas", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("caption", M_PCDATA|M_INLINE, M_TABULAR, 0); + elementType("center", M_PCDATA|M_INLINE|M_BLOCK, M_BLOCK, 0); + elementType("cite", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("code", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("col", M_EMPTY, M_COL|M_TABULAR, 0); + elementType("colgroup", M_COL, M_TABULAR, 0); + elementType("comment", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("dd", M_PCDATA|M_INLINE|M_BLOCK, M_DEF, 0); + elementType("del", M_PCDATA|M_INLINE|M_BLOCK, M_INLINE|M_BLOCKINLINE|M_BLOCK, F_RESTART); + elementType("dfn", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("dir", M_LI, M_BLOCK, 0); + elementType("div", M_PCDATA|M_INLINE|M_BLOCK, M_BLOCK, 0); + elementType("dl", M_DEF, M_BLOCK, 0); + elementType("dt", M_PCDATA|M_INLINE, M_DEF, 0); + elementType("em", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("fieldset", M_PCDATA|M_LEGEND|M_INLINE|M_BLOCK, M_BLOCK, 0); + elementType("font", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("form", M_PCDATA|M_INLINE|M_NOLINK|M_BLOCK|M_TR|M_CELL, M_BLOCK|M_FORM, F_NOFORCE); + elementType("frame", M_EMPTY, M_FRAME, 0); + elementType("frameset", M_FRAME, M_FRAME|M_HTML, 0); + elementType("h1", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("h2", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("h3", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("h4", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("h5", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("h6", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("head", M_HEAD, M_HTML, 0); + elementType("hr", M_EMPTY, M_BLOCK, 0); + elementType("html", M_HTML, M_ROOT, 0); + elementType("i", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("iframe", M_PCDATA|M_INLINE|M_BLOCK, M_INLINE|M_NOLINK, 0); + elementType("img", M_EMPTY, M_INLINE|M_NOLINK, 0); + elementType("input", M_EMPTY, M_INLINE|M_NOLINK, 0); + elementType("ins", M_PCDATA|M_INLINE|M_BLOCK, M_INLINE|M_BLOCK, F_RESTART); + elementType("isindex", M_EMPTY, M_HEAD, 0); + elementType("kbd", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("label", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("legend", M_PCDATA|M_INLINE, M_LEGEND, 0); + elementType("li", M_PCDATA|M_INLINE|M_BLOCK, M_LI, 0); + elementType("link", M_EMPTY, M_HEAD|M_INLINE, 0); + elementType("listing", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("map", M_BLOCK|M_AREA, M_INLINE, 0); + elementType("marquee", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("menu", M_LI, M_BLOCK, 0); + elementType("meta", M_EMPTY, M_HEAD, 0); + elementType("nobr", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("noframes", M_BODY|M_BLOCK|M_INLINE, M_BLOCK|M_HTML|M_FRAME, 0); + elementType("noscript", M_PCDATA|M_INLINE|M_BLOCK, M_BLOCK, 0); + elementType("object", M_PCDATA|M_PARAM|M_INLINE|M_BLOCK, M_HEAD|M_INLINE|M_NOLINK, 0); + elementType("ol", M_LI, M_BLOCK, 0); + elementType("optgroup", M_OPTIONS, M_OPTIONS, 0); + elementType("option", M_PCDATA, M_OPTION|M_OPTIONS, 0); + elementType("p", M_PCDATA|M_INLINE|M_TABLE, M_BLOCK|M_P, 0); + elementType("param", M_EMPTY, M_PARAM, 0); + elementType("pre", M_PCDATA|M_INLINE, M_BLOCK, 0); + elementType("q", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("rb", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("rbc", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("rp", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("rt", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("rtc", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("ruby", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("s", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("samp", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("script", M_PCDATA, M_ANY & ~M_ROOT, F_CDATA); + elementType("select", M_OPTIONS, M_INLINE, 0); + elementType("small", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("span", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("strike", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("strong", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("style", M_PCDATA, M_HEAD|M_INLINE, F_CDATA); + elementType("sub", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("sup", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("table", M_FORM|M_TABULAR, M_BLOCK|M_TABLE, F_NOFORCE); + elementType("tbody", M_TR, M_TABULAR, 0); + elementType("td", M_PCDATA|M_INLINE|M_BLOCK, M_CELL, 0); + elementType("textarea", M_PCDATA, M_INLINE, 0); + elementType("tfoot", M_TR|M_FORM|M_CELL, M_TABULAR, 0); + elementType("th", M_PCDATA|M_INLINE|M_BLOCK, M_CELL, 0); + elementType("thead", M_TR|M_FORM|M_CELL, M_TABULAR, 0); + elementType("title", M_PCDATA, M_HEAD, 0); + elementType("tr", M_FORM|M_CELL, M_TR|M_TABULAR, 0); + elementType("tt", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("u", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, F_RESTART); + elementType("ul", M_LI, M_BLOCK, 0); + elementType("var", M_PCDATA|M_INLINE, M_INLINE|M_NOLINK, 0); + elementType("wbr", M_EMPTY, M_INLINE|M_NOLINK, 0); + elementType("xmp", M_PCDATA|M_INLINE, M_BLOCK, 0); + } // elementTypes + + void parents() + { + parent("", "body"); + parent("html", ""); + parent("a", "body"); + parent("abbr", "body"); + parent("acronym", "body"); + parent("address", "body"); + parent("applet", "body"); + parent("area", "map"); + parent("b", "body"); + parent("base", "head"); + parent("basefont", "body"); + parent("bdo", "body"); + parent("bgsound", "head"); + parent("big", "body"); + parent("blink", "body"); + parent("blockquote", "body"); + parent("body", "html"); + parent("br", "body"); + parent("button", "form"); + parent("canvas", "body"); + parent("caption", "table"); + parent("center", "body"); + parent("cite", "body"); + parent("code", "body"); + parent("col", "table"); + parent("colgroup", "table"); + parent("comment", "body"); + parent("dd", "dl"); + parent("del", "body"); + parent("dfn", "body"); + parent("dir", "body"); + parent("div", "body"); + parent("dl", "body"); + parent("dt", "dl"); + parent("em", "body"); + parent("fieldset", "form"); + parent("font", "body"); + parent("form", "body"); + parent("frame", "frameset"); + parent("frameset", "html"); + parent("h1", "body"); + parent("h2", "body"); + parent("h3", "body"); + parent("h4", "body"); + parent("h5", "body"); + parent("h6", "body"); + parent("head", "html"); + parent("hr", "body"); + parent("i", "body"); + parent("iframe", "body"); + parent("img", "body"); + parent("input", "form"); + parent("ins", "body"); + parent("isindex", "head"); + parent("kbd", "body"); + parent("label", "form"); + parent("legend", "fieldset"); + parent("li", "ul"); + parent("link", "head"); + parent("listing", "body"); + parent("map", "body"); + parent("marquee", "body"); + parent("menu", "body"); + parent("meta", "head"); + parent("nobr", "body"); + parent("noframes", "html"); + parent("noscript", "body"); + parent("object", "body"); + parent("ol", "body"); + parent("optgroup", "select"); + parent("option", "select"); + parent("p", "body"); + parent("param", "object"); + parent("pre", "body"); + parent("q", "body"); + parent("rb", "body"); + parent("rbc", "body"); + parent("rp", "body"); + parent("rt", "body"); + parent("rtc", "body"); + parent("ruby", "body"); + parent("s", "body"); + parent("samp", "body"); + parent("script", "html"); + parent("select", "form"); + parent("small", "body"); + parent("span", "body"); + parent("strike", "body"); + parent("strong", "body"); + parent("style", "head"); + parent("sub", "body"); + parent("sup", "body"); + parent("table", "body"); + parent("tbody", "table"); + parent("td", "tr"); + parent("textarea", "form"); + parent("tfoot", "table"); + parent("th", "tr"); + parent("thead", "table"); + parent("title", "head"); + parent("tr", "tbody"); + parent("tt", "body"); + parent("u", "body"); + parent("ul", "body"); + parent("var", "body"); + parent("wbr", "body"); + parent("xmp", "body"); + } // parents + + void attributes() + { + attributes_misc(); + attributes_class(); + attributes_dir(); + attributes_id(); + attributes_lang(); + } // attributes + + void attributes_misc() + { + attribute("a", "hreflang", "NMTOKEN", ""); + attribute("a", "shape", "CDATA", "rect"); + attribute("a", "tabindex", "NMTOKEN", ""); + attribute("applet", "align", "NMTOKEN", ""); + attribute("area", "nohref", "BOOLEAN", ""); + attribute("area", "shape", "CDATA", "rect"); + attribute("area", "tabindex", "NMTOKEN", ""); + attribute("br", "clear", "CDATA", "none"); + attribute("button", "disabled", "BOOLEAN", ""); + attribute("button", "tabindex", "NMTOKEN", ""); + attribute("button", "type", "CDATA", "submit"); + attribute("caption", "align", "NMTOKEN", ""); + attribute("col", "align", "NMTOKEN", ""); + attribute("col", "span", "CDATA", "1"); + attribute("col", "valign", "NMTOKEN", ""); + attribute("colgroup", "align", "NMTOKEN", ""); + attribute("colgroup", "span", "CDATA", "1"); + attribute("colgroup", "valign", "NMTOKEN", ""); + attribute("dir", "compact", "BOOLEAN", ""); + attribute("div", "align", "NMTOKEN", ""); + attribute("dl", "compact", "BOOLEAN", ""); + attribute("form", "enctype", "CDATA", "application/x-www-form-urlencoded"); + attribute("form", "method", "CDATA", "get"); + attribute("frame", "frameborder", "CDATA", "1"); + attribute("frame", "noresize", "BOOLEAN", ""); + attribute("frame", "scrolling", "CDATA", "auto"); + attribute("h1", "align", "NMTOKEN", ""); + attribute("h2", "align", "NMTOKEN", ""); + attribute("h3", "align", "NMTOKEN", ""); + attribute("h4", "align", "NMTOKEN", ""); + attribute("h5", "align", "NMTOKEN", ""); + attribute("h6", "align", "NMTOKEN", ""); + attribute("hr", "align", "NMTOKEN", ""); + attribute("hr", "noshade", "BOOLEAN", ""); + attribute("iframe", "align", "NMTOKEN", ""); + attribute("iframe", "frameborder", "CDATA", "1"); + attribute("iframe", "scrolling", "CDATA", "auto"); + attribute("img", "align", "NMTOKEN", ""); + attribute("img", "ismap", "BOOLEAN", ""); + attribute("input", "align", "NMTOKEN", ""); + attribute("input", "checked", "BOOLEAN", ""); + attribute("input", "disabled", "BOOLEAN", ""); + attribute("input", "ismap", "BOOLEAN", ""); + attribute("input", "maxlength", "NMTOKEN", ""); + attribute("input", "readonly", "BOOLEAN", ""); + attribute("input", "tabindex", "NMTOKEN", ""); + attribute("input", "type", "CDATA", "text"); + attribute("label", "for", "IDREF", ""); + attribute("legend", "align", "NMTOKEN", ""); + attribute("li", "value", "NMTOKEN", ""); + attribute("link", "hreflang", "NMTOKEN", ""); + attribute("marquee", "width", "NMTOKEN", ""); + attribute("menu", "compact", "BOOLEAN", ""); + attribute("meta", "http-equiv", "NMTOKEN", ""); + attribute("meta", "name", "NMTOKEN", ""); + attribute("object", "align", "NMTOKEN", ""); + attribute("object", "declare", "BOOLEAN", ""); + attribute("object", "tabindex", "NMTOKEN", ""); + attribute("ol", "compact", "BOOLEAN", ""); + attribute("ol", "start", "NMTOKEN", ""); + attribute("optgroup", "disabled", "BOOLEAN", ""); + attribute("option", "disabled", "BOOLEAN", ""); + attribute("option", "selected", "BOOLEAN", ""); + attribute("p", "align", "NMTOKEN", ""); + attribute("param", "valuetype", "CDATA", "data"); + attribute("pre", "width", "NMTOKEN", ""); + attribute("rt", "rbspan", "CDATA", "1"); + attribute("script", "defer", "BOOLEAN", ""); + attribute("select", "disabled", "BOOLEAN", ""); + attribute("select", "multiple", "BOOLEAN", ""); + attribute("select", "size", "NMTOKEN", ""); + attribute("select", "tabindex", "NMTOKEN", ""); + attribute("table", "align", "NMTOKEN", ""); + attribute("table", "frame", "NMTOKEN", ""); + attribute("table", "rules", "NMTOKEN", ""); + attribute("tbody", "align", "NMTOKEN", ""); + attribute("tbody", "valign", "NMTOKEN", ""); + attribute("td", "align", "NMTOKEN", ""); + attribute("td", "colspan", "CDATA", "1"); + attribute("td", "headers", "IDREFS", ""); + attribute("td", "nowrap", "BOOLEAN", ""); + attribute("td", "rowspan", "CDATA", "1"); + attribute("td", "scope", "NMTOKEN", ""); + attribute("td", "valign", "NMTOKEN", ""); + attribute("textarea", "cols", "NMTOKEN", ""); + attribute("textarea", "disabled", "BOOLEAN", ""); + attribute("textarea", "readonly", "BOOLEAN", ""); + attribute("textarea", "rows", "NMTOKEN", ""); + attribute("textarea", "tabindex", "NMTOKEN", ""); + attribute("tfoot", "align", "NMTOKEN", ""); + attribute("tfoot", "valign", "NMTOKEN", ""); + attribute("th", "align", "NMTOKEN", ""); + attribute("th", "colspan", "CDATA", "1"); + attribute("th", "headers", "IDREFS", ""); + attribute("th", "nowrap", "BOOLEAN", ""); + attribute("th", "rowspan", "CDATA", "1"); + attribute("th", "scope", "NMTOKEN", ""); + attribute("th", "valign", "NMTOKEN", ""); + attribute("thead", "align", "NMTOKEN", ""); + attribute("thead", "valign", "NMTOKEN", ""); + attribute("tr", "align", "NMTOKEN", ""); + attribute("tr", "valign", "NMTOKEN", ""); + attribute("ul", "compact", "BOOLEAN", ""); + attribute("ul", "type", "NMTOKEN", ""); + attribute("xmp", "width", "NMTOKEN", ""); + } // attributes_misc + + void attributes_class() + { + attribute("a", "class", "NMTOKEN", ""); + attribute("abbr", "class", "NMTOKEN", ""); + attribute("acronym", "class", "NMTOKEN", ""); + attribute("address", "class", "NMTOKEN", ""); + attribute("applet", "class", "NMTOKEN", ""); + attribute("area", "class", "NMTOKEN", ""); + attribute("b", "class", "NMTOKEN", ""); + attribute("base", "class", "NMTOKEN", ""); + attribute("basefont", "class", "NMTOKEN", ""); + attribute("bdo", "class", "NMTOKEN", ""); + attribute("bgsound", "class", "NMTOKEN", ""); + attribute("big", "class", "NMTOKEN", ""); + attribute("blink", "class", "NMTOKEN", ""); + attribute("blockquote", "class", "NMTOKEN", ""); + attribute("body", "class", "NMTOKEN", ""); + attribute("br", "class", "NMTOKEN", ""); + attribute("button", "class", "NMTOKEN", ""); + attribute("canvas", "class", "NMTOKEN", ""); + attribute("caption", "class", "NMTOKEN", ""); + attribute("center", "class", "NMTOKEN", ""); + attribute("cite", "class", "NMTOKEN", ""); + attribute("code", "class", "NMTOKEN", ""); + attribute("col", "class", "NMTOKEN", ""); + attribute("colgroup", "class", "NMTOKEN", ""); + attribute("comment", "class", "NMTOKEN", ""); + attribute("dd", "class", "NMTOKEN", ""); + attribute("del", "class", "NMTOKEN", ""); + attribute("dfn", "class", "NMTOKEN", ""); + attribute("dir", "class", "NMTOKEN", ""); + attribute("div", "class", "NMTOKEN", ""); + attribute("dl", "class", "NMTOKEN", ""); + attribute("dt", "class", "NMTOKEN", ""); + attribute("em", "class", "NMTOKEN", ""); + attribute("fieldset", "class", "NMTOKEN", ""); + attribute("font", "class", "NMTOKEN", ""); + attribute("form", "class", "NMTOKEN", ""); + attribute("frame", "class", "NMTOKEN", ""); + attribute("frameset", "class", "NMTOKEN", ""); + attribute("h1", "class", "NMTOKEN", ""); + attribute("h2", "class", "NMTOKEN", ""); + attribute("h3", "class", "NMTOKEN", ""); + attribute("h4", "class", "NMTOKEN", ""); + attribute("h5", "class", "NMTOKEN", ""); + attribute("h6", "class", "NMTOKEN", ""); + attribute("head", "class", "NMTOKEN", ""); + attribute("hr", "class", "NMTOKEN", ""); + attribute("html", "class", "NMTOKEN", ""); + attribute("i", "class", "NMTOKEN", ""); + attribute("iframe", "class", "NMTOKEN", ""); + attribute("img", "class", "NMTOKEN", ""); + attribute("input", "class", "NMTOKEN", ""); + attribute("ins", "class", "NMTOKEN", ""); + attribute("isindex", "class", "NMTOKEN", ""); + attribute("kbd", "class", "NMTOKEN", ""); + attribute("label", "class", "NMTOKEN", ""); + attribute("legend", "class", "NMTOKEN", ""); + attribute("li", "class", "NMTOKEN", ""); + attribute("link", "class", "NMTOKEN", ""); + attribute("listing", "class", "NMTOKEN", ""); + attribute("map", "class", "NMTOKEN", ""); + attribute("marquee", "class", "NMTOKEN", ""); + attribute("menu", "class", "NMTOKEN", ""); + attribute("meta", "class", "NMTOKEN", ""); + attribute("nobr", "class", "NMTOKEN", ""); + attribute("noframes", "class", "NMTOKEN", ""); + attribute("noscript", "class", "NMTOKEN", ""); + attribute("object", "class", "NMTOKEN", ""); + attribute("ol", "class", "NMTOKEN", ""); + attribute("optgroup", "class", "NMTOKEN", ""); + attribute("option", "class", "NMTOKEN", ""); + attribute("p", "class", "NMTOKEN", ""); + attribute("param", "class", "NMTOKEN", ""); + attribute("pre", "class", "NMTOKEN", ""); + attribute("q", "class", "NMTOKEN", ""); + attribute("rb", "class", "NMTOKEN", ""); + attribute("rbc", "class", "NMTOKEN", ""); + attribute("rp", "class", "NMTOKEN", ""); + attribute("rt", "class", "NMTOKEN", ""); + attribute("rtc", "class", "NMTOKEN", ""); + attribute("ruby", "class", "NMTOKEN", ""); + attribute("s", "class", "NMTOKEN", ""); + attribute("samp", "class", "NMTOKEN", ""); + attribute("script", "class", "NMTOKEN", ""); + attribute("select", "class", "NMTOKEN", ""); + attribute("small", "class", "NMTOKEN", ""); + attribute("span", "class", "NMTOKEN", ""); + attribute("strike", "class", "NMTOKEN", ""); + attribute("strong", "class", "NMTOKEN", ""); + attribute("style", "class", "NMTOKEN", ""); + attribute("sub", "class", "NMTOKEN", ""); + attribute("sup", "class", "NMTOKEN", ""); + attribute("table", "class", "NMTOKEN", ""); + attribute("tbody", "class", "NMTOKEN", ""); + attribute("td", "class", "NMTOKEN", ""); + attribute("textarea", "class", "NMTOKEN", ""); + attribute("tfoot", "class", "NMTOKEN", ""); + attribute("th", "class", "NMTOKEN", ""); + attribute("thead", "class", "NMTOKEN", ""); + attribute("title", "class", "NMTOKEN", ""); + attribute("tr", "class", "NMTOKEN", ""); + attribute("tt", "class", "NMTOKEN", ""); + attribute("u", "class", "NMTOKEN", ""); + attribute("ul", "class", "NMTOKEN", ""); + attribute("var", "class", "NMTOKEN", ""); + attribute("wbr", "class", "NMTOKEN", ""); + attribute("xmp", "class", "NMTOKEN", ""); + } // attributes_class + + void attributes_dir() + { + + attribute("a", "dir", "NMTOKEN", ""); + attribute("abbr", "dir", "NMTOKEN", ""); + attribute("acronym", "dir", "NMTOKEN", ""); + attribute("address", "dir", "NMTOKEN", ""); + attribute("applet", "dir", "NMTOKEN", ""); + attribute("area", "dir", "NMTOKEN", ""); + attribute("b", "dir", "NMTOKEN", ""); + attribute("base", "dir", "NMTOKEN", ""); + attribute("basefont", "dir", "NMTOKEN", ""); + attribute("bdo", "dir", "NMTOKEN", ""); + attribute("bgsound", "dir", "NMTOKEN", ""); + attribute("big", "dir", "NMTOKEN", ""); + attribute("blink", "dir", "NMTOKEN", ""); + attribute("blockquote", "dir", "NMTOKEN", ""); + attribute("body", "dir", "NMTOKEN", ""); + attribute("br", "dir", "NMTOKEN", ""); + attribute("button", "dir", "NMTOKEN", ""); + attribute("canvas", "dir", "NMTOKEN", ""); + attribute("caption", "dir", "NMTOKEN", ""); + attribute("center", "dir", "NMTOKEN", ""); + attribute("cite", "dir", "NMTOKEN", ""); + attribute("code", "dir", "NMTOKEN", ""); + attribute("col", "dir", "NMTOKEN", ""); + attribute("colgroup", "dir", "NMTOKEN", ""); + attribute("comment", "dir", "NMTOKEN", ""); + attribute("dd", "dir", "NMTOKEN", ""); + attribute("del", "dir", "NMTOKEN", ""); + attribute("dfn", "dir", "NMTOKEN", ""); + attribute("dir", "dir", "NMTOKEN", ""); + attribute("div", "dir", "NMTOKEN", ""); + attribute("dl", "dir", "NMTOKEN", ""); + attribute("dt", "dir", "NMTOKEN", ""); + attribute("em", "dir", "NMTOKEN", ""); + attribute("fieldset", "dir", "NMTOKEN", ""); + attribute("font", "dir", "NMTOKEN", ""); + attribute("form", "dir", "NMTOKEN", ""); + attribute("frame", "dir", "NMTOKEN", ""); + attribute("frameset", "dir", "NMTOKEN", ""); + attribute("h1", "dir", "NMTOKEN", ""); + attribute("h2", "dir", "NMTOKEN", ""); + attribute("h3", "dir", "NMTOKEN", ""); + attribute("h4", "dir", "NMTOKEN", ""); + attribute("h5", "dir", "NMTOKEN", ""); + attribute("h6", "dir", "NMTOKEN", ""); + attribute("head", "dir", "NMTOKEN", ""); + attribute("hr", "dir", "NMTOKEN", ""); + attribute("html", "dir", "NMTOKEN", ""); + attribute("i", "dir", "NMTOKEN", ""); + attribute("iframe", "dir", "NMTOKEN", ""); + attribute("img", "dir", "NMTOKEN", ""); + attribute("input", "dir", "NMTOKEN", ""); + attribute("ins", "dir", "NMTOKEN", ""); + attribute("isindex", "dir", "NMTOKEN", ""); + attribute("kbd", "dir", "NMTOKEN", ""); + attribute("label", "dir", "NMTOKEN", ""); + attribute("legend", "dir", "NMTOKEN", ""); + attribute("li", "dir", "NMTOKEN", ""); + attribute("link", "dir", "NMTOKEN", ""); + attribute("listing", "dir", "NMTOKEN", ""); + attribute("map", "dir", "NMTOKEN", ""); + attribute("marquee", "dir", "NMTOKEN", ""); + attribute("menu", "dir", "NMTOKEN", ""); + attribute("meta", "dir", "NMTOKEN", ""); + attribute("nobr", "dir", "NMTOKEN", ""); + attribute("noframes", "dir", "NMTOKEN", ""); + attribute("noscript", "dir", "NMTOKEN", ""); + attribute("object", "dir", "NMTOKEN", ""); + attribute("ol", "dir", "NMTOKEN", ""); + attribute("optgroup", "dir", "NMTOKEN", ""); + attribute("option", "dir", "NMTOKEN", ""); + attribute("p", "dir", "NMTOKEN", ""); + attribute("param", "dir", "NMTOKEN", ""); + attribute("pre", "dir", "NMTOKEN", ""); + attribute("q", "dir", "NMTOKEN", ""); + attribute("rb", "dir", "NMTOKEN", ""); + attribute("rbc", "dir", "NMTOKEN", ""); + attribute("rp", "dir", "NMTOKEN", ""); + attribute("rt", "dir", "NMTOKEN", ""); + attribute("rtc", "dir", "NMTOKEN", ""); + attribute("ruby", "dir", "NMTOKEN", ""); + attribute("s", "dir", "NMTOKEN", ""); + attribute("samp", "dir", "NMTOKEN", ""); + attribute("script", "dir", "NMTOKEN", ""); + attribute("select", "dir", "NMTOKEN", ""); + attribute("small", "dir", "NMTOKEN", ""); + attribute("span", "dir", "NMTOKEN", ""); + attribute("strike", "dir", "NMTOKEN", ""); + attribute("strong", "dir", "NMTOKEN", ""); + attribute("style", "dir", "NMTOKEN", ""); + attribute("sub", "dir", "NMTOKEN", ""); + attribute("sup", "dir", "NMTOKEN", ""); + attribute("table", "dir", "NMTOKEN", ""); + attribute("tbody", "dir", "NMTOKEN", ""); + attribute("td", "dir", "NMTOKEN", ""); + attribute("textarea", "dir", "NMTOKEN", ""); + attribute("tfoot", "dir", "NMTOKEN", ""); + attribute("th", "dir", "NMTOKEN", ""); + attribute("thead", "dir", "NMTOKEN", ""); + attribute("title", "dir", "NMTOKEN", ""); + attribute("tr", "dir", "NMTOKEN", ""); + attribute("tt", "dir", "NMTOKEN", ""); + attribute("u", "dir", "NMTOKEN", ""); + attribute("ul", "dir", "NMTOKEN", ""); + attribute("var", "dir", "NMTOKEN", ""); + attribute("wbr", "dir", "NMTOKEN", ""); + attribute("xmp", "dir", "NMTOKEN", ""); + } // attributes_dir + + void attributes_id() + { + attribute("a", "id", "ID", ""); + attribute("abbr", "id", "ID", ""); + attribute("acronym", "id", "ID", ""); + attribute("address", "id", "ID", ""); + attribute("applet", "id", "ID", ""); + attribute("area", "id", "ID", ""); + attribute("b", "id", "ID", ""); + attribute("base", "id", "ID", ""); + attribute("basefont", "id", "ID", ""); + attribute("bdo", "id", "ID", ""); + attribute("bgsound", "id", "ID", ""); + attribute("big", "id", "ID", ""); + attribute("blink", "id", "ID", ""); + attribute("blockquote", "id", "ID", ""); + attribute("body", "id", "ID", ""); + attribute("br", "id", "ID", ""); + attribute("button", "id", "ID", ""); + attribute("canvas", "id", "ID", ""); + attribute("caption", "id", "ID", ""); + attribute("center", "id", "ID", ""); + attribute("cite", "id", "ID", ""); + attribute("code", "id", "ID", ""); + attribute("col", "id", "ID", ""); + attribute("colgroup", "id", "ID", ""); + attribute("comment", "id", "ID", ""); + attribute("dd", "id", "ID", ""); + attribute("del", "id", "ID", ""); + attribute("dfn", "id", "ID", ""); + attribute("dir", "id", "ID", ""); + attribute("div", "id", "ID", ""); + attribute("dl", "id", "ID", ""); + attribute("dt", "id", "ID", ""); + attribute("em", "id", "ID", ""); + attribute("fieldset", "id", "ID", ""); + attribute("font", "id", "ID", ""); + attribute("form", "id", "ID", ""); + attribute("frame", "id", "ID", ""); + attribute("frameset", "id", "ID", ""); + attribute("h1", "id", "ID", ""); + attribute("h2", "id", "ID", ""); + attribute("h3", "id", "ID", ""); + attribute("h4", "id", "ID", ""); + attribute("h5", "id", "ID", ""); + attribute("h6", "id", "ID", ""); + attribute("head", "id", "ID", ""); + attribute("hr", "id", "ID", ""); + attribute("html", "id", "ID", ""); + attribute("i", "id", "ID", ""); + attribute("iframe", "id", "ID", ""); + attribute("img", "id", "ID", ""); + attribute("input", "id", "ID", ""); + attribute("ins", "id", "ID", ""); + attribute("isindex", "id", "ID", ""); + attribute("kbd", "id", "ID", ""); + attribute("label", "id", "ID", ""); + attribute("legend", "id", "ID", ""); + attribute("li", "id", "ID", ""); + attribute("link", "id", "ID", ""); + attribute("listing", "id", "ID", ""); + attribute("map", "id", "ID", ""); + attribute("marquee", "id", "ID", ""); + attribute("menu", "id", "ID", ""); + attribute("meta", "id", "ID", ""); + attribute("nobr", "id", "ID", ""); + attribute("noframes", "id", "ID", ""); + attribute("noscript", "id", "ID", ""); + attribute("object", "id", "ID", ""); + attribute("ol", "id", "ID", ""); + attribute("optgroup", "id", "ID", ""); + attribute("option", "id", "ID", ""); + attribute("p", "id", "ID", ""); + attribute("param", "id", "ID", ""); + attribute("pre", "id", "ID", ""); + attribute("q", "id", "ID", ""); + attribute("rb", "id", "ID", ""); + attribute("rbc", "id", "ID", ""); + attribute("rp", "id", "ID", ""); + attribute("rt", "id", "ID", ""); + attribute("rtc", "id", "ID", ""); + attribute("ruby", "id", "ID", ""); + attribute("s", "id", "ID", ""); + attribute("samp", "id", "ID", ""); + attribute("script", "id", "ID", ""); + attribute("select", "id", "ID", ""); + attribute("small", "id", "ID", ""); + attribute("span", "id", "ID", ""); + attribute("strike", "id", "ID", ""); + attribute("strong", "id", "ID", ""); + attribute("style", "id", "ID", ""); + attribute("sub", "id", "ID", ""); + attribute("sup", "id", "ID", ""); + attribute("table", "id", "ID", ""); + attribute("tbody", "id", "ID", ""); + attribute("td", "id", "ID", ""); + attribute("textarea", "id", "ID", ""); + attribute("tfoot", "id", "ID", ""); + attribute("th", "id", "ID", ""); + attribute("thead", "id", "ID", ""); + attribute("title", "id", "ID", ""); + attribute("tr", "id", "ID", ""); + attribute("tt", "id", "ID", ""); + attribute("u", "id", "ID", ""); + attribute("ul", "id", "ID", ""); + attribute("var", "id", "ID", ""); + attribute("wbr", "id", "ID", ""); + attribute("xmp", "id", "ID", ""); + } // attributes_id + + void attributes_lang() + { + attribute("a", "lang", "NMTOKEN", ""); + attribute("abbr", "lang", "NMTOKEN", ""); + attribute("acronym", "lang", "NMTOKEN", ""); + attribute("address", "lang", "NMTOKEN", ""); + attribute("applet", "lang", "NMTOKEN", ""); + attribute("area", "lang", "NMTOKEN", ""); + attribute("b", "lang", "NMTOKEN", ""); + attribute("base", "lang", "NMTOKEN", ""); + attribute("basefont", "lang", "NMTOKEN", ""); + attribute("bdo", "lang", "NMTOKEN", ""); + attribute("bgsound", "lang", "NMTOKEN", ""); + attribute("big", "lang", "NMTOKEN", ""); + attribute("blink", "lang", "NMTOKEN", ""); + attribute("blockquote", "lang", "NMTOKEN", ""); + attribute("body", "lang", "NMTOKEN", ""); + attribute("br", "lang", "NMTOKEN", ""); + attribute("button", "lang", "NMTOKEN", ""); + attribute("canvas", "lang", "NMTOKEN", ""); + attribute("caption", "lang", "NMTOKEN", ""); + attribute("center", "lang", "NMTOKEN", ""); + attribute("cite", "lang", "NMTOKEN", ""); + attribute("code", "lang", "NMTOKEN", ""); + attribute("col", "lang", "NMTOKEN", ""); + attribute("colgroup", "lang", "NMTOKEN", ""); + attribute("comment", "lang", "NMTOKEN", ""); + attribute("dd", "lang", "NMTOKEN", ""); + attribute("del", "lang", "NMTOKEN", ""); + attribute("dfn", "lang", "NMTOKEN", ""); + attribute("dir", "lang", "NMTOKEN", ""); + attribute("div", "lang", "NMTOKEN", ""); + attribute("dl", "lang", "NMTOKEN", ""); + attribute("dt", "lang", "NMTOKEN", ""); + attribute("em", "lang", "NMTOKEN", ""); + attribute("fieldset", "lang", "NMTOKEN", ""); + attribute("font", "lang", "NMTOKEN", ""); + attribute("form", "lang", "NMTOKEN", ""); + attribute("frame", "lang", "NMTOKEN", ""); + attribute("frameset", "lang", "NMTOKEN", ""); + attribute("h1", "lang", "NMTOKEN", ""); + attribute("h2", "lang", "NMTOKEN", ""); + attribute("h3", "lang", "NMTOKEN", ""); + attribute("h4", "lang", "NMTOKEN", ""); + attribute("h5", "lang", "NMTOKEN", ""); + attribute("h6", "lang", "NMTOKEN", ""); + attribute("head", "lang", "NMTOKEN", ""); + attribute("hr", "lang", "NMTOKEN", ""); + attribute("html", "lang", "NMTOKEN", ""); + attribute("i", "lang", "NMTOKEN", ""); + attribute("iframe", "lang", "NMTOKEN", ""); + attribute("img", "lang", "NMTOKEN", ""); + attribute("input", "lang", "NMTOKEN", ""); + attribute("ins", "lang", "NMTOKEN", ""); + attribute("isindex", "lang", "NMTOKEN", ""); + attribute("kbd", "lang", "NMTOKEN", ""); + attribute("label", "lang", "NMTOKEN", ""); + attribute("legend", "lang", "NMTOKEN", ""); + attribute("li", "lang", "NMTOKEN", ""); + attribute("link", "lang", "NMTOKEN", ""); + attribute("listing", "lang", "NMTOKEN", ""); + attribute("map", "lang", "NMTOKEN", ""); + attribute("marquee", "lang", "NMTOKEN", ""); + attribute("menu", "lang", "NMTOKEN", ""); + attribute("meta", "lang", "NMTOKEN", ""); + attribute("nobr", "lang", "NMTOKEN", ""); + attribute("noframes", "lang", "NMTOKEN", ""); + attribute("noscript", "lang", "NMTOKEN", ""); + attribute("object", "lang", "NMTOKEN", ""); + attribute("ol", "lang", "NMTOKEN", ""); + attribute("optgroup", "lang", "NMTOKEN", ""); + attribute("option", "lang", "NMTOKEN", ""); + attribute("p", "lang", "NMTOKEN", ""); + attribute("param", "lang", "NMTOKEN", ""); + attribute("pre", "lang", "NMTOKEN", ""); + attribute("q", "lang", "NMTOKEN", ""); + attribute("rb", "lang", "NMTOKEN", ""); + attribute("rbc", "lang", "NMTOKEN", ""); + attribute("rp", "lang", "NMTOKEN", ""); + attribute("rt", "lang", "NMTOKEN", ""); + attribute("rtc", "lang", "NMTOKEN", ""); + attribute("ruby", "lang", "NMTOKEN", ""); + attribute("s", "lang", "NMTOKEN", ""); + attribute("samp", "lang", "NMTOKEN", ""); + attribute("script", "lang", "NMTOKEN", ""); + attribute("select", "lang", "NMTOKEN", ""); + attribute("small", "lang", "NMTOKEN", ""); + attribute("span", "lang", "NMTOKEN", ""); + attribute("strike", "lang", "NMTOKEN", ""); + attribute("strong", "lang", "NMTOKEN", ""); + attribute("style", "lang", "NMTOKEN", ""); + attribute("sub", "lang", "NMTOKEN", ""); + attribute("sup", "lang", "NMTOKEN", ""); + attribute("table", "lang", "NMTOKEN", ""); + attribute("tbody", "lang", "NMTOKEN", ""); + attribute("td", "lang", "NMTOKEN", ""); + attribute("textarea", "lang", "NMTOKEN", ""); + attribute("tfoot", "lang", "NMTOKEN", ""); + attribute("th", "lang", "NMTOKEN", ""); + attribute("thead", "lang", "NMTOKEN", ""); + attribute("title", "lang", "NMTOKEN", ""); + attribute("tr", "lang", "NMTOKEN", ""); + attribute("tt", "lang", "NMTOKEN", ""); + attribute("u", "lang", "NMTOKEN", ""); + attribute("ul", "lang", "NMTOKEN", ""); + attribute("var", "lang", "NMTOKEN", ""); + attribute("wbr", "lang", "NMTOKEN", ""); + attribute("xmp", "lang", "NMTOKEN", ""); + } // attributes_lang + + void entities() + { + //entity("aacgr", 0x03AC); + //entity("Aacgr", 0x0386); + entity("aacute", 0x00E1); + entity("Aacute", 0x00C1); + //entity("abreve", 0x0103); + //entity("Abreve", 0x0102); + //entity("ac", 0x223E); + //entity("acd", 0x223F); + entity("acirc", 0x00E2); + entity("Acirc", 0x00C2); + entity("acute", 0x00B4); + //entity("acy", 0x0430); + //entity("Acy", 0x0410); + entity("aelig", 0x00E6); + entity("AElig", 0x00C6); + //entity("af", 0x2061); + //entity("afr", 0x1D51E); + //entity("Afr", 0x1D504); + //entity("agr", 0x03B1); + //entity("Agr", 0x0391); + entity("agrave", 0x00E0); + entity("Agrave", 0x00C0); + //entity("alefsym", 0x2135); + //entity("aleph", 0x2135); + //entity("alpha", 0x03B1); + //entity("Alpha", 0x0391); + //entity("amacr", 0x0101); + //entity("Amacr", 0x0100); + //entity("amalg", 0x2A3F); + entity("amp", 0x0026); + //entity("and", 0x2227); + //entity("And", 0x2A53); + //entity("andand", 0x2A55); + //entity("andd", 0x2A5C); + //entity("andslope", 0x2A58); + //entity("andv", 0x2A5A); + //entity("ang", 0x2220); + //entity("ange", 0x29A4); + //entity("angle", 0x2220); + //entity("angmsd", 0x2221); + //entity("angmsdaa", 0x29A8); + //entity("angmsdab", 0x29A9); + //entity("angmsdac", 0x29AA); + //entity("angmsdad", 0x29AB); + //entity("angmsdae", 0x29AC); + //entity("angmsdaf", 0x29AD); + //entity("angmsdag", 0x29AE); + //entity("angmsdah", 0x29AF); + //entity("angrt", 0x221F); + //entity("angrtvb", 0x22BE); + //entity("angrtvbd", 0x299D); + //entity("angsph", 0x2222); + //entity("angst", 0x212B); + //entity("angzarr", 0x237C); + //entity("aogon", 0x0105); + //entity("Aogon", 0x0104); + //entity("aopf", 0x1D552); + //entity("Aopf", 0x1D538); + //entity("ap", 0x2248); + //entity("apacir", 0x2A6F); + //entity("ape", 0x224A); + //entity("apE", 0x2A70); + //entity("apid", 0x224B); + entity("apos", 0x0027); + //entity("ApplyFunction", 0x2061); + //entity("approx", 0x2248); + //entity("approxeq", 0x224A); + entity("aring", 0x00E5); + entity("Aring", 0x00C5); + //entity("ascr", 0x1D4B6); + //entity("Ascr", 0x1D49C); + //entity("Assign", 0x2254); + entity("ast", 0x002A); + //entity("asymp", 0x2248); + //entity("asympeq", 0x224D); + entity("atilde", 0x00E3); + entity("Atilde", 0x00C3); + entity("auml", 0x00E4); + entity("Auml", 0x00C4); + //entity("awconint", 0x2233); + //entity("awint", 0x2A11); + //entity("b.alpha", 0x1D6C2); + //entity("b.beta", 0x1D6C3); + //entity("b.chi", 0x1D6D8); + //entity("b.delta", 0x1D6C5); + //entity("b.Delta", 0x1D6AB); + //entity("b.epsi", 0x1D6C6); + //entity("b.epsiv", 0x1D6DC); + //entity("b.eta", 0x1D6C8); + //entity("b.gamma", 0x1D6C4); + //entity("b.Gamma", 0x1D6AA); + //entity("b.gammad", 0x1D7CB); + //entity("b.Gammad", 0x1D7CA); + //entity("b.iota", 0x1D6CA); + //entity("b.kappa", 0x1D6CB); + //entity("b.kappav", 0x1D6DE); + //entity("b.lambda", 0x1D6CC); + //entity("b.Lambda", 0x1D6B2); + //entity("b.mu", 0x1D6CD); + //entity("b.nu", 0x1D6CE); + //entity("b.omega", 0x1D6DA); + //entity("b.Omega", 0x1D6C0); + //entity("b.phi", 0x1D6D7); + //entity("b.Phi", 0x1D6BD); + //entity("b.phiv", 0x1D6DF); + //entity("b.pi", 0x1D6D1); + //entity("b.Pi", 0x1D6B7); + //entity("b.piv", 0x1D6E1); + //entity("b.psi", 0x1D6D9); + //entity("b.Psi", 0x1D6BF); + //entity("b.rho", 0x1D6D2); + //entity("b.rhov", 0x1D6E0); + //entity("b.sigma", 0x1D6D4); + //entity("b.Sigma", 0x1D6BA); + //entity("b.sigmav", 0x1D6D3); + //entity("b.tau", 0x1D6D5); + //entity("b.Theta", 0x1D6AF); + //entity("b.thetas", 0x1D6C9); + //entity("b.thetav", 0x1D6DD); + //entity("b.upsi", 0x1D6D6); + //entity("b.Upsi", 0x1D6BC); + //entity("b.xi", 0x1D6CF); + //entity("b.Xi", 0x1D6B5); + //entity("b.zeta", 0x1D6C7); + //entity("backcong", 0x224C); + //entity("backepsilon", 0x03F6); + //entity("backprime", 0x2035); + //entity("backsim", 0x223D); + //entity("backsimeq", 0x22CD); + //entity("Backslash", 0x2216); + //entity("Barv", 0x2AE7); + //entity("barvee", 0x22BD); + //entity("barwed", 0x2305); + //entity("Barwed", 0x2306); + //entity("barwedge", 0x2305); + //entity("bbrk", 0x23B5); + //entity("bbrktbrk", 0x23B6); + //entity("bcong", 0x224C); + //entity("bcy", 0x0431); + //entity("Bcy", 0x0411); + //entity("bdquo", 0x201E); + //entity("becaus", 0x2235); + //entity("because", 0x2235); + //entity("bemptyv", 0x29B0); + //entity("bepsi", 0x03F6); + //entity("bernou", 0x212C); + //entity("Bernoullis", 0x212C); + //entity("beta", 0x03B2); + //entity("Beta", 0x0392); + //entity("beth", 0x2136); + //entity("between", 0x226C); + //entity("bfr", 0x1D51F); + //entity("Bfr", 0x1D505); + //entity("bgr", 0x03B2); + //entity("Bgr", 0x0392); + //entity("bigcap", 0x22C2); + //entity("bigcirc", 0x25EF); + //entity("bigcup", 0x22C3); + //entity("bigodot", 0x2A00); + //entity("bigoplus", 0x2A01); + //entity("bigotimes", 0x2A02); + //entity("bigsqcup", 0x2A06); + //entity("bigstar", 0x2605); + //entity("bigtriangledown", 0x25BD); + //entity("bigtriangleup", 0x25B3); + //entity("biguplus", 0x2A04); + //entity("bigvee", 0x22C1); + //entity("bigwedge", 0x22C0); + //entity("bkarow", 0x290D); + //entity("blacklozenge", 0x29EB); + //entity("blacksquare", 0x25AA); + //entity("blacktriangle", 0x25B4); + //entity("blacktriangledown", 0x25BE); + //entity("blacktriangleleft", 0x25C2); + //entity("blacktriangleright", 0x25B8); + //entity("blank", 0x2423); + //entity("blk12", 0x2592); + //entity("blk14", 0x2591); + //entity("blk34", 0x2593); + //entity("block", 0x2588); + //entity("bnot", 0x2310); + //entity("bNot", 0x2AED); + //entity("bopf", 0x1D553); + //entity("Bopf", 0x1D539); + //entity("bot", 0x22A5); + //entity("bottom", 0x22A5); + //entity("bowtie", 0x22C8); + //entity("boxbox", 0x29C9); + //entity("boxdl", 0x2510); + //entity("boxdL", 0x2555); + //entity("boxDl", 0x2556); + //entity("boxDL", 0x2557); + //entity("boxdr", 0x250C); + //entity("boxdR", 0x2552); + //entity("boxDr", 0x2553); + //entity("boxDR", 0x2554); + //entity("boxh", 0x2500); + //entity("boxH", 0x2550); + //entity("boxhd", 0x252C); + //entity("boxhD", 0x2565); + //entity("boxHd", 0x2564); + //entity("boxHD", 0x2566); + //entity("boxhu", 0x2534); + //entity("boxhU", 0x2568); + //entity("boxHu", 0x2567); + //entity("boxHU", 0x2569); + //entity("boxminus", 0x229F); + //entity("boxplus", 0x229E); + //entity("boxtimes", 0x22A0); + //entity("boxul", 0x2518); + //entity("boxuL", 0x255B); + //entity("boxUl", 0x255C); + //entity("boxUL", 0x255D); + //entity("boxur", 0x2514); + //entity("boxuR", 0x2558); + //entity("boxUr", 0x2559); + //entity("boxUR", 0x255A); + //entity("boxv", 0x2502); + //entity("boxV", 0x2551); + //entity("boxvh", 0x253C); + //entity("boxvH", 0x256A); + //entity("boxVh", 0x256B); + //entity("boxVH", 0x256C); + //entity("boxvl", 0x2524); + //entity("boxvL", 0x2561); + //entity("boxVl", 0x2562); + //entity("boxVL", 0x2563); + //entity("boxvr", 0x251C); + //entity("boxvR", 0x255E); + //entity("boxVr", 0x255F); + //entity("boxVR", 0x2560); + //entity("bprime", 0x2035); + //entity("breve", 0x02D8); + entity("brvbar", 0x00A6); + //entity("bscr", 0x1D4B7); + //entity("Bscr", 0x212C); + //entity("bsemi", 0x204F); + //entity("bsim", 0x223D); + //entity("bsime", 0x22CD); + entity("bsol", 0x005C); + //entity("bsolb", 0x29C5); + //entity("bull", 0x2022); + //entity("bullet", 0x2022); + //entity("bump", 0x224E); + //entity("bumpe", 0x224F); + //entity("bumpE", 0x2AAE); + //entity("bumpeq", 0x224F); + //entity("Bumpeq", 0x224E); + //entity("cacute", 0x0107); + //entity("Cacute", 0x0106); + //entity("cap", 0x2229); + //entity("Cap", 0x22D2); + //entity("capand", 0x2A44); + //entity("capbrcup", 0x2A49); + //entity("capcap", 0x2A4B); + //entity("capcup", 0x2A47); + //entity("capdot", 0x2A40); + //entity("CapitalDifferentialD", 0x2145); + //entity("caret", 0x2041); + //entity("caron", 0x02C7); + //entity("Cayleys", 0x212D); + //entity("ccaps", 0x2A4D); + //entity("ccaron", 0x010D); + //entity("Ccaron", 0x010C); + entity("ccedil", 0x00E7); + entity("Ccedil", 0x00C7); + //entity("ccirc", 0x0109); + //entity("Ccirc", 0x0108); + //entity("Cconint", 0x2230); + //entity("ccups", 0x2A4C); + //entity("ccupssm", 0x2A50); + //entity("cdot", 0x010B); + //entity("Cdot", 0x010A); + entity("cedil", 0x00B8); + entity("Cedilla", 0x00B8); + //entity("cemptyv", 0x29B2); + entity("cent", 0x00A2); + entity("centerdot", 0x00B7); + //entity("cfr", 0x1D520); + //entity("Cfr", 0x212D); + //entity("chcy", 0x0447); + //entity("CHcy", 0x0427); + //entity("check", 0x2713); + //entity("checkmark", 0x2713); + //entity("chi", 0x03C7); + //entity("Chi", 0x03A7); + //entity("cir", 0x25CB); + //entity("circ", 0x02C6); + //entity("circeq", 0x2257); + //entity("circlearrowleft", 0x21BA); + //entity("circlearrowright", 0x21BB); + //entity("circledast", 0x229B); + //entity("circledcirc", 0x229A); + //entity("circleddash", 0x229D); + //entity("CircleDot", 0x2299); + entity("circledR", 0x00AE); + //entity("circledS", 0x24C8); + //entity("CircleMinus", 0x2296); + //entity("CirclePlus", 0x2295); + //entity("CircleTimes", 0x2297); + //entity("cire", 0x2257); + //entity("cirE", 0x29C3); + //entity("cirfnint", 0x2A10); + //entity("cirmid", 0x2AEF); + //entity("cirscir", 0x29C2); + //entity("ClockwiseContourIntegral", 0x2232); + //entity("CloseCurlyDoubleQuote", 0x201D); + //entity("CloseCurlyQuote", 0x2019); + //entity("clubs", 0x2663); + //entity("clubsuit", 0x2663); + entity("colon", 0x003A); + //entity("Colon", 0x2237); + //entity("colone", 0x2254); + //entity("Colone", 0x2A74); + //entity("coloneq", 0x2254); + entity("comma", 0x002C); + entity("commat", 0x0040); + //entity("comp", 0x2201); + //entity("compfn", 0x2218); + //entity("complement", 0x2201); + //entity("complexes", 0x2102); + //entity("cong", 0x2245); + //entity("congdot", 0x2A6D); + //entity("Congruent", 0x2261); + //entity("conint", 0x222E); + //entity("Conint", 0x222F); + //entity("ContourIntegral", 0x222E); + //entity("copf", 0x1D554); + //entity("Copf", 0x2102); + //entity("coprod", 0x2210); + //entity("Coproduct", 0x2210); + entity("copy", 0x00A9); + //entity("copysr", 0x2117); + //entity("CounterClockwiseContourIntegral", 0x2233); + //entity("crarr", 0x21B5); + //entity("cross", 0x2717); + //entity("Cross", 0x2A2F); + //entity("cscr", 0x1D4B8); + //entity("Cscr", 0x1D49E); + //entity("csub", 0x2ACF); + //entity("csube", 0x2AD1); + //entity("csup", 0x2AD0); + //entity("csupe", 0x2AD2); + //entity("ctdot", 0x22EF); + //entity("cudarrl", 0x2938); + //entity("cudarrr", 0x2935); + //entity("cuepr", 0x22DE); + //entity("cuesc", 0x22DF); + //entity("cularr", 0x21B6); + //entity("cularrp", 0x293D); + //entity("cup", 0x222A); + //entity("Cup", 0x22D3); + //entity("cupbrcap", 0x2A48); + //entity("cupcap", 0x2A46); + //entity("CupCap", 0x224D); + //entity("cupcup", 0x2A4A); + //entity("cupdot", 0x228D); + //entity("cupor", 0x2A45); + //entity("curarr", 0x21B7); + //entity("curarrm", 0x293C); + //entity("curlyeqprec", 0x22DE); + //entity("curlyeqsucc", 0x22DF); + //entity("curlyvee", 0x22CE); + //entity("curlywedge", 0x22CF); + entity("curren", 0x00A4); + //entity("curvearrowleft", 0x21B6); + //entity("curvearrowright", 0x21B7); + //entity("cuvee", 0x22CE); + //entity("cuwed", 0x22CF); + //entity("cwconint", 0x2232); + //entity("cwint", 0x2231); + //entity("cylcty", 0x232D); + //entity("dagger", 0x2020); + //entity("Dagger", 0x2021); + //entity("daleth", 0x2138); + //entity("darr", 0x2193); + //entity("dArr", 0x21D3); + //entity("Darr", 0x21A1); + //entity("dash", 0x2010); + //entity("dashv", 0x22A3); + //entity("Dashv", 0x2AE4); + //entity("dbkarow", 0x290F); + //entity("dblac", 0x02DD); + //entity("dcaron", 0x010F); + //entity("Dcaron", 0x010E); + //entity("dcy", 0x0434); + //entity("Dcy", 0x0414); + //entity("dd", 0x2146); + //entity("DD", 0x2145); + //entity("ddagger", 0x2021); + //entity("ddarr", 0x21CA); + //entity("DDotrahd", 0x2911); + //entity("ddotseq", 0x2A77); + entity("deg", 0x00B0); + //entity("Del", 0x2207); + //entity("delta", 0x03B4); + //entity("Delta", 0x0394); + //entity("demptyv", 0x29B1); + //entity("dfisht", 0x297F); + //entity("dfr", 0x1D521); + //entity("Dfr", 0x1D507); + //entity("dgr", 0x03B4); + //entity("Dgr", 0x0394); + //entity("dHar", 0x2965); + //entity("dharl", 0x21C3); + //entity("dharr", 0x21C2); + entity("DiacriticalAcute", 0x00B4); + //entity("DiacriticalDot", 0x02D9); + //entity("DiacriticalDoubleAcute", 0x02DD); + entity("DiacriticalGrave", 0x0060); + //entity("DiacriticalTilde", 0x02DC); + //entity("diam", 0x22C4); + //entity("diamond", 0x22C4); + //entity("diamondsuit", 0x2666); + //entity("diams", 0x2666); + entity("die", 0x00A8); + //entity("DifferentialD", 0x2146); + //entity("digamma", 0x03DD); + //entity("disin", 0x22F2); + entity("div", 0x00F7); + entity("divide", 0x00F7); + //entity("divideontimes", 0x22C7); + //entity("divonx", 0x22C7); + //entity("djcy", 0x0452); + //entity("DJcy", 0x0402); + //entity("dlcorn", 0x231E); + //entity("dlcrop", 0x230D); + entity("dollar", 0x0024); + //entity("dopf", 0x1D555); + //entity("Dopf", 0x1D53B); + //entity("dot", 0x02D9); + entity("Dot", 0x00A8); + //entity("doteq", 0x2250); + //entity("doteqdot", 0x2251); + //entity("DotEqual", 0x2250); + //entity("dotminus", 0x2238); + //entity("dotplus", 0x2214); + //entity("dotsquare", 0x22A1); + //entity("doublebarwedge", 0x2306); + //entity("DoubleContourIntegral", 0x222F); + entity("DoubleDot", 0x00A8); + //entity("DoubleDownArrow", 0x21D3); + //entity("DoubleLeftArrow", 0x21D0); + //entity("DoubleLeftRightArrow", 0x21D4); + //entity("DoubleLeftTee", 0x2AE4); + //entity("DoubleLongLeftArrow", 0x27F8); + //entity("DoubleLongLeftRightArrow", 0x27FA); + //entity("DoubleLongRightArrow", 0x27F9); + //entity("DoubleRightArrow", 0x21D2); + //entity("DoubleRightTee", 0x22A8); + //entity("DoubleUpArrow", 0x21D1); + //entity("DoubleUpDownArrow", 0x21D5); + //entity("DoubleVerticalBar", 0x2225); + //entity("downarrow", 0x2193); + //entity("Downarrow", 0x21D3); + //entity("DownArrowBar", 0x2913); + //entity("DownArrowUpArrow", 0x21F5); + //entity("downdownarrows", 0x21CA); + //entity("downharpoonleft", 0x21C3); + //entity("downharpoonright", 0x21C2); + //entity("DownLeftRightVector", 0x2950); + //entity("DownLeftTeeVector", 0x295E); + //entity("DownLeftVector", 0x21BD); + //entity("DownLeftVectorBar", 0x2956); + //entity("DownRightTeeVector", 0x295F); + //entity("DownRightVector", 0x21C1); + //entity("DownRightVectorBar", 0x2957); + //entity("DownTee", 0x22A4); + //entity("DownTeeArrow", 0x21A7); + //entity("drbkarow", 0x2910); + //entity("drcorn", 0x231F); + //entity("drcrop", 0x230C); + //entity("dscr", 0x1D4B9); + //entity("Dscr", 0x1D49F); + //entity("dscy", 0x0455); + //entity("DScy", 0x0405); + //entity("dsol", 0x29F6); + //entity("dstrok", 0x0111); + //entity("Dstrok", 0x0110); + //entity("dtdot", 0x22F1); + //entity("dtri", 0x25BF); + //entity("dtrif", 0x25BE); + //entity("duarr", 0x21F5); + //entity("duhar", 0x296F); + //entity("dwangle", 0x29A6); + //entity("dzcy", 0x045F); + //entity("DZcy", 0x040F); + //entity("dzigrarr", 0x27FF); + //entity("eacgr", 0x03AD); + //entity("Eacgr", 0x0388); + entity("eacute", 0x00E9); + entity("Eacute", 0x00C9); + //entity("easter", 0x2A6E); + //entity("ecaron", 0x011B); + //entity("Ecaron", 0x011A); + //entity("ecir", 0x2256); + entity("ecirc", 0x00EA); + entity("Ecirc", 0x00CA); + //entity("ecolon", 0x2255); + //entity("ecy", 0x044D); + //entity("Ecy", 0x042D); + //entity("eDDot", 0x2A77); + //entity("edot", 0x0117); + //entity("eDot", 0x2251); + //entity("Edot", 0x0116); + //entity("ee", 0x2147); + //entity("eeacgr", 0x03AE); + //entity("EEacgr", 0x0389); + //entity("eegr", 0x03B7); + //entity("EEgr", 0x0397); + //entity("efDot", 0x2252); + //entity("efr", 0x1D522); + //entity("Efr", 0x1D508); + //entity("eg", 0x2A9A); + //entity("egr", 0x03B5); + //entity("Egr", 0x0395); + entity("egrave", 0x00E8); + entity("Egrave", 0x00C8); + //entity("egs", 0x2A96); + //entity("egsdot", 0x2A98); + //entity("el", 0x2A99); + //entity("Element", 0x2208); + //entity("elinters", 0x23E7); + //entity("ell", 0x2113); + //entity("els", 0x2A95); + //entity("elsdot", 0x2A97); + //entity("emacr", 0x0113); + //entity("Emacr", 0x0112); + //entity("empty", 0x2205); + //entity("emptyset", 0x2205); + //entity("EmptySmallSquare", 0x25FB); + //entity("emptyv", 0x2205); + //entity("EmptyVerySmallSquare", 0x25AB); + //entity("emsp", 0x2003); + //entity("emsp13", 0x2004); + //entity("emsp14", 0x2005); + //entity("eng", 0x014B); + //entity("ENG", 0x014A); + //entity("ensp", 0x2002); + //entity("eogon", 0x0119); + //entity("Eogon", 0x0118); + //entity("eopf", 0x1D556); + //entity("Eopf", 0x1D53C); + //entity("epar", 0x22D5); + //entity("eparsl", 0x29E3); + //entity("eplus", 0x2A71); + //entity("epsi", 0x03F5); + //entity("epsilon", 0x03B5); + //entity("Epsilon", 0x0395); + //entity("epsiv", 0x03B5); + //entity("eqcirc", 0x2256); + //entity("eqcolon", 0x2255); + //entity("eqsim", 0x2242); + //entity("eqslantgtr", 0x2A96); + //entity("eqslantless", 0x2A95); + //entity("Equal", 0x2A75); + entity("equals", 0x003D); + //entity("EqualTilde", 0x2242); + //entity("equest", 0x225F); + //entity("Equilibrium", 0x21CC); + //entity("equiv", 0x2261); + //entity("equivDD", 0x2A78); + //entity("eqvparsl", 0x29E5); + //entity("erarr", 0x2971); + //entity("erDot", 0x2253); + //entity("escr", 0x212F); + //entity("Escr", 0x2130); + //entity("esdot", 0x2250); + //entity("esim", 0x2242); + //entity("Esim", 0x2A73); + //entity("eta", 0x03B7); + //entity("Eta", 0x0397); + entity("eth", 0x00F0); + entity("ETH", 0x00D0); + entity("euml", 0x00EB); + entity("Euml", 0x00CB); + //entity("euro", 0x20AC); + entity("excl", 0x0021); + //entity("exist", 0x2203); + //entity("Exists", 0x2203); + //entity("expectation", 0x2130); + //entity("exponentiale", 0x2147); + //entity("fallingdotseq", 0x2252); + //entity("fcy", 0x0444); + //entity("Fcy", 0x0424); + //entity("female", 0x2640); + //entity("ffilig", 0xFB03); + //entity("fflig", 0xFB00); + //entity("ffllig", 0xFB04); + //entity("ffr", 0x1D523); + //entity("Ffr", 0x1D509); + //entity("filig", 0xFB01); + //entity("FilledSmallSquare", 0x25FC); + //entity("FilledVerySmallSquare", 0x25AA); + //entity("flat", 0x266D); + //entity("fllig", 0xFB02); + //entity("fltns", 0x25B1); + //entity("fnof", 0x0192); + //entity("fopf", 0x1D557); + //entity("Fopf", 0x1D53D); + //entity("forall", 0x2200); + //entity("fork", 0x22D4); + //entity("forkv", 0x2AD9); + //entity("Fouriertrf", 0x2131); + //entity("fpartint", 0x2A0D); + entity("frac12", 0x00BD); + //entity("frac13", 0x2153); + entity("frac14", 0x00BC); + //entity("frac15", 0x2155); + //entity("frac16", 0x2159); + //entity("frac18", 0x215B); + //entity("frac23", 0x2154); + //entity("frac25", 0x2156); + entity("frac34", 0x00BE); + //entity("frac35", 0x2157); + //entity("frac38", 0x215C); + //entity("frac45", 0x2158); + //entity("frac56", 0x215A); + //entity("frac58", 0x215D); + //entity("frac78", 0x215E); + //entity("frasl", 0x2044); + //entity("frown", 0x2322); + //entity("fscr", 0x1D4BB); + //entity("Fscr", 0x2131); + //entity("gacute", 0x01F5); + //entity("gamma", 0x03B3); + //entity("Gamma", 0x0393); + //entity("gammad", 0x03DD); + //entity("Gammad", 0x03DC); + //entity("gap", 0x2A86); + //entity("gbreve", 0x011F); + //entity("Gbreve", 0x011E); + //entity("Gcedil", 0x0122); + //entity("gcirc", 0x011D); + //entity("Gcirc", 0x011C); + //entity("gcy", 0x0433); + //entity("Gcy", 0x0413); + //entity("gdot", 0x0121); + //entity("Gdot", 0x0120); + //entity("ge", 0x2265); + //entity("gE", 0x2267); + //entity("gel", 0x22DB); + //entity("gEl", 0x2A8C); + //entity("geq", 0x2265); + //entity("geqq", 0x2267); + //entity("geqslant", 0x2A7E); + //entity("ges", 0x2A7E); + //entity("gescc", 0x2AA9); + //entity("gesdot", 0x2A80); + //entity("gesdoto", 0x2A82); + //entity("gesdotol", 0x2A84); + //entity("gesles", 0x2A94); + //entity("gfr", 0x1D524); + //entity("Gfr", 0x1D50A); + //entity("gg", 0x226B); + //entity("Gg", 0x22D9); + //entity("ggg", 0x22D9); + //entity("ggr", 0x03B3); + //entity("Ggr", 0x0393); + //entity("gimel", 0x2137); + //entity("gjcy", 0x0453); + //entity("GJcy", 0x0403); + //entity("gl", 0x2277); + //entity("gla", 0x2AA5); + //entity("glE", 0x2A92); + //entity("glj", 0x2AA4); + //entity("gnap", 0x2A8A); + //entity("gnapprox", 0x2A8A); + //entity("gne", 0x2A88); + //entity("gnE", 0x2269); + //entity("gneq", 0x2A88); + //entity("gneqq", 0x2269); + //entity("gnsim", 0x22E7); + //entity("gopf", 0x1D558); + //entity("Gopf", 0x1D53E); + entity("grave", 0x0060); + //entity("GreaterEqual", 0x2265); + //entity("GreaterEqualLess", 0x22DB); + //entity("GreaterFullEqual", 0x2267); + //entity("GreaterGreater", 0x2AA2); + //entity("GreaterLess", 0x2277); + //entity("GreaterSlantEqual", 0x2A7E); + //entity("GreaterTilde", 0x2273); + //entity("gscr", 0x210A); + //entity("Gscr", 0x1D4A2); + //entity("gsim", 0x2273); + //entity("gsime", 0x2A8E); + //entity("gsiml", 0x2A90); + entity("gt", 0x003E); + //entity("Gt", 0x226B); + //entity("gtcc", 0x2AA7); + //entity("gtcir", 0x2A7A); + //entity("gtdot", 0x22D7); + //entity("gtlPar", 0x2995); + //entity("gtquest", 0x2A7C); + //entity("gtrapprox", 0x2A86); + //entity("gtrarr", 0x2978); + //entity("gtrdot", 0x22D7); + //entity("gtreqless", 0x22DB); + //entity("gtreqqless", 0x2A8C); + //entity("gtrless", 0x2277); + //entity("gtrsim", 0x2273); + //entity("Hacek", 0x02C7); + //entity("hairsp", 0x200A); + entity("half", 0x00BD); + //entity("hamilt", 0x210B); + //entity("hardcy", 0x044A); + //entity("HARDcy", 0x042A); + //entity("harr", 0x2194); + //entity("hArr", 0x21D4); + //entity("harrcir", 0x2948); + //entity("harrw", 0x21AD); + entity("Hat", 0x005E); + //entity("hbar", 0x210F); + //entity("hcirc", 0x0125); + //entity("Hcirc", 0x0124); + //entity("hearts", 0x2665); + //entity("heartsuit", 0x2665); + //entity("hellip", 0x2026); + //entity("hercon", 0x22B9); + //entity("hfr", 0x1D525); + //entity("Hfr", 0x210C); + //entity("HilbertSpace", 0x210B); + //entity("hksearow", 0x2925); + //entity("hkswarow", 0x2926); + //entity("hoarr", 0x21FF); + //entity("homtht", 0x223B); + //entity("hookleftarrow", 0x21A9); + //entity("hookrightarrow", 0x21AA); + //entity("hopf", 0x1D559); + //entity("Hopf", 0x210D); + //entity("horbar", 0x2015); + //entity("HorizontalLine", 0x2500); + //entity("hscr", 0x1D4BD); + //entity("Hscr", 0x210B); + //entity("hslash", 0x210F); + //entity("hstrok", 0x0127); + //entity("Hstrok", 0x0126); + //entity("HumpDownHump", 0x224E); + //entity("HumpEqual", 0x224F); + //entity("hybull", 0x2043); + //entity("hyphen", 0x2010); + //entity("iacgr", 0x03AF); + //entity("Iacgr", 0x038A); + entity("iacute", 0x00ED); + entity("Iacute", 0x00CD); + //entity("ic", 0x2063); + entity("icirc", 0x00EE); + entity("Icirc", 0x00CE); + //entity("icy", 0x0438); + //entity("Icy", 0x0418); + //entity("idiagr", 0x0390); + //entity("idigr", 0x03CA); + //entity("Idigr", 0x03AA); + //entity("Idot", 0x0130); + //entity("iecy", 0x0435); + //entity("IEcy", 0x0415); + entity("iexcl", 0x00A1); + //entity("iff", 0x21D4); + //entity("ifr", 0x1D526); + //entity("Ifr", 0x2111); + //entity("igr", 0x03B9); + //entity("Igr", 0x0399); + entity("igrave", 0x00EC); + entity("Igrave", 0x00CC); + //entity("ii", 0x2148); + //entity("iiiint", 0x2A0C); + //entity("iiint", 0x222D); + //entity("iinfin", 0x29DC); + //entity("iiota", 0x2129); + //entity("ijlig", 0x0133); + //entity("IJlig", 0x0132); + //entity("Im", 0x2111); + //entity("imacr", 0x012B); + //entity("Imacr", 0x012A); + //entity("image", 0x2111); + //entity("ImaginaryI", 0x2148); + //entity("imagline", 0x2110); + //entity("imagpart", 0x2111); + //entity("imath", 0x0131); + //entity("imof", 0x22B7); + //entity("imped", 0x01B5); + //entity("Implies", 0x21D2); + //entity("in", 0x2208); + //entity("incare", 0x2105); + //entity("infin", 0x221E); + //entity("infintie", 0x29DD); + //entity("inodot", 0x0131); + //entity("int", 0x222B); + //entity("Int", 0x222C); + //entity("intcal", 0x22BA); + //entity("integers", 0x2124); + //entity("Integral", 0x222B); + //entity("intercal", 0x22BA); + //entity("Intersection", 0x22C2); + //entity("intlarhk", 0x2A17); + //entity("intprod", 0x2A3C); + //entity("InvisibleComma", 0x2063); + //entity("InvisibleTimes", 0x2062); + //entity("iocy", 0x0451); + //entity("IOcy", 0x0401); + //entity("iogon", 0x012F); + //entity("Iogon", 0x012E); + //entity("iopf", 0x1D55A); + //entity("Iopf", 0x1D540); + //entity("iota", 0x03B9); + //entity("Iota", 0x0399); + //entity("iprod", 0x2A3C); + entity("iquest", 0x00BF); + //entity("iscr", 0x1D4BE); + //entity("Iscr", 0x2110); + //entity("isin", 0x2208); + //entity("isindot", 0x22F5); + //entity("isinE", 0x22F9); + //entity("isins", 0x22F4); + //entity("isinsv", 0x22F3); + //entity("isinv", 0x2208); + //entity("it", 0x2062); + //entity("itilde", 0x0129); + //entity("Itilde", 0x0128); + //entity("iukcy", 0x0456); + //entity("Iukcy", 0x0406); + entity("iuml", 0x00EF); + entity("Iuml", 0x00CF); + //entity("jcirc", 0x0135); + //entity("Jcirc", 0x0134); + //entity("jcy", 0x0439); + //entity("Jcy", 0x0419); + //entity("jfr", 0x1D527); + //entity("Jfr", 0x1D50D); + //entity("jmath", 0x0237); + //entity("jopf", 0x1D55B); + //entity("Jopf", 0x1D541); + //entity("jscr", 0x1D4BF); + //entity("Jscr", 0x1D4A5); + //entity("jsercy", 0x0458); + //entity("Jsercy", 0x0408); + //entity("jukcy", 0x0454); + //entity("Jukcy", 0x0404); + //entity("kappa", 0x03BA); + //entity("Kappa", 0x039A); + //entity("kappav", 0x03F0); + //entity("kcedil", 0x0137); + //entity("Kcedil", 0x0136); + //entity("kcy", 0x043A); + //entity("Kcy", 0x041A); + //entity("kfr", 0x1D528); + //entity("Kfr", 0x1D50E); + //entity("kgr", 0x03BA); + //entity("Kgr", 0x039A); + //entity("kgreen", 0x0138); + //entity("khcy", 0x0445); + //entity("KHcy", 0x0425); + //entity("khgr", 0x03C7); + //entity("KHgr", 0x03A7); + //entity("kjcy", 0x045C); + //entity("KJcy", 0x040C); + //entity("kopf", 0x1D55C); + //entity("Kopf", 0x1D542); + //entity("kscr", 0x1D4C0); + //entity("Kscr", 0x1D4A6); + //entity("lAarr", 0x21DA); + //entity("lacute", 0x013A); + //entity("Lacute", 0x0139); + //entity("laemptyv", 0x29B4); + //entity("lagran", 0x2112); + //entity("lambda", 0x03BB); + //entity("Lambda", 0x039B); + //entity("lang", 0x2329); + //entity("Lang", 0x27EA); + //entity("langd", 0x2991); + //entity("langle", 0x2329); + //entity("lap", 0x2A85); + //entity("Laplacetrf", 0x2112); + entity("laquo", 0x00AB); + //entity("larr", 0x2190); + //entity("lArr", 0x21D0); + //entity("Larr", 0x219E); + //entity("larrb", 0x21E4); + //entity("larrbfs", 0x291F); + //entity("larrfs", 0x291D); + //entity("larrhk", 0x21A9); + //entity("larrlp", 0x21AB); + //entity("larrpl", 0x2939); + //entity("larrsim", 0x2973); + //entity("larrtl", 0x21A2); + //entity("lat", 0x2AAB); + //entity("latail", 0x2919); + //entity("lAtail", 0x291B); + //entity("late", 0x2AAD); + //entity("lbarr", 0x290C); + //entity("lBarr", 0x290E); + //entity("lbbrk", 0x2997); + entity("lbrace", 0x007B); + entity("lbrack", 0x005B); + //entity("lbrke", 0x298B); + //entity("lbrksld", 0x298F); + //entity("lbrkslu", 0x298D); + //entity("lcaron", 0x013E); + //entity("Lcaron", 0x013D); + //entity("lcedil", 0x013C); + //entity("Lcedil", 0x013B); + //entity("lceil", 0x2308); + entity("lcub", 0x007B); + //entity("lcy", 0x043B); + //entity("Lcy", 0x041B); + //entity("ldca", 0x2936); + //entity("ldquo", 0x201C); + //entity("ldquor", 0x201E); + //entity("ldrdhar", 0x2967); + //entity("ldrushar", 0x294B); + //entity("ldsh", 0x21B2); + //entity("le", 0x2264); + //entity("lE", 0x2266); + //entity("LeftAngleBracket", 0x2329); + //entity("leftarrow", 0x2190); + //entity("Leftarrow", 0x21D0); + //entity("LeftArrowBar", 0x21E4); + //entity("LeftArrowRightArrow", 0x21C6); + //entity("leftarrowtail", 0x21A2); + //entity("LeftCeiling", 0x2308); + //entity("LeftDoubleBracket", 0x27E6); + //entity("LeftDownTeeVector", 0x2961); + //entity("LeftDownVector", 0x21C3); + //entity("LeftDownVectorBar", 0x2959); + //entity("LeftFloor", 0x230A); + //entity("leftharpoondown", 0x21BD); + //entity("leftharpoonup", 0x21BC); + //entity("leftleftarrows", 0x21C7); + //entity("leftrightarrow", 0x2194); + //entity("Leftrightarrow", 0x21D4); + //entity("leftrightarrows", 0x21C6); + //entity("leftrightharpoons", 0x21CB); + //entity("leftrightsquigarrow", 0x21AD); + //entity("LeftRightVector", 0x294E); + //entity("LeftTee", 0x22A3); + //entity("LeftTeeArrow", 0x21A4); + //entity("LeftTeeVector", 0x295A); + //entity("leftthreetimes", 0x22CB); + //entity("LeftTriangle", 0x22B2); + //entity("LeftTriangleBar", 0x29CF); + //entity("LeftTriangleEqual", 0x22B4); + //entity("LeftUpDownVector", 0x2951); + //entity("LeftUpTeeVector", 0x2960); + //entity("LeftUpVector", 0x21BF); + //entity("LeftUpVectorBar", 0x2958); + //entity("LeftVector", 0x21BC); + //entity("LeftVectorBar", 0x2952); + //entity("leg", 0x22DA); + //entity("lEg", 0x2A8B); + //entity("leq", 0x2264); + //entity("leqq", 0x2266); + //entity("leqslant", 0x2A7D); + //entity("les", 0x2A7D); + //entity("lescc", 0x2AA8); + //entity("lesdot", 0x2A7F); + //entity("lesdoto", 0x2A81); + //entity("lesdotor", 0x2A83); + //entity("lesges", 0x2A93); + //entity("lessapprox", 0x2A85); + //entity("lessdot", 0x22D6); + //entity("lesseqgtr", 0x22DA); + //entity("lesseqqgtr", 0x2A8B); + //entity("LessEqualGreater", 0x22DA); + //entity("LessFullEqual", 0x2266); + //entity("LessGreater", 0x2276); + //entity("lessgtr", 0x2276); + //entity("LessLess", 0x2AA1); + //entity("lesssim", 0x2272); + //entity("LessSlantEqual", 0x2A7D); + //entity("LessTilde", 0x2272); + //entity("lfisht", 0x297C); + //entity("lfloor", 0x230A); + //entity("lfr", 0x1D529); + //entity("Lfr", 0x1D50F); + //entity("lg", 0x2276); + //entity("lgE", 0x2A91); + //entity("lgr", 0x03BB); + //entity("Lgr", 0x039B); + //entity("lHar", 0x2962); + //entity("lhard", 0x21BD); + //entity("lharu", 0x21BC); + //entity("lharul", 0x296A); + //entity("lhblk", 0x2584); + //entity("ljcy", 0x0459); + //entity("LJcy", 0x0409); + //entity("ll", 0x226A); + //entity("Ll", 0x22D8); + //entity("llarr", 0x21C7); + //entity("llcorner", 0x231E); + //entity("Lleftarrow", 0x21DA); + //entity("llhard", 0x296B); + //entity("lltri", 0x25FA); + //entity("lmidot", 0x0140); + //entity("Lmidot", 0x013F); + //entity("lmoust", 0x23B0); + //entity("lmoustache", 0x23B0); + //entity("lnap", 0x2A89); + //entity("lnapprox", 0x2A89); + //entity("lne", 0x2A87); + //entity("lnE", 0x2268); + //entity("lneq", 0x2A87); + //entity("lneqq", 0x2268); + //entity("lnsim", 0x22E6); + //entity("loang", 0x27EC); + //entity("loarr", 0x21FD); + //entity("lobrk", 0x27E6); + //entity("longleftarrow", 0x27F5); + //entity("Longleftarrow", 0x27F8); + //entity("longleftrightarrow", 0x27F7); + //entity("Longleftrightarrow", 0x27FA); + //entity("longmapsto", 0x27FC); + //entity("longrightarrow", 0x27F6); + //entity("Longrightarrow", 0x27F9); + //entity("looparrowleft", 0x21AB); + //entity("looparrowright", 0x21AC); + //entity("lopar", 0x2985); + //entity("lopf", 0x1D55D); + //entity("Lopf", 0x1D543); + //entity("loplus", 0x2A2D); + //entity("lotimes", 0x2A34); + //entity("lowast", 0x2217); + entity("lowbar", 0x005F); + //entity("LowerLeftArrow", 0x2199); + //entity("LowerRightArrow", 0x2198); + //entity("loz", 0x25CA); + //entity("lozenge", 0x25CA); + //entity("lozf", 0x29EB); + entity("lpar", 0x0028); + //entity("lparlt", 0x2993); + //entity("lrarr", 0x21C6); + //entity("lrcorner", 0x231F); + //entity("lrhar", 0x21CB); + //entity("lrhard", 0x296D); + //entity("lrm", 0x200E); + //entity("lrtri", 0x22BF); + //entity("lsaquo", 0x2039); + //entity("lscr", 0x1D4C1); + //entity("Lscr", 0x2112); + //entity("lsh", 0x21B0); + //entity("lsim", 0x2272); + //entity("lsime", 0x2A8D); + //entity("lsimg", 0x2A8F); + entity("lsqb", 0x005B); + //entity("lsquo", 0x2018); + //entity("lsquor", 0x201A); + //entity("lstrok", 0x0142); + //entity("Lstrok", 0x0141); + entity("lt", 0x003C); + //entity("Lt", 0x226A); + //entity("ltcc", 0x2AA6); + //entity("ltcir", 0x2A79); + //entity("ltdot", 0x22D6); + //entity("lthree", 0x22CB); + //entity("ltimes", 0x22C9); + //entity("ltlarr", 0x2976); + //entity("ltquest", 0x2A7B); + //entity("ltri", 0x25C3); + //entity("ltrie", 0x22B4); + //entity("ltrif", 0x25C2); + //entity("ltrPar", 0x2996); + //entity("lurdshar", 0x294A); + //entity("luruhar", 0x2966); + entity("macr", 0x00AF); + //entity("male", 0x2642); + //entity("malt", 0x2720); + //entity("maltese", 0x2720); + //entity("map", 0x21A6); + //entity("Map", 0x2905); + //entity("mapsto", 0x21A6); + //entity("mapstodown", 0x21A7); + //entity("mapstoleft", 0x21A4); + //entity("mapstoup", 0x21A5); + //entity("marker", 0x25AE); + //entity("mcomma", 0x2A29); + //entity("mcy", 0x043C); + //entity("Mcy", 0x041C); + //entity("mdash", 0x2014); + //entity("mDDot", 0x223A); + //entity("measuredangle", 0x2221); + //entity("MediumSpace", 0x205F); + //entity("Mellintrf", 0x2133); + //entity("mfr", 0x1D52A); + //entity("Mfr", 0x1D510); + //entity("mgr", 0x03BC); + //entity("Mgr", 0x039C); + //entity("mho", 0x2127); + entity("micro", 0x00B5); + //entity("mid", 0x2223); + //entity("midast", 0x002A); + //entity("midcir", 0x2AF0); + entity("middot", 0x00B7); + //entity("minus", 0x2212); + //entity("minusb", 0x229F); + //entity("minusd", 0x2238); + //entity("minusdu", 0x2A2A); + //entity("MinusPlus", 0x2213); + //entity("mlcp", 0x2ADB); + //entity("mldr", 0x2026); + //entity("mnplus", 0x2213); + //entity("models", 0x22A7); + //entity("mopf", 0x1D55E); + //entity("Mopf", 0x1D544); + //entity("mp", 0x2213); + //entity("mscr", 0x1D4C2); + //entity("Mscr", 0x2133); + //entity("mstpos", 0x223E); + //entity("mu", 0x03BC); + //entity("Mu", 0x039C); + //entity("multimap", 0x22B8); + //entity("mumap", 0x22B8); + //entity("nabla", 0x2207); + //entity("nacute", 0x0144); + //entity("Nacute", 0x0143); + //entity("nap", 0x2249); + //entity("napos", 0x0149); + //entity("napprox", 0x2249); + //entity("natur", 0x266E); + //entity("natural", 0x266E); + //entity("naturals", 0x2115); + entity("nbsp", 0x00A0); + //entity("ncap", 0x2A43); + //entity("ncaron", 0x0148); + //entity("Ncaron", 0x0147); + //entity("ncedil", 0x0146); + //entity("Ncedil", 0x0145); + //entity("ncong", 0x2247); + //entity("ncup", 0x2A42); + //entity("ncy", 0x043D); + //entity("Ncy", 0x041D); + //entity("ndash", 0x2013); + //entity("ne", 0x2260); + //entity("nearhk", 0x2924); + //entity("nearr", 0x2197); + //entity("neArr", 0x21D7); + //entity("nearrow", 0x2197); + //entity("NegativeMediumSpace", 0x200B); + //entity("NegativeThickSpace", 0x200B); + //entity("NegativeThinSpace", 0x200B); + //entity("NegativeVeryThinSpace", 0x200B); + //entity("nequiv", 0x2262); + //entity("nesear", 0x2928); + //entity("NestedGreaterGreater", 0x226B); + //entity("NestedLessLess", 0x226A); + entity("NewLine", 0x000A); + //entity("nexist", 0x2204); + //entity("nexists", 0x2204); + //entity("nfr", 0x1D52B); + //entity("Nfr", 0x1D511); + //entity("nge", 0x2271); + //entity("ngeq", 0x2271); + //entity("ngr", 0x03BD); + //entity("Ngr", 0x039D); + //entity("ngsim", 0x2275); + //entity("ngt", 0x226F); + //entity("ngtr", 0x226F); + //entity("nharr", 0x21AE); + //entity("nhArr", 0x21CE); + //entity("nhpar", 0x2AF2); + //entity("ni", 0x220B); + //entity("nis", 0x22FC); + //entity("nisd", 0x22FA); + //entity("niv", 0x220B); + //entity("njcy", 0x045A); + //entity("NJcy", 0x040A); + //entity("nlarr", 0x219A); + //entity("nlArr", 0x21CD); + //entity("nldr", 0x2025); + //entity("nle", 0x2270); + //entity("nleftarrow", 0x219A); + //entity("nLeftarrow", 0x21CD); + //entity("nleftrightarrow", 0x21AE); + //entity("nLeftrightarrow", 0x21CE); + //entity("nleq", 0x2270); + //entity("nless", 0x226E); + //entity("nlsim", 0x2274); + //entity("nlt", 0x226E); + //entity("nltri", 0x22EA); + //entity("nltrie", 0x22EC); + //entity("nmid", 0x2224); + //entity("NoBreak", 0x2060); + entity("NonBreakingSpace", 0x00A0); + //entity("nopf", 0x1D55F); + //entity("Nopf", 0x2115); + entity("not", 0x00AC); + //entity("Not", 0x2AEC); + //entity("NotCongruent", 0x2262); + //entity("NotCupCap", 0x226D); + //entity("NotDoubleVerticalBar", 0x2226); + //entity("NotElement", 0x2209); + //entity("NotEqual", 0x2260); + //entity("NotExists", 0x2204); + //entity("NotGreater", 0x226F); + //entity("NotGreaterEqual", 0x2271); + //entity("NotGreaterLess", 0x2279); + //entity("NotGreaterTilde", 0x2275); + //entity("notin", 0x2209); + //entity("notinva", 0x2209); + //entity("notinvb", 0x22F7); + //entity("notinvc", 0x22F6); + //entity("NotLeftTriangle", 0x22EA); + //entity("NotLeftTriangleEqual", 0x22EC); + //entity("NotLess", 0x226E); + //entity("NotLessEqual", 0x2270); + //entity("NotLessGreater", 0x2278); + //entity("NotLessTilde", 0x2274); + //entity("notni", 0x220C); + //entity("notniva", 0x220C); + //entity("notnivb", 0x22FE); + //entity("notnivc", 0x22FD); + //entity("NotPrecedes", 0x2280); + //entity("NotPrecedesSlantEqual", 0x22E0); + //entity("NotReverseElement", 0x220C); + //entity("NotRightTriangle", 0x22EB); + //entity("NotRightTriangleEqual", 0x22ED); + //entity("NotSquareSubsetEqual", 0x22E2); + //entity("NotSquareSupersetEqual", 0x22E3); + //entity("NotSubsetEqual", 0x2288); + //entity("NotSucceeds", 0x2281); + //entity("NotSucceedsSlantEqual", 0x22E1); + //entity("NotSupersetEqual", 0x2289); + //entity("NotTilde", 0x2241); + //entity("NotTildeEqual", 0x2244); + //entity("NotTildeFullEqual", 0x2247); + //entity("NotTildeTilde", 0x2249); + //entity("NotVerticalBar", 0x2224); + //entity("npar", 0x2226); + //entity("nparallel", 0x2226); + //entity("npolint", 0x2A14); + //entity("npr", 0x2280); + //entity("nprcue", 0x22E0); + //entity("nprec", 0x2280); + //entity("nrarr", 0x219B); + //entity("nrArr", 0x21CF); + //entity("nrightarrow", 0x219B); + //entity("nRightarrow", 0x21CF); + //entity("nrtri", 0x22EB); + //entity("nrtrie", 0x22ED); + //entity("nsc", 0x2281); + //entity("nsccue", 0x22E1); + //entity("nscr", 0x1D4C3); + //entity("Nscr", 0x1D4A9); + //entity("nshortmid", 0x2224); + //entity("nshortparallel", 0x2226); + //entity("nsim", 0x2241); + //entity("nsime", 0x2244); + //entity("nsimeq", 0x2244); + //entity("nsmid", 0x2224); + //entity("nspar", 0x2226); + //entity("nsqsube", 0x22E2); + //entity("nsqsupe", 0x22E3); + //entity("nsub", 0x2284); + //entity("nsube", 0x2288); + //entity("nsubseteq", 0x2288); + //entity("nsucc", 0x2281); + //entity("nsup", 0x2285); + //entity("nsupe", 0x2289); + //entity("nsupseteq", 0x2289); + //entity("ntgl", 0x2279); + entity("ntilde", 0x00F1); + entity("Ntilde", 0x00D1); + //entity("ntlg", 0x2278); + //entity("ntriangleleft", 0x22EA); + //entity("ntrianglelefteq", 0x22EC); + //entity("ntriangleright", 0x22EB); + //entity("ntrianglerighteq", 0x22ED); + //entity("nu", 0x03BD); + //entity("Nu", 0x039D); + entity("num", 0x0023); + //entity("numero", 0x2116); + //entity("numsp", 0x2007); + //entity("nvdash", 0x22AC); + //entity("nvDash", 0x22AD); + //entity("nVdash", 0x22AE); + //entity("nVDash", 0x22AF); + //entity("nvHarr", 0x2904); + //entity("nvinfin", 0x29DE); + //entity("nvlArr", 0x2902); + //entity("nvrArr", 0x2903); + //entity("nwarhk", 0x2923); + //entity("nwarr", 0x2196); + //entity("nwArr", 0x21D6); + //entity("nwarrow", 0x2196); + //entity("nwnear", 0x2927); + //entity("oacgr", 0x03CC); + //entity("Oacgr", 0x038C); + entity("oacute", 0x00F3); + entity("Oacute", 0x00D3); + //entity("oast", 0x229B); + //entity("ocir", 0x229A); + entity("ocirc", 0x00F4); + entity("Ocirc", 0x00D4); + //entity("ocy", 0x043E); + //entity("Ocy", 0x041E); + //entity("odash", 0x229D); + //entity("odblac", 0x0151); + //entity("Odblac", 0x0150); + //entity("odiv", 0x2A38); + //entity("odot", 0x2299); + //entity("odsold", 0x29BC); + //entity("oelig", 0x0153); + //entity("OElig", 0x0152); + //entity("ofcir", 0x29BF); + //entity("ofr", 0x1D52C); + //entity("Ofr", 0x1D512); + //entity("ogon", 0x02DB); + //entity("ogr", 0x03BF); + //entity("Ogr", 0x039F); + entity("ograve", 0x00F2); + entity("Ograve", 0x00D2); + //entity("ogt", 0x29C1); + //entity("ohacgr", 0x03CE); + //entity("OHacgr", 0x038F); + //entity("ohbar", 0x29B5); + //entity("ohgr", 0x03C9); + //entity("OHgr", 0x03A9); + //entity("ohm", 0x2126); + //entity("oint", 0x222E); + //entity("olarr", 0x21BA); + //entity("olcir", 0x29BE); + //entity("olcross", 0x29BB); + //entity("oline", 0x203E); + //entity("olt", 0x29C0); + //entity("omacr", 0x014D); + //entity("Omacr", 0x014C); + //entity("omega", 0x03C9); + //entity("Omega", 0x03A9); + //entity("omicron", 0x03BF); + //entity("Omicron", 0x039F); + //entity("omid", 0x29B6); + //entity("ominus", 0x2296); + //entity("oopf", 0x1D560); + //entity("Oopf", 0x1D546); + //entity("opar", 0x29B7); + //entity("OpenCurlyDoubleQuote", 0x201C); + //entity("OpenCurlyQuote", 0x2018); + //entity("operp", 0x29B9); + //entity("oplus", 0x2295); + //entity("or", 0x2228); + //entity("Or", 0x2A54); + //entity("orarr", 0x21BB); + //entity("ord", 0x2A5D); + //entity("order", 0x2134); + //entity("orderof", 0x2134); + entity("ordf", 0x00AA); + entity("ordm", 0x00BA); + //entity("origof", 0x22B6); + //entity("oror", 0x2A56); + //entity("orslope", 0x2A57); + //entity("orv", 0x2A5B); + //entity("oS", 0x24C8); + //entity("oscr", 0x2134); + //entity("Oscr", 0x1D4AA); + entity("oslash", 0x00F8); + entity("Oslash", 0x00D8); + //entity("osol", 0x2298); + entity("otilde", 0x00F5); + entity("Otilde", 0x00D5); + //entity("otimes", 0x2297); + //entity("Otimes", 0x2A37); + //entity("otimesas", 0x2A36); + entity("ouml", 0x00F6); + entity("Ouml", 0x00D6); + //entity("ovbar", 0x233D); + entity("OverBar", 0x00AF); + //entity("OverBrace", 0xFE37); + //entity("OverBracket", 0x23B4); + //entity("OverParenthesis", 0xFE35); + //entity("par", 0x2225); + entity("para", 0x00B6); + //entity("parallel", 0x2225); + //entity("parsim", 0x2AF3); + //entity("parsl", 0x2AFD); + //entity("part", 0x2202); + //entity("PartialD", 0x2202); + //entity("pcy", 0x043F); + //entity("Pcy", 0x041F); + entity("percnt", 0x0025); + entity("period", 0x002E); + //entity("permil", 0x2030); + //entity("perp", 0x22A5); + //entity("pertenk", 0x2031); + //entity("pfr", 0x1D52D); + //entity("Pfr", 0x1D513); + //entity("pgr", 0x03C0); + //entity("Pgr", 0x03A0); + //entity("phgr", 0x03C6); + //entity("PHgr", 0x03A6); + //entity("phi", 0x03D5); + //entity("Phi", 0x03A6); + //entity("phiv", 0x03C6); + //entity("phmmat", 0x2133); + //entity("phone", 0x260E); + //entity("pi", 0x03C0); + //entity("Pi", 0x03A0); + //entity("pitchfork", 0x22D4); + //entity("piv", 0x03D6); + //entity("planck", 0x210F); + //entity("planckh", 0x210E); + //entity("plankv", 0x210F); + entity("plus", 0x002B); + //entity("plusacir", 0x2A23); + //entity("plusb", 0x229E); + //entity("pluscir", 0x2A22); + //entity("plusdo", 0x2214); + //entity("plusdu", 0x2A25); + //entity("pluse", 0x2A72); + entity("PlusMinus", 0x00B1); + entity("plusmn", 0x00B1); + //entity("plussim", 0x2A26); + //entity("plustwo", 0x2A27); + entity("pm", 0x00B1); + //entity("Poincareplane", 0x210C); + //entity("pointint", 0x2A15); + //entity("popf", 0x1D561); + //entity("Popf", 0x2119); + entity("pound", 0x00A3); + //entity("pr", 0x227A); + //entity("Pr", 0x2ABB); + //entity("prap", 0x2AB7); + //entity("prcue", 0x227C); + //entity("pre", 0x2AAF); + //entity("prE", 0x2AB3); + //entity("prec", 0x227A); + //entity("precapprox", 0x2AB7); + //entity("preccurlyeq", 0x227C); + //entity("Precedes", 0x227A); + //entity("PrecedesEqual", 0x2AAF); + //entity("PrecedesSlantEqual", 0x227C); + //entity("PrecedesTilde", 0x227E); + //entity("preceq", 0x2AAF); + //entity("precnapprox", 0x2AB9); + //entity("precneqq", 0x2AB5); + //entity("precnsim", 0x22E8); + //entity("precsim", 0x227E); + //entity("prime", 0x2032); + //entity("Prime", 0x2033); + //entity("primes", 0x2119); + //entity("prnap", 0x2AB9); + //entity("prnE", 0x2AB5); + //entity("prnsim", 0x22E8); + //entity("prod", 0x220F); + //entity("Product", 0x220F); + //entity("profalar", 0x232E); + //entity("profline", 0x2312); + //entity("profsurf", 0x2313); + //entity("prop", 0x221D); + //entity("Proportion", 0x2237); + //entity("Proportional", 0x221D); + //entity("propto", 0x221D); + //entity("prsim", 0x227E); + //entity("prurel", 0x22B0); + //entity("pscr", 0x1D4C5); + //entity("Pscr", 0x1D4AB); + //entity("psgr", 0x03C8); + //entity("PSgr", 0x03A8); + //entity("psi", 0x03C8); + //entity("Psi", 0x03A8); + //entity("puncsp", 0x2008); + //entity("qfr", 0x1D52E); + //entity("Qfr", 0x1D514); + //entity("qint", 0x2A0C); + //entity("qopf", 0x1D562); + //entity("Qopf", 0x211A); + //entity("qprime", 0x2057); + //entity("qscr", 0x1D4C6); + //entity("Qscr", 0x1D4AC); + //entity("quaternions", 0x210D); + //entity("quatint", 0x2A16); + entity("quest", 0x003F); + //entity("questeq", 0x225F); + entity("quot", 0x0022); + //entity("rAarr", 0x21DB); + //entity("race", 0x29DA); + //entity("racute", 0x0155); + //entity("Racute", 0x0154); + //entity("radic", 0x221A); + //entity("raemptyv", 0x29B3); + //entity("rang", 0x232A); + //entity("Rang", 0x27EB); + //entity("rangd", 0x2992); + //entity("range", 0x29A5); + //entity("rangle", 0x232A); + entity("raquo", 0x00BB); + //entity("rarr", 0x2192); + //entity("rArr", 0x21D2); + //entity("Rarr", 0x21A0); + //entity("rarrap", 0x2975); + //entity("rarrb", 0x21E5); + //entity("rarrbfs", 0x2920); + //entity("rarrc", 0x2933); + //entity("rarrfs", 0x291E); + //entity("rarrhk", 0x21AA); + //entity("rarrlp", 0x21AC); + //entity("rarrpl", 0x2945); + //entity("rarrsim", 0x2974); + //entity("rarrtl", 0x21A3); + //entity("Rarrtl", 0x2916); + //entity("rarrw", 0x219D); + //entity("ratail", 0x291A); + //entity("rAtail", 0x291C); + //entity("ratio", 0x2236); + //entity("rationals", 0x211A); + //entity("rbarr", 0x290D); + //entity("rBarr", 0x290F); + //entity("RBarr", 0x2910); + //entity("rbbrk", 0x2998); + entity("rbrace", 0x007D); + entity("rbrack", 0x005D); + //entity("rbrke", 0x298C); + //entity("rbrksld", 0x298E); + //entity("rbrkslu", 0x2990); + //entity("rcaron", 0x0159); + //entity("Rcaron", 0x0158); + //entity("rcedil", 0x0157); + //entity("Rcedil", 0x0156); + //entity("rceil", 0x2309); + entity("rcub", 0x007D); + //entity("rcy", 0x0440); + //entity("Rcy", 0x0420); + //entity("rdca", 0x2937); + //entity("rdldhar", 0x2969); + //entity("rdquo", 0x201D); + //entity("rdquor", 0x201D); + //entity("rdsh", 0x21B3); + //entity("Re", 0x211C); + //entity("real", 0x211C); + //entity("realine", 0x211B); + //entity("realpart", 0x211C); + //entity("reals", 0x211D); + //entity("rect", 0x25AD); + entity("reg", 0x00AE); + //entity("ReverseElement", 0x220B); + //entity("ReverseEquilibrium", 0x21CB); + //entity("ReverseUpEquilibrium", 0x296F); + //entity("rfisht", 0x297D); + //entity("rfloor", 0x230B); + //entity("rfr", 0x1D52F); + //entity("Rfr", 0x211C); + //entity("rgr", 0x03C1); + //entity("Rgr", 0x03A1); + //entity("rHar", 0x2964); + //entity("rhard", 0x21C1); + //entity("rharu", 0x21C0); + //entity("rharul", 0x296C); + //entity("rho", 0x03C1); + //entity("Rho", 0x03A1); + //entity("rhov", 0x03F1); + //entity("RightAngleBracket", 0x232A); + //entity("rightarrow", 0x2192); + //entity("Rightarrow", 0x21D2); + //entity("RightArrowBar", 0x21E5); + //entity("RightArrowLeftArrow", 0x21C4); + //entity("rightarrowtail", 0x21A3); + //entity("RightCeiling", 0x2309); + //entity("RightDoubleBracket", 0x27E7); + //entity("RightDownTeeVector", 0x295D); + //entity("RightDownVector", 0x21C2); + //entity("RightDownVectorBar", 0x2955); + //entity("RightFloor", 0x230B); + //entity("rightharpoondown", 0x21C1); + //entity("rightharpoonup", 0x21C0); + //entity("rightleftarrows", 0x21C4); + //entity("rightleftharpoons", 0x21CC); + //entity("rightrightarrows", 0x21C9); + //entity("rightsquigarrow", 0x219D); + //entity("RightTee", 0x22A2); + //entity("RightTeeArrow", 0x21A6); + //entity("RightTeeVector", 0x295B); + //entity("rightthreetimes", 0x22CC); + //entity("RightTriangle", 0x22B3); + //entity("RightTriangleBar", 0x29D0); + //entity("RightTriangleEqual", 0x22B5); + //entity("RightUpDownVector", 0x294F); + //entity("RightUpTeeVector", 0x295C); + //entity("RightUpVector", 0x21BE); + //entity("RightUpVectorBar", 0x2954); + //entity("RightVector", 0x21C0); + //entity("RightVectorBar", 0x2953); + //entity("ring", 0x02DA); + //entity("risingdotseq", 0x2253); + //entity("rlarr", 0x21C4); + //entity("rlhar", 0x21CC); + //entity("rlm", 0x200F); + //entity("rmoust", 0x23B1); + //entity("rmoustache", 0x23B1); + //entity("rnmid", 0x2AEE); + //entity("roang", 0x27ED); + //entity("roarr", 0x21FE); + //entity("robrk", 0x27E7); + //entity("ropar", 0x2986); + //entity("ropf", 0x1D563); + //entity("Ropf", 0x211D); + //entity("roplus", 0x2A2E); + //entity("rotimes", 0x2A35); + //entity("RoundImplies", 0x2970); + entity("rpar", 0x0029); + //entity("rpargt", 0x2994); + //entity("rppolint", 0x2A12); + //entity("rrarr", 0x21C9); + //entity("Rrightarrow", 0x21DB); + //entity("rsaquo", 0x203A); + //entity("rscr", 0x1D4C7); + //entity("Rscr", 0x211B); + //entity("rsh", 0x21B1); + entity("rsqb", 0x005D); + //entity("rsquo", 0x2019); + //entity("rsquor", 0x2019); + //entity("rthree", 0x22CC); + //entity("rtimes", 0x22CA); + //entity("rtri", 0x25B9); + //entity("rtrie", 0x22B5); + //entity("rtrif", 0x25B8); + //entity("rtriltri", 0x29CE); + //entity("RuleDelayed", 0x29F4); + //entity("ruluhar", 0x2968); + //entity("rx", 0x211E); + //entity("sacute", 0x015B); + //entity("Sacute", 0x015A); + //entity("sbquo", 0x201A); + //entity("sc", 0x227B); + //entity("Sc", 0x2ABC); + //entity("scap", 0x2AB8); + //entity("scaron", 0x0161); + //entity("Scaron", 0x0160); + //entity("sccue", 0x227D); + //entity("sce", 0x2AB0); + //entity("scE", 0x2AB4); + //entity("scedil", 0x015F); + //entity("Scedil", 0x015E); + //entity("scirc", 0x015D); + //entity("Scirc", 0x015C); + //entity("scnap", 0x2ABA); + //entity("scnE", 0x2AB6); + //entity("scnsim", 0x22E9); + //entity("scpolint", 0x2A13); + //entity("scsim", 0x227F); + //entity("scy", 0x0441); + //entity("Scy", 0x0421); + //entity("sdot", 0x22C5); + //entity("sdotb", 0x22A1); + //entity("sdote", 0x2A66); + //entity("searhk", 0x2925); + //entity("searr", 0x2198); + //entity("seArr", 0x21D8); + //entity("searrow", 0x2198); + entity("sect", 0x00A7); + entity("semi", 0x003B); + //entity("seswar", 0x2929); + //entity("setminus", 0x2216); + //entity("setmn", 0x2216); + //entity("sext", 0x2736); + //entity("sfgr", 0x03C2); + //entity("sfr", 0x1D530); + //entity("Sfr", 0x1D516); + //entity("sfrown", 0x2322); + //entity("sgr", 0x03C3); + //entity("Sgr", 0x03A3); + //entity("sharp", 0x266F); + //entity("shchcy", 0x0449); + //entity("SHCHcy", 0x0429); + //entity("shcy", 0x0448); + //entity("SHcy", 0x0428); + //entity("ShortDownArrow", 0x2193); + //entity("ShortLeftArrow", 0x2190); + //entity("shortmid", 0x2223); + //entity("shortparallel", 0x2225); + //entity("ShortRightArrow", 0x2192); + //entity("ShortUpArrow", 0x2191); + entity("shy", 0x00AD); + //entity("sigma", 0x03C3); + //entity("Sigma", 0x03A3); + //entity("sigmaf", 0x03C2); + //entity("sigmav", 0x03C2); + //entity("sim", 0x223C); + //entity("simdot", 0x2A6A); + //entity("sime", 0x2243); + //entity("simeq", 0x2243); + //entity("simg", 0x2A9E); + //entity("simgE", 0x2AA0); + //entity("siml", 0x2A9D); + //entity("simlE", 0x2A9F); + //entity("simne", 0x2246); + //entity("simplus", 0x2A24); + //entity("simrarr", 0x2972); + //entity("slarr", 0x2190); + //entity("SmallCircle", 0x2218); + //entity("smallsetminus", 0x2216); + //entity("smashp", 0x2A33); + //entity("smeparsl", 0x29E4); + //entity("smid", 0x2223); + //entity("smile", 0x2323); + //entity("smt", 0x2AAA); + //entity("smte", 0x2AAC); + //entity("softcy", 0x044C); + //entity("SOFTcy", 0x042C); + entity("sol", 0x002F); + //entity("solb", 0x29C4); + //entity("solbar", 0x233F); + //entity("sopf", 0x1D564); + //entity("Sopf", 0x1D54A); + //entity("spades", 0x2660); + //entity("spadesuit", 0x2660); + //entity("spar", 0x2225); + //entity("sqcap", 0x2293); + //entity("sqcup", 0x2294); + //entity("Sqrt", 0x221A); + //entity("sqsub", 0x228F); + //entity("sqsube", 0x2291); + //entity("sqsubset", 0x228F); + //entity("sqsubseteq", 0x2291); + //entity("sqsup", 0x2290); + //entity("sqsupe", 0x2292); + //entity("sqsupset", 0x2290); + //entity("sqsupseteq", 0x2292); + //entity("squ", 0x25A1); + //entity("square", 0x25A1); + //entity("SquareIntersection", 0x2293); + //entity("SquareSubset", 0x228F); + //entity("SquareSubsetEqual", 0x2291); + //entity("SquareSuperset", 0x2290); + //entity("SquareSupersetEqual", 0x2292); + //entity("SquareUnion", 0x2294); + //entity("squarf", 0x25AA); + //entity("squf", 0x25AA); + //entity("srarr", 0x2192); + //entity("sscr", 0x1D4C8); + //entity("Sscr", 0x1D4AE); + //entity("ssetmn", 0x2216); + //entity("ssmile", 0x2323); + //entity("sstarf", 0x22C6); + //entity("star", 0x2606); + //entity("Star", 0x22C6); + //entity("starf", 0x2605); + //entity("straightepsilon", 0x03F5); + //entity("straightphi", 0x03D5); + entity("strns", 0x00AF); + //entity("sub", 0x2282); + //entity("Sub", 0x22D0); + //entity("subdot", 0x2ABD); + //entity("sube", 0x2286); + //entity("subE", 0x2AC5); + //entity("subedot", 0x2AC3); + //entity("submult", 0x2AC1); + //entity("subne", 0x228A); + //entity("subnE", 0x2ACB); + //entity("subplus", 0x2ABF); + //entity("subrarr", 0x2979); + //entity("subset", 0x2282); + //entity("Subset", 0x22D0); + //entity("subseteq", 0x2286); + //entity("subseteqq", 0x2AC5); + //entity("SubsetEqual", 0x2286); + //entity("subsetneq", 0x228A); + //entity("subsetneqq", 0x2ACB); + //entity("subsim", 0x2AC7); + //entity("subsub", 0x2AD5); + //entity("subsup", 0x2AD3); + //entity("succ", 0x227B); + //entity("succapprox", 0x2AB8); + //entity("succcurlyeq", 0x227D); + //entity("Succeeds", 0x227B); + //entity("SucceedsEqual", 0x2AB0); + //entity("SucceedsSlantEqual", 0x227D); + //entity("SucceedsTilde", 0x227F); + //entity("succeq", 0x2AB0); + //entity("succnapprox", 0x2ABA); + //entity("succneqq", 0x2AB6); + //entity("succnsim", 0x22E9); + //entity("succsim", 0x227F); + //entity("SuchThat", 0x220B); + //entity("sum", 0x2211); + //entity("sung", 0x266A); + //entity("sup", 0x2283); + //entity("Sup", 0x22D1); + entity("sup1", 0x00B9); + entity("sup2", 0x00B2); + entity("sup3", 0x00B3); + //entity("supdot", 0x2ABE); + //entity("supdsub", 0x2AD8); + //entity("supe", 0x2287); + //entity("supE", 0x2AC6); + //entity("supedot", 0x2AC4); + //entity("Superset", 0x2283); + //entity("SupersetEqual", 0x2287); + //entity("suphsub", 0x2AD7); + //entity("suplarr", 0x297B); + //entity("supmult", 0x2AC2); + //entity("supne", 0x228B); + //entity("supnE", 0x2ACC); + //entity("supplus", 0x2AC0); + //entity("supset", 0x2283); + //entity("Supset", 0x22D1); + //entity("supseteq", 0x2287); + //entity("supseteqq", 0x2AC6); + //entity("supsetneq", 0x228B); + //entity("supsetneqq", 0x2ACC); + //entity("supsim", 0x2AC8); + //entity("supsub", 0x2AD4); + //entity("supsup", 0x2AD6); + //entity("swarhk", 0x2926); + //entity("swarr", 0x2199); + //entity("swArr", 0x21D9); + //entity("swarrow", 0x2199); + //entity("swnwar", 0x292A); + entity("szlig", 0x00DF); + entity("Tab", 0x0009); + //entity("target", 0x2316); + //entity("tau", 0x03C4); + //entity("Tau", 0x03A4); + //entity("tbrk", 0x23B4); + //entity("tcaron", 0x0165); + //entity("Tcaron", 0x0164); + //entity("tcedil", 0x0163); + //entity("Tcedil", 0x0162); + //entity("tcy", 0x0442); + //entity("Tcy", 0x0422); + //entity("telrec", 0x2315); + //entity("tfr", 0x1D531); + //entity("Tfr", 0x1D517); + //entity("tgr", 0x03C4); + //entity("Tgr", 0x03A4); + //entity("there4", 0x2234); + //entity("therefore", 0x2234); + //entity("theta", 0x03B8); + //entity("Theta", 0x0398); + //entity("thetasym", 0x03D1); + //entity("thetav", 0x03D1); + //entity("thgr", 0x03B8); + //entity("THgr", 0x0398); + //entity("thickapprox", 0x2248); + //entity("thicksim", 0x223C); + //entity("thinsp", 0x2009); + //entity("ThinSpace", 0x2009); + //entity("thkap", 0x2248); + //entity("thksim", 0x223C); + entity("thorn", 0x00FE); + entity("THORN", 0x00DE); + //entity("tilde", 0x02DC); + //entity("Tilde", 0x223C); + //entity("TildeEqual", 0x2243); + //entity("TildeFullEqual", 0x2245); + //entity("TildeTilde", 0x2248); + entity("times", 0x00D7); + //entity("timesb", 0x22A0); + //entity("timesbar", 0x2A31); + //entity("timesd", 0x2A30); + //entity("tint", 0x222D); + //entity("toea", 0x2928); + //entity("top", 0x22A4); + //entity("topbot", 0x2336); + //entity("topcir", 0x2AF1); + //entity("topf", 0x1D565); + //entity("Topf", 0x1D54B); + //entity("topfork", 0x2ADA); + //entity("tosa", 0x2929); + //entity("tprime", 0x2034); + //entity("trade", 0x2122); + //entity("triangle", 0x25B5); + //entity("triangledown", 0x25BF); + //entity("triangleleft", 0x25C3); + //entity("trianglelefteq", 0x22B4); + //entity("triangleq", 0x225C); + //entity("triangleright", 0x25B9); + //entity("trianglerighteq", 0x22B5); + //entity("tridot", 0x25EC); + //entity("trie", 0x225C); + //entity("triminus", 0x2A3A); + //entity("triplus", 0x2A39); + //entity("trisb", 0x29CD); + //entity("tritime", 0x2A3B); + //entity("trpezium", 0x23E2); + //entity("tscr", 0x1D4C9); + //entity("Tscr", 0x1D4AF); + //entity("tscy", 0x0446); + //entity("TScy", 0x0426); + //entity("tshcy", 0x045B); + //entity("TSHcy", 0x040B); + //entity("tstrok", 0x0167); + //entity("Tstrok", 0x0166); + //entity("twixt", 0x226C); + //entity("twoheadleftarrow", 0x219E); + //entity("twoheadrightarrow", 0x21A0); + //entity("uacgr", 0x03CD); + //entity("Uacgr", 0x038E); + entity("uacute", 0x00FA); + entity("Uacute", 0x00DA); + //entity("uarr", 0x2191); + //entity("uArr", 0x21D1); + //entity("Uarr", 0x219F); + //entity("Uarrocir", 0x2949); + //entity("ubrcy", 0x045E); + //entity("Ubrcy", 0x040E); + //entity("ubreve", 0x016D); + //entity("Ubreve", 0x016C); + entity("ucirc", 0x00FB); + entity("Ucirc", 0x00DB); + //entity("ucy", 0x0443); + //entity("Ucy", 0x0423); + //entity("udarr", 0x21C5); + //entity("udblac", 0x0171); + //entity("Udblac", 0x0170); + //entity("udhar", 0x296E); + //entity("udiagr", 0x03B0); + //entity("udigr", 0x03CB); + //entity("Udigr", 0x03AB); + //entity("ufisht", 0x297E); + //entity("ufr", 0x1D532); + //entity("Ufr", 0x1D518); + //entity("ugr", 0x03C5); + //entity("Ugr", 0x03A5); + entity("ugrave", 0x00F9); + entity("Ugrave", 0x00D9); + //entity("uHar", 0x2963); + //entity("uharl", 0x21BF); + //entity("uharr", 0x21BE); + //entity("uhblk", 0x2580); + //entity("ulcorn", 0x231C); + //entity("ulcorner", 0x231C); + //entity("ulcrop", 0x230F); + //entity("ultri", 0x25F8); + //entity("umacr", 0x016B); + //entity("Umacr", 0x016A); + entity("uml", 0x00A8); + //entity("UnderBrace", 0xFE38); + //entity("UnderBracket", 0x23B5); + //entity("UnderParenthesis", 0xFE36); + //entity("Union", 0x22C3); + //entity("UnionPlus", 0x228E); + //entity("uogon", 0x0173); + //entity("Uogon", 0x0172); + //entity("uopf", 0x1D566); + //entity("Uopf", 0x1D54C); + //entity("uparrow", 0x2191); + //entity("Uparrow", 0x21D1); + //entity("UpArrowBar", 0x2912); + //entity("UpArrowDownArrow", 0x21C5); + //entity("updownarrow", 0x2195); + //entity("Updownarrow", 0x21D5); + //entity("UpEquilibrium", 0x296E); + //entity("upharpoonleft", 0x21BF); + //entity("upharpoonright", 0x21BE); + //entity("uplus", 0x228E); + //entity("UpperLeftArrow", 0x2196); + //entity("UpperRightArrow", 0x2197); + //entity("upsi", 0x03C5); + //entity("Upsi", 0x03D2); + //entity("upsih", 0x03D2); + //entity("upsilon", 0x03C5); + //entity("Upsilon", 0x03A5); + //entity("UpTee", 0x22A5); + //entity("UpTeeArrow", 0x21A5); + //entity("upuparrows", 0x21C8); + //entity("urcorn", 0x231D); + //entity("urcorner", 0x231D); + //entity("urcrop", 0x230E); + //entity("uring", 0x016F); + //entity("Uring", 0x016E); + //entity("urtri", 0x25F9); + //entity("uscr", 0x1D4CA); + //entity("Uscr", 0x1D4B0); + //entity("utdot", 0x22F0); + //entity("utilde", 0x0169); + //entity("Utilde", 0x0168); + //entity("utri", 0x25B5); + //entity("utrif", 0x25B4); + //entity("uuarr", 0x21C8); + entity("uuml", 0x00FC); + entity("Uuml", 0x00DC); + //entity("uwangle", 0x29A7); + //entity("vangrt", 0x299C); + //entity("varepsilon", 0x03B5); + //entity("varkappa", 0x03F0); + //entity("varnothing", 0x2205); + //entity("varphi", 0x03C6); + //entity("varpi", 0x03D6); + //entity("varpropto", 0x221D); + //entity("varr", 0x2195); + //entity("vArr", 0x21D5); + //entity("varrho", 0x03F1); + //entity("varsigma", 0x03C2); + //entity("vartheta", 0x03D1); + //entity("vartriangleleft", 0x22B2); + //entity("vartriangleright", 0x22B3); + //entity("vBar", 0x2AE8); + //entity("Vbar", 0x2AEB); + //entity("vBarv", 0x2AE9); + //entity("vcy", 0x0432); + //entity("Vcy", 0x0412); + //entity("vdash", 0x22A2); + //entity("vDash", 0x22A8); + //entity("Vdash", 0x22A9); + //entity("VDash", 0x22AB); + //entity("Vdashl", 0x2AE6); + //entity("vee", 0x2228); + //entity("Vee", 0x22C1); + //entity("veebar", 0x22BB); + //entity("veeeq", 0x225A); + //entity("vellip", 0x22EE); + entity("verbar", 0x007C); + //entity("Verbar", 0x2016); + entity("vert", 0x007C); + //entity("Vert", 0x2016); + //entity("VerticalBar", 0x2223); + entity("VerticalLine", 0x007C); + //entity("VerticalSeparator", 0x2758); + //entity("VerticalTilde", 0x2240); + //entity("VeryThinSpace", 0x200A); + //entity("vfr", 0x1D533); + //entity("Vfr", 0x1D519); + //entity("vltri", 0x22B2); + //entity("vopf", 0x1D567); + //entity("Vopf", 0x1D54D); + //entity("vprop", 0x221D); + //entity("vrtri", 0x22B3); + //entity("vscr", 0x1D4CB); + //entity("Vscr", 0x1D4B1); + //entity("Vvdash", 0x22AA); + //entity("vzigzag", 0x299A); + //entity("wcirc", 0x0175); + //entity("Wcirc", 0x0174); + //entity("wedbar", 0x2A5F); + //entity("wedge", 0x2227); + //entity("Wedge", 0x22C0); + //entity("wedgeq", 0x2259); + //entity("weierp", 0x2118); + //entity("wfr", 0x1D534); + //entity("Wfr", 0x1D51A); + //entity("wopf", 0x1D568); + //entity("Wopf", 0x1D54E); + //entity("wp", 0x2118); + //entity("wr", 0x2240); + //entity("wreath", 0x2240); + //entity("wscr", 0x1D4CC); + //entity("Wscr", 0x1D4B2); + //entity("xcap", 0x22C2); + //entity("xcirc", 0x25EF); + //entity("xcup", 0x22C3); + //entity("xdtri", 0x25BD); + //entity("xfr", 0x1D535); + //entity("Xfr", 0x1D51B); + //entity("xgr", 0x03BE); + //entity("Xgr", 0x039E); + //entity("xharr", 0x27F7); + //entity("xhArr", 0x27FA); + //entity("xi", 0x03BE); + //entity("Xi", 0x039E); + //entity("xlarr", 0x27F5); + //entity("xlArr", 0x27F8); + //entity("xmap", 0x27FC); + //entity("xnis", 0x22FB); + //entity("xodot", 0x2A00); + //entity("xopf", 0x1D569); + //entity("Xopf", 0x1D54F); + //entity("xoplus", 0x2A01); + //entity("xotime", 0x2A02); + //entity("xrarr", 0x27F6); + //entity("xrArr", 0x27F9); + //entity("xscr", 0x1D4CD); + //entity("Xscr", 0x1D4B3); + //entity("xsqcup", 0x2A06); + //entity("xuplus", 0x2A04); + //entity("xutri", 0x25B3); + //entity("xvee", 0x22C1); + //entity("xwedge", 0x22C0); + entity("yacute", 0x00FD); + entity("Yacute", 0x00DD); + //entity("yacy", 0x044F); + //entity("YAcy", 0x042F); + //entity("ycirc", 0x0177); + //entity("Ycirc", 0x0176); + //entity("ycy", 0x044B); + //entity("Ycy", 0x042B); + entity("yen", 0x00A5); + //entity("yfr", 0x1D536); + //entity("Yfr", 0x1D51C); + //entity("yicy", 0x0457); + //entity("YIcy", 0x0407); + //entity("yopf", 0x1D56A); + //entity("Yopf", 0x1D550); + //entity("yscr", 0x1D4CE); + //entity("Yscr", 0x1D4B4); + //entity("yucy", 0x044E); + //entity("YUcy", 0x042E); + entity("yuml", 0x00FF); + //entity("Yuml", 0x0178); + //entity("zacute", 0x017A); + //entity("Zacute", 0x0179); + //entity("zcaron", 0x017E); + //entity("Zcaron", 0x017D); + //entity("zcy", 0x0437); + //entity("Zcy", 0x0417); + //entity("zdot", 0x017C); + //entity("Zdot", 0x017B); + //entity("zeetrf", 0x2128); + //entity("ZeroWidthSpace", 0x200B); + //entity("zeta", 0x03B6); + //entity("Zeta", 0x0396); + //entity("zfr", 0x1D537); + //entity("Zfr", 0x2128); + //entity("zgr", 0x03B6); + //entity("Zgr", 0x0396); + //entity("zhcy", 0x0436); + //entity("ZHcy", 0x0416); + //entity("zigrarr", 0x21DD); + //entity("zopf", 0x1D56B); + //entity("Zopf", 0x2124); + //entity("zscr", 0x1D4CF); + //entity("Zscr", 0x1D4B5); + //entity("zwj", 0x200D); + //entity("zwnj", 0x200C); + } // entities + + HTMLSchema(const HTMLSchema&); + HTMLSchema& operator=(const HTMLSchema&); + bool operator==(const HTMLSchema&) const; +}; // class HTMLSchema + +} // namespace SAX + +} // namespace Arabica +#endif + diff --git a/arabica/include/XML/QName.hpp b/arabica/include/XML/QName.hpp new file mode 100644 index 000000000..1e697a12e --- /dev/null +++ b/arabica/include/XML/QName.hpp @@ -0,0 +1,194 @@ +#ifndef ARABICA_XML_QNAME_HPP +#define ARABICA_XML_QNAME_HPP + +#include +#include +#include +#include +#include + +template class QualifiedNameTest; + +namespace Arabica +{ +namespace XML +{ +namespace impl +{ + +template +class MapMapper +{ + typedef typename std::map string_map; + typedef typename std::map::const_iterator string_map_iterator; +public: + MapMapper(const std::map& namespaces) : namespaces_(namespaces) { } + MapMapper(const MapMapper& rhs) : namespaces_(rhs.namespaces_) { } + + string_type operator()(const string_type& prefix) const + { + string_map_iterator ns = namespaces_.find(prefix); + if(ns == namespaces_.end()) + return string_adaptor::empty_string(); + return ns->second; + } //operator() + +private: + const string_map& namespaces_; + + bool operator==(const MapMapper&) const; + MapMapper& operator=(const MapMapper&); +}; // class MapMapper + +} // namespace impl + +template > +class QualifiedName +{ + typedef string_adaptor SA; + +public: + /** + *

This function processes a raw XML 1.0 name in the current + * context by removing the prefix and looking it up among the + * prefixes currently declared. + * + *

If the raw name has a prefix that has not been declared, + * then the return value will be empty.

+ * + *

Note that attribute names are processed differently than + * element names: an unprefixed element name will received the + * default Namespace (if any), while an unprefixed attribute name + * will not.

+ */ + template + static QualifiedName parseQName(const string_type& rawname, + bool is_attribute, + const UriMapper& mapper) + { + if(!Arabica::XML::is_qname(rawname)) + throw std::runtime_error("Bad qname : '" + SA::asStdString(rawname) +"'"); + + static string_type COLON = SA::construct_from_utf8(":"); + + typename string_adaptor::size_type index = string_adaptor::find(rawname, COLON); + + if(index == string_adaptor::npos()) + return QualifiedName(rawname, + is_attribute ? SA::empty_string() : mapper(SA::empty_string())); + + // prefix + string_type prefix = string_adaptor::substr(rawname, 0, index); + string_type localName = string_adaptor::substr(rawname, index + 1); + string_type uri = mapper(prefix); + + return QualifiedName(prefix, localName, uri, rawname); + } // parseQName + + static QualifiedName parseQName(const string_type& rawname, + bool is_attribute, + const std::map& namespaces) + { + return parseQName(rawname, is_attribute, impl::MapMapper(namespaces)); + } // parseQName + +public: + QualifiedName(const QualifiedName& rhs) : + prefix_(rhs.prefix_), + localName_(rhs.localName_), + namespaceUri_(rhs.namespaceUri_), + rawName_(rhs.rawName_) + { + } // QualifiedName + + QualifiedName& operator=(const QualifiedName& rhs) + { + QualifiedName qn(rhs); + std::swap(prefix_, qn.prefix_); + std::swap(localName_, qn.localName_); + std::swap(namespaceUri_, qn.namespaceUri_); + std::swap(rawName_, qn.rawName_); + return *this; + } // operator= + + bool operator==(const QualifiedName& rhs) const + { + return (localName_ == rhs.localName_) && + (namespaceUri_ == rhs.namespaceUri_); + } // operator== + + bool operator!=(const QualifiedName& rhs) const + { + return !(operator==(rhs)); + } // operator!= + + string_type clarkName() const + { + if(SA::empty(namespaceUri_)) + return localName_; + + string_type cn; + SA::append(cn, SA::construct_from_utf8("{")); + SA::append(cn, namespaceUri_); + SA::append(cn, SA::construct_from_utf8("}")); + SA::append(cn, localName_); + return cn; + } // clarkName + + bool has_prefix() const { return !SA::empty(prefix_); } + void set_prefix(const string_type& prefix) { prefix_ = prefix; } + bool has_namespaceUri() const { return !SA::empty(namespaceUri_); } + + const string_type& prefix() const { return prefix_; } + const string_type& localName() const { return localName_; } + const string_type& namespaceUri() const { return namespaceUri_; } + + bool has_rawName() const { return !SA::empty(rawName_); } + const string_type& rawName() const { return rawName_; } + +private: + string_type prefix_; + string_type localName_; + string_type namespaceUri_; + string_type rawName_; + + QualifiedName(const string_type& localName, + const string_type& namespaceUri) : + prefix_(), + localName_(localName), + namespaceUri_(namespaceUri), + rawName_(localName) + { + } // QualifiedName + + QualifiedName(const string_type& prefix, + const string_type& localName, + const string_type& namespaceUri) : + prefix_(prefix), + localName_(localName), + namespaceUri_(namespaceUri), + rawName_() + { + } // QualifiedName + + QualifiedName(const string_type& prefix, + const string_type& localName, + const string_type& namespaceUri, + const string_type& rawName) : + prefix_(prefix), + localName_(localName), + namespaceUri_(namespaceUri), + rawName_(rawName) + { + } // QualifiedName + + + QualifiedName(); + + friend class QualifiedNameTest; +}; // class QualifiedName + +} // namespace XML + +} // namespace Arabica +#endif diff --git a/arabica/include/XML/XMLCharacterClasses.hpp b/arabica/include/XML/XMLCharacterClasses.hpp new file mode 100644 index 000000000..caf85eef5 --- /dev/null +++ b/arabica/include/XML/XMLCharacterClasses.hpp @@ -0,0 +1,28 @@ +#ifndef ARABICA_XML_CHARACTER_CLASSES_H +#define ARABICA_XML_CHARACTER_CLASSES_H + +#ifdef _MSC_VER +# include +#endif + +namespace Arabica +{ + +namespace XML +{ + bool is_char(wchar_t c); + bool is_space(wchar_t c); + bool is_name_char(wchar_t c); + bool is_ncname_char(wchar_t c); + bool is_letter(wchar_t c); + bool is_base_char(wchar_t c); + bool is_ideographic(wchar_t c); + bool is_digit(wchar_t c); + bool is_combining_char(wchar_t c); + bool is_extender(wchar_t c); + bool is_letter_or_digit(wchar_t c); + +} // namespace XML + +} // namespace Arabica +#endif diff --git a/arabica/include/XML/strings.hpp b/arabica/include/XML/strings.hpp new file mode 100755 index 000000000..fb01057b9 --- /dev/null +++ b/arabica/include/XML/strings.hpp @@ -0,0 +1,77 @@ +#ifndef ARABICA_XML_STRINGS_HPP +#define ARABICA_XML_STRINGS_HPP + +#include +#include + + // QName + //[7] QName ::= PrefixedName | UnprefixedName + //[8] PrefixedName ::= Prefix ':' LocalPart + //[9] UnprefixedName ::= LocalPart + //[10] Prefix ::= NCName + //[11] LocalPart ::= NCName + + // NCName + // [4] NCName ::= NCNameStartChar NCNameChar* //An XML Name, minus the ":" + // [5] NCNameChar ::= NameChar - ':' + // [6] NCNameStartChar ::= Letter | '_' } // namespace XML + +namespace Arabica +{ +namespace XML +{ + template + inline bool is_ncname(const typename string_adaptor::const_iterator& b, + const typename string_adaptor::const_iterator& e) + { + using namespace Arabica::text; + typedef typename string_adaptor::const_iterator const_iterator; + typedef typename string_adaptor::value_type value_type; + + if(b == e) + return false; // zero length + + const_iterator s = b; + if(!(is_letter(*s) || (*s == Unicode::LOW_LINE))) + return false; + + ++s; + for( ; s != e; ++s) + { + value_type c = *s; + if(!is_ncname_char(c)) + return false; + } + return true; + } // is_ncname + + template + inline bool is_ncname(const typename string_adaptor::string_type& str) + { + return is_ncname(string_adaptor::begin(str), + string_adaptor::end(str)); + } // is_ncname + + template + inline bool is_qname(const typename string_adaptor::string_type& str) + { + using namespace Arabica::text; + typedef typename string_adaptor::const_iterator const_iterator; + typedef typename string_adaptor::value_type value_type; + + size_t colon_index = string_adaptor::find(str, Unicode::COLON); + + if(colon_index == string_adaptor::npos()) + return is_ncname(str); + + const_iterator b = string_adaptor::begin(str); + const_iterator e = string_adaptor::end(str); + return is_ncname(b, b+colon_index) && + is_ncname(b+(colon_index+1), e); + } // is_qname + +} // namespace XML +} // namespace Arabica + + +#endif diff --git a/arabica/include/convert/impl/codecvt_specialisations.hpp b/arabica/include/convert/impl/codecvt_specialisations.hpp new file mode 100644 index 000000000..c52cdc2e8 --- /dev/null +++ b/arabica/include/convert/impl/codecvt_specialisations.hpp @@ -0,0 +1,131 @@ +#ifndef ARABICA_IMPL_CODECVT_SPECIALISATIONS_H +#define ARABICA_IMPL_CODECVT_SPECIALISATIONS_H + +#include + +namespace std +{ + +template<> +class codecvt : + public locale::facet, public codecvt_base +{ +public: + static locale::id id; + + codecvt_base::result out(std::mbstate_t& state, + const char* from, + const char* from_end, + const char*& from_next, + wchar_t* to, + wchar_t* to_limit, + wchar_t*& to_next) const + { + return this->do_out(state, from, from_end, from_next, to, to_limit, to_next); + } // out + + + codecvt_base::result in(std::mbstate_t& state, + const wchar_t* from, + const wchar_t* from_end, + const wchar_t*& from_next, + char* to, + char* to_limit, + char*& to_next) const + { + return this->do_in(state, from, from_end, from_next, to, to_limit, to_next); + } // in + + int encoding() const throw() + { + return this->do_encoding(); + } // encoding + + bool always_noconv() const throw() + { + return this->do_always_noconv(); + } // always_noconv + + int length(std::mbstate_t& state, + const wchar_t* from, + const wchar_t* end, + size_t max) const + { + return this->do_length(state, from, end, max); + } // length + +protected: + virtual ~codecvt() { } + + virtual codecvt_base::result do_out(std::mbstate_t&, + const char* from, + const char* from_end, + const char*& from_next, + wchar_t* to, + wchar_t* to_limit, + wchar_t*& to_next) const + { + int limit = std::max(from_end - from, to_limit - to); + from_next = from; + to_next = to; + + while(limit--) + *to_next++ = static_cast(*from_next++); + + return codecvt_base::ok; + } // do_out + + + virtual codecvt_base::result do_in(std::mbstate_t&, + const wchar_t* from, + const wchar_t* from_end, + const wchar_t*& from_next, + char* to, + char* to_limit, + char*& to_next) const + { + int limit = std::max(from_end - from, to_limit - to); + from_next = from; + to_next = to; + + while(limit--) + *to_next++ = static_cast(*from_next++); + + return codecvt_base::ok; + } // do_in + + virtual codecvt_base::result do_unshift(std::mbstate_t&, + wchar_t* to, + wchar_t* /*to_limit*/, + wchar_t*& to_next) const + { + to_next = to; + return codecvt_base::noconv; + } // do_unshift + + virtual int do_encoding() const throw() + { + return 1; + } // do_encoding + + virtual bool do_always_noconv() const throw() + { + return false; + } // do_always_noconv + + virtual int do_length(std::mbstate_t&, + const wchar_t* from, + const wchar_t* end, + size_t max) const + { + return std::min(max, (end - from)); + } // do_length + + virtual int do_max_length() const throw() + { + return 1; + } // do_max_length +}; // class codecvt : + +} // namespace std +#endif diff --git a/arabica/include/convert/impl/ucs2_utf16.hpp b/arabica/include/convert/impl/ucs2_utf16.hpp new file mode 100644 index 000000000..bb111baea --- /dev/null +++ b/arabica/include/convert/impl/ucs2_utf16.hpp @@ -0,0 +1,27 @@ +#ifndef ARABICA_UTILS_UCS2_UTF16_H +#define ARABICA_UTILS_UCS2_UTF16_H + +#include + +namespace Arabica +{ +namespace convert +{ +namespace impl +{ + +std::codecvt_base::result ucs2_2_utf16(bool be, + wchar_t const* from, wchar_t const* from_end, wchar_t const*& from_next, + char* to, char* to_limit, char*& to_next); +std::codecvt_base::result utf16_2_ucs2(bool be, + char const* from, char const* from_end, char const*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next); + +} // namespace impl +} // namepsace convert +} // namespace Arabica + +#endif + + + diff --git a/arabica/include/convert/impl/ucs2_utf8.hpp b/arabica/include/convert/impl/ucs2_utf8.hpp new file mode 100644 index 000000000..e2ed06f20 --- /dev/null +++ b/arabica/include/convert/impl/ucs2_utf8.hpp @@ -0,0 +1,23 @@ +#ifndef ARABICA_UTILS_UCS2_UTF8_H +#define ARABICA_UTILS_UCS2_UTF8_H + +#include + +namespace Arabica +{ +namespace convert +{ +namespace impl +{ + +std::codecvt_base::result ucs2_2_utf8(const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next); + +std::codecvt_base::result utf8_2_ucs2(const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next); + +} // namespace impl +} // namespace convert +} // namespace Arabica + +#endif diff --git a/arabica/include/convert/utf8ucs2codecvt.hpp b/arabica/include/convert/utf8ucs2codecvt.hpp new file mode 100644 index 000000000..c30a9694f --- /dev/null +++ b/arabica/include/convert/utf8ucs2codecvt.hpp @@ -0,0 +1,70 @@ +#ifndef ARABICA_UTF8UCS2_CODECVT_H +#define ARABICA_UTF8UCS2_CODECVT_H +//--------------------------------------------------------------------------- +// class utf8ucs2codecvt +// This facet converts from Unicode (UCS-2) wchar_ts to +// char using the UTF-8 encoding. +// +// For the full guff on codecvts see section 22.2.1.5 of +// The C++ Standard (ISO/IEC 14882 to be pedantic). +// +// I got my information about UTF-8 from RFC 2044. +//--------------------------------------------------------------------------- +#include + +#ifndef ARABICA_NO_WCHAR_T +#include +#include + +#ifndef ARABICA_NO_CODECVT_SPECIALISATIONS +#include +#endif + +namespace Arabica +{ +namespace convert +{ + +class utf8ucs2codecvt : public std::codecvt +{ +protected: + virtual ~utf8ucs2codecvt() { } + + virtual result do_out(std::mbstate_t&, + const wchar_t* from, + const wchar_t* from_end, + const wchar_t*& from_next, + char* to, + char* to_limit, + char*& to_next) const; + + virtual result do_in(std::mbstate_t&, + const char* from, + const char* from_end, + const char*& from_next, + wchar_t* to, + wchar_t* to_limit, + wchar_t*& to_next) const; + + virtual result do_unshift(std::mbstate_t&, + char*, + char*, + char*&) const; + + virtual int do_encoding() const throw() { return 0; } + + virtual bool do_always_noconv() const throw() { return false; } + + virtual int do_length(const std::mbstate_t&, + const char* from, + const char* end, + size_t max) const throw(); + + virtual int do_max_length() const throw() { return 3; } +}; // class utf8ucs2codecvt + +} // namespace convert +} // namespace Arabica + +#endif +#endif diff --git a/arabica/include/io/convertstream.hpp b/arabica/include/io/convertstream.hpp new file mode 100644 index 000000000..26bb317d7 --- /dev/null +++ b/arabica/include/io/convertstream.hpp @@ -0,0 +1,282 @@ +#ifndef ARABICA_CONVERT_STREAM_H +#define ARABICA_CONVERT_STREAM_H +////////////////////////////////////////////////////// +// +// $Id$ +// +////////////////////////////////////////////////////// +// +// basic_iconvertstream, basic_oconvertstream +// +// Written by Jez Higgins +// Copyright 1999-2005 Jez UK Ltd, http://www.jezuk.co.uk/ +// +// Normal basic_stringstream do not apply the codecvt facet +// of their locale. These two streams act exactly like +// basic_stringstream except that they do apply the imbued codecvt +// facet to their input (in the case of basic_iconvertstream) +// or output (int the case of basic_oconvertstream). +// +// This means you can to cool things like this +// +// std::locale loc(std::_Addfac(std::locale(), new base64_codecvt)); +// converting_ostringstream os; +// os.imbue(loc); +// +// os << "stuff"; +// ... lots more stuff streamed into os +// +// std::cout << os.str() << std::endl; +// os.str() contains the Base64 encoded byte sequence +// +// Decoding is just as simple. +// +// std::locale loc(std::_Addfac(std::locale(), new base64_codecvt)); +// +// converting_istringstream is; +// is.imbue(loc); +// is.str(a_base64_byte_stream); +// std::cout << is.str(); +// ... is.str() is the decode byte stream, which can also be extracted +// ... using >> operators (is >> byte; etc) +// +//////////////////////////////////////////////////////////// + +#include +#include +#include +#include +#include + +namespace Arabica +{ +namespace io +{ + +template +class convertstreambuf_init +{ +public: + typedef std::basic_stringbuf stringbufT; + + convertstreambuf_init(std::ios_base::openmode mode) : + buf_(mode) + { + } // convertstreambuf_init + + stringbufT const* buf() const + { + return &buf_; + } // buf() + + stringbufT* buf() + { + return &buf_; + } // buf() + +private: + stringbufT buf_; +}; // class convertstreambuf_init + +template, + typename fromCharT = charT, + typename fromTraitsT = std::char_traits > +class basic_iconvertstream : + private virtual convertstreambuf_init, + public std::basic_istream +{ + typedef convertstreambuf_init convertstreambuf_initT; +public: + typedef std::basic_istream istreamT; + typedef typename convertstreambuf_initT::stringbufT stringbufT; + typedef std::basic_string stringT; + typedef std::basic_string fromStringT; + + explicit basic_iconvertstream(std::ios_base::openmode mode = std::ios_base::in) : + convertstreambuf_initT(mode | std::ios_base::in), + std::basic_istream(convertstreambuf_initT::buf()) + { + } // basic_iconvertstream + + explicit basic_iconvertstream(const stringT& str, std::ios_base::openmode mode = std::ios_base::in) : + convertstreambuf_initT(mode | std::ios_base::in), + std::basic_istream(convertstreambuf_initT::buf()) + { + str(str); + } // basic_iconvertstream + + virtual ~basic_iconvertstream() + {} + + stringbufT* rdbuf() const + { + return const_cast(convertstreambuf_initT::buf()); + } // rdbuf + + stringT str() const + { + return convertstreambuf_initT::buf()->str(); + } // str + + void str(const fromStringT& str) + { + // do conversion + const std::codecvt& cvt = + std::use_facet >(this->getloc()); + + if(cvt.always_noconv()) + { + convertstreambuf_initT::buf()->str(no_conversion(str)); + return; + } + + // we must do code conversion + stringT converted; + const fromCharT* from_next = str.data(); + typename std::codecvt_base::result r; + typename traitsT::state_type state; + + do + { + charT* to_next; + r = cvt.in(state, from_next, str.data() + str.length(), from_next, + to_, to_ + toSize_, to_next); + if(r == std::codecvt_base::noconv) + { + converted.append(no_conversion(str)); + break; + } + converted.append(to_, (to_next - to_)); + } + while(r == std::codecvt_base::partial); + + // naughty! ignore (r == std::codecvt_base::error) + convertstreambuf_initT::buf()->str(converted); + } // str + +private: + stringT no_conversion(const fromStringT& str) + { + stringT dest; + + std::back_insert_iterator id(dest); + for(typename fromStringT::const_iterator i = str.begin(); i != str.end(); ++i, ++id) + *id = static_cast(*i); + + return dest; + } // no_conversion + + static const int toSize_ = 4096; + charT to_[toSize_]; +}; // basic_iconvertstream + +template, + typename toCharT = charT, + typename toTraitsT = std::char_traits > +class basic_oconvertstream : + private virtual convertstreambuf_init, + public std::basic_ostream +{ + typedef convertstreambuf_init convertstreambuf_initT; +public: + typedef std::basic_ostream ostreamT; + typedef typename convertstreambuf_initT::stringbufT stringbufT; + typedef std::basic_string stringT; + typedef std::basic_string toStringT; + + explicit basic_oconvertstream(std::ios_base::openmode mode = std::ios_base::out) : + convertstreambuf_initT(mode | std::ios_base::out), + std::basic_ostream(convertstreambuf_initT::buf()) + { + } // basic_oconvertstream + + explicit basic_oconvertstream(const stringT& str, std::ios_base::openmode mode = std::ios_base::out) : + convertstreambuf_initT(mode | std::ios_base::out), + std::basic_ostream(convertstreambuf_initT::buf()) + { + convertstreambuf_initT::buf()->str(str); + } // basic_oconvertstream + + virtual ~basic_oconvertstream() + {} + + stringbufT* rdbuf() const + { + return const_cast(convertstreambuf_initT::buf()); + } // rdbuf + + toStringT str() + { + toStringT out; + stringT newstuff(convertstreambuf_initT::buf()->str()); + + if(newstuff.length() == 0) + return out; + + // convert it here + const std::codecvt& cvt = + std::use_facet >(this->getloc()); + + if(cvt.always_noconv()) + out.append(no_conversion(newstuff)); + else + { + // we must do code conversion + const charT* from_next = newstuff.data(); + typename std::codecvt_base::result r; + typename traitsT::state_type state; + + do + { + toCharT* to_next; + r = cvt.out(state, from_next, newstuff.data() + newstuff.length(), from_next, + to_, to_ + toSize_, to_next); + if(r == std::codecvt_base::noconv) + { + out.append(no_conversion(newstuff)); + break; + } + out.append(to_, (to_next - to_)); + } + while(r == std::codecvt_base::partial); + // naughty! ignore (r == std::codecvt_base::error) + } // if(cvt.always_noconv()) + + convertstreambuf_initT::buf()->str(stringT()); + + return out; + } // str + + void str(const stringT& str) + { + convertstreambuf_initT::buf()->str(str); + } // str + +private: + toStringT no_conversion(const stringT& str) + { + toStringT dest; + + std::back_insert_iterator id(dest); + for(typename stringT::const_iterator i = str.begin(); i != str.end(); ++i, ++id) + *id = static_cast(*i); + + return dest; + } // no_conversion + + static const int toSize_ = 4096; + toCharT to_[toSize_]; +}; // basic_oconvertstream + +typedef basic_iconvertstream converting_istringstream; +typedef basic_oconvertstream converting_ostringstream; +#ifndef ARABICA_NO_WSTRING_T +typedef basic_iconvertstream converting_iwstringstream; +typedef basic_oconvertstream converting_owstringstream; +#endif + +} // namespace io +} // namespace Arabica +#endif diff --git a/arabica/include/io/socket_stream.hpp b/arabica/include/io/socket_stream.hpp new file mode 100644 index 000000000..48bba0f8b --- /dev/null +++ b/arabica/include/io/socket_stream.hpp @@ -0,0 +1,436 @@ +#ifndef ARABICA_SOCKET_STREAM_H +#define ARABICA_SOCKET_STREAM_H +/////////////////////////////////////////////////////////////////////// +// +// socket_stream.h +// +// Written by Jez Higgins +// Copyright 1999-2003 Jez UK Ltd, http://www.jezuk.co.uk/ +// +/////////////////////////////////////////////////////////////////////// +// $Id$ +/////////////////////////////////////////////////////////////////////// + +#include +#ifndef ARABICA_USE_WINSOCK +#include +#include +#include +#include +#include +#include +#include +#else +#include +#endif +#include +#include +#include +#include +#include + +#ifndef INADDR_NONE +# define INADDR_NONE ((in_addr_t) -1) +#endif + +#ifdef _MSC_VER +#pragma warning(disable: 4250) +// See http://connect.microsoft.com/VisualStudio/feedback/details/733720/inheriting-from-std-fstream-produces-c4250-warning +#endif +namespace Arabica +{ +namespace io +{ + +/////////////////////////////////////////////////////////// +// basic_socketbuf declaration +template +class basic_socketbuf : public std::basic_streambuf +{ + public: + typedef typename traitsT::int_type int_type; + + using std::basic_streambuf::setp; + using std::basic_streambuf::setg; + using std::basic_streambuf::underflow; + using std::basic_streambuf::gptr; + using std::basic_streambuf::gbump; + using std::basic_streambuf::egptr; + using std::basic_streambuf::eback; + using std::basic_streambuf::pptr; + using std::basic_streambuf::sputc; + + basic_socketbuf(); + virtual ~basic_socketbuf(); + + bool is_open() const; + + basic_socketbuf* open(const char* hostname, unsigned short port); + basic_socketbuf* close(); + + protected: + virtual int_type overflow(int_type c = traitsT::eof()); + virtual int sync(); + virtual int_type underflow(); + virtual int_type pbackfail(int_type c); + + private: + typedef typename traitsT::state_type state_t; + + int sock_; + std::vector outBuffer_; + state_t outState_; + std::vector inBuffer_; + state_t inState_; + + void growOutBuffer(); + bool writeSocket(); + void growInBuffer(); + int readSocket(); + int closeSocket(int sock) const; + + static const size_t bufferSize_; + static const size_t pbSize_; + +#ifndef ARABICA_USE_WINSOCK + static const int INVALID_SOCKET; + static const int SOCKET_ERROR; +#endif +}; // class basic_socketbuf + +template +const size_t basic_socketbuf::bufferSize_ = 1024; +template +const size_t basic_socketbuf::pbSize_ = 4; + // why 4? both Josuttis and Langer&Kreft use 4. +#ifndef ARABICA_USE_WINSOCK +template +const int basic_socketbuf::INVALID_SOCKET = -1; +template +const int basic_socketbuf::SOCKET_ERROR = -1; +#endif + +/////////////////////////////////////////////////////////// +// basic_socketbuf definition +template +basic_socketbuf::basic_socketbuf() + : std::basic_streambuf(), + sock_(INVALID_SOCKET), + outBuffer_(0), + inBuffer_(0) +{ +// outState_ = 0; +// inState_ = 0; + + setp(0, 0); + setg(0, 0, 0); +} // basic_socketbuf + +template +basic_socketbuf::~basic_socketbuf() +{ + if(is_open()) + { + sync(); + closeSocket(sock_); + } // if(is_open()) +} // ~basic_socketbuf + +template +bool basic_socketbuf::is_open() const +{ + return (sock_ != INVALID_SOCKET); +} // is_open + +template +basic_socketbuf* basic_socketbuf::open(const char* hostname, + unsigned short port) +{ + // already open? and crappy data + if((sock_ != INVALID_SOCKET) || + (hostname == 0) || + (strlen(hostname) == 0)) + return 0; + + // set up address + sockaddr_in sockAddr; + memset(&sockAddr, 0, sizeof(sockAddr)); + + sockAddr.sin_family = AF_INET; + sockAddr.sin_addr.s_addr = inet_addr(hostname); + if(sockAddr.sin_addr.s_addr == INADDR_NONE) + { + hostent* host = gethostbyname(hostname); + if(!host) + return 0; + + sockAddr.sin_addr.s_addr = + reinterpret_cast(host->h_addr)->s_addr; + } // if(sockAddr.sin_addr.s_addr == INADDR_NONE) + sockAddr.sin_port = htons(port); + + // connect + int tmpsock = socket(AF_INET, SOCK_STREAM, 0); + if(tmpsock == INVALID_SOCKET) + return 0; + if(connect(tmpsock, reinterpret_cast(&sockAddr), sizeof(sockaddr_in)) != 0) + { + closeSocket(tmpsock); + return 0; + } + + // hurray, we've connected so initialise everything else we need to + sock_ = tmpsock; + + return this; +} // open + +template +basic_socketbuf* basic_socketbuf::close() +{ + if(!is_open()) + return 0; + + if(closeSocket(sock_) == SOCKET_ERROR) + return 0; + + sock_ = INVALID_SOCKET; + setg(0,0,0); + + return this; +} // close; + +template +typename basic_socketbuf::int_type basic_socketbuf::overflow(typename basic_socketbuf::int_type c) +{ + if(traitsT::eq_int_type(traitsT::eof(), c)) + return traitsT::not_eof(c); + if(!is_open()) + return traitsT::eof(); + + growOutBuffer(); + sputc(traitsT::to_char_type(c)); + + return traitsT::not_eof(c); +} // overflow + +template +int basic_socketbuf::sync() +{ + return writeSocket() ? 0 : -1; +} // sync + +template +typename basic_socketbuf::int_type basic_socketbuf::underflow() +{ + if(!is_open()) + return traitsT::eof(); + if(gptr() != 0 && gptr() < egptr()) + return (traitsT::to_int_type(*gptr())); + + size_t length = readSocket(); + if(!length) + return traitsT::eof(); + + return traitsT::to_int_type(*gptr()); +} // underflow + +template +typename basic_socketbuf::int_type basic_socketbuf::pbackfail(int_type c) +{ + if(gptr() == eback()) + return traitsT::eof(); + + gbump(-1); + if(!traitsT::eq_int_type(c, traitsT::eof())) + *(gptr()) = traitsT::to_char_type(c); + return traitsT::not_eof(c); +} // pbackfail + +template +void basic_socketbuf::growOutBuffer() +{ + size_t oldsize = outBuffer_.capacity(); + size_t newsize = (oldsize ? oldsize*2 : bufferSize_); + outBuffer_.resize(newsize); + + char* out_begin = &(outBuffer_[0]); + setp(out_begin + oldsize, out_begin + newsize); +} // growOutBuffer + +template +bool basic_socketbuf::writeSocket() +{ + // write to the socket + charT* from_next = &(outBuffer_[0]); + size_t length = pptr() - from_next; + if(!length) + return true; + + bool ok = (send(sock_, from_next, length, 0) != SOCKET_ERROR); + + if(ok) + setp(from_next, from_next + outBuffer_.capacity()); + + return ok; +} // writeSocket + +template +void basic_socketbuf::growInBuffer() +{ + size_t oldsize = inBuffer_.capacity(); + size_t newsize = (oldsize ? oldsize*2 : bufferSize_+pbSize_); + inBuffer_.resize(newsize); +} // growInBuffer + +template +int basic_socketbuf::readSocket() +{ + if(!inBuffer_.capacity()) + growInBuffer(); + + size_t pbCount = std::min(gptr() - eback(), pbSize_); + + memcpy(&(inBuffer_[0]) + (pbSize_-pbCount)*sizeof(charT), + gptr() - pbCount*sizeof(charT), + pbCount*sizeof(charT)); + + int res = recv(sock_, &(inBuffer_[0]) + pbSize_, inBuffer_.capacity() - pbSize_, 0); + if(res == 0) + { + // server closed the socket + close(); + return 0; + } // if(res == 0) + else if(res == SOCKET_ERROR) + { +#ifdef ARABICA_USE_WINSOCK + if(GetLastError() == WSAEMSGSIZE) + { + // buffer was too small, so make it bigger + growInBuffer(); + return readSocket(); + } // if(GetLastError() != WSAEMSGSIZE) +#endif + + // unclever error handling + close(); + return 0; + } // if(res == SOCKET_ERROR) + + charT* to_begin = &(inBuffer_[0]) + pbSize_; + setg(to_begin - pbCount, to_begin, to_begin + res); + + return res; +} // readSocket + +template +int basic_socketbuf::closeSocket(int sock) const +{ +#ifdef ARABICA_USE_WINSOCK + return closesocket(sock); +#else + return ::close(sock); +#endif +} // closeSocket + +/////////////////////////////////////////////////////////// +// basic_socketstream declaration +template +class socketstreambuf_init +{ +public: + typedef basic_socketbuf sockbuf; + + sockbuf* buf() const + { + return &buf_; + } // buf() + +private: + mutable sockbuf buf_; +}; // class socketstreambuf_init + +template +class basic_socketstream : + private virtual socketstreambuf_init, + public std::basic_iostream +{ + public: + using std::basic_iostream::setstate; + using std::basic_iostream::badbit; + + basic_socketstream(); + explicit basic_socketstream(const char* hostname, int port); + + virtual ~basic_socketstream(); + + basic_socketbuf* rdbuf() const; + bool is_open() const; + void open(const char* hostname, unsigned short port); + void close(); +}; // class basic_socketstream + +//////////////////////////////////////////////////////////////// +// basic_socketstream definition +template +basic_socketstream::basic_socketstream() : + socketstreambuf_init(), + std::basic_iostream(socketstreambuf_init::buf()) +{ +} // basic_socketstream + +template +basic_socketstream::basic_socketstream(const char* hostname, int port) : + socketstreambuf_init(), + std::basic_iostream(socketstreambuf_init::buf()) +{ + open(hostname, port); +} // basic_socketstream + +template +basic_socketstream::~basic_socketstream() +{ +} // ~basic_socketstream + +template +basic_socketbuf* basic_socketstream::rdbuf() const +{ + return socketstreambuf_init::buf(); +} // rdbuf + +template +bool basic_socketstream::is_open() const +{ + return socketstreambuf_init::buf()->is_open(); +} // is_open + +template +void basic_socketstream::open(const char* hostname, unsigned short port) +{ + if(socketstreambuf_init::buf()->open(hostname, port) == 0) + setstate(badbit); +} // open + +template +void basic_socketstream::close() +{ + if(!is_open()) + return; + + if(socketstreambuf_init::buf()->close() == 0) + setstate(badbit); +} // close + +typedef basic_socketbuf > socketbuf; +typedef basic_socketstream > socketstream; +#ifndef ARABICA_NO_WSTRING_T +typedef basic_socketbuf > wsocketbuf; +typedef basic_socketstream > wsocketstream; +#endif + +} // namespace io +} // namespace Arabica + +#endif +//end of file diff --git a/arabica/include/io/uri.hpp b/arabica/include/io/uri.hpp new file mode 100644 index 000000000..0bd9ef8e8 --- /dev/null +++ b/arabica/include/io/uri.hpp @@ -0,0 +1,84 @@ +#ifndef ARABICA_IO_URI_HPP +#define ARABICA_IO_URI_HPP + +#include + +namespace Arabica +{ + namespace io + { + class URI + { + public: + URI() { } + + URI(const std::string& URI); + + URI(const URI& base, const std::string& relativeURI); + + URI(const URI& rhs) : + scheme_(rhs.scheme_), + host_(rhs.host_), + path_(rhs.path_), + port_(rhs.port_), + is_absolute_(rhs.is_absolute_) + { + } // URI + + URI& operator=(const URI& rhs) + { + URI t(rhs); + swap(t); + return *this; + } // operator= + + bool operator==(const URI& rhs) const + { + return scheme_ == rhs.scheme_ && + host_ == rhs.host_ && + path_ == rhs.path_ && + port_ == rhs.port_ && + is_absolute_ == rhs.is_absolute_; + } // operator== + + bool operator!=(const URI& rhs) const + { + return !(operator==(rhs)); + } // operator!= + + ~URI() { } + + void swap(URI& rhs) + { + std::swap(scheme_, rhs.scheme_); + std::swap(host_, rhs.host_); + std::swap(path_, rhs.path_); + std::swap(port_, rhs.port_); + std::swap(is_absolute_, rhs.is_absolute_); + } // swap + + const std::string& scheme() const { return scheme_; } + const std::string& host() const { return host_; } + const std::string& port() const; + const std::string& path() const { return path_; } + const bool& is_absolute() const { return is_absolute_; } + + std::string as_string() const; + + private: + void parse(const std::string& URI); + void parse_uri(const std::string& URI); + std::string::const_iterator parseAuthority(const std::string::const_iterator& u, const std::string::const_iterator& ue); + void absolutise(URI& relURI); + void combinePath(const std::string& path); + + std::string scheme_; + std::string host_; + std::string path_; + std::string port_; + bool is_absolute_; + }; // class URI + } // namespace io +} // namespace Arabica + +#endif diff --git a/arabica/include/text/UnicodeCharacters.hpp b/arabica/include/text/UnicodeCharacters.hpp new file mode 100644 index 000000000..4a61a4b25 --- /dev/null +++ b/arabica/include/text/UnicodeCharacters.hpp @@ -0,0 +1,292 @@ +#ifndef ARABICA_XML_UNICODE_CHARACTERS_H +#define ARABICA_XML_UNICODE_CHARACTERS_H + +namespace Arabica +{ +namespace text +{ + +template +struct Unicode +{ + static const charT HORIZONTAL_TABULATION; + static const charT LINE_FEED; + static const charT CARRIAGE_RETURN; + static const charT SPACE; + static const charT EXCLAMATION_MARK; + static const charT QUOTATION_MARK; + static const charT NUMBER_SIGN; + static const charT PERCENT_SIGN; + static const charT AMPERSAND; + static const charT APOSTROPHE; + static const charT LEFT_PARENTHESIS; + static const charT RIGHT_PARENTHESIS; + static const charT ASTERISK; + static const charT PLUS_SIGN; + static const charT COMMA; + static const charT HYPHEN_MINUS; + static const charT FULL_STOP; + static const charT SLASH; + static const charT NUMBER_0; + static const charT NUMBER_1; + static const charT NUMBER_2; + static const charT NUMBER_3; + static const charT NUMBER_4; + static const charT NUMBER_5; + static const charT NUMBER_6; + static const charT NUMBER_7; + static const charT NUMBER_8; + static const charT NUMBER_9; + static const charT COLON; + static const charT SEMI_COLON; + static const charT LESS_THAN_SIGN; + static const charT EQUALS_SIGN; + static const charT GREATER_THAN_SIGN; + static const charT QUESTION_MARK; + static const charT CAPITAL_A; + static const charT CAPITAL_B; + static const charT CAPITAL_C; + static const charT CAPITAL_D; + static const charT CAPITAL_E; + static const charT CAPITAL_F; + static const charT CAPITAL_G; + static const charT CAPITAL_H; + static const charT CAPITAL_I; + static const charT CAPITAL_J; + static const charT CAPITAL_K; + static const charT CAPITAL_L; + static const charT CAPITAL_M; + static const charT CAPITAL_N; + static const charT CAPITAL_O; + static const charT CAPITAL_P; + static const charT CAPITAL_Q; + static const charT CAPITAL_R; + static const charT CAPITAL_S; + static const charT CAPITAL_T; + static const charT CAPITAL_U; + static const charT CAPITAL_V; + static const charT CAPITAL_W; + static const charT CAPITAL_X; + static const charT CAPITAL_Y; + static const charT CAPITAL_Z; + static const charT LEFT_SQUARE_BRACKET; + static const charT BACK_SLASH; + static const charT RIGHT_SQUARE_BRACKET; + static const charT LOW_LINE; + static const charT LOWERCASE_A; + static const charT LOWERCASE_B; + static const charT LOWERCASE_C; + static const charT LOWERCASE_D; + static const charT LOWERCASE_E; + static const charT LOWERCASE_F; + static const charT LOWERCASE_G; + static const charT LOWERCASE_H; + static const charT LOWERCASE_I; + static const charT LOWERCASE_J; + static const charT LOWERCASE_K; + static const charT LOWERCASE_L; + static const charT LOWERCASE_M; + static const charT LOWERCASE_N; + static const charT LOWERCASE_O; + static const charT LOWERCASE_P; + static const charT LOWERCASE_Q; + static const charT LOWERCASE_R; + static const charT LOWERCASE_S; + static const charT LOWERCASE_T; + static const charT LOWERCASE_U; + static const charT LOWERCASE_V; + static const charT LOWERCASE_W; + static const charT LOWERCASE_X; + static const charT LOWERCASE_Y; + static const charT LOWERCASE_Z; + static const charT VERTICAL_BAR; +}; // namespace XML + +template +const charT Unicode::HORIZONTAL_TABULATION = 0x09; +template +const charT Unicode::LINE_FEED = 0x0A; +template +const charT Unicode::CARRIAGE_RETURN = 0x0D; +template +const charT Unicode::SPACE = 0x20; +template +const charT Unicode::EXCLAMATION_MARK = 0x21; // ! +template +const charT Unicode::QUOTATION_MARK = 0x22; // " +template +const charT Unicode::NUMBER_SIGN = 0x23; // # +template +const charT Unicode::PERCENT_SIGN = 0x25; // % +template +const charT Unicode::AMPERSAND = 0x26; // & +template +const charT Unicode::APOSTROPHE = 0x27; // ' +template +const charT Unicode::LEFT_PARENTHESIS = 0x28; // ( +template +const charT Unicode::RIGHT_PARENTHESIS = 0x29; // ) +template +const charT Unicode::ASTERISK = 0x2A; // * +template +const charT Unicode::PLUS_SIGN = 0x2B; // + +template +const charT Unicode::COMMA = 0x2C; // , +template +const charT Unicode::HYPHEN_MINUS = 0x2D; // - +template +const charT Unicode::FULL_STOP = 0x2E; // . +template +const charT Unicode::SLASH = 0x2F; // / +template +const charT Unicode::NUMBER_0 = 0x30; +template +const charT Unicode::NUMBER_1 = 0x31; +template +const charT Unicode::NUMBER_2 = 0x32; +template +const charT Unicode::NUMBER_3 = 0x33; +template +const charT Unicode::NUMBER_4 = 0x34; +template +const charT Unicode::NUMBER_5 = 0x35; +template +const charT Unicode::NUMBER_6 = 0x36; +template +const charT Unicode::NUMBER_7 = 0x37; +template +const charT Unicode::NUMBER_8 = 0x38; +template +const charT Unicode::NUMBER_9 = 0x39; +template +const charT Unicode::COLON = 0x3A; // : +template +const charT Unicode::SEMI_COLON = 0x3B; // ; +template +const charT Unicode::LESS_THAN_SIGN = 0x3C; // < +template +const charT Unicode::EQUALS_SIGN = 0x3D; // = +template +const charT Unicode::GREATER_THAN_SIGN = 0x3E; // > +template +const charT Unicode::QUESTION_MARK = 0x3F; // ? +template +const charT Unicode::CAPITAL_A = 0x41; +template +const charT Unicode::CAPITAL_B = 0x42; +template +const charT Unicode::CAPITAL_C = 0x43; +template +const charT Unicode::CAPITAL_D = 0x44; +template +const charT Unicode::CAPITAL_E = 0x45; +template +const charT Unicode::CAPITAL_F = 0x46; +template +const charT Unicode::CAPITAL_G = 0x47; +template +const charT Unicode::CAPITAL_H = 0x48; +template +const charT Unicode::CAPITAL_I = 0x49; +template +const charT Unicode::CAPITAL_J = 0x4A; +template +const charT Unicode::CAPITAL_K = 0x4B; +template +const charT Unicode::CAPITAL_L = 0x4C; +template +const charT Unicode::CAPITAL_M = 0x4D; +template +const charT Unicode::CAPITAL_N = 0x4E; +template +const charT Unicode::CAPITAL_O = 0x4F; +template +const charT Unicode::CAPITAL_P = 0x50; +template +const charT Unicode::CAPITAL_Q = 0x51; +template +const charT Unicode::CAPITAL_R = 0x52; +template +const charT Unicode::CAPITAL_S = 0x53; +template +const charT Unicode::CAPITAL_T = 0x54; +template +const charT Unicode::CAPITAL_U = 0x55; +template +const charT Unicode::CAPITAL_V = 0x56; +template +const charT Unicode::CAPITAL_W = 0x57; +template +const charT Unicode::CAPITAL_X = 0x58; +template +const charT Unicode::CAPITAL_Y = 0x59; +template +const charT Unicode::CAPITAL_Z = 0x5A; +template +const charT Unicode::LEFT_SQUARE_BRACKET = 0x5B; // ] +template +const charT Unicode::BACK_SLASH = 0x5C; // +template +const charT Unicode::RIGHT_SQUARE_BRACKET = 0x5D; // [ +template +const charT Unicode::LOW_LINE = 0x5F; // _ +template +const charT Unicode::LOWERCASE_A = 0x61; +template +const charT Unicode::LOWERCASE_B = 0x62; +template +const charT Unicode::LOWERCASE_C = 0x63; +template +const charT Unicode::LOWERCASE_D = 0x64; +template +const charT Unicode::LOWERCASE_E = 0x65; +template +const charT Unicode::LOWERCASE_F = 0x66; +template +const charT Unicode::LOWERCASE_G = 0x67; +template +const charT Unicode::LOWERCASE_H = 0x68; +template +const charT Unicode::LOWERCASE_I = 0x69; +template +const charT Unicode::LOWERCASE_J = 0x6A; +template +const charT Unicode::LOWERCASE_K = 0x6B; +template +const charT Unicode::LOWERCASE_L = 0x6C; +template +const charT Unicode::LOWERCASE_M = 0x6D; +template +const charT Unicode::LOWERCASE_N = 0x6E; +template +const charT Unicode::LOWERCASE_O = 0x6F; +template +const charT Unicode::LOWERCASE_P = 0x70; +template +const charT Unicode::LOWERCASE_Q = 0x71; +template +const charT Unicode::LOWERCASE_R = 0x72; +template +const charT Unicode::LOWERCASE_S = 0x73; +template +const charT Unicode::LOWERCASE_T = 0x74; +template +const charT Unicode::LOWERCASE_U = 0x75; +template +const charT Unicode::LOWERCASE_V = 0x76; +template +const charT Unicode::LOWERCASE_W = 0x77; +template +const charT Unicode::LOWERCASE_X = 0x78; +template +const charT Unicode::LOWERCASE_Y = 0x79; +template +const charT Unicode::LOWERCASE_Z = 0x7A; +template +const charT Unicode::VERTICAL_BAR = 0x7C; // | + +} // namespace text +} // namespace Arabica + +#endif + diff --git a/arabica/include/text/normalize_whitespace.hpp b/arabica/include/text/normalize_whitespace.hpp new file mode 100644 index 000000000..97b282388 --- /dev/null +++ b/arabica/include/text/normalize_whitespace.hpp @@ -0,0 +1,50 @@ +#ifndef ARABICA_UTILS_NORMALIZE_WHITESPACE_HPP +#define ARABICA_UTILS_NORMALIZE_WHITESPACE_HPP + +#include +#include +#include + +namespace Arabica +{ +namespace text +{ + +template +inline string_type normalize_whitespace(const string_type& ch) +{ + std::string value = string_adaptor::asStdString(ch); + std::string stripped = normalize_whitespace >(value); + return string_adaptor::construct_from_utf8(stripped.c_str()); +} // normalize_whitespace + +template<> +inline std::string normalize_whitespace >(const std::string& ch) +{ + std::string value(ch); + std::string::const_iterator i = value.begin(), ie = value.end(); + std::string::iterator p = value.begin(), pe = value.end(); + + // string leading space + while((i != ie) && (Arabica::XML::is_space(static_cast(*i)))) + ++i; + + while(i != ie) + { + while((i != ie) && (!Arabica::XML::is_space(static_cast(*i)))) + *p++ = *i++; + while((i != ie) && (Arabica::XML::is_space(static_cast(*i)))) + ++i; + if(i != ie) + *p++ = Arabica::text::Unicode::SPACE; + } // while ... + if(p != pe) + value.erase(p, pe); + + return value; +} // normalize_whitespace + +} // namespace text +} // namespace Arabica +#endif + diff --git a/arabica/src/SAX/helpers/InputSourceResolver.cpp b/arabica/src/SAX/helpers/InputSourceResolver.cpp new file mode 100644 index 000000000..b33ff099c --- /dev/null +++ b/arabica/src/SAX/helpers/InputSourceResolver.cpp @@ -0,0 +1,143 @@ +/* + * $Id$ + */ + +#include +#include +#include +#include +#include +#include + +using namespace Arabica::SAX; + +void InputSourceResolver::open(const std::string& /* publicId */, + const std::string& systemId, + std::istream* byteStream) +{ + if(byteStream != 0) + { + byteStream_ = byteStream; + return; + } + + // does it look like a URI? + Arabica::io::URI url(systemId); + if(!url.scheme().empty()) + { + URIResolver res = findResolver(url.scheme()); + if(res) + byteStream_ = res(systemId); + if(byteStream_) + { + deleteStream_ = true; + return; + } // if ... + } // if ... + + // try and open it as a file + std::ifstream* ifs = new std::ifstream(url.path().c_str()); + if(ifs->is_open()) + { + deleteStream_ = true; + byteStream_ = ifs; + } + else + delete ifs; +} // InputSourceResolver + +InputSourceResolver::~InputSourceResolver() +{ + if(deleteStream_) + delete byteStream_; +} // ~InputSourceResolver + +////////////////////////////////////////////////////// +// resolverMap register/unregister +bool InputSourceResolver::registerResolver(const std::string& method, URIResolver resolver) +{ + resolverMap()[method] = resolver; + return true; +} // registerResolver + +bool InputSourceResolver::unRegisterResolver(const std::string& method) +{ + resolverMapT::iterator i = resolverMap().find(method); + if(i != resolverMap().end()) + resolverMap().erase(i); + return true; +} // unRegisterResolver + +InputSourceResolver::URIResolver InputSourceResolver::findResolver(std::string method) +{ + resolverMapT::iterator i = resolverMap().find(method); + return (i != resolverMap().end()) ? i->second : 0; +} // findResolver + +namespace +{ + std::istream* fileResolver(const std::string& fileURI) + { + Arabica::io::URI url(fileURI); + std::string fileName = url.path(); + + std::ifstream* ifs = new std::ifstream(fileName.c_str()); + if(ifs->is_open()) + return ifs; + delete ifs; + + // WIN32 specific stuff + for(std::string::iterator i = fileName.begin(); i != fileName.end(); ++i) + if(*i == '/') + *i = '\\'; + + if((fileName[0] == '\\') && (fileName[2] == ':')) + fileName.erase(0, 1); + + ifs = new std::ifstream(fileName.c_str()); + if(ifs->is_open()) + return ifs; + delete ifs; + + return 0; + } // fileResolver + + static bool fileReg = InputSourceResolver::registerResolver("file", fileResolver); + + std::istream* httpResolver(const std::string& httpURI) + { +#ifdef ARABICA_USE_WINSOCK + WORD wVersionRequested; + WSADATA wsaData; + int err; + + wVersionRequested = MAKEWORD(1, 1); + err = WSAStartup( wVersionRequested, &wsaData ); + if(err != 0) + return 0; +#endif + + Arabica::io::URI url(httpURI); + + Arabica::io::socketstream* ifs = new Arabica::io::socketstream(url.host().c_str(), std::atoi(url.port().c_str())); + if(!ifs->is_open()) + return 0; + *ifs << "GET " << url.path() << " HTTP/1.0" << std::endl; + *ifs << "Host: " << url.host() << std::endl; + *ifs << "Connection: close" << std::endl; + *ifs << std::endl; + + char buffer[1024]; + do + { + ifs->getline(buffer, sizeof(buffer)); + } + while(buffer[0] != '\r'); + + return ifs; + } // httpResolver + + static bool httpReg = InputSourceResolver::registerResolver("http", httpResolver); +} // namespace + +// end of file diff --git a/arabica/src/SAX/wrappers/saxlibxml2.cpp b/arabica/src/SAX/wrappers/saxlibxml2.cpp new file mode 100644 index 000000000..c2eeb68c6 --- /dev/null +++ b/arabica/src/SAX/wrappers/saxlibxml2.cpp @@ -0,0 +1,249 @@ +/*@ + * $Id$ + */ + +#ifdef _MSC_VER +#pragma warning(disable: 4786 4800) +#endif + +#include + +#include + +namespace Arabica +{ +namespace SAX +{ +namespace libxml2_wrapper_impl_tiddle +{ + +std::string formatErrorMsg(const char* fmt, va_list arg) +{ + char buff[4096]; + vsprintf(buff, fmt, arg); + return std::string(buff); +} // formatErrorMsg + +void lwit_startDocument(void* user_data) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->parserContext()->myDoc = xmlNewDoc(p->parserContext()->version); + p->parserContext()->myDoc->intSubset = xmlNewDtd(p->parserContext()->myDoc, BAD_CAST "fake", NULL, NULL); + p->SAXstartDocument(); +} // lwit_startDocument + +void lwit_endDocument(void* user_data) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXendDocument(); + xmlFreeDoc(p->parserContext()->myDoc); + p->parserContext()->myDoc = 0; +} // lwit_endDocument + +void lwit_startElement(void *user_data, const xmlChar* name, const xmlChar** attrs) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXstartElement(name, attrs); +} // lwit_startElement + +void lwit_endElement(void *user_data, const xmlChar* name) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXendElement(name); +} // lwit_endElement + +void lwit_characters(void* user_data, const xmlChar* ch, int len) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXcharacters(ch, len); +} // lwit_characters + +void lwit_cdata(void* user_data, const xmlChar* ch, int len) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXstartCdataSection(); + p->SAXcdata(ch, len); +// everyone else will call endCData if we are in cdata +// p->SAXendCdataSection(); +} // lwit_cdata + +void lwit_ignorableWhitespace(void *user_data, const xmlChar* ch, int len) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXignorableWhitespace(ch, len); +} // lwit_ignorableWhitespace + +void lwit_processingInstruction(void *user_data, const xmlChar* target, const xmlChar* data) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXprocessingInstruction(target, data); +} // lwit_processingInstruction + +void lwit_comment(void *user_data, const xmlChar* comment) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXcomment(comment); +} // lwit_comment + +void lwit_warning(void *user_data, const char* fmt, ...) +{ + va_list arg; + va_start(arg, fmt); + std::string msg(formatErrorMsg(fmt, arg)); + va_end(arg); + + libxml2_base* p = reinterpret_cast(user_data); + p->SAXwarning(msg); +} // lwit_warning + +void lwit_error(void* user_data, const char* fmt, ...) +{ + va_list arg; + va_start(arg, fmt); + std::string msg(formatErrorMsg(fmt, arg)); + va_end(arg); + + libxml2_base* p = reinterpret_cast(user_data); + p->SAXerror(msg); +} // lwit_error + +void lwit_fatalError(void* user_data, const char* fmt, ...) +{ + va_list arg; + va_start(arg, fmt); + std::string msg(formatErrorMsg(fmt, arg)); + va_end(arg); + + libxml2_base* p = reinterpret_cast(user_data); + p->SAXfatalError(msg); +} // lwit_fatalError + +void lwit_locator(void* user_data, xmlSAXLocatorPtr locator) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXlocator(locator); +} // lwit_locator + +void lwit_notationDecl(void* user_data, const xmlChar *name, const xmlChar *publicId, const xmlChar *systemId) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXnotationDecl(name, publicId, systemId); +} // lwit_notationDecl + +void lwit_unparsedEntityDecl(void* user_data, + const xmlChar *name, const xmlChar *publicId, + const xmlChar *systemId, const xmlChar *notationName) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXunparsedEntityDecl(name, publicId, systemId, notationName); +} // lwit_unparsedEntityDecl + +void lwit_elementDecl(void* user_data, const xmlChar *name, int type, xmlElementContentPtr content) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXelementDecl(name, type, content); +} // lwit_elementDecl + +void lwit_attributeDecl(void *user_data, const xmlChar *elem, const xmlChar *fullname, int type, int def, const xmlChar *defaultValue, xmlEnumerationPtr tree) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXattributeDecl(elem, fullname, type, def, defaultValue, tree); +} // lwit_attributeDecl + +void lwit_entityDecl(void* user_data, const xmlChar *name, int type, const xmlChar *publicId, const xmlChar *systemId, xmlChar *content) +{ + libxml2_base* p = reinterpret_cast(user_data); + p->SAXentityDecl(name, type, publicId, systemId, content); + xmlSAX2EntityDecl(p->parserContext(), name, type, publicId, systemId, content); +} // lwit_entityDecl + +xmlParserInputPtr lwit_resolveEntity(void* user_data, const xmlChar* publicId, const xmlChar* systemId) +{ + libxml2_base* p = reinterpret_cast(user_data); + return p->SAXresolveEntity(publicId, systemId); +} // lwit_resolveEntity + +xmlEntityPtr lwit_getEntity(void* user_data, const xmlChar* name) +{ + libxml2_base* p = reinterpret_cast(user_data); + xmlEntityPtr ent = xmlSAX2GetEntity(p->parserContext(), name); + return ent; +} // lwit_getEntity + +class libxmlInitialiser +{ +public: + libxmlInitialiser() { xmlInitParser(); } +}; + +static xmlSAXHandler saxHandler = { + 0, // internalSubsetSAXFunc internalSubset; + 0, // isStandaloneSAXFunc isStandalone; + 0, // hasInternalSubsetSAXFunc hasInternalSubset; + 0, // hasExternalSubsetSAXFunc hasExternalSubset; + lwit_resolveEntity, // resolveEntitySAXFunc resolveEntity; + lwit_getEntity, // getEntitySAXFunc getEntity; + lwit_entityDecl, // entityDeclSAXFunc entityDecl; + lwit_notationDecl, // notationDeclSAXFunc notationDecl; + lwit_attributeDecl, // attributeDeclSAXFunc attributeDecl; + lwit_elementDecl, // elementDeclSAXFunc elementDecl; + lwit_unparsedEntityDecl, // unparsedEntityDeclSAXFunc unparsedEntityDecl; + lwit_locator, // setDocumentLocatorSAXFunc setDocumentLocator; + lwit_startDocument, // startDocumentSAXFunc startDocument; + lwit_endDocument, // endDocumentSAXFunc endDocument; + lwit_startElement, // startElementSAXFunc startElement; + lwit_endElement, // endElementSAXFunc endElement; + 0, // referenceSAXFunc reference; + lwit_characters, // charactersSAXFunc characters; + lwit_ignorableWhitespace, // ignorableWhitespaceSAXFunc ignorableWhitespace; + lwit_processingInstruction, // processingInstructionSAXFunc processingInstruction; + lwit_comment, // commentSAXFunc comment; + lwit_warning, // warningSAXFunc warning; + lwit_error, // errorSAXFunc error; + lwit_fatalError, // fatalErrorSAXFunc fatalError; + 0, // getParameterEntitySAXFunc getParameterEntity; + lwit_cdata, // cdataBlockSAXFunc cdataBlock; + 0, // externalSubsetSAXFunc externalSubset; + 0, // initialized; + /* The following fields are extensions available only on version 2 */ + 0, // _private + 0, // startElementNs + 0, // endElementNs; + 0 // serror; + }; + +xmlSAXHandler* lwit_SaxHandler() +{ + static libxmlInitialiser init; + return &saxHandler; +} + +void lwit_setFeature(xmlParserCtxtPtr context, const char* name, bool value) +{ + int v = value; + if(xmlSetFeature(context, name, reinterpret_cast(&v)) == -1) + { + std::ostringstream os; + os << "Feature not recognized " << name; + throw SAX::SAXNotRecognizedException(os.str()); + } // if ... +} // lwitSetFeature + +bool lwit_getFeature(xmlParserCtxtPtr context, const char* name) +{ + int v; + if(xmlGetFeature(context, name, reinterpret_cast(&v)) == -1) + { + std::ostringstream os; + os << "Feature not recognized " << name; + throw SAX::SAXNotRecognizedException(os.str()); + } // if ... + return static_cast(v); +} // lwit_getFeature + +} // namespace libxml2_wrapper_impl_tiddle + +} // namespace SAX +} // namespace Arabica + +// end of file diff --git a/arabica/src/XML/XMLCharacterClasses.cpp b/arabica/src/XML/XMLCharacterClasses.cpp new file mode 100644 index 000000000..b3ae23c96 --- /dev/null +++ b/arabica/src/XML/XMLCharacterClasses.cpp @@ -0,0 +1,288 @@ + +#include +#include +#include + +const wchar_t base_char_ranges[][2] = +{ + { 0x0041, 0x005A }, { 0x0061, 0x007A }, { 0x00C0, 0x00D6 }, + { 0x00D8, 0x00F6 }, { 0x00F8, 0x00FF }, { 0x0100, 0x0131 }, + { 0x0134, 0x013E }, { 0x0141, 0x0148 }, { 0x014A, 0x017E }, + { 0x0180, 0x01C3 }, { 0x01CD, 0x01F0 }, { 0x01F4, 0x01F5 }, + { 0x01FA, 0x0217 }, { 0x0250, 0x02A8 }, { 0x02BB, 0x02C1 }, + { 0x0386, 0x0386 }, { 0x0388, 0x038A }, { 0x038C, 0x038C }, + { 0x038E, 0x03A1 }, { 0x03A3, 0x03CE }, { 0x03D0, 0x03D6 }, + { 0x03DA, 0x03DA }, { 0x03DC, 0x03DC }, { 0x03DE, 0x03DE }, + { 0x03E0, 0x03E0 }, { 0x03E2, 0x03F3 }, { 0x0401, 0x040C }, + { 0x040E, 0x044F }, { 0x0451, 0x045C }, { 0x045E, 0x0481 }, + { 0x0490, 0x04C4 }, { 0x04C7, 0x04C8 }, { 0x04CB, 0x04CC }, + { 0x04D0, 0x04EB }, { 0x04EE, 0x04F5 }, { 0x04F8, 0x04F9 }, + { 0x0531, 0x0556 }, { 0x0559, 0x0559 }, { 0x0561, 0x0586 }, + { 0x05D0, 0x05EA }, { 0x05F0, 0x05F2 }, { 0x0621, 0x063A }, + { 0x0641, 0x064A }, { 0x0671, 0x06B7 }, { 0x06BA, 0x06BE }, + { 0x06C0, 0x06CE }, { 0x06D0, 0x06D3 }, { 0x06D5, 0x06D5 }, + { 0x06E5, 0x06E6 }, { 0x0905, 0x0939 }, { 0x093D, 0x093D }, + { 0x0958, 0x0961 }, { 0x0985, 0x098C }, { 0x098F, 0x0990 }, + { 0x0993, 0x09A8 }, { 0x09AA, 0x09B0 }, { 0x09B2, 0x09B2 }, + { 0x09B6, 0x09B9 }, { 0x09DC, 0x09DD }, { 0x09DF, 0x09E1 }, + { 0x09F0, 0x09F1 }, { 0x0A05, 0x0A0A }, { 0x0A0F, 0x0A10 }, + { 0x0A13, 0x0A28 }, { 0x0A2A, 0x0A30 }, { 0x0A32, 0x0A33 }, + { 0x0A35, 0x0A36 }, { 0x0A38, 0x0A39 }, { 0x0A59, 0x0A5C }, + { 0x0A5E, 0x0A5E }, { 0x0A72, 0x0A74 }, { 0x0A85, 0x0A8B }, + { 0x0A8D, 0x0A8D }, { 0x0A8F, 0x0A91 }, { 0x0A93, 0x0AA8 }, + { 0x0AAA, 0x0AB0 }, { 0x0AB2, 0x0AB3 }, { 0x0AB5, 0x0AB9 }, + { 0x0ABD, 0x0ABD }, { 0x0AE0, 0x0AE0 }, { 0x0B05, 0x0B0C }, + { 0x0B0F, 0x0B10 }, { 0x0B13, 0x0B28 }, { 0x0B2A, 0x0B30 }, + { 0x0B32, 0x0B33 }, { 0x0B36, 0x0B39 }, { 0x0B3D, 0x0B3D }, + { 0x0B5C, 0x0B5D }, { 0x0B5F, 0x0B61 }, { 0x0B85, 0x0B8A }, + { 0x0B8E, 0x0B90 }, { 0x0B92, 0x0B95 }, { 0x0B99, 0x0B9A }, + { 0x0B9C, 0x0B9C }, { 0x0B9E, 0x0B9F }, { 0x0BA3, 0x0BA4 }, + { 0x0BA8, 0x0BAA }, { 0x0BAE, 0x0BB5 }, { 0x0BB7, 0x0BB9 }, + { 0x0C05, 0x0C0C }, { 0x0C0E, 0x0C10 }, { 0x0C12, 0x0C28 }, + { 0x0C2A, 0x0C33 }, { 0x0C35, 0x0C39 }, { 0x0C60, 0x0C61 }, + { 0x0C85, 0x0C8C }, { 0x0C8E, 0x0C90 }, { 0x0C92, 0x0CA8 }, + { 0x0CAA, 0x0CB3 }, { 0x0CB5, 0x0CB9 }, { 0x0CDE, 0x0CDE }, + { 0x0CE0, 0x0CE1 }, { 0x0D05, 0x0D0C }, { 0x0D0E, 0x0D10 }, + { 0x0D12, 0x0D28 }, { 0x0D2A, 0x0D39 }, { 0x0D60, 0x0D61 }, + { 0x0E01, 0x0E2E }, { 0x0E30, 0x0E30 }, { 0x0E32, 0x0E33 }, + { 0x0E40, 0x0E45 }, { 0x0E81, 0x0E82 }, { 0x0E84, 0x0E84 }, + { 0x0E87, 0x0E88 }, { 0x0E8A, 0x0E8A }, { 0x0E8D, 0x0E8D }, + { 0x0E94, 0x0E97 }, { 0x0E99, 0x0E9F }, { 0x0EA1, 0x0EA3 }, + { 0x0EA5, 0x0EA5 }, { 0x0EA7, 0x0EA7 }, { 0x0EAA, 0x0EAB }, + { 0x0EAD, 0x0EAE }, { 0x0EB0, 0x0EB0 }, { 0x0EB2, 0x0EB3 }, + { 0x0EBD, 0x0EBD }, { 0x0EC0, 0x0EC4 }, { 0x0F40, 0x0F47 }, + { 0x0F49, 0x0F69 }, { 0x10A0, 0x10C5 }, { 0x10D0, 0x10F6 }, + { 0x1100, 0x1100 }, { 0x1102, 0x1103 }, { 0x1105, 0x1107 }, + { 0x1109, 0x1109 }, { 0x110B, 0x110C }, { 0x110E, 0x1112 }, + { 0x113C, 0x113C }, { 0x113E, 0x113E }, { 0x1140, 0x1140 }, + { 0x114C, 0x114C }, { 0x114E, 0x114E }, { 0x1150, 0x1150 }, + { 0x1154, 0x1155 }, { 0x1159, 0x1159 }, { 0x115F, 0x1161 }, + { 0x1163, 0x1163 }, { 0x1165, 0x1165 }, { 0x1167, 0x1167 }, + { 0x1169, 0x1169 }, { 0x116D, 0x116E }, { 0x1172, 0x1173 }, + { 0x1175, 0x1175 }, { 0x119E, 0x119E }, { 0x11A8, 0x11A8 }, + { 0x11AB, 0x11AB }, { 0x11AE, 0x11AF }, { 0x11B7, 0x11B8 }, + { 0x11BA, 0x11BA }, { 0x11BC, 0x11C2 }, { 0x11EB, 0x11EB }, + { 0x11F0, 0x11F0 }, { 0x11F9, 0x11F9 }, { 0x1E00, 0x1E9B }, + { 0x1EA0, 0x1EF9 }, { 0x1F00, 0x1F15 }, { 0x1F18, 0x1F1D }, + { 0x1F20, 0x1F45 }, { 0x1F48, 0x1F4D }, { 0x1F50, 0x1F57 }, + { 0x1F59, 0x1F59 }, { 0x1F5B, 0x1F5B }, { 0x1F5D, 0x1F5D }, + { 0x1F5F, 0x1F7D }, { 0x1F80, 0x1FB4 }, { 0x1FB6, 0x1FBC }, + { 0x1FBE, 0x1FBE }, { 0x1FC2, 0x1FC4 }, { 0x1FC6, 0x1FCC }, + { 0x1FD0, 0x1FD3 }, { 0x1FD6, 0x1FDB }, { 0x1FE0, 0x1FEC }, + { 0x1FF2, 0x1FF4 }, { 0x1FF6, 0x1FFC }, { 0x2126, 0x2126 }, + { 0x212A, 0x212B }, { 0x212E, 0x212E }, { 0x2180, 0x2182 }, + { 0x3041, 0x3094 }, { 0x30A1, 0x30FA }, { 0x3105, 0x312C }, + { 0xAC00, 0xD7A3 }, { 0, 0 } +}; // base_char_ranges + +bool Arabica::XML::is_char(wchar_t c) +{ + return (c == text::Unicode::HORIZONTAL_TABULATION) || + (c == text::Unicode::LINE_FEED) || + (c == text::Unicode::CARRIAGE_RETURN) || + ((c >= 0x0020) && (c <= 0xD7FF)) || + ((c >= 0xE000) && (c <= 0xFFFD)) +#ifndef ARABICA_NO_WCHAR_T + || ((c >= 0x10000) && (c <= 0x10FFFF)) +#endif + ; +} // is_char + +bool Arabica::XML::is_space(wchar_t c) +{ + return (c == text::Unicode::SPACE) || + (c == text::Unicode::HORIZONTAL_TABULATION) || + (c == text::Unicode::CARRIAGE_RETURN) || + (c == text::Unicode::LINE_FEED); +} // is_space + +bool Arabica::XML::is_name_char(wchar_t c) +{ + return is_letter(c) || + is_digit(c) || + (c == text::Unicode::FULL_STOP) || // . + (c == text::Unicode::HYPHEN_MINUS) || // - + (c == text::Unicode::LOW_LINE) || // _ + (c == text::Unicode::COLON) || // : + is_combining_char(c) || + is_extender(c); +} // is_name_char + +bool Arabica::XML::is_ncname_char(wchar_t c) +{ + return is_letter(c) || + is_digit(c) || + (c == text::Unicode::FULL_STOP) || // . + (c == text::Unicode::HYPHEN_MINUS) || // - + (c == text::Unicode::LOW_LINE) || // _ + is_combining_char(c) || + is_extender(c); +} // is_ncname_char + +bool Arabica::XML::is_letter(wchar_t c) +{ + return is_base_char(c) || + is_ideographic(c); +} // is_letter + +bool Arabica::XML::is_base_char(wchar_t c) +{ + for(int i=0; base_char_ranges[i][0]; ++i) + { + if(c < base_char_ranges[i][0]) + return false; + + if((c >= base_char_ranges[i][0]) && (c <= base_char_ranges[i][1])) + return true; + } // for ... + + return false; +} // is_base_char + +bool Arabica::XML::is_ideographic(wchar_t c) +{ + return ((c >= 0x4E00) && (c <= 0x9FA5)) || + c == 0x3007 || + ((c >= 0x3021) && (c <= 0x3029)); +} // is_ideographic + +bool Arabica::XML::is_digit(wchar_t c) +{ + return ((c >= 0x0030) && (c <= 0x0039)) || + ((c >= 0x0660) && (c <= 0x0669)) || + ((c >= 0x06F0) && (c <= 0x06F9)) || + ((c >= 0x0966) && (c <= 0x096F)) || + ((c >= 0x09E6) && (c <= 0x09EF)) || + ((c >= 0x0A66) && (c <= 0x0A6F)) || + ((c >= 0x0AE6) && (c <= 0x0AEF)) || + ((c >= 0x0B66) && (c <= 0x0B6F)) || + ((c >= 0x0BE7) && (c <= 0x0BEF)) || + ((c >= 0x0C66) && (c <= 0x0C6F)) || + ((c >= 0x0CE6) && (c <= 0x0CEF)) || + ((c >= 0x0D66) && (c <= 0x0D6F)) || + ((c >= 0x0E50) && (c <= 0x0E59)) || + ((c >= 0x0ED0) && (c <= 0x0ED9)) || + ((c >= 0x0F20) && (c <= 0x0F29)); +} // is_digit + +bool Arabica::XML::is_combining_char(wchar_t c) +{ + return ((c >= 0x0300) && (c <= 0x0345)) || + ((c >= 0x0360) && (c <= 0x0361)) || + ((c >= 0x0483) && (c <= 0x0486)) || + ((c >= 0x0591) && (c <= 0x05A1)) || + ((c >= 0x05A3) && (c <= 0x05B9)) || + ((c >= 0x05BB) && (c <= 0x05BD)) || + (c == 0x05BF) || + ((c >= 0x05C1) && (c <= 0x05C2)) || + (c == 0x05C4) || + ((c >= 0x064B) && (c <= 0x0652)) || + (c == 0x0670) || + ((c >= 0x06D6) && (c <= 0x06DC)) || + ((c >= 0x06DD) && (c <= 0x06DF)) || + ((c >= 0x06E0) && (c <= 0x06E4)) || + ((c >= 0x06E7) && (c <= 0x06E8)) || + ((c >= 0x06EA) && (c <= 0x06ED)) || + ((c >= 0x0901) && (c <= 0x0903)) || + (c == 0x093C) || + ((c >= 0x093E) && (c <= 0x094C)) || + (c == 0x094D) || + ((c >= 0x0951) && (c <= 0x0954)) || + ((c >= 0x0962) && (c <= 0x0963)) || + ((c >= 0x0981) && (c <= 0x0983)) || + (c == 0x09BC) || + (c == 0x09BE) || + (c == 0x09BF) || + ((c >= 0x09C0) && (c <= 0x09C4)) || + ((c >= 0x09C7) && (c <= 0x09C8)) || + ((c >= 0x09CB) && (c <= 0x09CD)) || + (c == 0x09D7) || + ((c >= 0x09E2) && (c <= 0x09E3)) || + (c == 0x0A02) || + (c == 0x0A3C) || + (c == 0x0A3E) || + (c == 0x0A3F) || + ((c >= 0x0A40) && (c <= 0x0A42)) || + ((c >= 0x0A47) && (c <= 0x0A48)) || + ((c >= 0x0A4B) && (c <= 0x0A4D)) || + ((c >= 0x0A70) && (c <= 0x0A71)) || + ((c >= 0x0A81) && (c <= 0x0A83)) || + (c == 0x0ABC) || + ((c >= 0x0ABE) && (c <= 0x0AC5)) || + ((c >= 0x0AC7) && (c <= 0x0AC9)) || + ((c >= 0x0ACB) && (c <= 0x0ACD)) || + ((c >= 0x0B01) && (c <= 0x0B03)) || + (c == 0x0B3C) || + ((c >= 0x0B3E) && (c <= 0x0B43)) || + ((c >= 0x0B47) && (c <= 0x0B48)) || + ((c >= 0x0B4B) && (c <= 0x0B4D)) || + ((c >= 0x0B56) && (c <= 0x0B57)) || + ((c >= 0x0B82) && (c <= 0x0B83)) || + ((c >= 0x0BBE) && (c <= 0x0BC2)) || + ((c >= 0x0BC6) && (c <= 0x0BC8)) || + ((c >= 0x0BCA) && (c <= 0x0BCD)) || + (c == 0x0BD7) || + ((c >= 0x0C01) && (c <= 0x0C03)) || + ((c >= 0x0C3E) && (c <= 0x0C44)) || + ((c >= 0x0C46) && (c <= 0x0C48)) || + ((c >= 0x0C4A) && (c <= 0x0C4D)) || + ((c >= 0x0C55) && (c <= 0x0C56)) || + ((c >= 0x0C82) && (c <= 0x0C83)) || + ((c >= 0x0CBE) && (c <= 0x0CC4)) || + ((c >= 0x0CC6) && (c <= 0x0CC8)) || + ((c >= 0x0CCA) && (c <= 0x0CCD)) || + ((c >= 0x0CD5) && (c <= 0x0CD6)) || + ((c >= 0x0D02) && (c <= 0x0D03)) || + ((c >= 0x0D3E) && (c <= 0x0D43)) || + ((c >= 0x0D46) && (c <= 0x0D48)) || + ((c >= 0x0D4A) && (c <= 0x0D4D)) || + (c == 0x0D57) || + (c == 0x0E31) || + ((c >= 0x0E34) && (c <= 0x0E3A)) || + ((c >= 0x0E47) && (c <= 0x0E4E)) || + (c == 0x0EB1) || + ((c >= 0x0EB4) && (c <= 0x0EB9)) || + ((c >= 0x0EBB) && (c <= 0x0EBC)) || + ((c >= 0x0EC8) && (c <= 0x0ECD)) || + ((c >= 0x0F18) && (c <= 0x0F19)) || + (c == 0x0F35) || + (c == 0x0F37) || + (c == 0x0F39) || + (c == 0x0F3E) || + (c == 0x0F3F) || + ((c >= 0x0F71) && (c <= 0x0F84)) || + ((c >= 0x0F86) && (c <= 0x0F8B)) || + ((c >= 0x0F90) && (c <= 0x0F95)) || + (c == 0x0F97) || + ((c >= 0x0F99) && (c <= 0x0FAD)) || + ((c >= 0x0FB1) && (c <= 0x0FB7)) || + (c == 0x0FB9) || + ((c >= 0x20D0) && (c <= 0x20DC)) || + (c == 0x20E1) || + ((c >= 0x302A) && (c <= 0x302F)) || + (c == 0x3099) || + (c == 0x309A); +} // is_combining + +bool Arabica::XML::is_extender(wchar_t c) +{ + return (c == 0x00B7) || + (c == 0x02D0) || + (c == 0x02D1) || + (c == 0x0387) || + (c == 0x0640) || + (c == 0x0E46) || + (c == 0x0EC6) || + (c == 0x3005) || + ((c >= 0x3031) && (c <= 0x3035)) || + ((c >= 0x309D) && (c <= 0x309E)) || + ((c >= 0x30FC) && (c <= 0x30FE)); +} // is_extender + +bool Arabica::XML::is_letter_or_digit(wchar_t c) +{ + return is_letter(c) || is_digit(c); +} // is_letter_or_digit + + +// end of file diff --git a/arabica/src/arabica.cpp b/arabica/src/arabica.cpp new file mode 100644 index 000000000..ff809beaa --- /dev/null +++ b/arabica/src/arabica.cpp @@ -0,0 +1,9 @@ + +#include + +#ifdef ARABICA_USE_LIBXML2 +#include "SAX/wrappers/saxlibxml2.cpp" +#ifdef _MSC_VER +#pragma message("Pulling in libxml2 wrappers") +#endif +#endif diff --git a/arabica/src/convert/impl/ucs2_utf16.cpp b/arabica/src/convert/impl/ucs2_utf16.cpp new file mode 100644 index 000000000..ca1e0502b --- /dev/null +++ b/arabica/src/convert/impl/ucs2_utf16.cpp @@ -0,0 +1,57 @@ +// -------------------------------------------------------------------------- +// -------------------------------------------------------------------------- +#include +// -------------------------------------------------------------------------- + +std::codecvt_base::result Arabica::convert::impl::utf16_2_ucs2(bool be, + char const* from, char const* from_end, char const*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) +{ + from_next = from; + to_next = to; + + while((from_next+1 < from_end) && (to_next < to_limit)) + { + wchar_t b1 = static_cast(*from_next++); + wchar_t b2 = static_cast(*from_next++); + + *to_next++ = be ? ((b1 << 8) + b2) : ((b2 << 8) + b1); + } // while + + return (from_next == from_end) ? std::codecvt_base::ok : std::codecvt_base::partial; +} // utf16_2_ucs2 + +std::codecvt_base::result Arabica::convert::impl::ucs2_2_utf16(bool be, + wchar_t const* from, wchar_t const* from_end, wchar_t const*& from_next, + char* to, char* to_limit, char*& to_next) +{ + from_next = from; + to_next = to; + + while(from_next < from_end) + { + if(to_next + 2 >= to_limit) + return std::codecvt_base::partial; + + wchar_t ch = *from_next; + unsigned char lb = static_cast(ch & 0xFF); + unsigned char hb = static_cast((ch >> 8) & 0xFF); + + if(be) + { // big endian + *to_next++ = hb; + *to_next++ = lb; + } + else + { // little endian + *to_next++ = lb; + *to_next++ = hb; + } + + ++from_next; + } // while(from_next < from_end) + + return std::codecvt_base::ok; +} // ucs2_2_utf8 + +// end of file diff --git a/arabica/src/convert/impl/ucs2_utf8.cpp b/arabica/src/convert/impl/ucs2_utf8.cpp new file mode 100644 index 000000000..4b9f5d864 --- /dev/null +++ b/arabica/src/convert/impl/ucs2_utf8.cpp @@ -0,0 +1,103 @@ +//--------------------------------------------------------------------------- +// $Id$ +//--------------------------------------------------------------------------- +#include +//--------------------------------------------------------------------------- +// Some of this code is derived from work done by Ken Thompson, +// provided to the X/Open Group. +// +// I got my information about UTF-8 from RFC 2044. + + +namespace { + struct Tab + { + unsigned char char_mask; + unsigned char char_value; + int shift; + unsigned long wide_mask; + }; + + static const Tab tab[] = + { + { (unsigned char)(0x80), (unsigned char)(0x00), 0*6, 0x7F, }, // 1 byte sequence + { (unsigned char)(0xE0), (unsigned char)(0xC0), 1*6, 0x7FF, }, // 2 byte sequence + { (unsigned char)(0xF0), (unsigned char)(0xE0), 2*6, 0xFFFF, }, // 3 byte sequence + { 0, 0, 0, 0, } // end of table + }; +} // namespace + + +std::codecvt_base::result Arabica::convert::impl::ucs2_2_utf8( + const wchar_t* from, const wchar_t* from_end, const wchar_t*& from_next, + char* to, char* to_limit, char*& to_next) +{ + from_next = from; + to_next = to; + + while(from_next < from_end) + { + unsigned long fn = static_cast(*from_next); + + for(const Tab *t = tab; t->char_mask; t++) + { + if(fn > t->wide_mask ) + continue; + + // is there enough room in outbuffer? + if(to_next + (t - tab) + 1 >= to_limit) + return std::codecvt_base::partial; + + int c = t->shift; + *to_next++ = static_cast(t->char_value | (fn >> c)); + while(c > 0) + { + c -= 6; + *to_next++ = static_cast(0x80 | ((fn >> c) & 0x3F)); + } // while(c > 0) + break; + } // for(Tab *t = tab; t->char_mask; t++) + ++from_next; + } // while(from_next < from_end) + + return std::codecvt_base::ok; +} // ucs2_2_utf8 + +std::codecvt_base::result Arabica::convert::impl::utf8_2_ucs2( + const char* from, const char* from_end, const char*& from_next, + wchar_t* to, wchar_t* to_limit, wchar_t*& to_next) +{ + from_next = from; + to_next = to; + + while((from_next < from_end) && (to_next < to_limit)) + { + unsigned char start = static_cast(*from_next); + + const Tab *t = tab; + for(; t->char_mask; ++t) + { + if((start & t->char_mask) == t->char_value) + break; + } + + if((from_next + (t - tab)) >= from_end) + break; + + unsigned long wide_mask = t->wide_mask; + + *to_next = start; + for(; t != tab; --t) + { + from_next++; + *to_next = (*to_next << 6) | ((*from_next ^ 0x80) & 0xff); + } + *to_next &= wide_mask; + + ++from_next; + ++to_next; + } // while + + return (from_next == from_end) ? std::codecvt_base::ok : std::codecvt_base::partial; +} // utf8_2_ucs2 +// end of file diff --git a/arabica/src/convert/utf8ucs2codecvt.cpp b/arabica/src/convert/utf8ucs2codecvt.cpp new file mode 100644 index 000000000..b51a3d003 --- /dev/null +++ b/arabica/src/convert/utf8ucs2codecvt.cpp @@ -0,0 +1,85 @@ +//--------------------------------------------------------------------------- +// $Id$ +//--------------------------------------------------------------------------- +#include +#include +#include +//--------------------------------------------------------------------------- +#ifndef ARABICA_NO_WCHAR_T + +using namespace Arabica::convert; + +std::codecvt_base::result utf8ucs2codecvt::do_out(std::mbstate_t& /* state */, + const wchar_t* from, + const wchar_t* from_end, + const wchar_t*& from_next, + char* to, + char* to_limit, + char*& to_next) const +{ + return impl::ucs2_2_utf8(from, from_end, from_next, to, to_limit, to_next); +} // do_out + +std::codecvt_base::result utf8ucs2codecvt::do_in(std::mbstate_t& /* state */, + const char* from, + const char* from_end, + const char*& from_next, + wchar_t* to, + wchar_t* to_limit, + wchar_t*& to_next) const +{ + return impl::utf8_2_ucs2(from, from_end, from_next, to, to_limit, to_next); +} // do_in + +std::codecvt_base::result utf8ucs2codecvt::do_unshift(std::mbstate_t& /* state */, + char* to, + char* /* to_limit */, + char*& to_next) const +{ + to_next = to; + return noconv; +} // do_unshift + +int utf8ucs2codecvt::do_length(const std::mbstate_t&, + const char* from, + const char* end, + size_t max) const throw() +{ + size_t count(0); + const char* from_next = from; + + while((from_next < end) && (count < max)) + { + if(!(*from_next & 0x80)) + { + ++count; + ++from_next; + } + else if((*from_next&0xc0) == 0xc0) + { + if(from_next+2 < end) + { + ++count; + from_next += 2; + } + else + break; + } + else if((*from_next&0xe0) == 0xe0) + { + if(from_next+3 < end) + { + ++count; + from_next += 3; + } + else + break; + } + } // while + + return (from_next-from); +} // do_length + +#endif +// end of file + diff --git a/arabica/src/io/uri.cpp b/arabica/src/io/uri.cpp new file mode 100644 index 000000000..f28351ee3 --- /dev/null +++ b/arabica/src/io/uri.cpp @@ -0,0 +1,197 @@ + +#include +#include + +using namespace Arabica::io; + +namespace { + const std::string ZERO = "0"; + const std::string PORT_EIGHTY = "80"; + const std::string PORT_443 = "443"; + + const std::string SCHEME_HTTP = "http"; + const std::string SCHEME_HTTPS = "https"; + const std::string SCHEME_FILE = "file"; + + const std::string COLON = ":"; + const char FORWARD_SLASH = '/'; + + const std::string& wellKnownPort(const std::string& scheme) + { + if(scheme.empty()) + return ZERO; + + if(scheme == SCHEME_HTTP) + return PORT_EIGHTY; + if(scheme == SCHEME_HTTPS) + return PORT_443; + + return ZERO; + } // wellKnownPort +} // namespace + +URI::URI(const std::string& uri) : + is_absolute_(false) +{ + parse(uri); +} // URI + +URI::URI(const URI& base, const std::string& relativeUrl) : + scheme_(base.scheme_), + host_(base.host_), + path_(base.path_), + port_(base.port_), + is_absolute_(base.is_absolute_) +{ + if(!relativeUrl.empty()) + { + URI relUrl(relativeUrl); + absolutise(relUrl); + } // if ... +} // URI + +const std::string& URI::port() const +{ + if(port_.empty()) + return wellKnownPort(scheme_); + return port_; +} // port() + +std::string URI::as_string() const +{ + std::string str; + if(!scheme_.empty()) + str.append(scheme_).append(COLON); + if(is_absolute_) + str.append("//"); + if(!host_.empty()) + { + str.append(host_); + if(!port_.empty()) + str.append(COLON).append(port_); + } + str.append(path_); + return str; +} // as_string + +void fixSlashes(std::string& path) +{ + for(size_t i = path.find('\\'); i != std::string::npos; i = path.find('\\', i)) + path[i] = FORWARD_SLASH; +} // fixSlashes + +void URI::parse(const std::string& uri) +{ + parse_uri(uri); + + is_absolute_ = (!scheme_.empty() && !host_.empty()) || + (((scheme_ == SCHEME_FILE) && (!path_.empty())) && + ((path_[0] == FORWARD_SLASH) || (path_[1] == ':'))); +} // parse + +void URI::parse_uri(const std::string& uri) +{ + // I'd like to use something a bit stronger - http://code.google.com/p/uri-grammar/ + // but that would put a Boost Spirit dependence right in the core, which I'm not prepared to do at the moment + + size_t d = uri.find_first_of(COLON); + if(d == std::string::npos) + { + path_ = uri; + fixSlashes(path_); + return; + } // if ... + + if(d == 1) + { + // looks like a windows file path + path_ = uri; + fixSlashes(path_); + scheme_ = SCHEME_FILE; + return; + } // if ... + + scheme_ = uri.substr(0, d); + + std::string::const_iterator u = uri.begin() + d; + std::string::const_iterator ue = uri.end(); + + ++u; + if(*u == FORWARD_SLASH && *(u+1) == FORWARD_SLASH) + { + u += 2; + u = parseAuthority(u, ue); + } // if ... + + path_.append(u, ue); +} // parse + +std::string::const_iterator URI::parseAuthority(const std::string::const_iterator& u, + const std::string::const_iterator& ue) +{ + std::string::const_iterator slash = std::find(u, ue, FORWARD_SLASH); + if(slash == ue) + { + // ah, this is easy + host_.append(u, ue); + return ue; + } // if(slash == we) + + std::string::const_iterator colon = std::find(u, slash, ':'); + host_.append(u, colon); + + if(colon != slash) + port_.append(colon+1, slash); + + return slash; +} // parseAuthority + +bool compatible_schemes(const std::string& scheme, + const std::string& relative) +{ + if(scheme.empty() && (relative == "file")) + return true; + if(relative.empty()) + return true; + return (scheme == relative); +} // compatible_schemes + +void URI::absolutise(URI& relative) +{ + if((relative.is_absolute()) || + !compatible_schemes(scheme_, relative.scheme())) + { + swap(relative); + return; + } + + if(relative.path_[0] == FORWARD_SLASH) + path_ = relative.path_; + else + combinePath(relative.path_); +} // absolutise + +void URI::combinePath(const std::string& relPath) +{ + if(*(path_.rbegin()) != FORWARD_SLASH) + path_.erase(path_.rfind(FORWARD_SLASH)+1); + + std::string::size_type from = path_.length() - 1; + path_.append(relPath); + + size_t dots = path_.find("/../", from); + while(dots != std::string::npos) + { + int preceding_slash = (dots > 0) ? path_.rfind(FORWARD_SLASH, dots-1) : 0; + path_.erase(preceding_slash, dots+3-preceding_slash); + dots = path_.find("/../", preceding_slash); + } // while + + size_t dot = path_.find("/./"); + while(dot != std::string::npos) + { + path_.erase(dot, 2); + dot = path_.find("/./", dot); + } +} // combinePath + diff --git a/arabica/src/taggle/Schema.cpp b/arabica/src/taggle/Schema.cpp new file mode 100644 index 000000000..15aad905a --- /dev/null +++ b/arabica/src/taggle/Schema.cpp @@ -0,0 +1,14 @@ + +#include +#include + +const int Arabica::SAX::Schema::M_ANY = 0xFFFFFFFF; +const int Arabica::SAX::Schema::M_EMPTY = 0; +const int Arabica::SAX::Schema::M_PCDATA = 1 << 30; +const int Arabica::SAX::Schema::M_ROOT = 1 << 31; + +const int Arabica::SAX::Schema::F_RESTART = 1; +const int Arabica::SAX::Schema::F_CDATA = 2; +const int Arabica::SAX::Schema::F_NOFORCE = 4; + + From a9da081ef1054c8e9ed11ff2481b8a446f395858 Mon Sep 17 00:00:00 2001 From: Markus Mirz Date: Tue, 26 Mar 2024 21:36:30 +0100 Subject: [PATCH 3/9] ignore clangd cache files Signed-off-by: Markus Mirz --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 1fc8c9c81..9b922e1e0 100644 --- a/.gitignore +++ b/.gitignore @@ -49,3 +49,5 @@ Doxyfile cmake-build* *.swp + +.cache \ No newline at end of file From 0033965e230ed4014e6536f185e2c514043bcd62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sat, 26 Oct 2024 14:02:40 +0200 Subject: [PATCH 4/9] Update arabica from https://github.com/jezhiggins/arabica.git (Resolved 64-bit specific warnings, Replaced use of std::auto_ptr with std::unique_ptr) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Günther --- arabica/.gitignore | 6 ++ arabica/CMakeLists.txt | 14 +-- arabica/LICENSE | 2 +- arabica/include/SAX/ArabicaConfig.hpp.in | 45 +++++--- arabica/include/SAX/IStreamHandle.hpp | 28 ++--- arabica/include/SAX/InputSource.hpp | 14 +-- arabica/include/SAX/ParserConfig.hpp | 4 +- arabica/include/SAX/XMLReader.hpp | 100 ------------------ arabica/include/SAX/ext/DeclHandler.hpp | 8 +- arabica/include/SAX/ext/LexicalHandler.hpp | 12 +-- arabica/include/SAX/helpers/PropertyNames.hpp | 53 ---------- arabica/include/SAX/helpers/XMLFilterImpl.hpp | 35 +----- arabica/include/SAX/saxfwd.hpp | 2 +- arabica/include/SAX/wrappers/saxlibxml2.hpp | 55 ---------- arabica/include/Taggle/impl/Parser.hpp | 85 +-------------- .../convert/impl/codecvt_specialisations.hpp | 22 ++++ arabica/include/io/convertstream.hpp | 4 +- arabica/include/io/socket_stream.hpp | 31 +++--- arabica/include/io/uri.hpp | 11 +- .../src/SAX/helpers/InputSourceResolver.cpp | 6 +- arabica/src/SAX/wrappers/saxlibxml2.cpp | 2 +- arabica/src/convert/utf8ucs2codecvt.cpp | 2 +- arabica/src/io/uri.cpp | 2 +- 23 files changed, 136 insertions(+), 407 deletions(-) delete mode 100644 arabica/include/SAX/helpers/PropertyNames.hpp diff --git a/arabica/.gitignore b/arabica/.gitignore index 3c415b35c..cb807da70 100644 --- a/arabica/.gitignore +++ b/arabica/.gitignore @@ -40,6 +40,12 @@ tests/XSLT/test_path.hpp vs9/mangle.sln vs9/*.user vs10/mangle.sln +/vs2013+/Arabica.VC.db +/vs2013+/Arabica.VC.VC.opendb +/vc12 +/vc14 +/vs2013+/int/vc12 +/vs2013+/int/vc14 *.vcxproj.filters *.vcxproj.user diff --git a/arabica/CMakeLists.txt b/arabica/CMakeLists.txt index ed4eff2fb..838050702 100644 --- a/arabica/CMakeLists.txt +++ b/arabica/CMakeLists.txt @@ -7,8 +7,8 @@ set(CMAKE_CXX_STANDARD 11) set(LIB_NAME arabica) -set(ARABICA_MAJOR_VERSION 2016) -set(ARABICA_MINOR_VERSION January) +set(ARABICA_MAJOR_VERSION 2024) +set(ARABICA_MINOR_VERSION September) # # Build as shared library @@ -20,13 +20,12 @@ option(BUILD_SHARED_LIBS "Build as shared libaries" OFF) # options: USE_MSXML, USE_EXPAT, USE_LIBXML2, USE_XERCES set(ARABICA_XML_BACKEND USE_LIBXML2) -configure_file(${CMAKE_CURRENT_LIST_DIR}/include/SAX/ArabicaConfig.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/include/SAX/ArabicaConfig.hpp) - # # find libxml2: LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES if(ARABICA_XML_BACKEND STREQUAL USE_LIBXML2) - find_package(LibXml2) - set(ADDITIONAL_INC ${LIBXML2_INCLUDE_DIR}) + set(ARABICA_USE_LIBXML2 TRUE) + find_package(LibXml2 REQUIRED) + set(ADDITIONAL_INC ${LIBXML2_INCLUDE_DIRS}) set(ADDITIONAL_LIB ${LIBXML2_LIBRARIES}) endif() @@ -34,6 +33,8 @@ endif() # platform check set(BUILD_X64 TRUE) +configure_file(${CMAKE_CURRENT_LIST_DIR}/include/SAX/ArabicaConfig.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/include/SAX/ArabicaConfig.hpp) + set(GENERATED_HEADER_FILES ${CMAKE_CURRENT_BINARY_DIR}/include/SAX/ArabicaConfig.hpp ) @@ -72,7 +73,6 @@ set(PUBLIC_HEADER_FILES include/SAX/helpers/FeatureNames.hpp include/SAX/helpers/InputSourceResolver.hpp include/SAX/helpers/NamespaceSupport.hpp - include/SAX/helpers/PropertyNames.hpp include/SAX/helpers/XMLFilterImpl.hpp include/SAX/wrappers/saxlibxml2.hpp include/Arabica/getparam.hpp diff --git a/arabica/LICENSE b/arabica/LICENSE index 2cef36588..8a485cf5b 100644 --- a/arabica/LICENSE +++ b/arabica/LICENSE @@ -1,4 +1,4 @@ -Copyright 2001-2017 Jez UK Ltd +Copyright 2001-2024 JezUK Ltd All rights reserved. Redistribution and use in source and binary forms, with or diff --git a/arabica/include/SAX/ArabicaConfig.hpp.in b/arabica/include/SAX/ArabicaConfig.hpp.in index 1934dc60f..47562720b 100644 --- a/arabica/include/SAX/ArabicaConfig.hpp.in +++ b/arabica/include/SAX/ArabicaConfig.hpp.in @@ -1,12 +1,33 @@ -#ifndef ARABICA_ARABICA_CONFIG_H -#define ARABICA_ARABICA_CONFIG_H - -#cmakedefine ARABICA_NO_WCHAR_T -#cmakedefine ARABICA_VS6_WORKAROUND -#cmakedefine ARABICA_NO_CODECVT_SPECIALISATIONS -#cmakedefine ARABICA_USE_WINSOCK -#cmakedefine ARABICA_WINDOWS -#cmakedefine ARABICA_HAVE_BOOST -#define ARABICA_@ARABICA_XML_BACKEND@ - -#endif // ARABICA_ARABICA_CONFIG_H + +/* define if the Boost library is available */ +#cmakedefine ARABICA_HAVE_BOOST + +/* defined if we don't need extra codecvt template specialisations */ +#cmakedefine NO_CODECVT_SPECIALISATIONS + +/* no mbstate_t */ +#cmakedefine NO_MBSTATE_T + +/* no std::mbstate_t */ +#cmakedefine NO_STD_MBSTATE_T + +/* disables wchar_t */ +#cmakedefine NO_WCHAR_T + +/* define to build against Expat */ +#cmakedefine ARABICA_USE_EXPAT + +/* define to build against LibXML2 */ +#cmakedefine ARABICA_USE_LIBXML2 + +/* define to build against Xerces */ +#cmakedefine ARABICA_USE_XERCES + +/* define to build using Garden */ +#cmakedefine USE_GARDEN + +/* defined for Windows builds using Winsock rather than BSD-style sockets */ +#cmakedefine USE_WINSOCK + +/* Version number of package */ +#cmakedefine VERSION diff --git a/arabica/include/SAX/IStreamHandle.hpp b/arabica/include/SAX/IStreamHandle.hpp index 11cdbf8d1..ede67a352 100644 --- a/arabica/include/SAX/IStreamHandle.hpp +++ b/arabica/include/SAX/IStreamHandle.hpp @@ -34,12 +34,12 @@ namespace SAX { * * \par * Ownership of a std::istream is passed to an IStreamHandle via a - * std::auto_ptr. Ownership of a + * std::unique_ptr. Ownership of a * std::istream is passed between IStreamHandle by assignment. * - * \see IStreamHandle(std::auto_ptr) for passing + * \see IStreamHandle(std::unique_ptr) for passing * ownership at construction. - * \see IStreamHandle::operator=(std::auto_ptr) for + * \see IStreamHandle::operator=(std::unique_ptr) for * passing ownership after construction. * \see IStreamHandle(std::istream&) for constructing without * passing ownership @@ -89,7 +89,7 @@ namespace SAX { * * \par * If an IStreamHandle is constructed with or assigned a - * std::auto_ptr, it takes ownership of + * std::unique_ptr, it takes ownership of * the pointee. If an IStreamHandle is constructed with or * assigned a std::istream&, it does not take * ownership of the pointee. @@ -117,9 +117,9 @@ namespace SAX { * * \par * All public API methods of IStreamHandle that take an - * auto_ptr parameter conform to the follow post-conditions. + * unique_ptr parameter conform to the follow post-conditions. * For the purposes of these post-conditions, rhs will represent - * the std::auto_ptr parameter. + * the std::unique_ptr parameter. * - is_ contains the value returned by rhs.release(). * - rhs.get() == 0 (ownership has been transfered). * - owner_ = true @@ -169,8 +169,8 @@ class IStreamHandle * other IStreamHandle objects. * */ - explicit IStreamHandle(std::auto_ptr is); - explicit IStreamHandle(std::auto_ptr is); + explicit IStreamHandle(std::unique_ptr is); + explicit IStreamHandle(std::unique_ptr is); /** Construct an IStreamHandle sharing a std::istream with rhs. * @@ -225,8 +225,8 @@ class IStreamHandle * shared with other IStreamHandle objects. * */ - IStreamHandle& operator=(std::auto_ptr rhs); - IStreamHandle& operator=(std::auto_ptr rhs); + IStreamHandle& operator=(std::unique_ptr rhs); + IStreamHandle& operator=(std::unique_ptr rhs); /** Assign a new std::istream to this. This destroys the * std::istream held by this if this owns @@ -296,7 +296,7 @@ IStreamHandle::IStreamHandle(std::istream& is) } inline -IStreamHandle::IStreamHandle(std::auto_ptr is) +IStreamHandle::IStreamHandle(std::unique_ptr is) : is_(is.release()), counter_(new int(0)), owner_(true) @@ -307,7 +307,7 @@ IStreamHandle::IStreamHandle(std::auto_ptr is) } inline -IStreamHandle::IStreamHandle(std::auto_ptr is) +IStreamHandle::IStreamHandle(std::unique_ptr is) : is_(is.release()), counter_(new int(0)), owner_(true) @@ -352,7 +352,7 @@ IStreamHandle& IStreamHandle::operator=(const IStreamHandle& rhs) } inline -IStreamHandle& IStreamHandle::operator=(std::auto_ptr rhs) +IStreamHandle& IStreamHandle::operator=(std::unique_ptr rhs) { removeRef(); set(rhs.release(), true); @@ -365,7 +365,7 @@ IStreamHandle& IStreamHandle::operator=(std::auto_ptr rhs) } inline -IStreamHandle& IStreamHandle::operator=(std::auto_ptr rhs) +IStreamHandle& IStreamHandle::operator=(std::unique_ptr rhs) { removeRef(); set(rhs.release(), true); diff --git a/arabica/include/SAX/InputSource.hpp b/arabica/include/SAX/InputSource.hpp index 1933cd7ec..cccc87905 100644 --- a/arabica/include/SAX/InputSource.hpp +++ b/arabica/include/SAX/InputSource.hpp @@ -105,7 +105,7 @@ class InputSource * @param byteStream The raw byte stream containing the document. The * InputSource does not assume ownership of * this byteStream. - * @see #InputSource(std::auto_ptr) + * @see #InputSource(std::unique_ptr) * @see #setPublicId * @see #setSystemId * @see #setEncoding @@ -136,15 +136,15 @@ class InputSource * @see #setEncoding * @see #setByteStream */ - InputSource(std::auto_ptr byteStream) : - byteStream_(byteStream), + InputSource(std::unique_ptr&& byteStream) : + byteStream_(std::move(byteStream)), publicId_(), systemId_(), encoding_() { } - InputSource(std::auto_ptr byteStream) : - byteStream_(byteStream), + InputSource(std::unique_ptr&& byteStream) : + byteStream_(std::move(byteStream)), publicId_(), systemId_(), encoding_() @@ -233,7 +233,7 @@ class InputSource * @param byteStream A byte stream containing an XML document or * other entity. The InputSource does not assume * ownership of byteStream. - * @see #setByteStream(std::auto_ptr) To transfer ownership of + * @see #setByteStream(std::unique_ptr) To transfer ownership of * an std::istream to an InputSource * @see #setEncoding * @see #getByteStream @@ -261,7 +261,7 @@ class InputSource * @see #getByteStream * @see #getEncoding */ - void setByteStream(std::auto_ptr byteStream) + void setByteStream(std::unique_ptr byteStream) { byteStream_ = byteStream; } // setByteStream diff --git a/arabica/include/SAX/ParserConfig.hpp b/arabica/include/SAX/ParserConfig.hpp index ff44c5a6d..cdf2db7c1 100644 --- a/arabica/include/SAX/ParserConfig.hpp +++ b/arabica/include/SAX/ParserConfig.hpp @@ -11,7 +11,7 @@ #endif #endif -#ifdef ARABICA_USE_MSXML +#ifdef USE_MSXML #ifndef _MSC_VER #error "Can only use MSXML on Windows" #endif @@ -37,7 +37,7 @@ #endif #endif -#ifdef ARABICA_USE_GARDEN +#ifdef USE_GARDEN #ifdef _MSC_VER #pragma message("Including Garden") #endif diff --git a/arabica/include/SAX/XMLReader.hpp b/arabica/include/SAX/XMLReader.hpp index 159d096d4..e7376c9d9 100644 --- a/arabica/include/SAX/XMLReader.hpp +++ b/arabica/include/SAX/XMLReader.hpp @@ -336,106 +336,6 @@ class XMLReaderInterface : public XMLReaderInterface_tag * @see #setErrorHandler */ virtual void parse(InputSourceT& input) = 0; - - //////////////////////////////////////////////////// - // property implementation -protected: - class PropertyBase - { - public: - virtual ~PropertyBase() { } - }; // PropertyBase - - template - class Property : public PropertyBase - { - public: - Property(propertyTypeT wrappee) : wrappee_(wrappee) { } - - propertyTypeT get() { return wrappee_; } - - private: - propertyTypeT wrappee_; - }; // class Property - -public: - virtual std::auto_ptr doGetProperty(const string_type& name) = 0; - virtual void doSetProperty(const string_type& name, std::auto_ptr value) = 0; - - /** - * Look up the value of a property. - * - *

The property name is any fully-qualified URI. It is - * possible for an XMLReader to recognize a property name but - * to be unable to return its state; this is especially true - * in the case of an adapter for a SAX1 {@link Parser - * Parser}.

- * - *

XMLReaders are not required to recognize any specific - * property names, though an initial core set is documented for - * SAX2.

- * - *

Some property values may be available only in specific - * contexts, such as before, during, or after a parse.

- * - *

Implementors are free (and encouraged) to invent their own properties, - * using names built on their own URIs.

- * - * @param name The property name, which is a fully-qualified URI. - * @return The current value of the property. - * @exception SAXNotRecognizedException When the - * XMLReader does not recognize the property name. - * @exception SAXNotSupportedException When the - * XMLReader recognizes the property name but - * cannot determine its value at this time. - * @see #setProperty - */ - template - propertyTypeT& getProperty(const string_type& name) const - { - std::auto_ptr pb = doGetProperty(name); - Property* prop = dynamic_cast* >(pb.get()); - - if(!prop) - throw SAX::SAXNotSupportedException("Property " + name + " is wrong type."); - - return prop->get(); - } // getProperty - - /** - * Set the value of a property. - * - *

The property name is any fully-qualified URI. It is - * possible for an XMLReader to recognize a property name but - * to be unable to set its value; this is especially true - * in the case of an adapter for a SAX1 {@link Parser - * Parser}.

- * - *

XMLReaders are not required to recognize setting - * any specific property names, though a core set is provided with - * SAX2.

- * - *

Some property values may be immutable or mutable only - * in specific contexts, such as before, during, or after - * a parse.

- * - *

This method is also the standard mechanism for setting - * extended handlers.

- * - * @param name The property name, which is a fully-qualified URI. - * @param value The requested value for the property. - * @exception SAXNotRecognizedException When the - * XMLReader does not recognize the property name. - * @exception SAXNotSupportedException When the - * XMLReader recognizes the property name but - * cannot set the requested value. - */ - template - void setProperty(const string_type& name, propertyTypeT& value) - { - Property* prop = new Property(value); - doSetProperty(name, std::auto_ptr(prop)); - } // setProperty }; // class XMLReaderInterface } // namespace SAX diff --git a/arabica/include/SAX/ext/DeclHandler.hpp b/arabica/include/SAX/ext/DeclHandler.hpp index 29125a910..6f433de63 100644 --- a/arabica/include/SAX/ext/DeclHandler.hpp +++ b/arabica/include/SAX/ext/DeclHandler.hpp @@ -31,13 +31,7 @@ namespace SAX * {@link LexicalHandler#endDTD endDTD} events.

* *

To set the DeclHandler for an XML reader, use the - * {@link XMLReader#setProperty setProperty} method - * with the propertyId "http://xml.org/sax/properties/declaration-handler". - * If the reader does not support declaration events, it will throw a - * {@link SAXNotRecognizedException SAXNotRecognizedException} - * or a - * {@link SAXNotSupportedException SAXNotSupportedException} - * when you attempt to register the handler.

+ * {@link XMLReader#setDeclHandler setDeclHandler}.

* * @since 2.0 * @author Jez Higgins, diff --git a/arabica/include/SAX/ext/LexicalHandler.hpp b/arabica/include/SAX/ext/LexicalHandler.hpp index 3e57576ab..a5feb2546 100644 --- a/arabica/include/SAX/ext/LexicalHandler.hpp +++ b/arabica/include/SAX/ext/LexicalHandler.hpp @@ -28,21 +28,13 @@ namespace SAX * endDocument events.

* *

To set the LexicalHandler for an XML reader, use the - * {@link XMLReader#setProperty setProperty} method - * with the propertyId "http://xml.org/sax/properties/lexical-handler". - * If the reader does not support lexical events, it will throw a - * {@link SAXNotRecognizedException SAXNotRecognizedException} - * or a - * {@link SAXNotSupportedException SAXNotSupportedException} - * when you attempt to register the handler.

+ * {@link XMLReader#setLexicalHandler setLexicalHandler} method.

* * @since 2.0 * @author Jez Higgins, * jez@jezuk.co.uk * @version 1.0 - * @see XMLReader#setProperty - * @see SAXNotRecognizedException - * @see SAXNotSupportedException + * @see XMLReader#setLexicalHandler */ template > class LexicalHandler diff --git a/arabica/include/SAX/helpers/PropertyNames.hpp b/arabica/include/SAX/helpers/PropertyNames.hpp deleted file mode 100644 index 2d1f0d9ae..000000000 --- a/arabica/include/SAX/helpers/PropertyNames.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef ARABICA_PROPERTY_NAMES_H -#define ARABICA_PROPERTY_NAMES_H -/* - * $Id$ - */ - -#include -#include -#include - -namespace Arabica -{ -namespace SAX -{ - -/** The core SAX 2 parser properties. */ -template > -struct PropertyNames -{ - /** @name SAX 2 Properties - * @{ */ - /** Register a lexical handler. - * - * The Lexical Handler is used to see some syntax events that are essential - * in some applications: comments, CDATA delimiters, selected general - * entity inclusions, and the start and end of the DTD (and declaration of - * document element name). - * - * The value assigned must implement SAX::LexicalHandler. - */ - const string_type lexicalHandler; - /** Register a Declaration Handler. - * - * Used to see most DTD declarations except those treated as lexical - * ("document element name is ...") or which are mandatory for all SAX - * parsers (DTDHandler). - * - * The value assigned must implement SAX::DeclHandler */ - const string_type declHandler; - /** @} */ - - PropertyNames() : - lexicalHandler(string_adaptor_type::construct_from_utf8("http://xml.org/sax/handlers/LexicalHandler")), - declHandler(string_adaptor_type::construct_from_utf8("http://xml.org/sax/handlers/DeclHandler")) - { - } // PropertyNames -}; // struct PropertyNames - -} // namespace SAX -} // namespace Arabica - -#endif -// end of file diff --git a/arabica/include/SAX/helpers/XMLFilterImpl.hpp b/arabica/include/SAX/helpers/XMLFilterImpl.hpp index 98abec276..0724132c7 100644 --- a/arabica/include/SAX/helpers/XMLFilterImpl.hpp +++ b/arabica/include/SAX/helpers/XMLFilterImpl.hpp @@ -115,11 +115,7 @@ class XMLFilterImpl : public XMLFilter, virtual void setFeature(const string_type& name, bool value) { if(!parent_) - { - string_type ex = string_adaptor::construct_from_utf8("Feature: "); - string_adaptor::append(ex, name); - throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); - } // if ... + throw SAXNotRecognizedException("Feature: " + string_adaptor::asStdString(name)); parent_->setFeature(name, value); } // setFeature @@ -140,11 +136,7 @@ class XMLFilterImpl : public XMLFilter, virtual bool getFeature(const string_type& name) const { if(!parent_) - { - string_type ex = string_adaptor::construct_from_utf8("Feature: "); - string_adaptor::append(ex, name); - throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); - } // if ... + throw SAXNotRecognizedException("Feature: " + string_adaptor::asStdString(name)); return parent_->getFeature(name); } // setFeature @@ -223,29 +215,6 @@ class XMLFilterImpl : public XMLFilter, parent_->parse(input); } // parse - virtual std::auto_ptr doGetProperty(const string_type& name) - { - if(parent_) - return parent_->doGetProperty(name); - - string_type ex = string_adaptor::construct_from_utf8("Property: "); - string_adaptor::append(ex, name); - throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); - } // doGetProperty - - virtual void doSetProperty(const string_type& name, typename std::auto_ptr value) - { - if(parent_) - { - parent_->doSetProperty(name, value); - return; - } // if(parent_) - - string_type ex = string_adaptor::construct_from_utf8("Property: "); - string_adaptor::append(ex, name); - throw SAXNotRecognizedException(string_adaptor::asStdString(ex)); - } // doSetProperty - public: ////////////////////////////////////////////////// // EntityResolver diff --git a/arabica/include/SAX/saxfwd.hpp b/arabica/include/SAX/saxfwd.hpp index 983a67aa3..0e0155591 100644 --- a/arabica/include/SAX/saxfwd.hpp +++ b/arabica/include/SAX/saxfwd.hpp @@ -22,7 +22,7 @@ def ARABICA_SAX_FWD_H * * \section license License * - * Copyright (c) 2001-2012 Jez UK Ltd
+ * Copyright (c) 2001-2024 Jez UK Ltd
* All rights reserved. *

* Redistribution and use in source and binary forms, with or
diff --git a/arabica/include/SAX/wrappers/saxlibxml2.hpp b/arabica/include/SAX/wrappers/saxlibxml2.hpp index 76072d83b..b693b52ea 100644 --- a/arabica/include/SAX/wrappers/saxlibxml2.hpp +++ b/arabica/include/SAX/wrappers/saxlibxml2.hpp @@ -17,7 +17,6 @@ #include #include -#include #include #include #include @@ -145,11 +144,6 @@ class libxml2_wrapper : typedef SAX::NamespaceSupport namespaceSupportT; typedef SAX::ErrorHandler errorHandlerT; typedef SAX::SAXParseException SAXParseExceptionT; - typedef typename XMLReaderT::PropertyBase PropertyBaseT; - typedef typename XMLReaderT::template Property getLexicalHandlerT; - typedef typename XMLReaderT::template Property setLexicalHandlerT; - typedef typename XMLReaderT::template Property getDeclHandlerT; - typedef typename XMLReaderT::template Property setDeclHandlerT; typedef XML::QualifiedName qualifiedNameT; libxml2_wrapper(); @@ -179,12 +173,6 @@ class libxml2_wrapper : // parsing virtual void parse(inputSourceT& source); - protected: - //////////////////////////////////////////////// - // properties - virtual std::auto_ptr doGetProperty(const string_type& name); - virtual void doSetProperty(const string_type& name, std::auto_ptr value); - public: virtual string_type getPublicId() const; virtual string_type getSystemId() const; @@ -245,7 +233,6 @@ class libxml2_wrapper : string_type emptyString_; const FeatureNames features_; - const PropertyNames properties_; const NamespaceConstants nsc_; const AttributeDefaults attrDefaults_; const AttributeTypes attrTypes_; @@ -354,48 +341,6 @@ void libxml2_wrapper::setFeature(const string_type& name, b } } // setFeature -template -std::auto_ptr::PropertyBaseT> libxml2_wrapper::doGetProperty(const string_type& name) -{ - if(name == properties_.declHandler) - { - getDeclHandlerT* prop = new getDeclHandlerT(declHandler_); - return std::auto_ptr(prop); - } - if(name == properties_.lexicalHandler) - { - getLexicalHandlerT* prop = new getLexicalHandlerT(lexicalHandler_); - return std::auto_ptr(prop); - } - - throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptor::asStdString(name)); -} // doGetProperty - -template -void libxml2_wrapper::doSetProperty(const string_type& name, std::auto_ptr value) -{ - if(name == properties_.declHandler) - { - setDeclHandlerT* prop = dynamic_cast(value.get()); - - if(!prop) - throw std::bad_cast(); - - declHandler_ = &(prop->get()); - } - if(name == properties_.lexicalHandler) - { - setLexicalHandlerT* prop = dynamic_cast(value.get()); - - if(!prop) - throw std::bad_cast(); - - lexicalHandler_ = &(prop->get()); - } - - throw SAX::SAXNotRecognizedException(std::string("Property not recognized ") + string_adaptor::asStdString(name)); -} // doSetProperty - template typename XML::QualifiedName::string_adaptor> libxml2_wrapper::processName(const string_type& qName, bool isAttribute) { diff --git a/arabica/include/Taggle/impl/Parser.hpp b/arabica/include/Taggle/impl/Parser.hpp index a6630540d..41d4b0e17 100644 --- a/arabica/include/Taggle/impl/Parser.hpp +++ b/arabica/include/Taggle/impl/Parser.hpp @@ -396,90 +396,7 @@ class Taggle : CDATAElements = value; } // setFeature - typedef typename XMLReaderInterface::PropertyBase PropertyBaseT; - virtual std::auto_ptr doGetProperty(const string_type& /*name*/) - { - return std::auto_ptr(0); - } // doGetProperty - - virtual void doSetProperty(const string_type& /*name*/, std::auto_ptr /*value*/) - { - } // doSetProperty - - /* - Object getProperty (std::string name) - { - if(name.equals(lexicalHandlerProperty)) - { - return lexicalHandler_ == this ? null : lexicalHandler_; - } - else if(name.equals(scannerProperty)) - { - return scanner_; - } - else if(name.equals(schemaProperty)) - { - return schema_; - } - else if(name.equals(autoDetectorProperty)) - { - return theAutoDetector; - } - else - { - throw new SAXNotRecognizedException("Unknown property " + name); - } - } // getProperty - - void setProperty (std::string name, Object value) - { - if(name.equals(lexicalHandlerProperty)) - { - if(value == null) - { - lexicalHandler_ = this; - } - else if(value instanceof LexicalHandler) - { - lexicalHandler_ = (LexicalHandler)value; - } - else - { - throw new SAXNotSupportedException("Your lexical handler is not a LexicalHandler"); - } - } - else if(name.equals(scannerProperty)) - { - if(value instanceof Scanner) { - scanner_ = (Scanner)value; - } - else { - throw new SAXNotSupportedException("Your scanner is not a Scanner"); - } - } - else if(name.equals(schemaProperty)) { - if(value instanceof Schema) { - schema_ = (Schema)value; - } - else { - throw new SAXNotSupportedException("Your schema is not a Schema"); - } - } - else if(name.equals(autoDetectorProperty)) { - if(value instanceof AutoDetector) { - theAutoDetector = (AutoDetector)value; - } - else { - throw new SAXNotSupportedException("Your auto-detector is not an AutoDetector"); - } - } - else { - throw new SAXNotRecognizedException("Unknown property " + name); - } - } -*/ - - virtual void setEntityResolver(EntityResolverT& resolver) + virtual void setEntityResolver(EntityResolverT& resolver) { entityResolver_ = &resolver; } // setEntityResolver diff --git a/arabica/include/convert/impl/codecvt_specialisations.hpp b/arabica/include/convert/impl/codecvt_specialisations.hpp index c52cdc2e8..bb488e2c2 100644 --- a/arabica/include/convert/impl/codecvt_specialisations.hpp +++ b/arabica/include/convert/impl/codecvt_specialisations.hpp @@ -1,6 +1,18 @@ #ifndef ARABICA_IMPL_CODECVT_SPECIALISATIONS_H #define ARABICA_IMPL_CODECVT_SPECIALISATIONS_H +#if defined(_MSC_VER) +# if defined(max) +# pragma push_macro("max") +# undef max +# endif +# if defined(min) +# pragma push_macro("min") +# undef min +# endif +#endif + +#include #include namespace std @@ -128,4 +140,14 @@ class codecvt : }; // class codecvt : } // namespace std + +#if defined(_MSC_VER) +# if defined(max) +# pragma pop_macro("max") +# endif +# if defined(min) +# pragma pop_macro("min") +# endif +#endif + #endif diff --git a/arabica/include/io/convertstream.hpp b/arabica/include/io/convertstream.hpp index 26bb317d7..8459dba0a 100644 --- a/arabica/include/io/convertstream.hpp +++ b/arabica/include/io/convertstream.hpp @@ -96,7 +96,8 @@ class basic_iconvertstream : explicit basic_iconvertstream(std::ios_base::openmode mode = std::ios_base::in) : convertstreambuf_initT(mode | std::ios_base::in), std::basic_istream(convertstreambuf_initT::buf()) - { + { + std::fill_n(to_, toSize_, 0); } // basic_iconvertstream explicit basic_iconvertstream(const stringT& str, std::ios_base::openmode mode = std::ios_base::in) : @@ -190,6 +191,7 @@ class basic_oconvertstream : convertstreambuf_initT(mode | std::ios_base::out), std::basic_ostream(convertstreambuf_initT::buf()) { + std::fill_n(to_, toSize_, 0); } // basic_oconvertstream explicit basic_oconvertstream(const stringT& str, std::ios_base::openmode mode = std::ios_base::out) : diff --git a/arabica/include/io/socket_stream.hpp b/arabica/include/io/socket_stream.hpp index 48bba0f8b..8cbb8e969 100644 --- a/arabica/include/io/socket_stream.hpp +++ b/arabica/include/io/socket_stream.hpp @@ -12,7 +12,7 @@ /////////////////////////////////////////////////////////////////////// #include -#ifndef ARABICA_USE_WINSOCK +#ifndef USE_WINSOCK #include #include #include @@ -27,6 +27,7 @@ #include #include #include +#include #include #ifndef INADDR_NONE @@ -49,6 +50,11 @@ class basic_socketbuf : public std::basic_streambuf { public: typedef typename traitsT::int_type int_type; +#if defined(USE_WINSOCK) && defined(UINTPTR_MAX) + typedef std::uintptr_t socket_type; +#else + typedef int socket_type; +#endif using std::basic_streambuf::setp; using std::basic_streambuf::setg; @@ -77,7 +83,8 @@ class basic_socketbuf : public std::basic_streambuf private: typedef typename traitsT::state_type state_t; - int sock_; + socket_type sock_; + std::vector outBuffer_; state_t outState_; std::vector inBuffer_; @@ -87,12 +94,12 @@ class basic_socketbuf : public std::basic_streambuf bool writeSocket(); void growInBuffer(); int readSocket(); - int closeSocket(int sock) const; + int closeSocket(socket_type sock) const; static const size_t bufferSize_; static const size_t pbSize_; -#ifndef ARABICA_USE_WINSOCK +#ifndef USE_WINSOCK static const int INVALID_SOCKET; static const int SOCKET_ERROR; #endif @@ -103,7 +110,7 @@ const size_t basic_socketbuf::bufferSize_ = 1024; template const size_t basic_socketbuf::pbSize_ = 4; // why 4? both Josuttis and Langer&Kreft use 4. -#ifndef ARABICA_USE_WINSOCK +#ifndef USE_WINSOCK template const int basic_socketbuf::INVALID_SOCKET = -1; template @@ -170,7 +177,7 @@ basic_socketbuf* basic_socketbuf::open(const cha sockAddr.sin_port = htons(port); // connect - int tmpsock = socket(AF_INET, SOCK_STREAM, 0); + int tmpsock = static_cast(socket(AF_INET, SOCK_STREAM, 0)); if(tmpsock == INVALID_SOCKET) return 0; if(connect(tmpsock, reinterpret_cast(&sockAddr), sizeof(sockaddr_in)) != 0) @@ -267,7 +274,7 @@ bool basic_socketbuf::writeSocket() if(!length) return true; - bool ok = (send(sock_, from_next, length, 0) != SOCKET_ERROR); + bool ok = (send(sock_, from_next, static_cast(length), 0) != SOCKET_ERROR); if(ok) setp(from_next, from_next + outBuffer_.capacity()); @@ -289,13 +296,13 @@ int basic_socketbuf::readSocket() if(!inBuffer_.capacity()) growInBuffer(); - size_t pbCount = std::min(gptr() - eback(), pbSize_); + size_t pbCount = std::min(gptr() - eback(), pbSize_); memcpy(&(inBuffer_[0]) + (pbSize_-pbCount)*sizeof(charT), gptr() - pbCount*sizeof(charT), pbCount*sizeof(charT)); - int res = recv(sock_, &(inBuffer_[0]) + pbSize_, inBuffer_.capacity() - pbSize_, 0); + int res = recv(sock_, &(inBuffer_[0]) + pbSize_, static_cast(inBuffer_.capacity() - pbSize_), 0); if(res == 0) { // server closed the socket @@ -304,7 +311,7 @@ int basic_socketbuf::readSocket() } // if(res == 0) else if(res == SOCKET_ERROR) { -#ifdef ARABICA_USE_WINSOCK +#ifdef USE_WINSOCK if(GetLastError() == WSAEMSGSIZE) { // buffer was too small, so make it bigger @@ -325,9 +332,9 @@ int basic_socketbuf::readSocket() } // readSocket template -int basic_socketbuf::closeSocket(int sock) const +int basic_socketbuf::closeSocket(socket_type sock) const { -#ifdef ARABICA_USE_WINSOCK +#ifdef USE_WINSOCK return closesocket(sock); #else return ::close(sock); diff --git a/arabica/include/io/uri.hpp b/arabica/include/io/uri.hpp index 0bd9ef8e8..3ffee5ff5 100644 --- a/arabica/include/io/uri.hpp +++ b/arabica/include/io/uri.hpp @@ -10,7 +10,10 @@ namespace Arabica class URI { public: - URI() { } + URI(): + is_absolute_(false) + { + } URI(const std::string& URI); @@ -21,9 +24,9 @@ namespace Arabica host_(rhs.host_), path_(rhs.path_), port_(rhs.port_), - is_absolute_(rhs.is_absolute_) - { - } // URI + is_absolute_(rhs.is_absolute_) + { + } // URI URI& operator=(const URI& rhs) { diff --git a/arabica/src/SAX/helpers/InputSourceResolver.cpp b/arabica/src/SAX/helpers/InputSourceResolver.cpp index b33ff099c..ce6266a78 100644 --- a/arabica/src/SAX/helpers/InputSourceResolver.cpp +++ b/arabica/src/SAX/helpers/InputSourceResolver.cpp @@ -2,6 +2,10 @@ * $Id$ */ +#ifdef _MSC_VER +#pragma warning(disable: 4786) +#endif + #include #include #include @@ -106,7 +110,7 @@ namespace std::istream* httpResolver(const std::string& httpURI) { -#ifdef ARABICA_USE_WINSOCK +#ifdef USE_WINSOCK WORD wVersionRequested; WSADATA wsaData; int err; diff --git a/arabica/src/SAX/wrappers/saxlibxml2.cpp b/arabica/src/SAX/wrappers/saxlibxml2.cpp index c2eeb68c6..b1650a0ca 100644 --- a/arabica/src/SAX/wrappers/saxlibxml2.cpp +++ b/arabica/src/SAX/wrappers/saxlibxml2.cpp @@ -20,7 +20,7 @@ namespace libxml2_wrapper_impl_tiddle std::string formatErrorMsg(const char* fmt, va_list arg) { char buff[4096]; - vsprintf(buff, fmt, arg); + vsnprintf(buff, 4096, fmt, arg); return std::string(buff); } // formatErrorMsg diff --git a/arabica/src/convert/utf8ucs2codecvt.cpp b/arabica/src/convert/utf8ucs2codecvt.cpp index b51a3d003..d7d89a0f5 100644 --- a/arabica/src/convert/utf8ucs2codecvt.cpp +++ b/arabica/src/convert/utf8ucs2codecvt.cpp @@ -77,7 +77,7 @@ int utf8ucs2codecvt::do_length(const std::mbstate_t&, } } // while - return (from_next-from); + return static_cast(from_next-from); } // do_length #endif diff --git a/arabica/src/io/uri.cpp b/arabica/src/io/uri.cpp index f28351ee3..24e3cf641 100644 --- a/arabica/src/io/uri.cpp +++ b/arabica/src/io/uri.cpp @@ -182,7 +182,7 @@ void URI::combinePath(const std::string& relPath) size_t dots = path_.find("/../", from); while(dots != std::string::npos) { - int preceding_slash = (dots > 0) ? path_.rfind(FORWARD_SLASH, dots-1) : 0; + size_t preceding_slash = (dots > 0) ? path_.rfind(FORWARD_SLASH, dots-1) : 0; path_.erase(preceding_slash, dots+3-preceding_slash); dots = path_.find("/../", preceding_slash); } // while From 4e54cc0c3e4d470ed7ee9495e34323d2e08b6da1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sat, 26 Oct 2024 14:36:21 +0200 Subject: [PATCH 5/9] Fix setting default USE_CIM_VERSION MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Günther --- CMakeLists.txt | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 35a36ec29..0ebb6b3bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,12 @@ project(libcimpp CXX) set(CMAKE_CXX_STANDARD 11) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/" "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake") +if(NOT USE_CIM_VERSION) + set(USE_CIM_VERSION "CGMES_2.4.15_27JAN2020" CACHE STRING "Define CIM Version") +endif() + +message(STATUS "Building ${PROJECT_NAME} with USE_CIM_VERSION=${USE_CIM_VERSION}") + if(USE_CIM_VERSION STREQUAL "CGMES_2.4.15_27JAN2020") set(CGMES_BUILD ON) set(CIM_NAME "CGMES 2_4_15 27_01_2020") @@ -30,13 +36,6 @@ endif() add_subdirectory(arabica) -if(NOT USE_CIM_VERSION) - set(USE_CIM_VERSION "CGMES_2.4.15_27JAN2020" CACHE STRING "Define CIM Version") -endif() - -message(STATUS "Building ${PROJECT_NAME} with USE_CIM_VERSION=${USE_CIM_VERSION}") - - # Uncomment this if you are developing on CIMgen and want to generate CIM c++ #if(CGMES_BUILD) # set(CGMES_OUTPUT_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/${CIM_FOLDER}) @@ -87,4 +86,4 @@ endif() include(FeatureSummary) feature_summary(WHAT ALL VAR enabledFeaturesText) message(STATUS "${enabledFeaturesText}") -message(STATUS "Building CIMpp with USE_CIM_VERSION=${USE_CIM_VERSION}") +message(STATUS "Building ${PROJECT_NAME} with USE_CIM_VERSION=${USE_CIM_VERSION}") From 8bd53687df1898f840659a332b5e9c1921114042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sat, 26 Oct 2024 15:51:12 +0200 Subject: [PATCH 6/9] Fix cpack (move libraries from /static to /usr/lib) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Günther --- CMakeLists.txt | 10 ++-------- arabica/CMakeLists.txt | 8 +++----- package/Dockerfile | 14 +++----------- package/entrypoint.sh | 1 - 4 files changed, 8 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0ebb6b3bb..125aa2500 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,16 +56,10 @@ include(GNUInstallDirs) install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/static + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -file(GLOB HEADERS "src/*.h" "src/*.hpp") -install(FILES ${HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cimpp/${USE_CIM_VERSION} - COMPONENT devel -) - -install(DIRECTORY ${USE_CIM_VERSION} +install(DIRECTORY ${USE_CIM_VERSION} src DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cimpp COMPONENT devel FILES_MATCHING diff --git a/arabica/CMakeLists.txt b/arabica/CMakeLists.txt index 838050702..031b8dffb 100644 --- a/arabica/CMakeLists.txt +++ b/arabica/CMakeLists.txt @@ -129,15 +129,13 @@ target_include_directories(${LIB_NAME} PUBLIC $ libarabica.deb -RUN dpkg -i libarabica.deb - -entrypoint [ "package/entrypoint.sh" ] +ENTRYPOINT [ "./entrypoint.sh" ] diff --git a/package/entrypoint.sh b/package/entrypoint.sh index 0764073ff..53596d537 100755 --- a/package/entrypoint.sh +++ b/package/entrypoint.sh @@ -1,7 +1,6 @@ #!/bin/sh cd /github/workspace -git submodule update --init mkdir build cd build cmake -DBUILD_SHARED_LIBS=ON .. From 114e375900bc0d59f744cf3eb5b18d388190aa1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sat, 26 Oct 2024 19:07:21 +0200 Subject: [PATCH 7/9] Separate the static cpp sources in the static directory independend from cgmes version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Günther --- CGMES_2.4.15_16FEB2016/BaseClass.cpp | 22 --- CGMES_2.4.15_16FEB2016/BaseClass.h | 1 - CGMES_2.4.15_16FEB2016/BaseClass.hpp | 22 --- CGMES_2.4.15_16FEB2016/BaseClassDefiner.cpp | 14 -- CGMES_2.4.15_16FEB2016/BaseClassDefiner.hpp | 24 ---- CGMES_2.4.15_16FEB2016/Boolean.cpp | 80 ----------- CGMES_2.4.15_16FEB2016/Boolean.hpp | 38 ----- CGMES_2.4.15_16FEB2016/CIMFactory.cpp | 44 ------ CGMES_2.4.15_16FEB2016/CIMFactory.hpp | 22 --- CGMES_2.4.15_16FEB2016/Date.cpp | 20 --- CGMES_2.4.15_16FEB2016/Date.hpp | 26 ---- CGMES_2.4.15_16FEB2016/Float.cpp | 67 --------- CGMES_2.4.15_16FEB2016/Float.hpp | 42 ------ CGMES_2.4.15_16FEB2016/Folders.hpp | 1 - .../IEC61970/IEC61970CIMVersion.cpp | 15 -- .../IEC61970/IEC61970CIMVersion.h | 31 ---- CGMES_2.4.15_16FEB2016/Integer.cpp | 72 ---------- CGMES_2.4.15_16FEB2016/Integer.hpp | 41 ------ CGMES_2.4.15_16FEB2016/String.hpp | 14 -- CGMES_2.4.15_16FEB2016/Task.cpp | 59 -------- CGMES_2.4.15_16FEB2016/Task.hpp | 22 --- CGMES_2.4.15_16FEB2016/UnknownType.cpp | 136 ------------------ CGMES_2.4.15_16FEB2016/UnknownType.hpp | 24 ---- CGMES_2.4.15_16FEB2016/assignments.cpp | 41 ------ CGMES_2.4.15_16FEB2016/assignments.hpp | 11 -- CGMES_2.4.15_27JAN2020/BaseClass.cpp | 22 --- CGMES_2.4.15_27JAN2020/BaseClass.h | 1 - CGMES_2.4.15_27JAN2020/BaseClass.hpp | 22 --- CGMES_2.4.15_27JAN2020/BaseClassDefiner.cpp | 14 -- CGMES_2.4.15_27JAN2020/BaseClassDefiner.hpp | 24 ---- CGMES_2.4.15_27JAN2020/Boolean.cpp | 80 ----------- CGMES_2.4.15_27JAN2020/Boolean.hpp | 38 ----- CGMES_2.4.15_27JAN2020/CIMFactory.cpp | 44 ------ CGMES_2.4.15_27JAN2020/CIMFactory.hpp | 22 --- CGMES_2.4.15_27JAN2020/Date.cpp | 20 --- CGMES_2.4.15_27JAN2020/Date.hpp | 26 ---- CGMES_2.4.15_27JAN2020/Float.cpp | 67 --------- CGMES_2.4.15_27JAN2020/Float.hpp | 42 ------ CGMES_2.4.15_27JAN2020/Folders.hpp | 1 - .../IEC61970/IEC61970CIMVersion.cpp | 15 -- .../IEC61970/IEC61970CIMVersion.h | 31 ---- CGMES_2.4.15_27JAN2020/Integer.cpp | 72 ---------- CGMES_2.4.15_27JAN2020/Integer.hpp | 41 ------ CGMES_2.4.15_27JAN2020/String.hpp | 14 -- CGMES_2.4.15_27JAN2020/Task.cpp | 59 -------- CGMES_2.4.15_27JAN2020/Task.hpp | 22 --- CGMES_2.4.15_27JAN2020/UnknownType.cpp | 136 ------------------ CGMES_2.4.15_27JAN2020/UnknownType.hpp | 24 ---- CGMES_2.4.15_27JAN2020/assignments.cpp | 41 ------ CGMES_2.4.15_27JAN2020/assignments.hpp | 11 -- CMakeLists.txt | 6 +- {CGMES_2.4.15/static => static}/BaseClass.cpp | 0 {CGMES_2.4.15/static => static}/BaseClass.h | 0 {CGMES_2.4.15/static => static}/BaseClass.hpp | 0 .../static => static}/BaseClassDefiner.cpp | 0 .../static => static}/BaseClassDefiner.hpp | 0 {CGMES_2.4.15/static => static}/Boolean.cpp | 0 {CGMES_2.4.15/static => static}/Boolean.hpp | 0 .../static => static}/CIMFactory.cpp | 0 .../static => static}/CIMFactory.hpp | 0 {CGMES_2.4.15/static => static}/Date.cpp | 0 {CGMES_2.4.15/static => static}/Date.hpp | 0 {CGMES_2.4.15/static => static}/Float.cpp | 0 {CGMES_2.4.15/static => static}/Float.hpp | 0 {CGMES_2.4.15/static => static}/Folders.hpp | 0 .../IEC61970/IEC61970CIMVersion.cpp | 0 .../IEC61970/IEC61970CIMVersion.h | 0 {CGMES_2.4.15/static => static}/Integer.cpp | 0 {CGMES_2.4.15/static => static}/Integer.hpp | 0 {CGMES_2.4.15/static => static}/String.hpp | 0 {CGMES_2.4.15/static => static}/Task.cpp | 0 {CGMES_2.4.15/static => static}/Task.hpp | 0 .../static => static}/UnknownType.cpp | 0 .../static => static}/UnknownType.hpp | 0 .../static => static}/assignments.cpp | 0 .../static => static}/assignments.hpp | 0 76 files changed, 4 insertions(+), 1780 deletions(-) delete mode 100644 CGMES_2.4.15_16FEB2016/BaseClass.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/BaseClass.h delete mode 100644 CGMES_2.4.15_16FEB2016/BaseClass.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/BaseClassDefiner.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/BaseClassDefiner.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/Boolean.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/Boolean.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/CIMFactory.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/CIMFactory.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/Date.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/Date.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/Float.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/Float.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/Folders.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.h delete mode 100644 CGMES_2.4.15_16FEB2016/Integer.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/Integer.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/String.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/Task.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/Task.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/UnknownType.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/UnknownType.hpp delete mode 100644 CGMES_2.4.15_16FEB2016/assignments.cpp delete mode 100644 CGMES_2.4.15_16FEB2016/assignments.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/BaseClass.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/BaseClass.h delete mode 100644 CGMES_2.4.15_27JAN2020/BaseClass.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/BaseClassDefiner.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/BaseClassDefiner.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/Boolean.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/Boolean.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/CIMFactory.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/CIMFactory.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/Date.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/Date.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/Float.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/Float.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/Folders.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.h delete mode 100644 CGMES_2.4.15_27JAN2020/Integer.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/Integer.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/String.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/Task.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/Task.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/UnknownType.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/UnknownType.hpp delete mode 100644 CGMES_2.4.15_27JAN2020/assignments.cpp delete mode 100644 CGMES_2.4.15_27JAN2020/assignments.hpp rename {CGMES_2.4.15/static => static}/BaseClass.cpp (100%) rename {CGMES_2.4.15/static => static}/BaseClass.h (100%) rename {CGMES_2.4.15/static => static}/BaseClass.hpp (100%) rename {CGMES_2.4.15/static => static}/BaseClassDefiner.cpp (100%) rename {CGMES_2.4.15/static => static}/BaseClassDefiner.hpp (100%) rename {CGMES_2.4.15/static => static}/Boolean.cpp (100%) rename {CGMES_2.4.15/static => static}/Boolean.hpp (100%) rename {CGMES_2.4.15/static => static}/CIMFactory.cpp (100%) rename {CGMES_2.4.15/static => static}/CIMFactory.hpp (100%) rename {CGMES_2.4.15/static => static}/Date.cpp (100%) rename {CGMES_2.4.15/static => static}/Date.hpp (100%) rename {CGMES_2.4.15/static => static}/Float.cpp (100%) rename {CGMES_2.4.15/static => static}/Float.hpp (100%) rename {CGMES_2.4.15/static => static}/Folders.hpp (100%) rename {CGMES_2.4.15/static => static}/IEC61970/IEC61970CIMVersion.cpp (100%) rename {CGMES_2.4.15/static => static}/IEC61970/IEC61970CIMVersion.h (100%) rename {CGMES_2.4.15/static => static}/Integer.cpp (100%) rename {CGMES_2.4.15/static => static}/Integer.hpp (100%) rename {CGMES_2.4.15/static => static}/String.hpp (100%) rename {CGMES_2.4.15/static => static}/Task.cpp (100%) rename {CGMES_2.4.15/static => static}/Task.hpp (100%) rename {CGMES_2.4.15/static => static}/UnknownType.cpp (100%) rename {CGMES_2.4.15/static => static}/UnknownType.hpp (100%) rename {CGMES_2.4.15/static => static}/assignments.cpp (100%) rename {CGMES_2.4.15/static => static}/assignments.hpp (100%) diff --git a/CGMES_2.4.15_16FEB2016/BaseClass.cpp b/CGMES_2.4.15_16FEB2016/BaseClass.cpp deleted file mode 100644 index 20dc2088d..000000000 --- a/CGMES_2.4.15_16FEB2016/BaseClass.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "BaseClass.hpp" - -using namespace CIMPP; - -BaseClass::~BaseClass() {} - -void BaseClass::addConstructToMap(std::unordered_map& factory_map) {} - -void BaseClass::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void BaseClass::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char BaseClass::debugName[] = "BaseClass"; -const char* BaseClass::debugString() -{ - return BaseClass::debugName; -} - -CIMPP::BaseClassDefiner BaseClass::declare() { - return BaseClassDefiner(BaseClass::addConstructToMap, BaseClass::addPrimitiveAssignFnsToMap, BaseClass::addClassAssignFnsToMap, BaseClass::debugName); -} diff --git a/CGMES_2.4.15_16FEB2016/BaseClass.h b/CGMES_2.4.15_16FEB2016/BaseClass.h deleted file mode 100644 index d1ebb818e..000000000 --- a/CGMES_2.4.15_16FEB2016/BaseClass.h +++ /dev/null @@ -1 +0,0 @@ -#include "BaseClass.hpp" diff --git a/CGMES_2.4.15_16FEB2016/BaseClass.hpp b/CGMES_2.4.15_16FEB2016/BaseClass.hpp deleted file mode 100644 index a7cd61294..000000000 --- a/CGMES_2.4.15_16FEB2016/BaseClass.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BASECLASS_HPP -#define BASECLASS_HPP - -#ifndef CGMES_BUILD -#define CGMES_BUILD -#endif - -#include -#include "BaseClassDefiner.hpp" - -class BaseClass { -public: - enum cgmesProfile {EQ = 0, SSH = 1, TP = 2, SV = 3, DY = 4, GL = 5, DI = 6}; - virtual ~BaseClass(); - static CIMPP::BaseClassDefiner declare(); - static void addConstructToMap(std::unordered_map&); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - const static char debugName[]; - virtual const char* debugString(); -}; -#endif // BASECLASS_HPP diff --git a/CGMES_2.4.15_16FEB2016/BaseClassDefiner.cpp b/CGMES_2.4.15_16FEB2016/BaseClassDefiner.cpp deleted file mode 100644 index 95bcb95d6..000000000 --- a/CGMES_2.4.15_16FEB2016/BaseClassDefiner.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "BaseClassDefiner.hpp" - -using namespace CIMPP; - -BaseClassDefiner::BaseClassDefiner(void(*addConstruct)(std::unordered_map&), - void(*addPrimitiveAssignFns)(std::unordered_map&), - void(*addClassAssignFns)(std::unordered_map&), - const char *debugStr) { - addConstructToMap = addConstruct; - addPrimitiveAssignFnsToMap = addPrimitiveAssignFns; - addClassAssignFnsToMap = addClassAssignFns; - debugString = debugStr; -} diff --git a/CGMES_2.4.15_16FEB2016/BaseClassDefiner.hpp b/CGMES_2.4.15_16FEB2016/BaseClassDefiner.hpp deleted file mode 100644 index a87353841..000000000 --- a/CGMES_2.4.15_16FEB2016/BaseClassDefiner.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef BASECLASSDEFINER_HPP -#define BASECLASSDEFINER_HPP - -#include -#include - -class BaseClass; -typedef bool (*class_assign_function)(BaseClass*, BaseClass*); -typedef bool (*assign_function)(std::stringstream&, BaseClass*); -namespace CIMPP { - - class BaseClassDefiner { - public: - BaseClassDefiner(void(*addConstruct)(std::unordered_map&), - void(*addPrimitiveAssignFns)(std::unordered_map&), - void(*addClassAssignFns)(std::unordered_map&), - const char *debugStr); - void (*addConstructToMap)(std::unordered_map&); - void (*addPrimitiveAssignFnsToMap)(std::unordered_map&); - void (*addClassAssignFnsToMap)(std::unordered_map&); - const char* debugString; - }; -} -#endif // BASECLASSDEFINER diff --git a/CGMES_2.4.15_16FEB2016/Boolean.cpp b/CGMES_2.4.15_16FEB2016/Boolean.cpp deleted file mode 100644 index 35f7fa9a1..000000000 --- a/CGMES_2.4.15_16FEB2016/Boolean.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "Boolean.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Boolean::Boolean(){} - -Boolean::~Boolean(){} - -Boolean::Boolean(bool value) - : value(value), initialized(true) {} - -const BaseClassDefiner Boolean::declare() -{ - return BaseClassDefiner(Boolean::addConstructToMap, Boolean::addPrimitiveAssignFnsToMap, Boolean::addClassAssignFnsToMap, Boolean::debugName); -} - -Boolean& Boolean::operator=(bool &rop) -{ - value = rop; - initialized = true; - return *this; -} - -Boolean::operator bool() -{ - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; -} - -void Boolean::addConstructToMap(std::unordered_map& factory_map) {} - -void Boolean::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Boolean::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char Boolean::debugName[] = "Boolean"; -const char* Boolean::debugString() -{ - return Boolean::debugName; -} - -namespace CIMPP { - std::istream& operator>>(std::istream& lop, Boolean& rop) - { - std::string tmp; - lop >> tmp; - if(tmp == "true" || tmp == "True" || tmp == "TRUE") - { - rop.value = true; - rop.initialized = true; - return lop; - } - if(tmp == "false" || tmp == "False" || tmp == "FALSE") - { - rop.value = false; - rop.initialized = true; - return lop; - } - else - { - lop.setstate(std::ios::failbit); - return lop; - } - } - - std::ostream& operator<<(std::ostream& os, Boolean& rop) - { - if (rop) { - os << "true"; - } - else { - os << "false"; - } - return os; - } -} diff --git a/CGMES_2.4.15_16FEB2016/Boolean.hpp b/CGMES_2.4.15_16FEB2016/Boolean.hpp deleted file mode 100644 index 34e30d18a..000000000 --- a/CGMES_2.4.15_16FEB2016/Boolean.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef BOOLEAN_H -#define BOOLEAN_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - /** - * A type with the value space "true" and "false". - */ - class Boolean - { - public: - Boolean(); - virtual ~Boolean(); - static const BaseClassDefiner declare(); - - Boolean(bool value); - Boolean& operator=(bool &rop); - friend std::istream& operator>>(std::istream& lop, Boolean& rop); - friend std::ostream& operator<<(std::ostream& os, Boolean& rop); - operator bool(); - - bool value = false; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif diff --git a/CGMES_2.4.15_16FEB2016/CIMFactory.cpp b/CGMES_2.4.15_16FEB2016/CIMFactory.cpp deleted file mode 100644 index a2ed2e7c9..000000000 --- a/CGMES_2.4.15_16FEB2016/CIMFactory.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "CIMFactory.hpp" -#include "Folders.hpp" -#include "CIMClassList.hpp" -#include -#include - -using namespace CIMPP; - -static std::unordered_map initialize(); -std::unordered_map CIMFactory::factory_map = initialize(); - -BaseClass* CIMFactory::CreateNew(const std::string& name) { - std::unordered_map::iterator it = factory_map.find(name); - if(it != factory_map.end()) { - return (*it->second)(); - } - else { - std::cerr << "!! ** Could not find factory for " << name << " ** !!" << std::endl; - return nullptr; - } -} - -bool CIMFactory::IsCIMClass(const std::string& name) { - std::unordered_map::iterator it = factory_map.find(name); - if(it == factory_map.end()) { - return false; - } - else { - return true; - } -} - -CIMFactory::CIMFactory() {} - -CIMFactory::~CIMFactory() {} - -static std::unordered_map initialize() { - std::unordered_map map; - for (const BaseClassDefiner& CIMClass : CIMClassList) - { - CIMClass.addConstructToMap(map); - } - return map; -} diff --git a/CGMES_2.4.15_16FEB2016/CIMFactory.hpp b/CGMES_2.4.15_16FEB2016/CIMFactory.hpp deleted file mode 100644 index 9e3cbe455..000000000 --- a/CGMES_2.4.15_16FEB2016/CIMFactory.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CIMFACTORY_HPP -#define CIMFACTORY_HPP - -#include -#include -#include "BaseClass.hpp" - -namespace CIMPP { - - class CIMFactory - { - public: - CIMFactory(); - virtual ~CIMFactory(); - static BaseClass* CreateNew(const std::string& name); - static bool IsCIMClass(const std::string& name); - - private: - static std::unordered_map factory_map; - }; -} -#endif // CIMFACTORY_HPP diff --git a/CGMES_2.4.15_16FEB2016/Date.cpp b/CGMES_2.4.15_16FEB2016/Date.cpp deleted file mode 100644 index 79a800c86..000000000 --- a/CGMES_2.4.15_16FEB2016/Date.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "BaseClass.hpp" -#include "Date.hpp" -#include "String.hpp" - -using namespace CIMPP; - -Date::Date() {} - -Date::Date(String s) -{ - value=s; -} - -Date::~Date() {} - -BaseClass* Date_factory() -{ - return new Date; -} diff --git a/CGMES_2.4.15_16FEB2016/Date.hpp b/CGMES_2.4.15_16FEB2016/Date.hpp deleted file mode 100644 index 6027d6e09..000000000 --- a/CGMES_2.4.15_16FEB2016/Date.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef Date_H -#define Date_H - -#include "BaseClass.hpp" -#include "String.hpp" - - -/* -Date as "yyyy-mm-dd", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddZ". A local timezone relative UTC is specified as "yyyy-mm-dd(+/-)hh:mm". -*/ -namespace CIMPP { - - class Date: public BaseClass - { - public: - Date(); - Date(String); - virtual ~Date(); - - private: - String value; - }; - - BaseClass* Date_factory(); -} -#endif diff --git a/CGMES_2.4.15_16FEB2016/Float.cpp b/CGMES_2.4.15_16FEB2016/Float.cpp deleted file mode 100644 index 4daa76621..000000000 --- a/CGMES_2.4.15_16FEB2016/Float.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "Float.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Float::Float(){} - -Float::~Float(){} - -Float::Float(long double value) : value(value), initialized(true) {} - -void Float::addConstructToMap(std::unordered_map& factory_map) {} - -void Float::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Float::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char Float::debugName[] = "Float"; -const char* Float::debugString() { - return Float::debugName; -} - -const BaseClassDefiner Float::declare() { - return BaseClassDefiner(Float::addConstructToMap, Float::addPrimitiveAssignFnsToMap, Float::addClassAssignFnsToMap, Float::debugName); -} - -Float& Float::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; -} - -Float& Float::operator-=(const Float& rhs) { - value -= rhs.value; - return *this; -} - -Float& Float::operator*=(const Float& rhs) { - value *= rhs.value; - return *this; -} - -Float& Float::operator/=(const Float& rhs) { - value /= rhs.value; - return *this; -} - -Float& Float::operator+=(const Float& rhs) { - value += rhs.value; - return *this; -} - -Float::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; -} - -std::istream& operator>>(std::istream& lop, Float& rop) { - std::string tmp; - lop >> tmp; - rop.value = stold(tmp); - rop.initialized = true; - return lop; -} diff --git a/CGMES_2.4.15_16FEB2016/Float.hpp b/CGMES_2.4.15_16FEB2016/Float.hpp deleted file mode 100644 index ab30f43d6..000000000 --- a/CGMES_2.4.15_16FEB2016/Float.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef FLOAT_H -#define FLOAT_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - - /** - * A floating point number. The range is unspecified and not limited. - */ - class Float : public BaseClass - { - - public: - Float(); - virtual ~Float(); - Float(long double value); - static const BaseClassDefiner declare(); - Float& operator=(long double &rop); - Float& operator+=(const Float& rhs); - Float& operator-=(const Float& rhs); - Float& operator*=(const Float& rhs); - Float& operator/=(const Float& rhs); - friend std::istream& operator>>(std::istream& lop, Float& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif // FLOAT_H diff --git a/CGMES_2.4.15_16FEB2016/Folders.hpp b/CGMES_2.4.15_16FEB2016/Folders.hpp deleted file mode 100644 index 275606db6..000000000 --- a/CGMES_2.4.15_16FEB2016/Folders.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "IEC61970.hpp" diff --git a/CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.cpp b/CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.cpp deleted file mode 100644 index c769c5282..000000000 --- a/CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/////////////////////////////////////////////////////////// -// IEC61970CIMVersion.cpp -// Implementation of the Class IEC61970CIMVersion -/////////////////////////////////////////////////////////// - -#include "IEC61970CIMVersion.h" - -using namespace CIMPP; - -IEC61970CIMVersion::IEC61970CIMVersion(){} - -IEC61970CIMVersion::~IEC61970CIMVersion(){} - -const Date IEC61970CIMVersion::date = Date("2017-07-26"); -const String IEC61970CIMVersion::version = "IEC61970CIM17v23"; diff --git a/CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.h b/CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.h deleted file mode 100644 index 61a9e2910..000000000 --- a/CGMES_2.4.15_16FEB2016/IEC61970/IEC61970CIMVersion.h +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////// -// IEC61970CIMVersion.h -// Implementation of the Class IEC61970CIMVersion -/////////////////////////////////////////////////////////// - -#ifndef IEC61970CIMVERSION_H -#define IEC61970CIMVERSION_H - -#include "BaseClass.hpp" -#include "Date.hpp" -#include "String.hpp" - -namespace CIMPP { - - class IEC61970CIMVersion : public BaseClass - { - public: - IEC61970CIMVersion(); - virtual ~IEC61970CIMVersion(); - /** - * Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. - */ - static const Date date; - /** - * Form is IEC61970CIMXXvYY where XX is the major CIM package version and the YY - * is the minor version. For example IEC61970CIM13v18. - */ - static const String version; - }; -} -#endif // IEC61970CIMVERSION_H diff --git a/CGMES_2.4.15_16FEB2016/Integer.cpp b/CGMES_2.4.15_16FEB2016/Integer.cpp deleted file mode 100644 index 638dd4175..000000000 --- a/CGMES_2.4.15_16FEB2016/Integer.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "Integer.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Integer::Integer(){} - -Integer::~Integer(){} - -Integer::Integer(long int value) - : value(value), initialized(true) {} - -const BaseClassDefiner Integer::declare() { - return BaseClassDefiner(Integer::addConstructToMap, Integer::addPrimitiveAssignFnsToMap, Integer::addClassAssignFnsToMap, Integer::debugName); -} - -const char Integer::debugName[] = "Integer"; -const char* Integer::debugString() { - return Integer::debugName; -} - -void Integer::addConstructToMap(std::unordered_map& factory_map) {} - -void Integer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Integer::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -namespace CIMPP { - Integer& Integer::operator=(long int &rop){ - value = rop; - initialized = true; - return *this; - } - - Integer& Integer::operator-=(const Integer& rhs){ - value -= rhs.value; - return *this; - } - - Integer& Integer::operator*=(const Integer& rhs){ - value *= rhs.value; - return *this; - } - - Integer& Integer::operator/=(const Integer& rhs){ - value /= rhs.value; - return *this; - } - - Integer& Integer::operator+=(const Integer& rhs){ - value += rhs.value; - return *this; - } - - Integer::operator long int(){ - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } - - std::istream& operator>>(std::istream& lop, Integer& rop) - { - std::string tmp; - lop >> tmp; - - rop.value = stol(tmp); - rop.initialized = true; - return lop; - } -} diff --git a/CGMES_2.4.15_16FEB2016/Integer.hpp b/CGMES_2.4.15_16FEB2016/Integer.hpp deleted file mode 100644 index a39f6c814..000000000 --- a/CGMES_2.4.15_16FEB2016/Integer.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef INTEGER_H -#define INTEGER_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - - /** - * An Integer number. The range is unspecified and not limited. - */ - class Integer - { - public: - Integer(); - Integer(long int value); - virtual ~Integer(); - static const BaseClassDefiner declare(); - Integer& operator=(long int &rop); - Integer& operator+=(const Integer& rhs); - Integer& operator-=(const Integer& rhs); - Integer& operator*=(const Integer& rhs); - Integer& operator/=(const Integer& rhs); - friend std::istream& operator>>(std::istream& lop, Integer& rop); - operator long int(); - - long int value = 0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif // INTEGER_H diff --git a/CGMES_2.4.15_16FEB2016/String.hpp b/CGMES_2.4.15_16FEB2016/String.hpp deleted file mode 100644 index 9ed603352..000000000 --- a/CGMES_2.4.15_16FEB2016/String.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef STRING_H -#define STRING_H - -#include "BaseClass.hpp" -#include "string" - -/* -A string consisting of a sequence of characters. The character encoding is UTF-8. The string length is unspecified and unlimited. -*/ -namespace CIMPP { - - typedef std::string String; -} -#endif diff --git a/CGMES_2.4.15_16FEB2016/Task.cpp b/CGMES_2.4.15_16FEB2016/Task.cpp deleted file mode 100644 index 47f50c291..000000000 --- a/CGMES_2.4.15_16FEB2016/Task.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include - -#include "Folders.hpp" -#include "CIMClassList.hpp" -#include "Task.hpp" - -using namespace CIMPP; - -typedef bool (*task_function)(BaseClass*, BaseClass*); -static std::unordered_map initialize(); -std::unordered_map Task::dynamic_switch = initialize(); - -Task::Task() {} - -Task::Task(BaseClass* CIMObj, const std::string CIMAttrName, const std::string Value) - : _CIMObj(CIMObj), _CIMAttrName(CIMAttrName), _Value(Value) {} - -Task::~Task() {} - -void Task::print() -{ - if(IdentifiedObject* IdObj = dynamic_cast(_CIMObj)) - std::cout << _CIMAttrName << " '" << IdObj->name << "' = '" << _Value << "'" << std::endl; - else - std::cout << _CIMAttrName << " = '" << _Value << "'" << std::endl; - -} - -bool Task::resolve(std::unordered_map *RDFMap) -{ - std::unordered_map::iterator it_id = RDFMap->find(_Value); - if(it_id == RDFMap->end()) { - std::cerr << "Couldn't find " << _CIMAttrName << " with value: " << _Value << " in RDFMap." << std::endl; - return false; - } - - std::unordered_map::iterator it_func = dynamic_switch.find(_CIMAttrName); - if(it_func == dynamic_switch.end()) { - std::cerr << "Couldn't find " << _CIMAttrName << " in dynamic_switch map." << std::endl; - return false; - } - - if((*it_func->second)(_CIMObj, it_id->second)) - return true; - else - return (*it_func->second)(it_id->second, _CIMObj); -} - -static std::unordered_map initialize() -{ - std::unordered_map object_map; - for (const BaseClassDefiner& CIMClass : CIMClassList) { - CIMClass.addClassAssignFnsToMap(object_map); - } - - return object_map; -} - - diff --git a/CGMES_2.4.15_16FEB2016/Task.hpp b/CGMES_2.4.15_16FEB2016/Task.hpp deleted file mode 100644 index 2dd484a3f..000000000 --- a/CGMES_2.4.15_16FEB2016/Task.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef TASK_HPP -#define TASK_HPP - -#include -#include -#include "BaseClass.hpp" - -class Task -{ -public: - Task(); - Task(BaseClass* CIMObj, const std::string CIMAttrName, const std::string Value); - ~Task(); - bool resolve(std::unordered_map *RDFMap); - void print(); -private: - BaseClass* _CIMObj; - std::string _CIMAttrName; - std::string _Value; - static std::unordered_map dynamic_switch; -}; -#endif // TASK_HPP diff --git a/CGMES_2.4.15_16FEB2016/UnknownType.cpp b/CGMES_2.4.15_16FEB2016/UnknownType.cpp deleted file mode 100644 index 1518151d5..000000000 --- a/CGMES_2.4.15_16FEB2016/UnknownType.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include -#include -#include -#include - -#include "BaseClass.hpp" -#include "UnknownType.hpp" - -using namespace CIMPP; - -UnknownType::UnknownType() {}; - -UnknownType::~UnknownType() {}; - -bool seenAttribute(std::string name, std::string value) { - static std::list> seenAttributes; - bool found = false; - for(const std::pair & attribute : seenAttributes) { - if (name == attribute.first && value == attribute.second) { - found = true; - - } - } - if (!found) { - seenAttributes.push_back(std::pair(name, value)); - } - return found; -} - -bool assign_Unknown_Attribute(std::stringstream &buffer, std::string name) { - std::string attribute; - buffer >> attribute; - if(buffer.fail()) { - return false; - } - else if (!seenAttribute(name, attribute)) { - std::cout << "Warning: could not assign attribute with name: " << name << " and value: " << attribute << std::endl; - } - return true; -} - -bool assign_Name_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - return assign_Unknown_Attribute(buffer, "cim:Name.name"); -} - -bool assign_NameType_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - return assign_Unknown_Attribute(buffer, "cim:NameType.name"); -} - -bool assign_Name_IdentifiedObject(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - return assign_Unknown_Attribute(buffer, "cim:Name.IdentifiedObject"); -} - -bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1); -bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1); - -bool assign_Unknown_Class(std::string type) { - std::cout << "Warning: could not assign class of unrecognised type " << type << "." << std::endl; - return true; -} - -bool assign_Class_NameType_name(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:NameType.name"); - } -} - -bool assign_Class_Name_NameType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:Name.NameType"); - } -} - -bool assign_Class_Name_name(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:Name.name"); - } -} - -bool assign_Class_Name_IdentifiedObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:Name.IdentifiedObject"); - } -} - -void UnknownType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Terminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.connected"), &assign_ACDCTerminal_connected)); - assign_map.insert(std::make_pair(std::string("cim:Name.name"), &assign_Name_name)); - assign_map.insert(std::make_pair(std::string("cim:NameType.name"), &assign_NameType_name)); -} - -void UnknownType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Name.name"), &assign_Class_Name_name)); - assign_map.insert(std::make_pair(std::string("cim:Name.IdentifiedObject"), &assign_Class_Name_IdentifiedObject)); - assign_map.insert(std::make_pair(std::string("cim:NameType.name"), &assign_Class_NameType_name)); - assign_map.insert(std::make_pair(std::string("cim:Name.NameType"), &assign_Class_Name_NameType)); -} - -namespace CIMPP { - BaseClass* UnknownType_factory() { - return new UnknownType; - } -} - -void UnknownType::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:NameType"), &UnknownType_factory)); - factory_map.insert(std::make_pair(std::string("cim:Name"), &UnknownType_factory)); -} - -const char UnknownType::debugName[] = "UnknownType"; - -const BaseClassDefiner UnknownType::declare() -{ - return BaseClassDefiner(addConstructToMap, addPrimitiveAssignFnsToMap, addClassAssignFnsToMap, debugName); -} diff --git a/CGMES_2.4.15_16FEB2016/UnknownType.hpp b/CGMES_2.4.15_16FEB2016/UnknownType.hpp deleted file mode 100644 index 6cc8acd7e..000000000 --- a/CGMES_2.4.15_16FEB2016/UnknownType.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef UnknownType_H -#define UnknownType_H -#include -#include -#include -#include "BaseClass.hpp" - - -namespace CIMPP { - - class UnknownType: public BaseClass - { -public: - static const char debugName[]; - UnknownType(); - virtual ~UnknownType(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); - }; -} -#endif diff --git a/CGMES_2.4.15_16FEB2016/assignments.cpp b/CGMES_2.4.15_16FEB2016/assignments.cpp deleted file mode 100644 index 887a72dea..000000000 --- a/CGMES_2.4.15_16FEB2016/assignments.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include - -#include "Folders.hpp" -#include "CIMClassList.hpp" -#include "assignments.hpp" -#include -#include "BaseClass.hpp" - -using namespace CIMPP; - -static std::unordered_map dynamic_switch_factory(); -static std::unordered_map dynamic_switch = dynamic_switch_factory(); - -bool assign(BaseClass* CIMObj, const std::string& CIMAttrName, const std::string& Value) -{ - std::unordered_map::iterator prim_it = dynamic_switch.find(CIMAttrName); - if(prim_it != dynamic_switch.end()) { - std::stringstream str; - str << Value; - return (*prim_it->second)(str, CIMObj); - } - -#ifdef DEBUG - std::cerr << "Couldn't assign attribute with value: " << Value << " to " << CIMAttrName << " in object of type " << CIMObj->debugString() << std::endl; -#endif - return false; -} - -std::unordered_map dynamic_switch_factory() -{ - std::unordered_map assign_map; - for (const BaseClassDefiner& CIMClass : CIMClassList) - { - CIMClass.addPrimitiveAssignFnsToMap(assign_map); - } - - return assign_map; -} - diff --git a/CGMES_2.4.15_16FEB2016/assignments.hpp b/CGMES_2.4.15_16FEB2016/assignments.hpp deleted file mode 100644 index 1492ee219..000000000 --- a/CGMES_2.4.15_16FEB2016/assignments.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef ASSIGN_HPP -#define ASSIGN_HPP - -#include -#include "BaseClass.hpp" - -using namespace CIMPP; - -bool assign(BaseClass* CIMObj, const std::string& CIMAttrName, const std::string& Value); - -#endif // ASSIGN_HPP diff --git a/CGMES_2.4.15_27JAN2020/BaseClass.cpp b/CGMES_2.4.15_27JAN2020/BaseClass.cpp deleted file mode 100644 index 20dc2088d..000000000 --- a/CGMES_2.4.15_27JAN2020/BaseClass.cpp +++ /dev/null @@ -1,22 +0,0 @@ - -#include "BaseClass.hpp" - -using namespace CIMPP; - -BaseClass::~BaseClass() {} - -void BaseClass::addConstructToMap(std::unordered_map& factory_map) {} - -void BaseClass::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void BaseClass::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char BaseClass::debugName[] = "BaseClass"; -const char* BaseClass::debugString() -{ - return BaseClass::debugName; -} - -CIMPP::BaseClassDefiner BaseClass::declare() { - return BaseClassDefiner(BaseClass::addConstructToMap, BaseClass::addPrimitiveAssignFnsToMap, BaseClass::addClassAssignFnsToMap, BaseClass::debugName); -} diff --git a/CGMES_2.4.15_27JAN2020/BaseClass.h b/CGMES_2.4.15_27JAN2020/BaseClass.h deleted file mode 100644 index d1ebb818e..000000000 --- a/CGMES_2.4.15_27JAN2020/BaseClass.h +++ /dev/null @@ -1 +0,0 @@ -#include "BaseClass.hpp" diff --git a/CGMES_2.4.15_27JAN2020/BaseClass.hpp b/CGMES_2.4.15_27JAN2020/BaseClass.hpp deleted file mode 100644 index a7cd61294..000000000 --- a/CGMES_2.4.15_27JAN2020/BaseClass.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef BASECLASS_HPP -#define BASECLASS_HPP - -#ifndef CGMES_BUILD -#define CGMES_BUILD -#endif - -#include -#include "BaseClassDefiner.hpp" - -class BaseClass { -public: - enum cgmesProfile {EQ = 0, SSH = 1, TP = 2, SV = 3, DY = 4, GL = 5, DI = 6}; - virtual ~BaseClass(); - static CIMPP::BaseClassDefiner declare(); - static void addConstructToMap(std::unordered_map&); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - const static char debugName[]; - virtual const char* debugString(); -}; -#endif // BASECLASS_HPP diff --git a/CGMES_2.4.15_27JAN2020/BaseClassDefiner.cpp b/CGMES_2.4.15_27JAN2020/BaseClassDefiner.cpp deleted file mode 100644 index 95bcb95d6..000000000 --- a/CGMES_2.4.15_27JAN2020/BaseClassDefiner.cpp +++ /dev/null @@ -1,14 +0,0 @@ - -#include "BaseClassDefiner.hpp" - -using namespace CIMPP; - -BaseClassDefiner::BaseClassDefiner(void(*addConstruct)(std::unordered_map&), - void(*addPrimitiveAssignFns)(std::unordered_map&), - void(*addClassAssignFns)(std::unordered_map&), - const char *debugStr) { - addConstructToMap = addConstruct; - addPrimitiveAssignFnsToMap = addPrimitiveAssignFns; - addClassAssignFnsToMap = addClassAssignFns; - debugString = debugStr; -} diff --git a/CGMES_2.4.15_27JAN2020/BaseClassDefiner.hpp b/CGMES_2.4.15_27JAN2020/BaseClassDefiner.hpp deleted file mode 100644 index a87353841..000000000 --- a/CGMES_2.4.15_27JAN2020/BaseClassDefiner.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef BASECLASSDEFINER_HPP -#define BASECLASSDEFINER_HPP - -#include -#include - -class BaseClass; -typedef bool (*class_assign_function)(BaseClass*, BaseClass*); -typedef bool (*assign_function)(std::stringstream&, BaseClass*); -namespace CIMPP { - - class BaseClassDefiner { - public: - BaseClassDefiner(void(*addConstruct)(std::unordered_map&), - void(*addPrimitiveAssignFns)(std::unordered_map&), - void(*addClassAssignFns)(std::unordered_map&), - const char *debugStr); - void (*addConstructToMap)(std::unordered_map&); - void (*addPrimitiveAssignFnsToMap)(std::unordered_map&); - void (*addClassAssignFnsToMap)(std::unordered_map&); - const char* debugString; - }; -} -#endif // BASECLASSDEFINER diff --git a/CGMES_2.4.15_27JAN2020/Boolean.cpp b/CGMES_2.4.15_27JAN2020/Boolean.cpp deleted file mode 100644 index 35f7fa9a1..000000000 --- a/CGMES_2.4.15_27JAN2020/Boolean.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "Boolean.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Boolean::Boolean(){} - -Boolean::~Boolean(){} - -Boolean::Boolean(bool value) - : value(value), initialized(true) {} - -const BaseClassDefiner Boolean::declare() -{ - return BaseClassDefiner(Boolean::addConstructToMap, Boolean::addPrimitiveAssignFnsToMap, Boolean::addClassAssignFnsToMap, Boolean::debugName); -} - -Boolean& Boolean::operator=(bool &rop) -{ - value = rop; - initialized = true; - return *this; -} - -Boolean::operator bool() -{ - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; -} - -void Boolean::addConstructToMap(std::unordered_map& factory_map) {} - -void Boolean::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Boolean::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char Boolean::debugName[] = "Boolean"; -const char* Boolean::debugString() -{ - return Boolean::debugName; -} - -namespace CIMPP { - std::istream& operator>>(std::istream& lop, Boolean& rop) - { - std::string tmp; - lop >> tmp; - if(tmp == "true" || tmp == "True" || tmp == "TRUE") - { - rop.value = true; - rop.initialized = true; - return lop; - } - if(tmp == "false" || tmp == "False" || tmp == "FALSE") - { - rop.value = false; - rop.initialized = true; - return lop; - } - else - { - lop.setstate(std::ios::failbit); - return lop; - } - } - - std::ostream& operator<<(std::ostream& os, Boolean& rop) - { - if (rop) { - os << "true"; - } - else { - os << "false"; - } - return os; - } -} diff --git a/CGMES_2.4.15_27JAN2020/Boolean.hpp b/CGMES_2.4.15_27JAN2020/Boolean.hpp deleted file mode 100644 index 34e30d18a..000000000 --- a/CGMES_2.4.15_27JAN2020/Boolean.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef BOOLEAN_H -#define BOOLEAN_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - /** - * A type with the value space "true" and "false". - */ - class Boolean - { - public: - Boolean(); - virtual ~Boolean(); - static const BaseClassDefiner declare(); - - Boolean(bool value); - Boolean& operator=(bool &rop); - friend std::istream& operator>>(std::istream& lop, Boolean& rop); - friend std::ostream& operator<<(std::ostream& os, Boolean& rop); - operator bool(); - - bool value = false; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif diff --git a/CGMES_2.4.15_27JAN2020/CIMFactory.cpp b/CGMES_2.4.15_27JAN2020/CIMFactory.cpp deleted file mode 100644 index a2ed2e7c9..000000000 --- a/CGMES_2.4.15_27JAN2020/CIMFactory.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "CIMFactory.hpp" -#include "Folders.hpp" -#include "CIMClassList.hpp" -#include -#include - -using namespace CIMPP; - -static std::unordered_map initialize(); -std::unordered_map CIMFactory::factory_map = initialize(); - -BaseClass* CIMFactory::CreateNew(const std::string& name) { - std::unordered_map::iterator it = factory_map.find(name); - if(it != factory_map.end()) { - return (*it->second)(); - } - else { - std::cerr << "!! ** Could not find factory for " << name << " ** !!" << std::endl; - return nullptr; - } -} - -bool CIMFactory::IsCIMClass(const std::string& name) { - std::unordered_map::iterator it = factory_map.find(name); - if(it == factory_map.end()) { - return false; - } - else { - return true; - } -} - -CIMFactory::CIMFactory() {} - -CIMFactory::~CIMFactory() {} - -static std::unordered_map initialize() { - std::unordered_map map; - for (const BaseClassDefiner& CIMClass : CIMClassList) - { - CIMClass.addConstructToMap(map); - } - return map; -} diff --git a/CGMES_2.4.15_27JAN2020/CIMFactory.hpp b/CGMES_2.4.15_27JAN2020/CIMFactory.hpp deleted file mode 100644 index 9e3cbe455..000000000 --- a/CGMES_2.4.15_27JAN2020/CIMFactory.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CIMFACTORY_HPP -#define CIMFACTORY_HPP - -#include -#include -#include "BaseClass.hpp" - -namespace CIMPP { - - class CIMFactory - { - public: - CIMFactory(); - virtual ~CIMFactory(); - static BaseClass* CreateNew(const std::string& name); - static bool IsCIMClass(const std::string& name); - - private: - static std::unordered_map factory_map; - }; -} -#endif // CIMFACTORY_HPP diff --git a/CGMES_2.4.15_27JAN2020/Date.cpp b/CGMES_2.4.15_27JAN2020/Date.cpp deleted file mode 100644 index 79a800c86..000000000 --- a/CGMES_2.4.15_27JAN2020/Date.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "BaseClass.hpp" -#include "Date.hpp" -#include "String.hpp" - -using namespace CIMPP; - -Date::Date() {} - -Date::Date(String s) -{ - value=s; -} - -Date::~Date() {} - -BaseClass* Date_factory() -{ - return new Date; -} diff --git a/CGMES_2.4.15_27JAN2020/Date.hpp b/CGMES_2.4.15_27JAN2020/Date.hpp deleted file mode 100644 index 6027d6e09..000000000 --- a/CGMES_2.4.15_27JAN2020/Date.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef Date_H -#define Date_H - -#include "BaseClass.hpp" -#include "String.hpp" - - -/* -Date as "yyyy-mm-dd", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddZ". A local timezone relative UTC is specified as "yyyy-mm-dd(+/-)hh:mm". -*/ -namespace CIMPP { - - class Date: public BaseClass - { - public: - Date(); - Date(String); - virtual ~Date(); - - private: - String value; - }; - - BaseClass* Date_factory(); -} -#endif diff --git a/CGMES_2.4.15_27JAN2020/Float.cpp b/CGMES_2.4.15_27JAN2020/Float.cpp deleted file mode 100644 index 4daa76621..000000000 --- a/CGMES_2.4.15_27JAN2020/Float.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "Float.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Float::Float(){} - -Float::~Float(){} - -Float::Float(long double value) : value(value), initialized(true) {} - -void Float::addConstructToMap(std::unordered_map& factory_map) {} - -void Float::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Float::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char Float::debugName[] = "Float"; -const char* Float::debugString() { - return Float::debugName; -} - -const BaseClassDefiner Float::declare() { - return BaseClassDefiner(Float::addConstructToMap, Float::addPrimitiveAssignFnsToMap, Float::addClassAssignFnsToMap, Float::debugName); -} - -Float& Float::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; -} - -Float& Float::operator-=(const Float& rhs) { - value -= rhs.value; - return *this; -} - -Float& Float::operator*=(const Float& rhs) { - value *= rhs.value; - return *this; -} - -Float& Float::operator/=(const Float& rhs) { - value /= rhs.value; - return *this; -} - -Float& Float::operator+=(const Float& rhs) { - value += rhs.value; - return *this; -} - -Float::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; -} - -std::istream& operator>>(std::istream& lop, Float& rop) { - std::string tmp; - lop >> tmp; - rop.value = stold(tmp); - rop.initialized = true; - return lop; -} diff --git a/CGMES_2.4.15_27JAN2020/Float.hpp b/CGMES_2.4.15_27JAN2020/Float.hpp deleted file mode 100644 index ab30f43d6..000000000 --- a/CGMES_2.4.15_27JAN2020/Float.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef FLOAT_H -#define FLOAT_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - - /** - * A floating point number. The range is unspecified and not limited. - */ - class Float : public BaseClass - { - - public: - Float(); - virtual ~Float(); - Float(long double value); - static const BaseClassDefiner declare(); - Float& operator=(long double &rop); - Float& operator+=(const Float& rhs); - Float& operator-=(const Float& rhs); - Float& operator*=(const Float& rhs); - Float& operator/=(const Float& rhs); - friend std::istream& operator>>(std::istream& lop, Float& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif // FLOAT_H diff --git a/CGMES_2.4.15_27JAN2020/Folders.hpp b/CGMES_2.4.15_27JAN2020/Folders.hpp deleted file mode 100644 index 275606db6..000000000 --- a/CGMES_2.4.15_27JAN2020/Folders.hpp +++ /dev/null @@ -1 +0,0 @@ -#include "IEC61970.hpp" diff --git a/CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.cpp b/CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.cpp deleted file mode 100644 index c769c5282..000000000 --- a/CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/////////////////////////////////////////////////////////// -// IEC61970CIMVersion.cpp -// Implementation of the Class IEC61970CIMVersion -/////////////////////////////////////////////////////////// - -#include "IEC61970CIMVersion.h" - -using namespace CIMPP; - -IEC61970CIMVersion::IEC61970CIMVersion(){} - -IEC61970CIMVersion::~IEC61970CIMVersion(){} - -const Date IEC61970CIMVersion::date = Date("2017-07-26"); -const String IEC61970CIMVersion::version = "IEC61970CIM17v23"; diff --git a/CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.h b/CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.h deleted file mode 100644 index 61a9e2910..000000000 --- a/CGMES_2.4.15_27JAN2020/IEC61970/IEC61970CIMVersion.h +++ /dev/null @@ -1,31 +0,0 @@ -/////////////////////////////////////////////////////////// -// IEC61970CIMVersion.h -// Implementation of the Class IEC61970CIMVersion -/////////////////////////////////////////////////////////// - -#ifndef IEC61970CIMVERSION_H -#define IEC61970CIMVERSION_H - -#include "BaseClass.hpp" -#include "Date.hpp" -#include "String.hpp" - -namespace CIMPP { - - class IEC61970CIMVersion : public BaseClass - { - public: - IEC61970CIMVersion(); - virtual ~IEC61970CIMVersion(); - /** - * Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. - */ - static const Date date; - /** - * Form is IEC61970CIMXXvYY where XX is the major CIM package version and the YY - * is the minor version. For example IEC61970CIM13v18. - */ - static const String version; - }; -} -#endif // IEC61970CIMVERSION_H diff --git a/CGMES_2.4.15_27JAN2020/Integer.cpp b/CGMES_2.4.15_27JAN2020/Integer.cpp deleted file mode 100644 index 638dd4175..000000000 --- a/CGMES_2.4.15_27JAN2020/Integer.cpp +++ /dev/null @@ -1,72 +0,0 @@ -#include "Integer.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Integer::Integer(){} - -Integer::~Integer(){} - -Integer::Integer(long int value) - : value(value), initialized(true) {} - -const BaseClassDefiner Integer::declare() { - return BaseClassDefiner(Integer::addConstructToMap, Integer::addPrimitiveAssignFnsToMap, Integer::addClassAssignFnsToMap, Integer::debugName); -} - -const char Integer::debugName[] = "Integer"; -const char* Integer::debugString() { - return Integer::debugName; -} - -void Integer::addConstructToMap(std::unordered_map& factory_map) {} - -void Integer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Integer::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -namespace CIMPP { - Integer& Integer::operator=(long int &rop){ - value = rop; - initialized = true; - return *this; - } - - Integer& Integer::operator-=(const Integer& rhs){ - value -= rhs.value; - return *this; - } - - Integer& Integer::operator*=(const Integer& rhs){ - value *= rhs.value; - return *this; - } - - Integer& Integer::operator/=(const Integer& rhs){ - value /= rhs.value; - return *this; - } - - Integer& Integer::operator+=(const Integer& rhs){ - value += rhs.value; - return *this; - } - - Integer::operator long int(){ - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } - - std::istream& operator>>(std::istream& lop, Integer& rop) - { - std::string tmp; - lop >> tmp; - - rop.value = stol(tmp); - rop.initialized = true; - return lop; - } -} diff --git a/CGMES_2.4.15_27JAN2020/Integer.hpp b/CGMES_2.4.15_27JAN2020/Integer.hpp deleted file mode 100644 index a39f6c814..000000000 --- a/CGMES_2.4.15_27JAN2020/Integer.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef INTEGER_H -#define INTEGER_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - - /** - * An Integer number. The range is unspecified and not limited. - */ - class Integer - { - public: - Integer(); - Integer(long int value); - virtual ~Integer(); - static const BaseClassDefiner declare(); - Integer& operator=(long int &rop); - Integer& operator+=(const Integer& rhs); - Integer& operator-=(const Integer& rhs); - Integer& operator*=(const Integer& rhs); - Integer& operator/=(const Integer& rhs); - friend std::istream& operator>>(std::istream& lop, Integer& rop); - operator long int(); - - long int value = 0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif // INTEGER_H diff --git a/CGMES_2.4.15_27JAN2020/String.hpp b/CGMES_2.4.15_27JAN2020/String.hpp deleted file mode 100644 index 9ed603352..000000000 --- a/CGMES_2.4.15_27JAN2020/String.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef STRING_H -#define STRING_H - -#include "BaseClass.hpp" -#include "string" - -/* -A string consisting of a sequence of characters. The character encoding is UTF-8. The string length is unspecified and unlimited. -*/ -namespace CIMPP { - - typedef std::string String; -} -#endif diff --git a/CGMES_2.4.15_27JAN2020/Task.cpp b/CGMES_2.4.15_27JAN2020/Task.cpp deleted file mode 100644 index 47f50c291..000000000 --- a/CGMES_2.4.15_27JAN2020/Task.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include - -#include "Folders.hpp" -#include "CIMClassList.hpp" -#include "Task.hpp" - -using namespace CIMPP; - -typedef bool (*task_function)(BaseClass*, BaseClass*); -static std::unordered_map initialize(); -std::unordered_map Task::dynamic_switch = initialize(); - -Task::Task() {} - -Task::Task(BaseClass* CIMObj, const std::string CIMAttrName, const std::string Value) - : _CIMObj(CIMObj), _CIMAttrName(CIMAttrName), _Value(Value) {} - -Task::~Task() {} - -void Task::print() -{ - if(IdentifiedObject* IdObj = dynamic_cast(_CIMObj)) - std::cout << _CIMAttrName << " '" << IdObj->name << "' = '" << _Value << "'" << std::endl; - else - std::cout << _CIMAttrName << " = '" << _Value << "'" << std::endl; - -} - -bool Task::resolve(std::unordered_map *RDFMap) -{ - std::unordered_map::iterator it_id = RDFMap->find(_Value); - if(it_id == RDFMap->end()) { - std::cerr << "Couldn't find " << _CIMAttrName << " with value: " << _Value << " in RDFMap." << std::endl; - return false; - } - - std::unordered_map::iterator it_func = dynamic_switch.find(_CIMAttrName); - if(it_func == dynamic_switch.end()) { - std::cerr << "Couldn't find " << _CIMAttrName << " in dynamic_switch map." << std::endl; - return false; - } - - if((*it_func->second)(_CIMObj, it_id->second)) - return true; - else - return (*it_func->second)(it_id->second, _CIMObj); -} - -static std::unordered_map initialize() -{ - std::unordered_map object_map; - for (const BaseClassDefiner& CIMClass : CIMClassList) { - CIMClass.addClassAssignFnsToMap(object_map); - } - - return object_map; -} - - diff --git a/CGMES_2.4.15_27JAN2020/Task.hpp b/CGMES_2.4.15_27JAN2020/Task.hpp deleted file mode 100644 index 2dd484a3f..000000000 --- a/CGMES_2.4.15_27JAN2020/Task.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef TASK_HPP -#define TASK_HPP - -#include -#include -#include "BaseClass.hpp" - -class Task -{ -public: - Task(); - Task(BaseClass* CIMObj, const std::string CIMAttrName, const std::string Value); - ~Task(); - bool resolve(std::unordered_map *RDFMap); - void print(); -private: - BaseClass* _CIMObj; - std::string _CIMAttrName; - std::string _Value; - static std::unordered_map dynamic_switch; -}; -#endif // TASK_HPP diff --git a/CGMES_2.4.15_27JAN2020/UnknownType.cpp b/CGMES_2.4.15_27JAN2020/UnknownType.cpp deleted file mode 100644 index 1518151d5..000000000 --- a/CGMES_2.4.15_27JAN2020/UnknownType.cpp +++ /dev/null @@ -1,136 +0,0 @@ -#include -#include -#include -#include - -#include "BaseClass.hpp" -#include "UnknownType.hpp" - -using namespace CIMPP; - -UnknownType::UnknownType() {}; - -UnknownType::~UnknownType() {}; - -bool seenAttribute(std::string name, std::string value) { - static std::list> seenAttributes; - bool found = false; - for(const std::pair & attribute : seenAttributes) { - if (name == attribute.first && value == attribute.second) { - found = true; - - } - } - if (!found) { - seenAttributes.push_back(std::pair(name, value)); - } - return found; -} - -bool assign_Unknown_Attribute(std::stringstream &buffer, std::string name) { - std::string attribute; - buffer >> attribute; - if(buffer.fail()) { - return false; - } - else if (!seenAttribute(name, attribute)) { - std::cout << "Warning: could not assign attribute with name: " << name << " and value: " << attribute << std::endl; - } - return true; -} - -bool assign_Name_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - return assign_Unknown_Attribute(buffer, "cim:Name.name"); -} - -bool assign_NameType_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - return assign_Unknown_Attribute(buffer, "cim:NameType.name"); -} - -bool assign_Name_IdentifiedObject(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - return assign_Unknown_Attribute(buffer, "cim:Name.IdentifiedObject"); -} - -bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1); -bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1); - -bool assign_Unknown_Class(std::string type) { - std::cout << "Warning: could not assign class of unrecognised type " << type << "." << std::endl; - return true; -} - -bool assign_Class_NameType_name(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:NameType.name"); - } -} - -bool assign_Class_Name_NameType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:Name.NameType"); - } -} - -bool assign_Class_Name_name(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:Name.name"); - } -} - -bool assign_Class_Name_IdentifiedObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - static bool seen = false; - if (seen){ - return true; - } - else { - seen = true; - return assign_Unknown_Class("cim:Name.IdentifiedObject"); - } -} - -void UnknownType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Terminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.connected"), &assign_ACDCTerminal_connected)); - assign_map.insert(std::make_pair(std::string("cim:Name.name"), &assign_Name_name)); - assign_map.insert(std::make_pair(std::string("cim:NameType.name"), &assign_NameType_name)); -} - -void UnknownType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Name.name"), &assign_Class_Name_name)); - assign_map.insert(std::make_pair(std::string("cim:Name.IdentifiedObject"), &assign_Class_Name_IdentifiedObject)); - assign_map.insert(std::make_pair(std::string("cim:NameType.name"), &assign_Class_NameType_name)); - assign_map.insert(std::make_pair(std::string("cim:Name.NameType"), &assign_Class_Name_NameType)); -} - -namespace CIMPP { - BaseClass* UnknownType_factory() { - return new UnknownType; - } -} - -void UnknownType::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:NameType"), &UnknownType_factory)); - factory_map.insert(std::make_pair(std::string("cim:Name"), &UnknownType_factory)); -} - -const char UnknownType::debugName[] = "UnknownType"; - -const BaseClassDefiner UnknownType::declare() -{ - return BaseClassDefiner(addConstructToMap, addPrimitiveAssignFnsToMap, addClassAssignFnsToMap, debugName); -} diff --git a/CGMES_2.4.15_27JAN2020/UnknownType.hpp b/CGMES_2.4.15_27JAN2020/UnknownType.hpp deleted file mode 100644 index 6cc8acd7e..000000000 --- a/CGMES_2.4.15_27JAN2020/UnknownType.hpp +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef UnknownType_H -#define UnknownType_H -#include -#include -#include -#include "BaseClass.hpp" - - -namespace CIMPP { - - class UnknownType: public BaseClass - { -public: - static const char debugName[]; - UnknownType(); - virtual ~UnknownType(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); - }; -} -#endif diff --git a/CGMES_2.4.15_27JAN2020/assignments.cpp b/CGMES_2.4.15_27JAN2020/assignments.cpp deleted file mode 100644 index 887a72dea..000000000 --- a/CGMES_2.4.15_27JAN2020/assignments.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include - -#include "Folders.hpp" -#include "CIMClassList.hpp" -#include "assignments.hpp" -#include -#include "BaseClass.hpp" - -using namespace CIMPP; - -static std::unordered_map dynamic_switch_factory(); -static std::unordered_map dynamic_switch = dynamic_switch_factory(); - -bool assign(BaseClass* CIMObj, const std::string& CIMAttrName, const std::string& Value) -{ - std::unordered_map::iterator prim_it = dynamic_switch.find(CIMAttrName); - if(prim_it != dynamic_switch.end()) { - std::stringstream str; - str << Value; - return (*prim_it->second)(str, CIMObj); - } - -#ifdef DEBUG - std::cerr << "Couldn't assign attribute with value: " << Value << " to " << CIMAttrName << " in object of type " << CIMObj->debugString() << std::endl; -#endif - return false; -} - -std::unordered_map dynamic_switch_factory() -{ - std::unordered_map assign_map; - for (const BaseClassDefiner& CIMClass : CIMClassList) - { - CIMClass.addPrimitiveAssignFnsToMap(assign_map); - } - - return assign_map; -} - diff --git a/CGMES_2.4.15_27JAN2020/assignments.hpp b/CGMES_2.4.15_27JAN2020/assignments.hpp deleted file mode 100644 index 1492ee219..000000000 --- a/CGMES_2.4.15_27JAN2020/assignments.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef ASSIGN_HPP -#define ASSIGN_HPP - -#include -#include "BaseClass.hpp" - -using namespace CIMPP; - -bool assign(BaseClass* CIMObj, const std::string& CIMAttrName, const std::string& Value); - -#endif // ASSIGN_HPP diff --git a/CMakeLists.txt b/CMakeLists.txt index 125aa2500..095d68c4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,10 +43,12 @@ add_subdirectory(arabica) #endif() file(GLOB_RECURSE SRC src/*.cpp) +file(GLOB_RECURSE CIM_STATIC static/*.cpp) file(GLOB_RECURSE CIM_SRC ${USE_CIM_VERSION}/*.cpp) -add_library(${PROJECT_NAME} ${SRC} ${CIM_SRC}) +add_library(${PROJECT_NAME} ${SRC} ${CIM_STATIC} ${CIM_SRC}) set_target_properties(${PROJECT_NAME} PROPERTIES OUTPUT_NAME "cimpp${USE_CIM_VERSION}") target_include_directories(${PROJECT_NAME} PUBLIC $) +target_include_directories(${PROJECT_NAME} PUBLIC $) target_include_directories(${PROJECT_NAME} PUBLIC $) target_link_libraries(${PROJECT_NAME} PUBLIC arabica) set_property(TARGET arabica PROPERTY POSITION_INDEPENDENT_CODE ON) @@ -59,7 +61,7 @@ install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) -install(DIRECTORY ${USE_CIM_VERSION} src +install(DIRECTORY ${USE_CIM_VERSION} static src DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/cimpp COMPONENT devel FILES_MATCHING diff --git a/CGMES_2.4.15/static/BaseClass.cpp b/static/BaseClass.cpp similarity index 100% rename from CGMES_2.4.15/static/BaseClass.cpp rename to static/BaseClass.cpp diff --git a/CGMES_2.4.15/static/BaseClass.h b/static/BaseClass.h similarity index 100% rename from CGMES_2.4.15/static/BaseClass.h rename to static/BaseClass.h diff --git a/CGMES_2.4.15/static/BaseClass.hpp b/static/BaseClass.hpp similarity index 100% rename from CGMES_2.4.15/static/BaseClass.hpp rename to static/BaseClass.hpp diff --git a/CGMES_2.4.15/static/BaseClassDefiner.cpp b/static/BaseClassDefiner.cpp similarity index 100% rename from CGMES_2.4.15/static/BaseClassDefiner.cpp rename to static/BaseClassDefiner.cpp diff --git a/CGMES_2.4.15/static/BaseClassDefiner.hpp b/static/BaseClassDefiner.hpp similarity index 100% rename from CGMES_2.4.15/static/BaseClassDefiner.hpp rename to static/BaseClassDefiner.hpp diff --git a/CGMES_2.4.15/static/Boolean.cpp b/static/Boolean.cpp similarity index 100% rename from CGMES_2.4.15/static/Boolean.cpp rename to static/Boolean.cpp diff --git a/CGMES_2.4.15/static/Boolean.hpp b/static/Boolean.hpp similarity index 100% rename from CGMES_2.4.15/static/Boolean.hpp rename to static/Boolean.hpp diff --git a/CGMES_2.4.15/static/CIMFactory.cpp b/static/CIMFactory.cpp similarity index 100% rename from CGMES_2.4.15/static/CIMFactory.cpp rename to static/CIMFactory.cpp diff --git a/CGMES_2.4.15/static/CIMFactory.hpp b/static/CIMFactory.hpp similarity index 100% rename from CGMES_2.4.15/static/CIMFactory.hpp rename to static/CIMFactory.hpp diff --git a/CGMES_2.4.15/static/Date.cpp b/static/Date.cpp similarity index 100% rename from CGMES_2.4.15/static/Date.cpp rename to static/Date.cpp diff --git a/CGMES_2.4.15/static/Date.hpp b/static/Date.hpp similarity index 100% rename from CGMES_2.4.15/static/Date.hpp rename to static/Date.hpp diff --git a/CGMES_2.4.15/static/Float.cpp b/static/Float.cpp similarity index 100% rename from CGMES_2.4.15/static/Float.cpp rename to static/Float.cpp diff --git a/CGMES_2.4.15/static/Float.hpp b/static/Float.hpp similarity index 100% rename from CGMES_2.4.15/static/Float.hpp rename to static/Float.hpp diff --git a/CGMES_2.4.15/static/Folders.hpp b/static/Folders.hpp similarity index 100% rename from CGMES_2.4.15/static/Folders.hpp rename to static/Folders.hpp diff --git a/CGMES_2.4.15/static/IEC61970/IEC61970CIMVersion.cpp b/static/IEC61970/IEC61970CIMVersion.cpp similarity index 100% rename from CGMES_2.4.15/static/IEC61970/IEC61970CIMVersion.cpp rename to static/IEC61970/IEC61970CIMVersion.cpp diff --git a/CGMES_2.4.15/static/IEC61970/IEC61970CIMVersion.h b/static/IEC61970/IEC61970CIMVersion.h similarity index 100% rename from CGMES_2.4.15/static/IEC61970/IEC61970CIMVersion.h rename to static/IEC61970/IEC61970CIMVersion.h diff --git a/CGMES_2.4.15/static/Integer.cpp b/static/Integer.cpp similarity index 100% rename from CGMES_2.4.15/static/Integer.cpp rename to static/Integer.cpp diff --git a/CGMES_2.4.15/static/Integer.hpp b/static/Integer.hpp similarity index 100% rename from CGMES_2.4.15/static/Integer.hpp rename to static/Integer.hpp diff --git a/CGMES_2.4.15/static/String.hpp b/static/String.hpp similarity index 100% rename from CGMES_2.4.15/static/String.hpp rename to static/String.hpp diff --git a/CGMES_2.4.15/static/Task.cpp b/static/Task.cpp similarity index 100% rename from CGMES_2.4.15/static/Task.cpp rename to static/Task.cpp diff --git a/CGMES_2.4.15/static/Task.hpp b/static/Task.hpp similarity index 100% rename from CGMES_2.4.15/static/Task.hpp rename to static/Task.hpp diff --git a/CGMES_2.4.15/static/UnknownType.cpp b/static/UnknownType.cpp similarity index 100% rename from CGMES_2.4.15/static/UnknownType.cpp rename to static/UnknownType.cpp diff --git a/CGMES_2.4.15/static/UnknownType.hpp b/static/UnknownType.hpp similarity index 100% rename from CGMES_2.4.15/static/UnknownType.hpp rename to static/UnknownType.hpp diff --git a/CGMES_2.4.15/static/assignments.cpp b/static/assignments.cpp similarity index 100% rename from CGMES_2.4.15/static/assignments.cpp rename to static/assignments.cpp diff --git a/CGMES_2.4.15/static/assignments.hpp b/static/assignments.hpp similarity index 100% rename from CGMES_2.4.15/static/assignments.hpp rename to static/assignments.hpp From 038504e8075f2bcf7e041fc5e90be9508ab51185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sun, 27 Oct 2024 21:23:19 +0100 Subject: [PATCH 8/9] Update generated + static cpp sources from https://github.com/tom-hg57/cimgen/tree/fix-class-and-attribute-types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Günther --- CGMES_2.4.15_16FEB2016/ACDCConverter.cpp | 496 ++--- CGMES_2.4.15_16FEB2016/ACDCConverter.hpp | 87 +- .../ACDCConverterDCTerminal.cpp | 88 +- .../ACDCConverterDCTerminal.hpp | 41 +- CGMES_2.4.15_16FEB2016/ACDCTerminal.cpp | 159 +- CGMES_2.4.15_16FEB2016/ACDCTerminal.hpp | 53 +- CGMES_2.4.15_16FEB2016/ACLineSegment.cpp | 257 +-- CGMES_2.4.15_16FEB2016/ACLineSegment.hpp | 57 +- CGMES_2.4.15_16FEB2016/Accumulator.cpp | 84 +- CGMES_2.4.15_16FEB2016/Accumulator.hpp | 43 +- CGMES_2.4.15_16FEB2016/AccumulatorLimit.cpp | 88 +- CGMES_2.4.15_16FEB2016/AccumulatorLimit.hpp | 41 +- .../AccumulatorLimitSet.cpp | 84 +- .../AccumulatorLimitSet.hpp | 43 +- CGMES_2.4.15_16FEB2016/AccumulatorReset.cpp | 67 +- CGMES_2.4.15_16FEB2016/AccumulatorReset.hpp | 39 +- CGMES_2.4.15_16FEB2016/AccumulatorValue.cpp | 116 +- CGMES_2.4.15_16FEB2016/AccumulatorValue.hpp | 45 +- CGMES_2.4.15_16FEB2016/ActivePower.cpp | 101 +- CGMES_2.4.15_16FEB2016/ActivePower.hpp | 43 +- CGMES_2.4.15_16FEB2016/ActivePowerLimit.cpp | 61 +- CGMES_2.4.15_16FEB2016/ActivePowerLimit.hpp | 37 +- .../ActivePowerPerCurrentFlow.cpp | 146 +- .../ActivePowerPerCurrentFlow.hpp | 58 +- .../ActivePowerPerFrequency.cpp | 146 +- .../ActivePowerPerFrequency.hpp | 57 +- CGMES_2.4.15_16FEB2016/Analog.cpp | 103 +- CGMES_2.4.15_16FEB2016/Analog.hpp | 45 +- CGMES_2.4.15_16FEB2016/AnalogControl.cpp | 111 +- CGMES_2.4.15_16FEB2016/AnalogControl.hpp | 43 +- CGMES_2.4.15_16FEB2016/AnalogLimit.cpp | 88 +- CGMES_2.4.15_16FEB2016/AnalogLimit.hpp | 41 +- CGMES_2.4.15_16FEB2016/AnalogLimitSet.cpp | 84 +- CGMES_2.4.15_16FEB2016/AnalogLimitSet.hpp | 43 +- CGMES_2.4.15_16FEB2016/AnalogValue.cpp | 116 +- CGMES_2.4.15_16FEB2016/AnalogValue.hpp | 45 +- CGMES_2.4.15_16FEB2016/AngleDegrees.cpp | 101 +- CGMES_2.4.15_16FEB2016/AngleDegrees.hpp | 43 +- CGMES_2.4.15_16FEB2016/AngleRadians.cpp | 101 +- CGMES_2.4.15_16FEB2016/AngleRadians.hpp | 43 +- CGMES_2.4.15_16FEB2016/ApparentPower.cpp | 101 +- CGMES_2.4.15_16FEB2016/ApparentPower.hpp | 43 +- CGMES_2.4.15_16FEB2016/ApparentPowerLimit.cpp | 61 +- CGMES_2.4.15_16FEB2016/ApparentPowerLimit.hpp | 37 +- CGMES_2.4.15_16FEB2016/Area.cpp | 101 +- CGMES_2.4.15_16FEB2016/Area.hpp | 43 +- .../AsynchronousMachine.cpp | 307 +-- .../AsynchronousMachine.hpp | 69 +- .../AsynchronousMachineDynamics.cpp | 145 +- .../AsynchronousMachineDynamics.hpp | 51 +- .../AsynchronousMachineEquivalentCircuit.cpp | 157 +- .../AsynchronousMachineEquivalentCircuit.hpp | 45 +- .../AsynchronousMachineKind.cpp | 63 +- .../AsynchronousMachineKind.hpp | 47 +- ...ynchronousMachineTimeConstantReactance.cpp | 163 +- ...ynchronousMachineTimeConstantReactance.hpp | 45 +- .../AsynchronousMachineUserDefined.cpp | 80 +- .../AsynchronousMachineUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/BaseVoltage.cpp | 149 +- CGMES_2.4.15_16FEB2016/BaseVoltage.hpp | 53 +- .../BasicIntervalSchedule.cpp | 108 +- .../BasicIntervalSchedule.hpp | 43 +- CGMES_2.4.15_16FEB2016/Bay.cpp | 67 +- CGMES_2.4.15_16FEB2016/Bay.hpp | 39 +- CGMES_2.4.15_16FEB2016/Breaker.cpp | 38 +- CGMES_2.4.15_16FEB2016/Breaker.hpp | 35 +- CGMES_2.4.15_16FEB2016/BusNameMarker.cpp | 109 +- CGMES_2.4.15_16FEB2016/BusNameMarker.hpp | 45 +- CGMES_2.4.15_16FEB2016/BusbarSection.cpp | 61 +- CGMES_2.4.15_16FEB2016/BusbarSection.hpp | 37 +- CGMES_2.4.15_16FEB2016/CIMClassList.hpp | 841 ++++---- CGMES_2.4.15_16FEB2016/Capacitance.cpp | 101 +- CGMES_2.4.15_16FEB2016/Capacitance.hpp | 43 +- .../CapacitancePerLength.cpp | 146 +- .../CapacitancePerLength.hpp | 57 +- CGMES_2.4.15_16FEB2016/Command.cpp | 136 +- CGMES_2.4.15_16FEB2016/Command.hpp | 47 +- CGMES_2.4.15_16FEB2016/Conductance.cpp | 101 +- CGMES_2.4.15_16FEB2016/Conductance.hpp | 43 +- .../ConductingEquipment.cpp | 118 +- .../ConductingEquipment.hpp | 47 +- CGMES_2.4.15_16FEB2016/Conductor.cpp | 61 +- CGMES_2.4.15_16FEB2016/Conductor.hpp | 37 +- CGMES_2.4.15_16FEB2016/ConformLoad.cpp | 67 +- CGMES_2.4.15_16FEB2016/ConformLoad.hpp | 39 +- CGMES_2.4.15_16FEB2016/ConformLoadGroup.cpp | 84 +- CGMES_2.4.15_16FEB2016/ConformLoadGroup.hpp | 43 +- .../ConformLoadSchedule.cpp | 67 +- .../ConformLoadSchedule.hpp | 39 +- CGMES_2.4.15_16FEB2016/ConnectivityNode.cpp | 212 +- CGMES_2.4.15_16FEB2016/ConnectivityNode.hpp | 61 +- .../ConnectivityNodeContainer.cpp | 82 +- .../ConnectivityNodeContainer.hpp | 43 +- CGMES_2.4.15_16FEB2016/Connector.cpp | 38 +- CGMES_2.4.15_16FEB2016/Connector.hpp | 35 +- CGMES_2.4.15_16FEB2016/Control.cpp | 170 +- CGMES_2.4.15_16FEB2016/Control.hpp | 53 +- CGMES_2.4.15_16FEB2016/ControlArea.cpp | 182 +- CGMES_2.4.15_16FEB2016/ControlArea.hpp | 55 +- .../ControlAreaGeneratingUnit.cpp | 96 +- .../ControlAreaGeneratingUnit.hpp | 43 +- .../ControlAreaTypeKind.cpp | 67 +- .../ControlAreaTypeKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/CoordinateSystem.cpp | 75 +- CGMES_2.4.15_16FEB2016/CoordinateSystem.hpp | 41 +- CGMES_2.4.15_16FEB2016/CsConverter.cpp | 390 ++-- CGMES_2.4.15_16FEB2016/CsConverter.hpp | 65 +- .../CsOperatingModeKind.cpp | 63 +- .../CsOperatingModeKind.hpp | 47 +- CGMES_2.4.15_16FEB2016/CsPpccControlKind.cpp | 67 +- CGMES_2.4.15_16FEB2016/CsPpccControlKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/Currency.cpp | 111 +- CGMES_2.4.15_16FEB2016/Currency.hpp | 143 +- CGMES_2.4.15_16FEB2016/CurrentFlow.cpp | 101 +- CGMES_2.4.15_16FEB2016/CurrentFlow.hpp | 43 +- CGMES_2.4.15_16FEB2016/CurrentLimit.cpp | 61 +- CGMES_2.4.15_16FEB2016/CurrentLimit.hpp | 37 +- CGMES_2.4.15_16FEB2016/Curve.cpp | 149 +- CGMES_2.4.15_16FEB2016/Curve.hpp | 47 +- CGMES_2.4.15_16FEB2016/CurveData.cpp | 134 +- CGMES_2.4.15_16FEB2016/CurveData.hpp | 45 +- CGMES_2.4.15_16FEB2016/CurveStyle.cpp | 63 +- CGMES_2.4.15_16FEB2016/CurveStyle.hpp | 47 +- CGMES_2.4.15_16FEB2016/DCBaseTerminal.cpp | 92 +- CGMES_2.4.15_16FEB2016/DCBaseTerminal.hpp | 43 +- CGMES_2.4.15_16FEB2016/DCBreaker.cpp | 38 +- CGMES_2.4.15_16FEB2016/DCBreaker.hpp | 35 +- CGMES_2.4.15_16FEB2016/DCBusbar.cpp | 38 +- CGMES_2.4.15_16FEB2016/DCBusbar.hpp | 35 +- CGMES_2.4.15_16FEB2016/DCChopper.cpp | 38 +- CGMES_2.4.15_16FEB2016/DCChopper.hpp | 35 +- .../DCConductingEquipment.cpp | 61 +- .../DCConductingEquipment.hpp | 39 +- .../DCConverterOperatingModeKind.cpp | 67 +- .../DCConverterOperatingModeKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/DCConverterUnit.cpp | 88 +- CGMES_2.4.15_16FEB2016/DCConverterUnit.hpp | 41 +- CGMES_2.4.15_16FEB2016/DCDisconnector.cpp | 38 +- CGMES_2.4.15_16FEB2016/DCDisconnector.hpp | 35 +- .../DCEquipmentContainer.cpp | 82 +- .../DCEquipmentContainer.hpp | 43 +- CGMES_2.4.15_16FEB2016/DCGround.cpp | 84 +- CGMES_2.4.15_16FEB2016/DCGround.hpp | 39 +- CGMES_2.4.15_16FEB2016/DCLine.cpp | 67 +- CGMES_2.4.15_16FEB2016/DCLine.hpp | 39 +- CGMES_2.4.15_16FEB2016/DCLineSegment.cpp | 161 +- CGMES_2.4.15_16FEB2016/DCLineSegment.hpp | 49 +- CGMES_2.4.15_16FEB2016/DCNode.cpp | 117 +- CGMES_2.4.15_16FEB2016/DCNode.hpp | 47 +- CGMES_2.4.15_16FEB2016/DCPolarityKind.cpp | 67 +- CGMES_2.4.15_16FEB2016/DCPolarityKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/DCSeriesDevice.cpp | 111 +- CGMES_2.4.15_16FEB2016/DCSeriesDevice.hpp | 41 +- CGMES_2.4.15_16FEB2016/DCShunt.cpp | 111 +- CGMES_2.4.15_16FEB2016/DCShunt.hpp | 41 +- CGMES_2.4.15_16FEB2016/DCSwitch.cpp | 38 +- CGMES_2.4.15_16FEB2016/DCSwitch.hpp | 35 +- CGMES_2.4.15_16FEB2016/DCTerminal.cpp | 67 +- CGMES_2.4.15_16FEB2016/DCTerminal.hpp | 39 +- .../DCTopologicalIsland.cpp | 61 +- .../DCTopologicalIsland.hpp | 39 +- CGMES_2.4.15_16FEB2016/DCTopologicalNode.cpp | 141 +- CGMES_2.4.15_16FEB2016/DCTopologicalNode.hpp | 51 +- CGMES_2.4.15_16FEB2016/Date.cpp | 49 + CGMES_2.4.15_16FEB2016/Date.hpp | 35 + CGMES_2.4.15_16FEB2016/DateTime.cpp | 58 +- CGMES_2.4.15_16FEB2016/DateTime.hpp | 45 +- CGMES_2.4.15_16FEB2016/DayType.cpp | 61 +- CGMES_2.4.15_16FEB2016/DayType.hpp | 39 +- CGMES_2.4.15_16FEB2016/Decimal.cpp | 74 +- CGMES_2.4.15_16FEB2016/Decimal.hpp | 49 +- CGMES_2.4.15_16FEB2016/Diagram.cpp | 203 +- CGMES_2.4.15_16FEB2016/Diagram.hpp | 53 +- .../DiagramLayoutVersion.cpp | 158 +- .../DiagramLayoutVersion.hpp | 57 +- CGMES_2.4.15_16FEB2016/DiagramObject.cpp | 302 +-- CGMES_2.4.15_16FEB2016/DiagramObject.hpp | 69 +- .../DiagramObjectGluePoint.cpp | 66 +- .../DiagramObjectGluePoint.hpp | 39 +- CGMES_2.4.15_16FEB2016/DiagramObjectPoint.cpp | 186 +- CGMES_2.4.15_16FEB2016/DiagramObjectPoint.hpp | 51 +- CGMES_2.4.15_16FEB2016/DiagramObjectStyle.cpp | 61 +- CGMES_2.4.15_16FEB2016/DiagramObjectStyle.hpp | 39 +- CGMES_2.4.15_16FEB2016/DiagramStyle.cpp | 61 +- CGMES_2.4.15_16FEB2016/DiagramStyle.hpp | 39 +- .../DiscExcContIEEEDEC1A.cpp | 482 ++--- .../DiscExcContIEEEDEC1A.hpp | 71 +- .../DiscExcContIEEEDEC2A.cpp | 159 +- .../DiscExcContIEEEDEC2A.hpp | 45 +- .../DiscExcContIEEEDEC3A.cpp | 88 +- .../DiscExcContIEEEDEC3A.hpp | 39 +- CGMES_2.4.15_16FEB2016/Disconnector.cpp | 38 +- CGMES_2.4.15_16FEB2016/Disconnector.hpp | 35 +- ...DiscontinuousExcitationControlDynamics.cpp | 95 +- ...DiscontinuousExcitationControlDynamics.hpp | 43 +- ...continuousExcitationControlUserDefined.cpp | 80 +- ...continuousExcitationControlUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/Discrete.cpp | 88 +- CGMES_2.4.15_16FEB2016/Discrete.hpp | 43 +- CGMES_2.4.15_16FEB2016/DiscreteValue.cpp | 116 +- CGMES_2.4.15_16FEB2016/DiscreteValue.hpp | 45 +- .../DroopSignalFeedbackKind.cpp | 71 +- .../DroopSignalFeedbackKind.hpp | 63 +- .../DynamicsFunctionBlock.cpp | 61 +- .../DynamicsFunctionBlock.hpp | 37 +- CGMES_2.4.15_16FEB2016/DynamicsVersion.cpp | 158 +- CGMES_2.4.15_16FEB2016/DynamicsVersion.hpp | 57 +- .../EarthFaultCompensator.cpp | 61 +- .../EarthFaultCompensator.hpp | 37 +- CGMES_2.4.15_16FEB2016/EnergyArea.cpp | 66 +- CGMES_2.4.15_16FEB2016/EnergyArea.hpp | 39 +- CGMES_2.4.15_16FEB2016/EnergyConsumer.cpp | 240 +-- CGMES_2.4.15_16FEB2016/EnergyConsumer.hpp | 55 +- .../EnergySchedulingType.cpp | 61 +- .../EnergySchedulingType.hpp | 39 +- CGMES_2.4.15_16FEB2016/EnergySource.cpp | 386 ++-- CGMES_2.4.15_16FEB2016/EnergySource.hpp | 71 +- CGMES_2.4.15_16FEB2016/Equipment.cpp | 109 +- CGMES_2.4.15_16FEB2016/Equipment.hpp | 45 +- .../EquipmentBoundaryVersion.cpp | 168 +- .../EquipmentBoundaryVersion.hpp | 59 +- CGMES_2.4.15_16FEB2016/EquipmentContainer.cpp | 61 +- CGMES_2.4.15_16FEB2016/EquipmentContainer.hpp | 39 +- CGMES_2.4.15_16FEB2016/EquipmentVersion.cpp | 198 +- CGMES_2.4.15_16FEB2016/EquipmentVersion.hpp | 65 +- CGMES_2.4.15_16FEB2016/EquivalentBranch.cpp | 414 ++-- CGMES_2.4.15_16FEB2016/EquivalentBranch.hpp | 69 +- .../EquivalentEquipment.cpp | 67 +- .../EquivalentEquipment.hpp | 39 +- .../EquivalentInjection.cpp | 432 +++-- .../EquivalentInjection.hpp | 73 +- CGMES_2.4.15_16FEB2016/EquivalentNetwork.cpp | 61 +- CGMES_2.4.15_16FEB2016/EquivalentNetwork.hpp | 39 +- CGMES_2.4.15_16FEB2016/EquivalentShunt.cpp | 84 +- CGMES_2.4.15_16FEB2016/EquivalentShunt.hpp | 41 +- CGMES_2.4.15_16FEB2016/ExcAC1A.cpp | 584 +++--- CGMES_2.4.15_16FEB2016/ExcAC1A.hpp | 83 +- CGMES_2.4.15_16FEB2016/ExcAC2A.cpp | 780 ++++---- CGMES_2.4.15_16FEB2016/ExcAC2A.hpp | 95 +- CGMES_2.4.15_16FEB2016/ExcAC3A.cpp | 722 +++---- CGMES_2.4.15_16FEB2016/ExcAC3A.hpp | 89 +- CGMES_2.4.15_16FEB2016/ExcAC4A.cpp | 257 +-- CGMES_2.4.15_16FEB2016/ExcAC4A.hpp | 53 +- CGMES_2.4.15_16FEB2016/ExcAC5A.cpp | 486 ++--- CGMES_2.4.15_16FEB2016/ExcAC5A.hpp | 71 +- CGMES_2.4.15_16FEB2016/ExcAC6A.cpp | 609 +++--- CGMES_2.4.15_16FEB2016/ExcAC6A.hpp | 81 +- CGMES_2.4.15_16FEB2016/ExcAC8B.cpp | 701 +++---- CGMES_2.4.15_16FEB2016/ExcAC8B.hpp | 91 +- CGMES_2.4.15_16FEB2016/ExcANS.cpp | 410 ++-- CGMES_2.4.15_16FEB2016/ExcANS.hpp | 67 +- CGMES_2.4.15_16FEB2016/ExcAVR1.cpp | 356 ++-- CGMES_2.4.15_16FEB2016/ExcAVR1.hpp | 61 +- CGMES_2.4.15_16FEB2016/ExcAVR2.cpp | 383 ++-- CGMES_2.4.15_16FEB2016/ExcAVR2.hpp | 63 +- CGMES_2.4.15_16FEB2016/ExcAVR3.cpp | 350 ++-- CGMES_2.4.15_16FEB2016/ExcAVR3.hpp | 61 +- CGMES_2.4.15_16FEB2016/ExcAVR4.cpp | 410 ++-- CGMES_2.4.15_16FEB2016/ExcAVR4.hpp | 67 +- CGMES_2.4.15_16FEB2016/ExcAVR5.cpp | 111 +- CGMES_2.4.15_16FEB2016/ExcAVR5.hpp | 41 +- CGMES_2.4.15_16FEB2016/ExcAVR7.cpp | 553 +++--- CGMES_2.4.15_16FEB2016/ExcAVR7.hpp | 77 +- CGMES_2.4.15_16FEB2016/ExcBBC.cpp | 327 ++-- CGMES_2.4.15_16FEB2016/ExcBBC.hpp | 61 +- CGMES_2.4.15_16FEB2016/ExcCZ.cpp | 290 +-- CGMES_2.4.15_16FEB2016/ExcCZ.hpp | 55 +- CGMES_2.4.15_16FEB2016/ExcDC1A.cpp | 488 ++--- CGMES_2.4.15_16FEB2016/ExcDC1A.hpp | 73 +- CGMES_2.4.15_16FEB2016/ExcDC2A.cpp | 484 ++--- CGMES_2.4.15_16FEB2016/ExcDC2A.hpp | 73 +- CGMES_2.4.15_16FEB2016/ExcDC3A.cpp | 440 +++-- CGMES_2.4.15_16FEB2016/ExcDC3A.hpp | 71 +- CGMES_2.4.15_16FEB2016/ExcDC3A1.cpp | 406 ++-- CGMES_2.4.15_16FEB2016/ExcDC3A1.hpp | 65 +- CGMES_2.4.15_16FEB2016/ExcELIN1.cpp | 411 ++-- CGMES_2.4.15_16FEB2016/ExcELIN1.hpp | 67 +- CGMES_2.4.15_16FEB2016/ExcELIN2.cpp | 747 ++++---- CGMES_2.4.15_16FEB2016/ExcELIN2.hpp | 89 +- CGMES_2.4.15_16FEB2016/ExcHU.cpp | 356 ++-- CGMES_2.4.15_16FEB2016/ExcHU.hpp | 61 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.cpp | 486 ++--- CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.hpp | 73 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.cpp | 563 +++--- CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.hpp | 79 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.cpp | 565 +++--- CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.hpp | 79 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.cpp | 257 +-- CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.hpp | 53 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.cpp | 404 ++-- CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.hpp | 63 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.cpp | 586 +++--- CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.hpp | 79 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.cpp | 722 +++---- CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.hpp | 87 +- CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.cpp | 486 ++--- CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.hpp | 71 +- CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.cpp | 440 +++-- CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.hpp | 69 +- CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.cpp | 406 ++-- CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.hpp | 71 +- CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.cpp | 335 ++-- CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.hpp | 61 +- CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.cpp | 513 ++--- CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.hpp | 75 +- CGMES_2.4.15_16FEB2016/ExcIEEEST1A.cpp | 475 ++--- CGMES_2.4.15_16FEB2016/ExcIEEEST1A.hpp | 77 +- .../ExcIEEEST1AUELselectorKind.cpp | 71 +- .../ExcIEEEST1AUELselectorKind.hpp | 63 +- CGMES_2.4.15_16FEB2016/ExcIEEEST2A.cpp | 381 ++-- CGMES_2.4.15_16FEB2016/ExcIEEEST2A.hpp | 63 +- CGMES_2.4.15_16FEB2016/ExcIEEEST3A.cpp | 530 ++--- CGMES_2.4.15_16FEB2016/ExcIEEEST3A.hpp | 77 +- CGMES_2.4.15_16FEB2016/ExcIEEEST4B.cpp | 432 +++-- CGMES_2.4.15_16FEB2016/ExcIEEEST4B.hpp | 69 +- CGMES_2.4.15_16FEB2016/ExcIEEEST5B.cpp | 453 ++--- CGMES_2.4.15_16FEB2016/ExcIEEEST5B.hpp | 69 +- CGMES_2.4.15_16FEB2016/ExcIEEEST6B.cpp | 380 ++-- CGMES_2.4.15_16FEB2016/ExcIEEEST6B.hpp | 65 +- CGMES_2.4.15_16FEB2016/ExcIEEEST7B.cpp | 383 ++-- CGMES_2.4.15_16FEB2016/ExcIEEEST7B.hpp | 69 +- CGMES_2.4.15_16FEB2016/ExcOEX3T.cpp | 513 ++--- CGMES_2.4.15_16FEB2016/ExcOEX3T.hpp | 75 +- CGMES_2.4.15_16FEB2016/ExcPIC.cpp | 613 +++--- CGMES_2.4.15_16FEB2016/ExcPIC.hpp | 81 +- CGMES_2.4.15_16FEB2016/ExcREXS.cpp | 926 ++++----- CGMES_2.4.15_16FEB2016/ExcREXS.hpp | 109 +- .../ExcREXSFeedbackSignalKind.cpp | 67 +- .../ExcREXSFeedbackSignalKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/ExcSCRX.cpp | 240 +-- CGMES_2.4.15_16FEB2016/ExcSCRX.hpp | 57 +- CGMES_2.4.15_16FEB2016/ExcSEXS.cpp | 296 +-- CGMES_2.4.15_16FEB2016/ExcSEXS.hpp | 59 +- CGMES_2.4.15_16FEB2016/ExcSK.cpp | 826 ++++---- CGMES_2.4.15_16FEB2016/ExcSK.hpp | 103 +- CGMES_2.4.15_16FEB2016/ExcST1A.cpp | 484 ++--- CGMES_2.4.15_16FEB2016/ExcST1A.hpp | 71 +- CGMES_2.4.15_16FEB2016/ExcST2A.cpp | 413 ++-- CGMES_2.4.15_16FEB2016/ExcST2A.hpp | 67 +- CGMES_2.4.15_16FEB2016/ExcST3A.cpp | 530 ++--- CGMES_2.4.15_16FEB2016/ExcST3A.hpp | 77 +- CGMES_2.4.15_16FEB2016/ExcST4B.cpp | 511 ++--- CGMES_2.4.15_16FEB2016/ExcST4B.hpp | 77 +- CGMES_2.4.15_16FEB2016/ExcST6B.cpp | 567 +++--- CGMES_2.4.15_16FEB2016/ExcST6B.hpp | 83 +- .../ExcST6BOELselectorKind.cpp | 67 +- .../ExcST6BOELselectorKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/ExcST7B.cpp | 406 ++-- CGMES_2.4.15_16FEB2016/ExcST7B.hpp | 71 +- .../ExcST7BOELselectorKind.cpp | 71 +- .../ExcST7BOELselectorKind.hpp | 63 +- .../ExcST7BUELselectorKind.cpp | 71 +- .../ExcST7BUELselectorKind.hpp | 63 +- .../ExcitationSystemDynamics.cpp | 261 ++- .../ExcitationSystemDynamics.hpp | 69 +- .../ExcitationSystemUserDefined.cpp | 80 +- .../ExcitationSystemUserDefined.hpp | 41 +- .../ExternalNetworkInjection.cpp | 475 ++--- .../ExternalNetworkInjection.hpp | 79 +- CGMES_2.4.15_16FEB2016/Float.cpp | 77 + CGMES_2.4.15_16FEB2016/Float.hpp | 39 + CGMES_2.4.15_16FEB2016/FossilFuel.cpp | 88 +- CGMES_2.4.15_16FEB2016/FossilFuel.hpp | 41 +- .../FrancisGovernorControlKind.cpp | 67 +- .../FrancisGovernorControlKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/Frequency.cpp | 101 +- CGMES_2.4.15_16FEB2016/Frequency.hpp | 43 +- CGMES_2.4.15_16FEB2016/FuelType.cpp | 79 +- CGMES_2.4.15_16FEB2016/FuelType.hpp | 79 +- .../GenICompensationForGenJ.cpp | 140 +- .../GenICompensationForGenJ.hpp | 47 +- CGMES_2.4.15_16FEB2016/GeneratingUnit.cpp | 471 ++--- CGMES_2.4.15_16FEB2016/GeneratingUnit.hpp | 83 +- .../GeneratorControlSource.cpp | 71 +- .../GeneratorControlSource.hpp | 63 +- .../GenericNonLinearLoadModelKind.cpp | 63 +- .../GenericNonLinearLoadModelKind.hpp | 47 +- .../GeographicalLocationVersion.cpp | 158 +- .../GeographicalLocationVersion.hpp | 57 +- CGMES_2.4.15_16FEB2016/GeographicalRegion.cpp | 61 +- CGMES_2.4.15_16FEB2016/GeographicalRegion.hpp | 39 +- CGMES_2.4.15_16FEB2016/GovCT1.cpp | 975 +++++----- CGMES_2.4.15_16FEB2016/GovCT1.hpp | 109 +- CGMES_2.4.15_16FEB2016/GovCT2.cpp | 1566 +++++++-------- CGMES_2.4.15_16FEB2016/GovCT2.hpp | 153 +- CGMES_2.4.15_16FEB2016/GovGAST.cpp | 286 +-- CGMES_2.4.15_16FEB2016/GovGAST.hpp | 55 +- CGMES_2.4.15_16FEB2016/GovGAST1.cpp | 944 ++++----- CGMES_2.4.15_16FEB2016/GovGAST1.hpp | 105 +- CGMES_2.4.15_16FEB2016/GovGAST2.cpp | 904 ++++----- CGMES_2.4.15_16FEB2016/GovGAST2.hpp | 101 +- CGMES_2.4.15_16FEB2016/GovGAST3.cpp | 569 +++--- CGMES_2.4.15_16FEB2016/GovGAST3.hpp | 77 +- CGMES_2.4.15_16FEB2016/GovGAST4.cpp | 331 ++-- CGMES_2.4.15_16FEB2016/GovGAST4.hpp | 57 +- CGMES_2.4.15_16FEB2016/GovGASTWD.cpp | 925 ++++----- CGMES_2.4.15_16FEB2016/GovGASTWD.hpp | 101 +- CGMES_2.4.15_16FEB2016/GovHydro1.cpp | 408 ++-- CGMES_2.4.15_16FEB2016/GovHydro1.hpp | 63 +- CGMES_2.4.15_16FEB2016/GovHydro2.cpp | 807 ++++---- CGMES_2.4.15_16FEB2016/GovHydro2.hpp | 97 +- CGMES_2.4.15_16FEB2016/GovHydro3.cpp | 1000 +++++----- CGMES_2.4.15_16FEB2016/GovHydro3.hpp | 111 +- CGMES_2.4.15_16FEB2016/GovHydro4.cpp | 1054 +++++----- CGMES_2.4.15_16FEB2016/GovHydro4.hpp | 115 +- CGMES_2.4.15_16FEB2016/GovHydroDD.cpp | 973 +++++----- CGMES_2.4.15_16FEB2016/GovHydroDD.hpp | 109 +- CGMES_2.4.15_16FEB2016/GovHydroFrancis.cpp | 702 +++---- CGMES_2.4.15_16FEB2016/GovHydroFrancis.hpp | 97 +- CGMES_2.4.15_16FEB2016/GovHydroIEEE0.cpp | 232 +-- CGMES_2.4.15_16FEB2016/GovHydroIEEE0.hpp | 51 +- CGMES_2.4.15_16FEB2016/GovHydroIEEE2.cpp | 724 +++---- CGMES_2.4.15_16FEB2016/GovHydroIEEE2.hpp | 89 +- CGMES_2.4.15_16FEB2016/GovHydroPID.cpp | 919 ++++----- CGMES_2.4.15_16FEB2016/GovHydroPID.hpp | 105 +- CGMES_2.4.15_16FEB2016/GovHydroPID2.cpp | 594 +++--- CGMES_2.4.15_16FEB2016/GovHydroPID2.hpp | 83 +- CGMES_2.4.15_16FEB2016/GovHydroPelton.cpp | 727 +++---- CGMES_2.4.15_16FEB2016/GovHydroPelton.hpp | 97 +- CGMES_2.4.15_16FEB2016/GovHydroR.cpp | 1168 +++++------ CGMES_2.4.15_16FEB2016/GovHydroR.hpp | 123 +- CGMES_2.4.15_16FEB2016/GovHydroWEH.cpp | 1371 ++++++------- CGMES_2.4.15_16FEB2016/GovHydroWEH.hpp | 143 +- CGMES_2.4.15_16FEB2016/GovHydroWPID.cpp | 586 +++--- CGMES_2.4.15_16FEB2016/GovHydroWPID.hpp | 81 +- CGMES_2.4.15_16FEB2016/GovSteam0.cpp | 232 +-- CGMES_2.4.15_16FEB2016/GovSteam0.hpp | 51 +- CGMES_2.4.15_16FEB2016/GovSteam1.cpp | 1085 ++++++----- CGMES_2.4.15_16FEB2016/GovSteam1.hpp | 117 +- CGMES_2.4.15_16FEB2016/GovSteam2.cpp | 238 +-- CGMES_2.4.15_16FEB2016/GovSteam2.hpp | 53 +- CGMES_2.4.15_16FEB2016/GovSteamCC.cpp | 459 ++--- CGMES_2.4.15_16FEB2016/GovSteamCC.hpp | 69 +- CGMES_2.4.15_16FEB2016/GovSteamEU.cpp | 987 +++++----- CGMES_2.4.15_16FEB2016/GovSteamEU.hpp | 107 +- CGMES_2.4.15_16FEB2016/GovSteamFV2.cpp | 375 ++-- CGMES_2.4.15_16FEB2016/GovSteamFV2.hpp | 61 +- CGMES_2.4.15_16FEB2016/GovSteamFV3.cpp | 509 ++--- CGMES_2.4.15_16FEB2016/GovSteamFV3.hpp | 73 +- CGMES_2.4.15_16FEB2016/GovSteamFV4.cpp | 1403 +++++++------- CGMES_2.4.15_16FEB2016/GovSteamFV4.hpp | 139 +- CGMES_2.4.15_16FEB2016/GovSteamIEEE1.cpp | 563 +++--- CGMES_2.4.15_16FEB2016/GovSteamIEEE1.hpp | 77 +- CGMES_2.4.15_16FEB2016/GovSteamSGO.cpp | 350 ++-- CGMES_2.4.15_16FEB2016/GovSteamSGO.hpp | 61 +- .../GrossToNetActivePowerCurve.cpp | 67 +- .../GrossToNetActivePowerCurve.hpp | 39 +- CGMES_2.4.15_16FEB2016/Ground.cpp | 38 +- CGMES_2.4.15_16FEB2016/Ground.hpp | 35 +- CGMES_2.4.15_16FEB2016/GroundDisconnector.cpp | 38 +- CGMES_2.4.15_16FEB2016/GroundDisconnector.hpp | 35 +- CGMES_2.4.15_16FEB2016/GroundingImpedance.cpp | 61 +- CGMES_2.4.15_16FEB2016/GroundingImpedance.hpp | 37 +- .../HydroEnergyConversionKind.cpp | 63 +- .../HydroEnergyConversionKind.hpp | 47 +- .../HydroGeneratingUnit.cpp | 88 +- .../HydroGeneratingUnit.hpp | 41 +- .../HydroPlantStorageKind.cpp | 67 +- .../HydroPlantStorageKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/HydroPowerPlant.cpp | 103 +- CGMES_2.4.15_16FEB2016/HydroPowerPlant.hpp | 45 +- CGMES_2.4.15_16FEB2016/HydroPump.cpp | 92 +- CGMES_2.4.15_16FEB2016/HydroPump.hpp | 43 +- CGMES_2.4.15_16FEB2016/IEC61970.hpp | 47 +- CGMES_2.4.15_16FEB2016/IdentifiedObject.cpp | 123 +- CGMES_2.4.15_16FEB2016/IdentifiedObject.hpp | 49 +- CGMES_2.4.15_16FEB2016/IfdBaseKind.cpp | 71 +- CGMES_2.4.15_16FEB2016/IfdBaseKind.hpp | 63 +- CGMES_2.4.15_16FEB2016/Inductance.cpp | 101 +- CGMES_2.4.15_16FEB2016/Inductance.hpp | 43 +- .../InductancePerLength.cpp | 146 +- .../InductancePerLength.hpp | 57 +- CGMES_2.4.15_16FEB2016/InputSignalKind.cpp | 95 +- CGMES_2.4.15_16FEB2016/InputSignalKind.hpp | 111 +- CGMES_2.4.15_16FEB2016/Junction.cpp | 38 +- CGMES_2.4.15_16FEB2016/Junction.hpp | 35 +- CGMES_2.4.15_16FEB2016/Length.cpp | 101 +- CGMES_2.4.15_16FEB2016/Length.hpp | 43 +- CGMES_2.4.15_16FEB2016/Limit.cpp | 38 +- CGMES_2.4.15_16FEB2016/Limit.hpp | 35 +- CGMES_2.4.15_16FEB2016/LimitSet.cpp | 61 +- CGMES_2.4.15_16FEB2016/LimitSet.hpp | 37 +- CGMES_2.4.15_16FEB2016/LimitTypeKind.cpp | 83 +- CGMES_2.4.15_16FEB2016/LimitTypeKind.hpp | 87 +- CGMES_2.4.15_16FEB2016/Line.cpp | 67 +- CGMES_2.4.15_16FEB2016/Line.hpp | 39 +- .../LinearShuntCompensator.cpp | 136 +- .../LinearShuntCompensator.hpp | 45 +- CGMES_2.4.15_16FEB2016/LoadAggregate.cpp | 94 +- CGMES_2.4.15_16FEB2016/LoadAggregate.hpp | 43 +- CGMES_2.4.15_16FEB2016/LoadArea.cpp | 61 +- CGMES_2.4.15_16FEB2016/LoadArea.hpp | 39 +- CGMES_2.4.15_16FEB2016/LoadBreakSwitch.cpp | 38 +- CGMES_2.4.15_16FEB2016/LoadBreakSwitch.hpp | 35 +- CGMES_2.4.15_16FEB2016/LoadComposite.cpp | 323 ++-- CGMES_2.4.15_16FEB2016/LoadComposite.hpp | 59 +- CGMES_2.4.15_16FEB2016/LoadDynamics.cpp | 61 +- CGMES_2.4.15_16FEB2016/LoadDynamics.hpp | 39 +- .../LoadGenericNonLinear.cpp | 259 +-- .../LoadGenericNonLinear.hpp | 55 +- CGMES_2.4.15_16FEB2016/LoadGroup.cpp | 67 +- CGMES_2.4.15_16FEB2016/LoadGroup.hpp | 39 +- CGMES_2.4.15_16FEB2016/LoadMotor.cpp | 402 ++-- CGMES_2.4.15_16FEB2016/LoadMotor.hpp | 67 +- .../LoadResponseCharacteristic.cpp | 334 ++-- .../LoadResponseCharacteristic.hpp | 61 +- CGMES_2.4.15_16FEB2016/LoadStatic.cpp | 474 ++--- CGMES_2.4.15_16FEB2016/LoadStatic.hpp | 75 +- CGMES_2.4.15_16FEB2016/LoadUserDefined.cpp | 80 +- CGMES_2.4.15_16FEB2016/LoadUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/Location.cpp | 117 +- CGMES_2.4.15_16FEB2016/Location.hpp | 47 +- CGMES_2.4.15_16FEB2016/Measurement.cpp | 177 +- CGMES_2.4.15_16FEB2016/Measurement.hpp | 55 +- CGMES_2.4.15_16FEB2016/MeasurementValue.cpp | 136 +- CGMES_2.4.15_16FEB2016/MeasurementValue.hpp | 49 +- .../MeasurementValueQuality.cpp | 67 +- .../MeasurementValueQuality.hpp | 39 +- .../MeasurementValueSource.cpp | 61 +- .../MeasurementValueSource.hpp | 39 +- CGMES_2.4.15_16FEB2016/MechLoad1.cpp | 130 +- CGMES_2.4.15_16FEB2016/MechLoad1.hpp | 43 +- .../MechanicalLoadDynamics.cpp | 96 +- .../MechanicalLoadDynamics.hpp | 43 +- .../MechanicalLoadUserDefined.cpp | 80 +- .../MechanicalLoadUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/Money.cpp | 101 +- CGMES_2.4.15_16FEB2016/Money.hpp | 43 +- CGMES_2.4.15_16FEB2016/MonthDay.cpp | 58 +- CGMES_2.4.15_16FEB2016/MonthDay.hpp | 45 +- CGMES_2.4.15_16FEB2016/MutualCoupling.cpp | 280 +-- CGMES_2.4.15_16FEB2016/MutualCoupling.hpp | 63 +- CGMES_2.4.15_16FEB2016/NonConformLoad.cpp | 67 +- CGMES_2.4.15_16FEB2016/NonConformLoad.hpp | 39 +- .../NonConformLoadGroup.cpp | 82 +- .../NonConformLoadGroup.hpp | 43 +- .../NonConformLoadSchedule.cpp | 67 +- .../NonConformLoadSchedule.hpp | 39 +- .../NonlinearShuntCompensator.cpp | 61 +- .../NonlinearShuntCompensator.hpp | 39 +- .../NonlinearShuntCompensatorPoint.cpp | 188 +- .../NonlinearShuntCompensatorPoint.hpp | 51 +- .../NuclearGeneratingUnit.cpp | 38 +- .../NuclearGeneratingUnit.hpp | 35 +- CGMES_2.4.15_16FEB2016/OperationalLimit.cpp | 92 +- CGMES_2.4.15_16FEB2016/OperationalLimit.hpp | 43 +- .../OperationalLimitDirectionKind.cpp | 67 +- .../OperationalLimitDirectionKind.hpp | 55 +- .../OperationalLimitSet.cpp | 117 +- .../OperationalLimitSet.hpp | 47 +- .../OperationalLimitType.cpp | 130 +- .../OperationalLimitType.hpp | 47 +- CGMES_2.4.15_16FEB2016/OrientationKind.cpp | 59 +- CGMES_2.4.15_16FEB2016/OrientationKind.hpp | 39 +- CGMES_2.4.15_16FEB2016/OverexcLim2.cpp | 132 +- CGMES_2.4.15_16FEB2016/OverexcLim2.hpp | 43 +- CGMES_2.4.15_16FEB2016/OverexcLimIEEE.cpp | 182 +- CGMES_2.4.15_16FEB2016/OverexcLimIEEE.hpp | 47 +- CGMES_2.4.15_16FEB2016/OverexcLimX1.cpp | 288 +-- CGMES_2.4.15_16FEB2016/OverexcLimX1.hpp | 55 +- CGMES_2.4.15_16FEB2016/OverexcLimX2.cpp | 327 ++-- CGMES_2.4.15_16FEB2016/OverexcLimX2.hpp | 57 +- .../OverexcitationLimiterDynamics.cpp | 67 +- .../OverexcitationLimiterDynamics.hpp | 39 +- .../OverexcitationLimiterUserDefined.cpp | 80 +- .../OverexcitationLimiterUserDefined.hpp | 41 +- .../PFVArControllerType1Dynamics.cpp | 121 +- .../PFVArControllerType1Dynamics.hpp | 47 +- .../PFVArControllerType1UserDefined.cpp | 80 +- .../PFVArControllerType1UserDefined.hpp | 41 +- .../PFVArControllerType2Dynamics.cpp | 67 +- .../PFVArControllerType2Dynamics.hpp | 39 +- .../PFVArControllerType2UserDefined.cpp | 80 +- .../PFVArControllerType2UserDefined.hpp | 41 +- .../PFVArType1IEEEPFController.cpp | 222 ++- .../PFVArType1IEEEPFController.hpp | 53 +- .../PFVArType1IEEEVArController.cpp | 176 +- .../PFVArType1IEEEVArController.hpp | 49 +- CGMES_2.4.15_16FEB2016/PFVArType2Common1.cpp | 155 +- CGMES_2.4.15_16FEB2016/PFVArType2Common1.hpp | 45 +- .../PFVArType2IEEEPFController.cpp | 209 +- .../PFVArType2IEEEPFController.hpp | 51 +- .../PFVArType2IEEEVArController.cpp | 209 +- .../PFVArType2IEEEVArController.hpp | 51 +- CGMES_2.4.15_16FEB2016/PU.cpp | 101 +- CGMES_2.4.15_16FEB2016/PU.hpp | 43 +- CGMES_2.4.15_16FEB2016/PerCent.cpp | 101 +- CGMES_2.4.15_16FEB2016/PerCent.hpp | 43 +- .../PerLengthDCLineParameter.cpp | 117 +- .../PerLengthDCLineParameter.hpp | 54 +- CGMES_2.4.15_16FEB2016/PetersenCoil.cpp | 199 +- CGMES_2.4.15_16FEB2016/PetersenCoil.hpp | 53 +- .../PetersenCoilModeKind.cpp | 67 +- .../PetersenCoilModeKind.hpp | 55 +- CGMES_2.4.15_16FEB2016/PhaseCode.cpp | 139 +- CGMES_2.4.15_16FEB2016/PhaseCode.hpp | 199 +- CGMES_2.4.15_16FEB2016/PhaseTapChanger.cpp | 67 +- CGMES_2.4.15_16FEB2016/PhaseTapChanger.hpp | 39 +- .../PhaseTapChangerAsymmetrical.cpp | 61 +- .../PhaseTapChangerAsymmetrical.hpp | 37 +- .../PhaseTapChangerLinear.cpp | 107 +- .../PhaseTapChangerLinear.hpp | 41 +- .../PhaseTapChangerNonLinear.cpp | 107 +- .../PhaseTapChangerNonLinear.hpp | 41 +- .../PhaseTapChangerSymmetrical.cpp | 38 +- .../PhaseTapChangerSymmetrical.hpp | 35 +- .../PhaseTapChangerTable.cpp | 82 +- .../PhaseTapChangerTable.hpp | 43 +- .../PhaseTapChangerTablePoint.cpp | 88 +- .../PhaseTapChangerTablePoint.hpp | 41 +- .../PhaseTapChangerTabular.cpp | 67 +- .../PhaseTapChangerTabular.hpp | 42 +- CGMES_2.4.15_16FEB2016/PositionPoint.cpp | 124 +- CGMES_2.4.15_16FEB2016/PositionPoint.hpp | 47 +- .../PowerSystemResource.cpp | 112 +- .../PowerSystemResource.hpp | 47 +- .../PowerSystemStabilizerDynamics.cpp | 92 +- .../PowerSystemStabilizerDynamics.hpp | 43 +- .../PowerSystemStabilizerUserDefined.cpp | 80 +- .../PowerSystemStabilizerUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/PowerTransformer.cpp | 199 +- CGMES_2.4.15_16FEB2016/PowerTransformer.hpp | 55 +- .../PowerTransformerEnd.cpp | 405 ++-- .../PowerTransformerEnd.hpp | 73 +- .../ProprietaryParameterDynamics.cpp | 638 ++++--- .../ProprietaryParameterDynamics.hpp | 117 +- CGMES_2.4.15_16FEB2016/ProtectedSwitch.cpp | 38 +- CGMES_2.4.15_16FEB2016/ProtectedSwitch.hpp | 35 +- CGMES_2.4.15_16FEB2016/Pss1.cpp | 399 ++-- CGMES_2.4.15_16FEB2016/Pss1.hpp | 69 +- CGMES_2.4.15_16FEB2016/Pss1A.cpp | 586 +++--- CGMES_2.4.15_16FEB2016/Pss1A.hpp | 81 +- CGMES_2.4.15_16FEB2016/Pss2B.cpp | 853 +++++---- CGMES_2.4.15_16FEB2016/Pss2B.hpp | 99 +- CGMES_2.4.15_16FEB2016/Pss2ST.cpp | 464 ++--- CGMES_2.4.15_16FEB2016/Pss2ST.hpp | 71 +- CGMES_2.4.15_16FEB2016/Pss5.cpp | 457 ++--- CGMES_2.4.15_16FEB2016/Pss5.hpp | 73 +- CGMES_2.4.15_16FEB2016/PssELIN2.cpp | 329 ++-- CGMES_2.4.15_16FEB2016/PssELIN2.hpp | 59 +- CGMES_2.4.15_16FEB2016/PssIEEE1A.cpp | 340 ++-- CGMES_2.4.15_16FEB2016/PssIEEE1A.hpp | 59 +- CGMES_2.4.15_16FEB2016/PssIEEE2B.cpp | 739 +++---- CGMES_2.4.15_16FEB2016/PssIEEE2B.hpp | 91 +- CGMES_2.4.15_16FEB2016/PssIEEE3B.cpp | 507 ++--- CGMES_2.4.15_16FEB2016/PssIEEE3B.hpp | 75 +- CGMES_2.4.15_16FEB2016/PssIEEE4B.cpp | 1701 +++++++++-------- CGMES_2.4.15_16FEB2016/PssIEEE4B.hpp | 171 +- CGMES_2.4.15_16FEB2016/PssPTIST1.cpp | 325 ++-- CGMES_2.4.15_16FEB2016/PssPTIST1.hpp | 57 +- CGMES_2.4.15_16FEB2016/PssPTIST3.cpp | 942 ++++----- CGMES_2.4.15_16FEB2016/PssPTIST3.hpp | 105 +- CGMES_2.4.15_16FEB2016/PssSB4.cpp | 317 +-- CGMES_2.4.15_16FEB2016/PssSB4.hpp | 59 +- CGMES_2.4.15_16FEB2016/PssSH.cpp | 359 ++-- CGMES_2.4.15_16FEB2016/PssSH.hpp | 61 +- CGMES_2.4.15_16FEB2016/PssSK.cpp | 309 +-- CGMES_2.4.15_16FEB2016/PssSK.hpp | 57 +- CGMES_2.4.15_16FEB2016/PssWECC.cpp | 462 ++--- CGMES_2.4.15_16FEB2016/PssWECC.hpp | 71 +- CGMES_2.4.15_16FEB2016/Quality61850.cpp | 332 ++-- CGMES_2.4.15_16FEB2016/Quality61850.hpp | 59 +- CGMES_2.4.15_16FEB2016/RaiseLowerCommand.cpp | 67 +- CGMES_2.4.15_16FEB2016/RaiseLowerCommand.hpp | 39 +- CGMES_2.4.15_16FEB2016/RatioTapChanger.cpp | 138 +- CGMES_2.4.15_16FEB2016/RatioTapChanger.hpp | 49 +- .../RatioTapChangerTable.cpp | 82 +- .../RatioTapChangerTable.hpp | 43 +- .../RatioTapChangerTablePoint.cpp | 67 +- .../RatioTapChangerTablePoint.hpp | 39 +- CGMES_2.4.15_16FEB2016/Reactance.cpp | 101 +- CGMES_2.4.15_16FEB2016/Reactance.hpp | 43 +- .../ReactiveCapabilityCurve.cpp | 82 +- .../ReactiveCapabilityCurve.hpp | 43 +- CGMES_2.4.15_16FEB2016/ReactivePower.cpp | 101 +- CGMES_2.4.15_16FEB2016/ReactivePower.hpp | 43 +- .../RegularIntervalSchedule.cpp | 104 +- .../RegularIntervalSchedule.hpp | 45 +- CGMES_2.4.15_16FEB2016/RegularTimePoint.cpp | 138 +- CGMES_2.4.15_16FEB2016/RegularTimePoint.hpp | 45 +- CGMES_2.4.15_16FEB2016/RegulatingCondEq.cpp | 92 +- CGMES_2.4.15_16FEB2016/RegulatingCondEq.hpp | 41 +- CGMES_2.4.15_16FEB2016/RegulatingControl.cpp | 251 +-- CGMES_2.4.15_16FEB2016/RegulatingControl.hpp | 61 +- .../RegulatingControlModeKind.cpp | 87 +- .../RegulatingControlModeKind.hpp | 95 +- CGMES_2.4.15_16FEB2016/RegulationSchedule.cpp | 67 +- CGMES_2.4.15_16FEB2016/RegulationSchedule.hpp | 39 +- CGMES_2.4.15_16FEB2016/RemoteInputSignal.cpp | 309 +-- CGMES_2.4.15_16FEB2016/RemoteInputSignal.hpp | 73 +- CGMES_2.4.15_16FEB2016/RemoteSignalKind.cpp | 91 +- CGMES_2.4.15_16FEB2016/RemoteSignalKind.hpp | 103 +- CGMES_2.4.15_16FEB2016/ReportingGroup.cpp | 82 +- CGMES_2.4.15_16FEB2016/ReportingGroup.hpp | 43 +- CGMES_2.4.15_16FEB2016/Resistance.cpp | 101 +- CGMES_2.4.15_16FEB2016/Resistance.hpp | 43 +- .../ResistancePerLength.cpp | 146 +- .../ResistancePerLength.hpp | 57 +- CGMES_2.4.15_16FEB2016/RotatingMachine.cpp | 210 +- CGMES_2.4.15_16FEB2016/RotatingMachine.hpp | 59 +- .../RotatingMachineDynamics.cpp | 176 +- .../RotatingMachineDynamics.hpp | 51 +- CGMES_2.4.15_16FEB2016/RotationSpeed.cpp | 146 +- CGMES_2.4.15_16FEB2016/RotationSpeed.hpp | 57 +- CGMES_2.4.15_16FEB2016/RotorKind.cpp | 63 +- CGMES_2.4.15_16FEB2016/RotorKind.hpp | 47 +- CGMES_2.4.15_16FEB2016/SVCControlMode.cpp | 63 +- CGMES_2.4.15_16FEB2016/SVCControlMode.hpp | 41 +- CGMES_2.4.15_16FEB2016/Season.cpp | 99 +- CGMES_2.4.15_16FEB2016/Season.hpp | 45 +- .../SeasonDayTypeSchedule.cpp | 92 +- .../SeasonDayTypeSchedule.hpp | 43 +- CGMES_2.4.15_16FEB2016/Seconds.cpp | 101 +- CGMES_2.4.15_16FEB2016/Seconds.hpp | 43 +- CGMES_2.4.15_16FEB2016/SeriesCompensator.cpp | 207 +- CGMES_2.4.15_16FEB2016/SeriesCompensator.hpp | 53 +- CGMES_2.4.15_16FEB2016/SetPoint.cpp | 84 +- CGMES_2.4.15_16FEB2016/SetPoint.hpp | 39 +- .../ShortCircuitRotorKind.cpp | 71 +- .../ShortCircuitRotorKind.hpp | 63 +- CGMES_2.4.15_16FEB2016/ShuntCompensator.cpp | 279 +-- CGMES_2.4.15_16FEB2016/ShuntCompensator.hpp | 65 +- CGMES_2.4.15_16FEB2016/Simple_Float.cpp | 101 +- CGMES_2.4.15_16FEB2016/Simple_Float.hpp | 43 +- .../SolarGeneratingUnit.cpp | 38 +- .../SolarGeneratingUnit.hpp | 35 +- CGMES_2.4.15_16FEB2016/Source.cpp | 67 +- CGMES_2.4.15_16FEB2016/Source.hpp | 55 +- .../StateVariablesVersion.cpp | 158 +- .../StateVariablesVersion.hpp | 57 +- .../StaticLoadModelKind.cpp | 71 +- .../StaticLoadModelKind.hpp | 63 +- .../StaticVarCompensator.cpp | 183 +- .../StaticVarCompensator.hpp | 51 +- CGMES_2.4.15_16FEB2016/StationSupply.cpp | 38 +- CGMES_2.4.15_16FEB2016/StationSupply.hpp | 35 +- .../SteadyStateHypothesisVersion.cpp | 158 +- .../SteadyStateHypothesisVersion.hpp | 57 +- CGMES_2.4.15_16FEB2016/String.cpp | 49 + CGMES_2.4.15_16FEB2016/String.hpp | 35 + CGMES_2.4.15_16FEB2016/StringMeasurement.cpp | 61 +- CGMES_2.4.15_16FEB2016/StringMeasurement.hpp | 39 +- .../StringMeasurementValue.cpp | 81 +- .../StringMeasurementValue.hpp | 41 +- .../SubGeographicalRegion.cpp | 132 +- .../SubGeographicalRegion.hpp | 51 +- CGMES_2.4.15_16FEB2016/SubLoadArea.cpp | 88 +- CGMES_2.4.15_16FEB2016/SubLoadArea.hpp | 43 +- CGMES_2.4.15_16FEB2016/Substation.cpp | 107 +- CGMES_2.4.15_16FEB2016/Substation.hpp | 47 +- CGMES_2.4.15_16FEB2016/Susceptance.cpp | 101 +- CGMES_2.4.15_16FEB2016/Susceptance.hpp | 43 +- CGMES_2.4.15_16FEB2016/SvInjection.cpp | 111 +- CGMES_2.4.15_16FEB2016/SvInjection.hpp | 43 +- CGMES_2.4.15_16FEB2016/SvPowerFlow.cpp | 115 +- CGMES_2.4.15_16FEB2016/SvPowerFlow.hpp | 43 +- .../SvShuntCompensatorSections.cpp | 88 +- .../SvShuntCompensatorSections.hpp | 41 +- CGMES_2.4.15_16FEB2016/SvStatus.cpp | 92 +- CGMES_2.4.15_16FEB2016/SvStatus.hpp | 41 +- CGMES_2.4.15_16FEB2016/SvTapStep.cpp | 88 +- CGMES_2.4.15_16FEB2016/SvTapStep.hpp | 41 +- CGMES_2.4.15_16FEB2016/SvVoltage.cpp | 111 +- CGMES_2.4.15_16FEB2016/SvVoltage.hpp | 43 +- CGMES_2.4.15_16FEB2016/Switch.cpp | 153 +- CGMES_2.4.15_16FEB2016/Switch.hpp | 47 +- CGMES_2.4.15_16FEB2016/SwitchSchedule.cpp | 67 +- CGMES_2.4.15_16FEB2016/SwitchSchedule.hpp | 39 +- CGMES_2.4.15_16FEB2016/SynchronousMachine.cpp | 604 +++--- CGMES_2.4.15_16FEB2016/SynchronousMachine.hpp | 99 +- .../SynchronousMachineDetailed.cpp | 161 +- .../SynchronousMachineDetailed.hpp | 49 +- .../SynchronousMachineDynamics.cpp | 169 +- .../SynchronousMachineDynamics.hpp | 55 +- .../SynchronousMachineEquivalentCircuit.cpp | 323 ++-- .../SynchronousMachineEquivalentCircuit.hpp | 57 +- .../SynchronousMachineKind.cpp | 83 +- .../SynchronousMachineKind.hpp | 66 +- .../SynchronousMachineModelKind.cpp | 75 +- .../SynchronousMachineModelKind.hpp | 71 +- .../SynchronousMachineOperatingMode.cpp | 67 +- .../SynchronousMachineOperatingMode.hpp | 46 +- .../SynchronousMachineSimplified.cpp | 38 +- .../SynchronousMachineSimplified.hpp | 35 +- ...ynchronousMachineTimeConstantReactance.cpp | 412 ++-- ...ynchronousMachineTimeConstantReactance.hpp | 69 +- .../SynchronousMachineUserDefined.cpp | 80 +- .../SynchronousMachineUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/TapChanger.cpp | 332 ++-- CGMES_2.4.15_16FEB2016/TapChanger.hpp | 67 +- CGMES_2.4.15_16FEB2016/TapChangerControl.cpp | 61 +- CGMES_2.4.15_16FEB2016/TapChangerControl.hpp | 39 +- .../TapChangerTablePoint.cpp | 176 +- .../TapChangerTablePoint.hpp | 52 +- CGMES_2.4.15_16FEB2016/TapSchedule.cpp | 67 +- CGMES_2.4.15_16FEB2016/TapSchedule.hpp | 39 +- CGMES_2.4.15_16FEB2016/Temperature.cpp | 101 +- CGMES_2.4.15_16FEB2016/Temperature.hpp | 43 +- CGMES_2.4.15_16FEB2016/Terminal.cpp | 329 ++-- CGMES_2.4.15_16FEB2016/Terminal.hpp | 79 +- CGMES_2.4.15_16FEB2016/TextDiagramObject.cpp | 50 +- CGMES_2.4.15_16FEB2016/TextDiagramObject.hpp | 37 +- .../ThermalGeneratingUnit.cpp | 61 +- .../ThermalGeneratingUnit.hpp | 39 +- CGMES_2.4.15_16FEB2016/TieFlow.cpp | 117 +- CGMES_2.4.15_16FEB2016/TieFlow.hpp | 45 +- CGMES_2.4.15_16FEB2016/TopologicalIsland.cpp | 88 +- CGMES_2.4.15_16FEB2016/TopologicalIsland.hpp | 41 +- CGMES_2.4.15_16FEB2016/TopologicalNode.cpp | 374 ++-- CGMES_2.4.15_16FEB2016/TopologicalNode.hpp | 83 +- .../TopologyBoundaryVersion.cpp | 158 +- .../TopologyBoundaryVersion.hpp | 57 +- CGMES_2.4.15_16FEB2016/TopologyVersion.cpp | 158 +- CGMES_2.4.15_16FEB2016/TopologyVersion.hpp | 57 +- .../TransformerControlMode.cpp | 63 +- .../TransformerControlMode.hpp | 47 +- CGMES_2.4.15_16FEB2016/TransformerEnd.cpp | 240 ++- CGMES_2.4.15_16FEB2016/TransformerEnd.hpp | 63 +- CGMES_2.4.15_16FEB2016/TurbLCFB1.cpp | 352 ++-- CGMES_2.4.15_16FEB2016/TurbLCFB1.hpp | 59 +- .../TurbineGovernorDynamics.cpp | 118 +- .../TurbineGovernorDynamics.hpp | 47 +- .../TurbineGovernorUserDefined.cpp | 80 +- .../TurbineGovernorUserDefined.hpp | 41 +- .../TurbineLoadControllerDynamics.cpp | 67 +- .../TurbineLoadControllerDynamics.hpp | 39 +- .../TurbineLoadControllerUserDefined.cpp | 80 +- .../TurbineLoadControllerUserDefined.hpp | 41 +- .../UnderexcLim2Simplified.cpp | 207 +- .../UnderexcLim2Simplified.hpp | 49 +- CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.cpp | 401 ++-- CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.hpp | 65 +- CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.cpp | 1100 ++++++----- CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.hpp | 117 +- CGMES_2.4.15_16FEB2016/UnderexcLimX1.cpp | 186 +- CGMES_2.4.15_16FEB2016/UnderexcLimX1.hpp | 50 +- CGMES_2.4.15_16FEB2016/UnderexcLimX2.cpp | 207 +- CGMES_2.4.15_16FEB2016/UnderexcLimX2.hpp | 52 +- .../UnderexcitationLimiterDynamics.cpp | 95 +- .../UnderexcitationLimiterDynamics.hpp | 43 +- .../UnderexcitationLimiterUserDefined.cpp | 80 +- .../UnderexcitationLimiterUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/UnitMultiplier.cpp | 99 +- CGMES_2.4.15_16FEB2016/UnitMultiplier.hpp | 119 +- CGMES_2.4.15_16FEB2016/UnitSymbol.cpp | 163 +- CGMES_2.4.15_16FEB2016/UnitSymbol.hpp | 247 +-- CGMES_2.4.15_16FEB2016/VAdjIEEE.cpp | 186 +- CGMES_2.4.15_16FEB2016/VAdjIEEE.hpp | 49 +- CGMES_2.4.15_16FEB2016/VCompIEEEType1.cpp | 111 +- CGMES_2.4.15_16FEB2016/VCompIEEEType1.hpp | 41 +- CGMES_2.4.15_16FEB2016/VCompIEEEType2.cpp | 87 +- CGMES_2.4.15_16FEB2016/VCompIEEEType2.hpp | 44 +- CGMES_2.4.15_16FEB2016/Validity.cpp | 67 +- CGMES_2.4.15_16FEB2016/Validity.hpp | 55 +- CGMES_2.4.15_16FEB2016/ValueAliasSet.cpp | 120 +- CGMES_2.4.15_16FEB2016/ValueAliasSet.hpp | 51 +- CGMES_2.4.15_16FEB2016/ValueToAlias.cpp | 92 +- CGMES_2.4.15_16FEB2016/ValueToAlias.hpp | 41 +- CGMES_2.4.15_16FEB2016/VisibilityLayer.cpp | 84 +- CGMES_2.4.15_16FEB2016/VisibilityLayer.hpp | 41 +- CGMES_2.4.15_16FEB2016/Voltage.cpp | 101 +- CGMES_2.4.15_16FEB2016/Voltage.hpp | 43 +- .../VoltageAdjusterDynamics.cpp | 67 +- .../VoltageAdjusterDynamics.hpp | 39 +- .../VoltageAdjusterUserDefined.cpp | 80 +- .../VoltageAdjusterUserDefined.hpp | 41 +- .../VoltageCompensatorDynamics.cpp | 95 +- .../VoltageCompensatorDynamics.hpp | 43 +- .../VoltageCompensatorUserDefined.cpp | 80 +- .../VoltageCompensatorUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/VoltageLevel.cpp | 163 +- CGMES_2.4.15_16FEB2016/VoltageLevel.hpp | 51 +- CGMES_2.4.15_16FEB2016/VoltageLimit.cpp | 61 +- CGMES_2.4.15_16FEB2016/VoltageLimit.hpp | 37 +- .../VoltagePerReactivePower.cpp | 146 +- .../VoltagePerReactivePower.hpp | 57 +- CGMES_2.4.15_16FEB2016/VolumeFlowRate.cpp | 146 +- CGMES_2.4.15_16FEB2016/VolumeFlowRate.hpp | 57 +- CGMES_2.4.15_16FEB2016/VsCapabilityCurve.cpp | 61 +- CGMES_2.4.15_16FEB2016/VsCapabilityCurve.hpp | 39 +- CGMES_2.4.15_16FEB2016/VsConverter.cpp | 360 ++-- CGMES_2.4.15_16FEB2016/VsConverter.hpp | 71 +- CGMES_2.4.15_16FEB2016/VsPpccControlKind.cpp | 75 +- CGMES_2.4.15_16FEB2016/VsPpccControlKind.hpp | 71 +- CGMES_2.4.15_16FEB2016/VsQpccControlKind.cpp | 67 +- CGMES_2.4.15_16FEB2016/VsQpccControlKind.hpp | 49 +- CGMES_2.4.15_16FEB2016/WindAeroConstIEC.cpp | 66 +- CGMES_2.4.15_16FEB2016/WindAeroConstIEC.hpp | 39 +- CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.cpp | 179 +- CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.hpp | 51 +- CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.cpp | 198 +- CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.hpp | 55 +- CGMES_2.4.15_16FEB2016/WindContPType3IEC.cpp | 571 +++--- CGMES_2.4.15_16FEB2016/WindContPType3IEC.hpp | 87 +- CGMES_2.4.15_16FEB2016/WindContPType4aIEC.cpp | 133 +- CGMES_2.4.15_16FEB2016/WindContPType4aIEC.hpp | 45 +- CGMES_2.4.15_16FEB2016/WindContPType4bIEC.cpp | 156 +- CGMES_2.4.15_16FEB2016/WindContPType4bIEC.hpp | 47 +- .../WindContPitchAngleIEC.cpp | 304 +-- .../WindContPitchAngleIEC.hpp | 63 +- CGMES_2.4.15_16FEB2016/WindContQIEC.cpp | 704 +++---- CGMES_2.4.15_16FEB2016/WindContQIEC.hpp | 91 +- CGMES_2.4.15_16FEB2016/WindContRotorRIEC.cpp | 293 +-- CGMES_2.4.15_16FEB2016/WindContRotorRIEC.hpp | 61 +- .../WindDynamicsLookupTable.cpp | 238 ++- .../WindDynamicsLookupTable.hpp | 61 +- .../WindGenTurbineType1IEC.cpp | 67 +- .../WindGenTurbineType1IEC.hpp | 39 +- .../WindGenTurbineType2IEC.cpp | 92 +- .../WindGenTurbineType2IEC.hpp | 43 +- .../WindGenTurbineType3IEC.cpp | 196 +- .../WindGenTurbineType3IEC.hpp | 55 +- .../WindGenTurbineType3aIEC.cpp | 111 +- .../WindGenTurbineType3aIEC.hpp | 43 +- .../WindGenTurbineType3bIEC.cpp | 157 +- .../WindGenTurbineType3bIEC.hpp | 49 +- CGMES_2.4.15_16FEB2016/WindGenType4IEC.cpp | 132 +- CGMES_2.4.15_16FEB2016/WindGenType4IEC.hpp | 43 +- CGMES_2.4.15_16FEB2016/WindGenUnitKind.cpp | 63 +- CGMES_2.4.15_16FEB2016/WindGenUnitKind.hpp | 47 +- CGMES_2.4.15_16FEB2016/WindGeneratingUnit.cpp | 61 +- CGMES_2.4.15_16FEB2016/WindGeneratingUnit.hpp | 37 +- .../WindLVRTQcontrolModesKind.cpp | 67 +- .../WindLVRTQcontrolModesKind.hpp | 55 +- .../WindLookupTableFunctionKind.cpp | 75 +- .../WindLookupTableFunctionKind.hpp | 71 +- CGMES_2.4.15_16FEB2016/WindMechIEC.cpp | 208 +- CGMES_2.4.15_16FEB2016/WindMechIEC.hpp | 55 +- .../WindPitchContEmulIEC.cpp | 302 +-- .../WindPitchContEmulIEC.hpp | 61 +- CGMES_2.4.15_16FEB2016/WindPlantDynamics.cpp | 88 +- CGMES_2.4.15_16FEB2016/WindPlantDynamics.hpp | 43 +- .../WindPlantFreqPcontrolIEC.cpp | 327 ++-- .../WindPlantFreqPcontrolIEC.hpp | 65 +- CGMES_2.4.15_16FEB2016/WindPlantIEC.cpp | 92 +- CGMES_2.4.15_16FEB2016/WindPlantIEC.hpp | 43 +- .../WindPlantReactiveControlIEC.cpp | 381 ++-- .../WindPlantReactiveControlIEC.hpp | 69 +- .../WindPlantUserDefined.cpp | 80 +- .../WindPlantUserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/WindProtectionIEC.cpp | 280 +-- CGMES_2.4.15_16FEB2016/WindProtectionIEC.hpp | 59 +- .../WindQcontrolModesKind.cpp | 71 +- .../WindQcontrolModesKind.hpp | 63 +- .../WindTurbineType1or2Dynamics.cpp | 96 +- .../WindTurbineType1or2Dynamics.hpp | 43 +- .../WindTurbineType1or2IEC.cpp | 92 +- .../WindTurbineType1or2IEC.hpp | 43 +- .../WindTurbineType3or4Dynamics.cpp | 115 +- .../WindTurbineType3or4Dynamics.hpp | 47 +- .../WindTurbineType3or4IEC.cpp | 123 +- .../WindTurbineType3or4IEC.hpp | 47 +- .../WindTurbineType4aIEC.cpp | 67 +- .../WindTurbineType4aIEC.hpp | 39 +- .../WindTurbineType4bIEC.cpp | 92 +- .../WindTurbineType4bIEC.hpp | 43 +- .../WindType1or2UserDefined.cpp | 80 +- .../WindType1or2UserDefined.hpp | 41 +- .../WindType3or4UserDefined.cpp | 80 +- .../WindType3or4UserDefined.hpp | 41 +- CGMES_2.4.15_16FEB2016/WindingConnection.cpp | 83 +- CGMES_2.4.15_16FEB2016/WindingConnection.hpp | 87 +- CGMES_2.4.15_27JAN2020/ACDCConverter.cpp | 492 ++--- CGMES_2.4.15_27JAN2020/ACDCConverter.hpp | 87 +- .../ACDCConverterDCTerminal.cpp | 92 +- .../ACDCConverterDCTerminal.hpp | 41 +- CGMES_2.4.15_27JAN2020/ACDCTerminal.cpp | 157 +- CGMES_2.4.15_27JAN2020/ACDCTerminal.hpp | 53 +- CGMES_2.4.15_27JAN2020/ACLineSegment.cpp | 257 +-- CGMES_2.4.15_27JAN2020/ACLineSegment.hpp | 57 +- CGMES_2.4.15_27JAN2020/Accumulator.cpp | 84 +- CGMES_2.4.15_27JAN2020/Accumulator.hpp | 43 +- CGMES_2.4.15_27JAN2020/AccumulatorLimit.cpp | 88 +- CGMES_2.4.15_27JAN2020/AccumulatorLimit.hpp | 41 +- .../AccumulatorLimitSet.cpp | 84 +- .../AccumulatorLimitSet.hpp | 43 +- CGMES_2.4.15_27JAN2020/AccumulatorReset.cpp | 67 +- CGMES_2.4.15_27JAN2020/AccumulatorReset.hpp | 39 +- CGMES_2.4.15_27JAN2020/AccumulatorValue.cpp | 116 +- CGMES_2.4.15_27JAN2020/AccumulatorValue.hpp | 45 +- CGMES_2.4.15_27JAN2020/ActivePower.cpp | 101 +- CGMES_2.4.15_27JAN2020/ActivePower.hpp | 43 +- CGMES_2.4.15_27JAN2020/ActivePowerLimit.cpp | 61 +- CGMES_2.4.15_27JAN2020/ActivePowerLimit.hpp | 37 +- .../ActivePowerPerCurrentFlow.cpp | 146 +- .../ActivePowerPerCurrentFlow.hpp | 58 +- .../ActivePowerPerFrequency.cpp | 146 +- .../ActivePowerPerFrequency.hpp | 57 +- CGMES_2.4.15_27JAN2020/Analog.cpp | 103 +- CGMES_2.4.15_27JAN2020/Analog.hpp | 45 +- CGMES_2.4.15_27JAN2020/AnalogControl.cpp | 111 +- CGMES_2.4.15_27JAN2020/AnalogControl.hpp | 43 +- CGMES_2.4.15_27JAN2020/AnalogLimit.cpp | 88 +- CGMES_2.4.15_27JAN2020/AnalogLimit.hpp | 41 +- CGMES_2.4.15_27JAN2020/AnalogLimitSet.cpp | 84 +- CGMES_2.4.15_27JAN2020/AnalogLimitSet.hpp | 43 +- CGMES_2.4.15_27JAN2020/AnalogValue.cpp | 116 +- CGMES_2.4.15_27JAN2020/AnalogValue.hpp | 45 +- CGMES_2.4.15_27JAN2020/AngleDegrees.cpp | 101 +- CGMES_2.4.15_27JAN2020/AngleDegrees.hpp | 43 +- CGMES_2.4.15_27JAN2020/AngleRadians.cpp | 101 +- CGMES_2.4.15_27JAN2020/AngleRadians.hpp | 43 +- CGMES_2.4.15_27JAN2020/ApparentPower.cpp | 101 +- CGMES_2.4.15_27JAN2020/ApparentPower.hpp | 43 +- CGMES_2.4.15_27JAN2020/ApparentPowerLimit.cpp | 61 +- CGMES_2.4.15_27JAN2020/ApparentPowerLimit.hpp | 37 +- CGMES_2.4.15_27JAN2020/Area.cpp | 101 +- CGMES_2.4.15_27JAN2020/Area.hpp | 43 +- .../AsynchronousMachine.cpp | 313 +-- .../AsynchronousMachine.hpp | 69 +- .../AsynchronousMachineDynamics.cpp | 145 +- .../AsynchronousMachineDynamics.hpp | 51 +- .../AsynchronousMachineEquivalentCircuit.cpp | 157 +- .../AsynchronousMachineEquivalentCircuit.hpp | 45 +- .../AsynchronousMachineKind.cpp | 63 +- .../AsynchronousMachineKind.hpp | 47 +- ...ynchronousMachineTimeConstantReactance.cpp | 163 +- ...ynchronousMachineTimeConstantReactance.hpp | 45 +- .../AsynchronousMachineUserDefined.cpp | 80 +- .../AsynchronousMachineUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/BaseVoltage.cpp | 149 +- CGMES_2.4.15_27JAN2020/BaseVoltage.hpp | 53 +- .../BasicIntervalSchedule.cpp | 108 +- .../BasicIntervalSchedule.hpp | 43 +- CGMES_2.4.15_27JAN2020/Bay.cpp | 67 +- CGMES_2.4.15_27JAN2020/Bay.hpp | 39 +- CGMES_2.4.15_27JAN2020/Breaker.cpp | 38 +- CGMES_2.4.15_27JAN2020/Breaker.hpp | 35 +- CGMES_2.4.15_27JAN2020/BusNameMarker.cpp | 109 +- CGMES_2.4.15_27JAN2020/BusNameMarker.hpp | 45 +- CGMES_2.4.15_27JAN2020/BusbarSection.cpp | 61 +- CGMES_2.4.15_27JAN2020/BusbarSection.hpp | 37 +- CGMES_2.4.15_27JAN2020/CIMClassList.hpp | 841 ++++---- CGMES_2.4.15_27JAN2020/Capacitance.cpp | 101 +- CGMES_2.4.15_27JAN2020/Capacitance.hpp | 43 +- .../CapacitancePerLength.cpp | 146 +- .../CapacitancePerLength.hpp | 57 +- CGMES_2.4.15_27JAN2020/Command.cpp | 136 +- CGMES_2.4.15_27JAN2020/Command.hpp | 47 +- CGMES_2.4.15_27JAN2020/Conductance.cpp | 101 +- CGMES_2.4.15_27JAN2020/Conductance.hpp | 43 +- .../ConductingEquipment.cpp | 116 +- .../ConductingEquipment.hpp | 47 +- CGMES_2.4.15_27JAN2020/Conductor.cpp | 61 +- CGMES_2.4.15_27JAN2020/Conductor.hpp | 37 +- CGMES_2.4.15_27JAN2020/ConformLoad.cpp | 67 +- CGMES_2.4.15_27JAN2020/ConformLoad.hpp | 39 +- CGMES_2.4.15_27JAN2020/ConformLoadGroup.cpp | 84 +- CGMES_2.4.15_27JAN2020/ConformLoadGroup.hpp | 43 +- .../ConformLoadSchedule.cpp | 67 +- .../ConformLoadSchedule.hpp | 39 +- CGMES_2.4.15_27JAN2020/ConnectivityNode.cpp | 212 +- CGMES_2.4.15_27JAN2020/ConnectivityNode.hpp | 61 +- .../ConnectivityNodeContainer.cpp | 82 +- .../ConnectivityNodeContainer.hpp | 43 +- CGMES_2.4.15_27JAN2020/Connector.cpp | 38 +- CGMES_2.4.15_27JAN2020/Connector.hpp | 35 +- CGMES_2.4.15_27JAN2020/Control.cpp | 170 +- CGMES_2.4.15_27JAN2020/Control.hpp | 53 +- CGMES_2.4.15_27JAN2020/ControlArea.cpp | 180 +- CGMES_2.4.15_27JAN2020/ControlArea.hpp | 55 +- .../ControlAreaGeneratingUnit.cpp | 96 +- .../ControlAreaGeneratingUnit.hpp | 43 +- .../ControlAreaTypeKind.cpp | 67 +- .../ControlAreaTypeKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/CoordinateSystem.cpp | 75 +- CGMES_2.4.15_27JAN2020/CoordinateSystem.hpp | 41 +- CGMES_2.4.15_27JAN2020/CsConverter.cpp | 392 ++-- CGMES_2.4.15_27JAN2020/CsConverter.hpp | 65 +- .../CsOperatingModeKind.cpp | 63 +- .../CsOperatingModeKind.hpp | 47 +- CGMES_2.4.15_27JAN2020/CsPpccControlKind.cpp | 67 +- CGMES_2.4.15_27JAN2020/CsPpccControlKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/Currency.cpp | 111 +- CGMES_2.4.15_27JAN2020/Currency.hpp | 143 +- CGMES_2.4.15_27JAN2020/CurrentFlow.cpp | 101 +- CGMES_2.4.15_27JAN2020/CurrentFlow.hpp | 43 +- CGMES_2.4.15_27JAN2020/CurrentLimit.cpp | 61 +- CGMES_2.4.15_27JAN2020/CurrentLimit.hpp | 37 +- CGMES_2.4.15_27JAN2020/Curve.cpp | 149 +- CGMES_2.4.15_27JAN2020/Curve.hpp | 47 +- CGMES_2.4.15_27JAN2020/CurveData.cpp | 138 +- CGMES_2.4.15_27JAN2020/CurveData.hpp | 45 +- CGMES_2.4.15_27JAN2020/CurveStyle.cpp | 63 +- CGMES_2.4.15_27JAN2020/CurveStyle.hpp | 47 +- CGMES_2.4.15_27JAN2020/DCBaseTerminal.cpp | 92 +- CGMES_2.4.15_27JAN2020/DCBaseTerminal.hpp | 43 +- CGMES_2.4.15_27JAN2020/DCBreaker.cpp | 38 +- CGMES_2.4.15_27JAN2020/DCBreaker.hpp | 35 +- CGMES_2.4.15_27JAN2020/DCBusbar.cpp | 38 +- CGMES_2.4.15_27JAN2020/DCBusbar.hpp | 35 +- CGMES_2.4.15_27JAN2020/DCChopper.cpp | 38 +- CGMES_2.4.15_27JAN2020/DCChopper.hpp | 35 +- .../DCConductingEquipment.cpp | 61 +- .../DCConductingEquipment.hpp | 39 +- .../DCConverterOperatingModeKind.cpp | 67 +- .../DCConverterOperatingModeKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/DCConverterUnit.cpp | 88 +- CGMES_2.4.15_27JAN2020/DCConverterUnit.hpp | 41 +- CGMES_2.4.15_27JAN2020/DCDisconnector.cpp | 38 +- CGMES_2.4.15_27JAN2020/DCDisconnector.hpp | 35 +- .../DCEquipmentContainer.cpp | 82 +- .../DCEquipmentContainer.hpp | 43 +- CGMES_2.4.15_27JAN2020/DCGround.cpp | 84 +- CGMES_2.4.15_27JAN2020/DCGround.hpp | 39 +- CGMES_2.4.15_27JAN2020/DCLine.cpp | 67 +- CGMES_2.4.15_27JAN2020/DCLine.hpp | 39 +- CGMES_2.4.15_27JAN2020/DCLineSegment.cpp | 161 +- CGMES_2.4.15_27JAN2020/DCLineSegment.hpp | 49 +- CGMES_2.4.15_27JAN2020/DCNode.cpp | 117 +- CGMES_2.4.15_27JAN2020/DCNode.hpp | 47 +- CGMES_2.4.15_27JAN2020/DCPolarityKind.cpp | 67 +- CGMES_2.4.15_27JAN2020/DCPolarityKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/DCSeriesDevice.cpp | 111 +- CGMES_2.4.15_27JAN2020/DCSeriesDevice.hpp | 41 +- CGMES_2.4.15_27JAN2020/DCShunt.cpp | 111 +- CGMES_2.4.15_27JAN2020/DCShunt.hpp | 41 +- CGMES_2.4.15_27JAN2020/DCSwitch.cpp | 38 +- CGMES_2.4.15_27JAN2020/DCSwitch.hpp | 35 +- CGMES_2.4.15_27JAN2020/DCTerminal.cpp | 67 +- CGMES_2.4.15_27JAN2020/DCTerminal.hpp | 39 +- .../DCTopologicalIsland.cpp | 61 +- .../DCTopologicalIsland.hpp | 39 +- CGMES_2.4.15_27JAN2020/DCTopologicalNode.cpp | 141 +- CGMES_2.4.15_27JAN2020/DCTopologicalNode.hpp | 51 +- CGMES_2.4.15_27JAN2020/Date.cpp | 49 + CGMES_2.4.15_27JAN2020/Date.hpp | 35 + CGMES_2.4.15_27JAN2020/DateTime.cpp | 58 +- CGMES_2.4.15_27JAN2020/DateTime.hpp | 45 +- CGMES_2.4.15_27JAN2020/DayType.cpp | 61 +- CGMES_2.4.15_27JAN2020/DayType.hpp | 39 +- CGMES_2.4.15_27JAN2020/Decimal.cpp | 74 +- CGMES_2.4.15_27JAN2020/Decimal.hpp | 49 +- CGMES_2.4.15_27JAN2020/Diagram.cpp | 203 +- CGMES_2.4.15_27JAN2020/Diagram.hpp | 53 +- .../DiagramLayoutVersion.cpp | 158 +- .../DiagramLayoutVersion.hpp | 57 +- CGMES_2.4.15_27JAN2020/DiagramObject.cpp | 302 +-- CGMES_2.4.15_27JAN2020/DiagramObject.hpp | 69 +- .../DiagramObjectGluePoint.cpp | 66 +- .../DiagramObjectGluePoint.hpp | 39 +- CGMES_2.4.15_27JAN2020/DiagramObjectPoint.cpp | 186 +- CGMES_2.4.15_27JAN2020/DiagramObjectPoint.hpp | 51 +- CGMES_2.4.15_27JAN2020/DiagramObjectStyle.cpp | 61 +- CGMES_2.4.15_27JAN2020/DiagramObjectStyle.hpp | 39 +- CGMES_2.4.15_27JAN2020/DiagramStyle.cpp | 61 +- CGMES_2.4.15_27JAN2020/DiagramStyle.hpp | 39 +- .../DiscExcContIEEEDEC1A.cpp | 482 ++--- .../DiscExcContIEEEDEC1A.hpp | 71 +- .../DiscExcContIEEEDEC2A.cpp | 159 +- .../DiscExcContIEEEDEC2A.hpp | 45 +- .../DiscExcContIEEEDEC3A.cpp | 88 +- .../DiscExcContIEEEDEC3A.hpp | 39 +- CGMES_2.4.15_27JAN2020/Disconnector.cpp | 38 +- CGMES_2.4.15_27JAN2020/Disconnector.hpp | 35 +- ...DiscontinuousExcitationControlDynamics.cpp | 95 +- ...DiscontinuousExcitationControlDynamics.hpp | 43 +- ...continuousExcitationControlUserDefined.cpp | 80 +- ...continuousExcitationControlUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/Discrete.cpp | 88 +- CGMES_2.4.15_27JAN2020/Discrete.hpp | 43 +- CGMES_2.4.15_27JAN2020/DiscreteValue.cpp | 116 +- CGMES_2.4.15_27JAN2020/DiscreteValue.hpp | 45 +- .../DroopSignalFeedbackKind.cpp | 71 +- .../DroopSignalFeedbackKind.hpp | 63 +- .../DynamicsFunctionBlock.cpp | 61 +- .../DynamicsFunctionBlock.hpp | 37 +- CGMES_2.4.15_27JAN2020/DynamicsVersion.cpp | 158 +- CGMES_2.4.15_27JAN2020/DynamicsVersion.hpp | 57 +- .../EarthFaultCompensator.cpp | 61 +- .../EarthFaultCompensator.hpp | 37 +- CGMES_2.4.15_27JAN2020/EnergyArea.cpp | 66 +- CGMES_2.4.15_27JAN2020/EnergyArea.hpp | 39 +- CGMES_2.4.15_27JAN2020/EnergyConsumer.cpp | 240 +-- CGMES_2.4.15_27JAN2020/EnergyConsumer.hpp | 55 +- .../EnergySchedulingType.cpp | 61 +- .../EnergySchedulingType.hpp | 39 +- CGMES_2.4.15_27JAN2020/EnergySource.cpp | 376 ++-- CGMES_2.4.15_27JAN2020/EnergySource.hpp | 71 +- CGMES_2.4.15_27JAN2020/Equipment.cpp | 109 +- CGMES_2.4.15_27JAN2020/Equipment.hpp | 45 +- .../EquipmentBoundaryVersion.cpp | 168 +- .../EquipmentBoundaryVersion.hpp | 59 +- CGMES_2.4.15_27JAN2020/EquipmentContainer.cpp | 61 +- CGMES_2.4.15_27JAN2020/EquipmentContainer.hpp | 39 +- CGMES_2.4.15_27JAN2020/EquipmentVersion.cpp | 198 +- CGMES_2.4.15_27JAN2020/EquipmentVersion.hpp | 65 +- CGMES_2.4.15_27JAN2020/EquivalentBranch.cpp | 414 ++-- CGMES_2.4.15_27JAN2020/EquivalentBranch.hpp | 69 +- .../EquivalentEquipment.cpp | 67 +- .../EquivalentEquipment.hpp | 39 +- .../EquivalentInjection.cpp | 434 +++-- .../EquivalentInjection.hpp | 73 +- CGMES_2.4.15_27JAN2020/EquivalentNetwork.cpp | 61 +- CGMES_2.4.15_27JAN2020/EquivalentNetwork.hpp | 39 +- CGMES_2.4.15_27JAN2020/EquivalentShunt.cpp | 84 +- CGMES_2.4.15_27JAN2020/EquivalentShunt.hpp | 41 +- CGMES_2.4.15_27JAN2020/ExcAC1A.cpp | 584 +++--- CGMES_2.4.15_27JAN2020/ExcAC1A.hpp | 83 +- CGMES_2.4.15_27JAN2020/ExcAC2A.cpp | 780 ++++---- CGMES_2.4.15_27JAN2020/ExcAC2A.hpp | 95 +- CGMES_2.4.15_27JAN2020/ExcAC3A.cpp | 722 +++---- CGMES_2.4.15_27JAN2020/ExcAC3A.hpp | 89 +- CGMES_2.4.15_27JAN2020/ExcAC4A.cpp | 257 +-- CGMES_2.4.15_27JAN2020/ExcAC4A.hpp | 53 +- CGMES_2.4.15_27JAN2020/ExcAC5A.cpp | 486 ++--- CGMES_2.4.15_27JAN2020/ExcAC5A.hpp | 71 +- CGMES_2.4.15_27JAN2020/ExcAC6A.cpp | 609 +++--- CGMES_2.4.15_27JAN2020/ExcAC6A.hpp | 81 +- CGMES_2.4.15_27JAN2020/ExcAC8B.cpp | 701 +++---- CGMES_2.4.15_27JAN2020/ExcAC8B.hpp | 91 +- CGMES_2.4.15_27JAN2020/ExcANS.cpp | 410 ++-- CGMES_2.4.15_27JAN2020/ExcANS.hpp | 67 +- CGMES_2.4.15_27JAN2020/ExcAVR1.cpp | 356 ++-- CGMES_2.4.15_27JAN2020/ExcAVR1.hpp | 61 +- CGMES_2.4.15_27JAN2020/ExcAVR2.cpp | 383 ++-- CGMES_2.4.15_27JAN2020/ExcAVR2.hpp | 63 +- CGMES_2.4.15_27JAN2020/ExcAVR3.cpp | 350 ++-- CGMES_2.4.15_27JAN2020/ExcAVR3.hpp | 61 +- CGMES_2.4.15_27JAN2020/ExcAVR4.cpp | 410 ++-- CGMES_2.4.15_27JAN2020/ExcAVR4.hpp | 67 +- CGMES_2.4.15_27JAN2020/ExcAVR5.cpp | 111 +- CGMES_2.4.15_27JAN2020/ExcAVR5.hpp | 41 +- CGMES_2.4.15_27JAN2020/ExcAVR7.cpp | 553 +++--- CGMES_2.4.15_27JAN2020/ExcAVR7.hpp | 77 +- CGMES_2.4.15_27JAN2020/ExcBBC.cpp | 327 ++-- CGMES_2.4.15_27JAN2020/ExcBBC.hpp | 61 +- CGMES_2.4.15_27JAN2020/ExcCZ.cpp | 290 +-- CGMES_2.4.15_27JAN2020/ExcCZ.hpp | 55 +- CGMES_2.4.15_27JAN2020/ExcDC1A.cpp | 488 ++--- CGMES_2.4.15_27JAN2020/ExcDC1A.hpp | 73 +- CGMES_2.4.15_27JAN2020/ExcDC2A.cpp | 484 ++--- CGMES_2.4.15_27JAN2020/ExcDC2A.hpp | 73 +- CGMES_2.4.15_27JAN2020/ExcDC3A.cpp | 440 +++-- CGMES_2.4.15_27JAN2020/ExcDC3A.hpp | 71 +- CGMES_2.4.15_27JAN2020/ExcDC3A1.cpp | 406 ++-- CGMES_2.4.15_27JAN2020/ExcDC3A1.hpp | 65 +- CGMES_2.4.15_27JAN2020/ExcELIN1.cpp | 411 ++-- CGMES_2.4.15_27JAN2020/ExcELIN1.hpp | 67 +- CGMES_2.4.15_27JAN2020/ExcELIN2.cpp | 747 ++++---- CGMES_2.4.15_27JAN2020/ExcELIN2.hpp | 89 +- CGMES_2.4.15_27JAN2020/ExcHU.cpp | 356 ++-- CGMES_2.4.15_27JAN2020/ExcHU.hpp | 61 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.cpp | 486 ++--- CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.hpp | 73 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.cpp | 563 +++--- CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.hpp | 79 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.cpp | 565 +++--- CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.hpp | 79 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.cpp | 257 +-- CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.hpp | 53 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.cpp | 404 ++-- CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.hpp | 63 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.cpp | 586 +++--- CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.hpp | 79 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.cpp | 722 +++---- CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.hpp | 87 +- CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.cpp | 486 ++--- CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.hpp | 71 +- CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.cpp | 440 +++-- CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.hpp | 69 +- CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.cpp | 406 ++-- CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.hpp | 71 +- CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.cpp | 335 ++-- CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.hpp | 61 +- CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.cpp | 513 ++--- CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.hpp | 75 +- CGMES_2.4.15_27JAN2020/ExcIEEEST1A.cpp | 475 ++--- CGMES_2.4.15_27JAN2020/ExcIEEEST1A.hpp | 77 +- .../ExcIEEEST1AUELselectorKind.cpp | 71 +- .../ExcIEEEST1AUELselectorKind.hpp | 63 +- CGMES_2.4.15_27JAN2020/ExcIEEEST2A.cpp | 381 ++-- CGMES_2.4.15_27JAN2020/ExcIEEEST2A.hpp | 63 +- CGMES_2.4.15_27JAN2020/ExcIEEEST3A.cpp | 530 ++--- CGMES_2.4.15_27JAN2020/ExcIEEEST3A.hpp | 77 +- CGMES_2.4.15_27JAN2020/ExcIEEEST4B.cpp | 432 +++-- CGMES_2.4.15_27JAN2020/ExcIEEEST4B.hpp | 69 +- CGMES_2.4.15_27JAN2020/ExcIEEEST5B.cpp | 453 ++--- CGMES_2.4.15_27JAN2020/ExcIEEEST5B.hpp | 69 +- CGMES_2.4.15_27JAN2020/ExcIEEEST6B.cpp | 380 ++-- CGMES_2.4.15_27JAN2020/ExcIEEEST6B.hpp | 65 +- CGMES_2.4.15_27JAN2020/ExcIEEEST7B.cpp | 383 ++-- CGMES_2.4.15_27JAN2020/ExcIEEEST7B.hpp | 69 +- CGMES_2.4.15_27JAN2020/ExcOEX3T.cpp | 513 ++--- CGMES_2.4.15_27JAN2020/ExcOEX3T.hpp | 75 +- CGMES_2.4.15_27JAN2020/ExcPIC.cpp | 613 +++--- CGMES_2.4.15_27JAN2020/ExcPIC.hpp | 81 +- CGMES_2.4.15_27JAN2020/ExcREXS.cpp | 926 ++++----- CGMES_2.4.15_27JAN2020/ExcREXS.hpp | 109 +- .../ExcREXSFeedbackSignalKind.cpp | 67 +- .../ExcREXSFeedbackSignalKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/ExcSCRX.cpp | 240 +-- CGMES_2.4.15_27JAN2020/ExcSCRX.hpp | 57 +- CGMES_2.4.15_27JAN2020/ExcSEXS.cpp | 296 +-- CGMES_2.4.15_27JAN2020/ExcSEXS.hpp | 59 +- CGMES_2.4.15_27JAN2020/ExcSK.cpp | 826 ++++---- CGMES_2.4.15_27JAN2020/ExcSK.hpp | 103 +- CGMES_2.4.15_27JAN2020/ExcST1A.cpp | 484 ++--- CGMES_2.4.15_27JAN2020/ExcST1A.hpp | 71 +- CGMES_2.4.15_27JAN2020/ExcST2A.cpp | 413 ++-- CGMES_2.4.15_27JAN2020/ExcST2A.hpp | 67 +- CGMES_2.4.15_27JAN2020/ExcST3A.cpp | 530 ++--- CGMES_2.4.15_27JAN2020/ExcST3A.hpp | 77 +- CGMES_2.4.15_27JAN2020/ExcST4B.cpp | 511 ++--- CGMES_2.4.15_27JAN2020/ExcST4B.hpp | 77 +- CGMES_2.4.15_27JAN2020/ExcST6B.cpp | 567 +++--- CGMES_2.4.15_27JAN2020/ExcST6B.hpp | 83 +- .../ExcST6BOELselectorKind.cpp | 67 +- .../ExcST6BOELselectorKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/ExcST7B.cpp | 406 ++-- CGMES_2.4.15_27JAN2020/ExcST7B.hpp | 71 +- .../ExcST7BOELselectorKind.cpp | 71 +- .../ExcST7BOELselectorKind.hpp | 63 +- .../ExcST7BUELselectorKind.cpp | 71 +- .../ExcST7BUELselectorKind.hpp | 63 +- .../ExcitationSystemDynamics.cpp | 261 ++- .../ExcitationSystemDynamics.hpp | 69 +- .../ExcitationSystemUserDefined.cpp | 80 +- .../ExcitationSystemUserDefined.hpp | 41 +- .../ExternalNetworkInjection.cpp | 475 ++--- .../ExternalNetworkInjection.hpp | 79 +- CGMES_2.4.15_27JAN2020/Float.cpp | 77 + CGMES_2.4.15_27JAN2020/Float.hpp | 39 + CGMES_2.4.15_27JAN2020/FossilFuel.cpp | 88 +- CGMES_2.4.15_27JAN2020/FossilFuel.hpp | 41 +- .../FrancisGovernorControlKind.cpp | 67 +- .../FrancisGovernorControlKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/Frequency.cpp | 101 +- CGMES_2.4.15_27JAN2020/Frequency.hpp | 43 +- CGMES_2.4.15_27JAN2020/FuelType.cpp | 79 +- CGMES_2.4.15_27JAN2020/FuelType.hpp | 79 +- .../GenICompensationForGenJ.cpp | 140 +- .../GenICompensationForGenJ.hpp | 47 +- CGMES_2.4.15_27JAN2020/GeneratingUnit.cpp | 473 ++--- CGMES_2.4.15_27JAN2020/GeneratingUnit.hpp | 83 +- .../GeneratorControlSource.cpp | 71 +- .../GeneratorControlSource.hpp | 63 +- .../GenericNonLinearLoadModelKind.cpp | 63 +- .../GenericNonLinearLoadModelKind.hpp | 47 +- .../GeographicalLocationVersion.cpp | 158 +- .../GeographicalLocationVersion.hpp | 57 +- CGMES_2.4.15_27JAN2020/GeographicalRegion.cpp | 61 +- CGMES_2.4.15_27JAN2020/GeographicalRegion.hpp | 39 +- CGMES_2.4.15_27JAN2020/GovCT1.cpp | 975 +++++----- CGMES_2.4.15_27JAN2020/GovCT1.hpp | 109 +- CGMES_2.4.15_27JAN2020/GovCT2.cpp | 1566 +++++++-------- CGMES_2.4.15_27JAN2020/GovCT2.hpp | 153 +- CGMES_2.4.15_27JAN2020/GovGAST.cpp | 286 +-- CGMES_2.4.15_27JAN2020/GovGAST.hpp | 55 +- CGMES_2.4.15_27JAN2020/GovGAST1.cpp | 944 ++++----- CGMES_2.4.15_27JAN2020/GovGAST1.hpp | 105 +- CGMES_2.4.15_27JAN2020/GovGAST2.cpp | 904 ++++----- CGMES_2.4.15_27JAN2020/GovGAST2.hpp | 101 +- CGMES_2.4.15_27JAN2020/GovGAST3.cpp | 569 +++--- CGMES_2.4.15_27JAN2020/GovGAST3.hpp | 77 +- CGMES_2.4.15_27JAN2020/GovGAST4.cpp | 331 ++-- CGMES_2.4.15_27JAN2020/GovGAST4.hpp | 57 +- CGMES_2.4.15_27JAN2020/GovGASTWD.cpp | 925 ++++----- CGMES_2.4.15_27JAN2020/GovGASTWD.hpp | 101 +- CGMES_2.4.15_27JAN2020/GovHydro1.cpp | 408 ++-- CGMES_2.4.15_27JAN2020/GovHydro1.hpp | 63 +- CGMES_2.4.15_27JAN2020/GovHydro2.cpp | 807 ++++---- CGMES_2.4.15_27JAN2020/GovHydro2.hpp | 97 +- CGMES_2.4.15_27JAN2020/GovHydro3.cpp | 1000 +++++----- CGMES_2.4.15_27JAN2020/GovHydro3.hpp | 111 +- CGMES_2.4.15_27JAN2020/GovHydro4.cpp | 1054 +++++----- CGMES_2.4.15_27JAN2020/GovHydro4.hpp | 115 +- CGMES_2.4.15_27JAN2020/GovHydroDD.cpp | 973 +++++----- CGMES_2.4.15_27JAN2020/GovHydroDD.hpp | 109 +- CGMES_2.4.15_27JAN2020/GovHydroFrancis.cpp | 702 +++---- CGMES_2.4.15_27JAN2020/GovHydroFrancis.hpp | 97 +- CGMES_2.4.15_27JAN2020/GovHydroIEEE0.cpp | 232 +-- CGMES_2.4.15_27JAN2020/GovHydroIEEE0.hpp | 51 +- CGMES_2.4.15_27JAN2020/GovHydroIEEE2.cpp | 724 +++---- CGMES_2.4.15_27JAN2020/GovHydroIEEE2.hpp | 89 +- CGMES_2.4.15_27JAN2020/GovHydroPID.cpp | 919 ++++----- CGMES_2.4.15_27JAN2020/GovHydroPID.hpp | 105 +- CGMES_2.4.15_27JAN2020/GovHydroPID2.cpp | 594 +++--- CGMES_2.4.15_27JAN2020/GovHydroPID2.hpp | 83 +- CGMES_2.4.15_27JAN2020/GovHydroPelton.cpp | 727 +++---- CGMES_2.4.15_27JAN2020/GovHydroPelton.hpp | 97 +- CGMES_2.4.15_27JAN2020/GovHydroR.cpp | 1168 +++++------ CGMES_2.4.15_27JAN2020/GovHydroR.hpp | 123 +- CGMES_2.4.15_27JAN2020/GovHydroWEH.cpp | 1371 ++++++------- CGMES_2.4.15_27JAN2020/GovHydroWEH.hpp | 143 +- CGMES_2.4.15_27JAN2020/GovHydroWPID.cpp | 586 +++--- CGMES_2.4.15_27JAN2020/GovHydroWPID.hpp | 81 +- CGMES_2.4.15_27JAN2020/GovSteam0.cpp | 232 +-- CGMES_2.4.15_27JAN2020/GovSteam0.hpp | 51 +- CGMES_2.4.15_27JAN2020/GovSteam1.cpp | 1085 ++++++----- CGMES_2.4.15_27JAN2020/GovSteam1.hpp | 117 +- CGMES_2.4.15_27JAN2020/GovSteam2.cpp | 238 +-- CGMES_2.4.15_27JAN2020/GovSteam2.hpp | 53 +- CGMES_2.4.15_27JAN2020/GovSteamCC.cpp | 459 ++--- CGMES_2.4.15_27JAN2020/GovSteamCC.hpp | 69 +- CGMES_2.4.15_27JAN2020/GovSteamEU.cpp | 987 +++++----- CGMES_2.4.15_27JAN2020/GovSteamEU.hpp | 107 +- CGMES_2.4.15_27JAN2020/GovSteamFV2.cpp | 375 ++-- CGMES_2.4.15_27JAN2020/GovSteamFV2.hpp | 61 +- CGMES_2.4.15_27JAN2020/GovSteamFV3.cpp | 509 ++--- CGMES_2.4.15_27JAN2020/GovSteamFV3.hpp | 73 +- CGMES_2.4.15_27JAN2020/GovSteamFV4.cpp | 1403 +++++++------- CGMES_2.4.15_27JAN2020/GovSteamFV4.hpp | 139 +- CGMES_2.4.15_27JAN2020/GovSteamIEEE1.cpp | 563 +++--- CGMES_2.4.15_27JAN2020/GovSteamIEEE1.hpp | 77 +- CGMES_2.4.15_27JAN2020/GovSteamSGO.cpp | 350 ++-- CGMES_2.4.15_27JAN2020/GovSteamSGO.hpp | 61 +- .../GrossToNetActivePowerCurve.cpp | 67 +- .../GrossToNetActivePowerCurve.hpp | 39 +- CGMES_2.4.15_27JAN2020/Ground.cpp | 38 +- CGMES_2.4.15_27JAN2020/Ground.hpp | 35 +- CGMES_2.4.15_27JAN2020/GroundDisconnector.cpp | 38 +- CGMES_2.4.15_27JAN2020/GroundDisconnector.hpp | 35 +- CGMES_2.4.15_27JAN2020/GroundingImpedance.cpp | 61 +- CGMES_2.4.15_27JAN2020/GroundingImpedance.hpp | 37 +- .../HydroEnergyConversionKind.cpp | 63 +- .../HydroEnergyConversionKind.hpp | 47 +- .../HydroGeneratingUnit.cpp | 88 +- .../HydroGeneratingUnit.hpp | 41 +- .../HydroPlantStorageKind.cpp | 67 +- .../HydroPlantStorageKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/HydroPowerPlant.cpp | 105 +- CGMES_2.4.15_27JAN2020/HydroPowerPlant.hpp | 45 +- CGMES_2.4.15_27JAN2020/HydroPump.cpp | 92 +- CGMES_2.4.15_27JAN2020/HydroPump.hpp | 43 +- CGMES_2.4.15_27JAN2020/IEC61970.hpp | 47 +- CGMES_2.4.15_27JAN2020/IdentifiedObject.cpp | 129 +- CGMES_2.4.15_27JAN2020/IdentifiedObject.hpp | 49 +- CGMES_2.4.15_27JAN2020/IfdBaseKind.cpp | 71 +- CGMES_2.4.15_27JAN2020/IfdBaseKind.hpp | 63 +- CGMES_2.4.15_27JAN2020/Inductance.cpp | 101 +- CGMES_2.4.15_27JAN2020/Inductance.hpp | 43 +- .../InductancePerLength.cpp | 146 +- .../InductancePerLength.hpp | 57 +- CGMES_2.4.15_27JAN2020/InputSignalKind.cpp | 95 +- CGMES_2.4.15_27JAN2020/InputSignalKind.hpp | 111 +- CGMES_2.4.15_27JAN2020/Junction.cpp | 38 +- CGMES_2.4.15_27JAN2020/Junction.hpp | 35 +- CGMES_2.4.15_27JAN2020/Length.cpp | 101 +- CGMES_2.4.15_27JAN2020/Length.hpp | 43 +- CGMES_2.4.15_27JAN2020/Limit.cpp | 38 +- CGMES_2.4.15_27JAN2020/Limit.hpp | 35 +- CGMES_2.4.15_27JAN2020/LimitSet.cpp | 61 +- CGMES_2.4.15_27JAN2020/LimitSet.hpp | 37 +- CGMES_2.4.15_27JAN2020/LimitTypeKind.cpp | 83 +- CGMES_2.4.15_27JAN2020/LimitTypeKind.hpp | 87 +- CGMES_2.4.15_27JAN2020/Line.cpp | 67 +- CGMES_2.4.15_27JAN2020/Line.hpp | 39 +- .../LinearShuntCompensator.cpp | 136 +- .../LinearShuntCompensator.hpp | 45 +- CGMES_2.4.15_27JAN2020/LoadAggregate.cpp | 94 +- CGMES_2.4.15_27JAN2020/LoadAggregate.hpp | 43 +- CGMES_2.4.15_27JAN2020/LoadArea.cpp | 61 +- CGMES_2.4.15_27JAN2020/LoadArea.hpp | 39 +- CGMES_2.4.15_27JAN2020/LoadBreakSwitch.cpp | 38 +- CGMES_2.4.15_27JAN2020/LoadBreakSwitch.hpp | 35 +- CGMES_2.4.15_27JAN2020/LoadComposite.cpp | 323 ++-- CGMES_2.4.15_27JAN2020/LoadComposite.hpp | 59 +- CGMES_2.4.15_27JAN2020/LoadDynamics.cpp | 61 +- CGMES_2.4.15_27JAN2020/LoadDynamics.hpp | 39 +- .../LoadGenericNonLinear.cpp | 259 +-- .../LoadGenericNonLinear.hpp | 55 +- CGMES_2.4.15_27JAN2020/LoadGroup.cpp | 67 +- CGMES_2.4.15_27JAN2020/LoadGroup.hpp | 39 +- CGMES_2.4.15_27JAN2020/LoadMotor.cpp | 402 ++-- CGMES_2.4.15_27JAN2020/LoadMotor.hpp | 67 +- .../LoadResponseCharacteristic.cpp | 320 ++-- .../LoadResponseCharacteristic.hpp | 61 +- CGMES_2.4.15_27JAN2020/LoadStatic.cpp | 474 ++--- CGMES_2.4.15_27JAN2020/LoadStatic.hpp | 75 +- CGMES_2.4.15_27JAN2020/LoadUserDefined.cpp | 80 +- CGMES_2.4.15_27JAN2020/LoadUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/Location.cpp | 117 +- CGMES_2.4.15_27JAN2020/Location.hpp | 47 +- CGMES_2.4.15_27JAN2020/Measurement.cpp | 177 +- CGMES_2.4.15_27JAN2020/Measurement.hpp | 55 +- CGMES_2.4.15_27JAN2020/MeasurementValue.cpp | 136 +- CGMES_2.4.15_27JAN2020/MeasurementValue.hpp | 49 +- .../MeasurementValueQuality.cpp | 67 +- .../MeasurementValueQuality.hpp | 39 +- .../MeasurementValueSource.cpp | 61 +- .../MeasurementValueSource.hpp | 39 +- CGMES_2.4.15_27JAN2020/MechLoad1.cpp | 130 +- CGMES_2.4.15_27JAN2020/MechLoad1.hpp | 43 +- .../MechanicalLoadDynamics.cpp | 96 +- .../MechanicalLoadDynamics.hpp | 43 +- .../MechanicalLoadUserDefined.cpp | 80 +- .../MechanicalLoadUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/Money.cpp | 101 +- CGMES_2.4.15_27JAN2020/Money.hpp | 43 +- CGMES_2.4.15_27JAN2020/MonthDay.cpp | 58 +- CGMES_2.4.15_27JAN2020/MonthDay.hpp | 45 +- CGMES_2.4.15_27JAN2020/MutualCoupling.cpp | 280 +-- CGMES_2.4.15_27JAN2020/MutualCoupling.hpp | 63 +- CGMES_2.4.15_27JAN2020/NonConformLoad.cpp | 67 +- CGMES_2.4.15_27JAN2020/NonConformLoad.hpp | 39 +- .../NonConformLoadGroup.cpp | 82 +- .../NonConformLoadGroup.hpp | 43 +- .../NonConformLoadSchedule.cpp | 67 +- .../NonConformLoadSchedule.hpp | 39 +- .../NonlinearShuntCompensator.cpp | 61 +- .../NonlinearShuntCompensator.hpp | 39 +- .../NonlinearShuntCompensatorPoint.cpp | 192 +- .../NonlinearShuntCompensatorPoint.hpp | 51 +- .../NuclearGeneratingUnit.cpp | 38 +- .../NuclearGeneratingUnit.hpp | 35 +- CGMES_2.4.15_27JAN2020/OperationalLimit.cpp | 92 +- CGMES_2.4.15_27JAN2020/OperationalLimit.hpp | 43 +- .../OperationalLimitDirectionKind.cpp | 67 +- .../OperationalLimitDirectionKind.hpp | 55 +- .../OperationalLimitSet.cpp | 117 +- .../OperationalLimitSet.hpp | 47 +- .../OperationalLimitType.cpp | 134 +- .../OperationalLimitType.hpp | 47 +- CGMES_2.4.15_27JAN2020/OrientationKind.cpp | 59 +- CGMES_2.4.15_27JAN2020/OrientationKind.hpp | 39 +- CGMES_2.4.15_27JAN2020/OverexcLim2.cpp | 132 +- CGMES_2.4.15_27JAN2020/OverexcLim2.hpp | 43 +- CGMES_2.4.15_27JAN2020/OverexcLimIEEE.cpp | 182 +- CGMES_2.4.15_27JAN2020/OverexcLimIEEE.hpp | 47 +- CGMES_2.4.15_27JAN2020/OverexcLimX1.cpp | 288 +-- CGMES_2.4.15_27JAN2020/OverexcLimX1.hpp | 55 +- CGMES_2.4.15_27JAN2020/OverexcLimX2.cpp | 327 ++-- CGMES_2.4.15_27JAN2020/OverexcLimX2.hpp | 57 +- .../OverexcitationLimiterDynamics.cpp | 67 +- .../OverexcitationLimiterDynamics.hpp | 39 +- .../OverexcitationLimiterUserDefined.cpp | 80 +- .../OverexcitationLimiterUserDefined.hpp | 41 +- .../PFVArControllerType1Dynamics.cpp | 121 +- .../PFVArControllerType1Dynamics.hpp | 47 +- .../PFVArControllerType1UserDefined.cpp | 80 +- .../PFVArControllerType1UserDefined.hpp | 41 +- .../PFVArControllerType2Dynamics.cpp | 67 +- .../PFVArControllerType2Dynamics.hpp | 39 +- .../PFVArControllerType2UserDefined.cpp | 80 +- .../PFVArControllerType2UserDefined.hpp | 41 +- .../PFVArType1IEEEPFController.cpp | 222 ++- .../PFVArType1IEEEPFController.hpp | 53 +- .../PFVArType1IEEEVArController.cpp | 176 +- .../PFVArType1IEEEVArController.hpp | 49 +- CGMES_2.4.15_27JAN2020/PFVArType2Common1.cpp | 155 +- CGMES_2.4.15_27JAN2020/PFVArType2Common1.hpp | 45 +- .../PFVArType2IEEEPFController.cpp | 209 +- .../PFVArType2IEEEPFController.hpp | 51 +- .../PFVArType2IEEEVArController.cpp | 209 +- .../PFVArType2IEEEVArController.hpp | 51 +- CGMES_2.4.15_27JAN2020/PU.cpp | 101 +- CGMES_2.4.15_27JAN2020/PU.hpp | 43 +- CGMES_2.4.15_27JAN2020/PerCent.cpp | 101 +- CGMES_2.4.15_27JAN2020/PerCent.hpp | 43 +- .../PerLengthDCLineParameter.cpp | 117 +- .../PerLengthDCLineParameter.hpp | 54 +- CGMES_2.4.15_27JAN2020/PetersenCoil.cpp | 199 +- CGMES_2.4.15_27JAN2020/PetersenCoil.hpp | 53 +- .../PetersenCoilModeKind.cpp | 67 +- .../PetersenCoilModeKind.hpp | 55 +- CGMES_2.4.15_27JAN2020/PhaseCode.cpp | 139 +- CGMES_2.4.15_27JAN2020/PhaseCode.hpp | 199 +- CGMES_2.4.15_27JAN2020/PhaseTapChanger.cpp | 67 +- CGMES_2.4.15_27JAN2020/PhaseTapChanger.hpp | 39 +- .../PhaseTapChangerAsymmetrical.cpp | 61 +- .../PhaseTapChangerAsymmetrical.hpp | 37 +- .../PhaseTapChangerLinear.cpp | 107 +- .../PhaseTapChangerLinear.hpp | 41 +- .../PhaseTapChangerNonLinear.cpp | 107 +- .../PhaseTapChangerNonLinear.hpp | 41 +- .../PhaseTapChangerSymmetrical.cpp | 38 +- .../PhaseTapChangerSymmetrical.hpp | 35 +- .../PhaseTapChangerTable.cpp | 82 +- .../PhaseTapChangerTable.hpp | 43 +- .../PhaseTapChangerTablePoint.cpp | 92 +- .../PhaseTapChangerTablePoint.hpp | 41 +- .../PhaseTapChangerTabular.cpp | 67 +- .../PhaseTapChangerTabular.hpp | 42 +- CGMES_2.4.15_27JAN2020/PositionPoint.cpp | 124 +- CGMES_2.4.15_27JAN2020/PositionPoint.hpp | 47 +- .../PowerSystemResource.cpp | 112 +- .../PowerSystemResource.hpp | 47 +- .../PowerSystemStabilizerDynamics.cpp | 92 +- .../PowerSystemStabilizerDynamics.hpp | 43 +- .../PowerSystemStabilizerUserDefined.cpp | 80 +- .../PowerSystemStabilizerUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/PowerTransformer.cpp | 199 +- CGMES_2.4.15_27JAN2020/PowerTransformer.hpp | 55 +- .../PowerTransformerEnd.cpp | 385 ++-- .../PowerTransformerEnd.hpp | 73 +- .../ProprietaryParameterDynamics.cpp | 638 ++++--- .../ProprietaryParameterDynamics.hpp | 117 +- CGMES_2.4.15_27JAN2020/ProtectedSwitch.cpp | 38 +- CGMES_2.4.15_27JAN2020/ProtectedSwitch.hpp | 35 +- CGMES_2.4.15_27JAN2020/Pss1.cpp | 399 ++-- CGMES_2.4.15_27JAN2020/Pss1.hpp | 69 +- CGMES_2.4.15_27JAN2020/Pss1A.cpp | 586 +++--- CGMES_2.4.15_27JAN2020/Pss1A.hpp | 81 +- CGMES_2.4.15_27JAN2020/Pss2B.cpp | 853 +++++---- CGMES_2.4.15_27JAN2020/Pss2B.hpp | 99 +- CGMES_2.4.15_27JAN2020/Pss2ST.cpp | 464 ++--- CGMES_2.4.15_27JAN2020/Pss2ST.hpp | 71 +- CGMES_2.4.15_27JAN2020/Pss5.cpp | 457 ++--- CGMES_2.4.15_27JAN2020/Pss5.hpp | 73 +- CGMES_2.4.15_27JAN2020/PssELIN2.cpp | 329 ++-- CGMES_2.4.15_27JAN2020/PssELIN2.hpp | 59 +- CGMES_2.4.15_27JAN2020/PssIEEE1A.cpp | 340 ++-- CGMES_2.4.15_27JAN2020/PssIEEE1A.hpp | 59 +- CGMES_2.4.15_27JAN2020/PssIEEE2B.cpp | 739 +++---- CGMES_2.4.15_27JAN2020/PssIEEE2B.hpp | 91 +- CGMES_2.4.15_27JAN2020/PssIEEE3B.cpp | 507 ++--- CGMES_2.4.15_27JAN2020/PssIEEE3B.hpp | 75 +- CGMES_2.4.15_27JAN2020/PssIEEE4B.cpp | 1701 +++++++++-------- CGMES_2.4.15_27JAN2020/PssIEEE4B.hpp | 171 +- CGMES_2.4.15_27JAN2020/PssPTIST1.cpp | 325 ++-- CGMES_2.4.15_27JAN2020/PssPTIST1.hpp | 57 +- CGMES_2.4.15_27JAN2020/PssPTIST3.cpp | 942 ++++----- CGMES_2.4.15_27JAN2020/PssPTIST3.hpp | 105 +- CGMES_2.4.15_27JAN2020/PssSB4.cpp | 317 +-- CGMES_2.4.15_27JAN2020/PssSB4.hpp | 59 +- CGMES_2.4.15_27JAN2020/PssSH.cpp | 359 ++-- CGMES_2.4.15_27JAN2020/PssSH.hpp | 61 +- CGMES_2.4.15_27JAN2020/PssSK.cpp | 309 +-- CGMES_2.4.15_27JAN2020/PssSK.hpp | 57 +- CGMES_2.4.15_27JAN2020/PssWECC.cpp | 462 ++--- CGMES_2.4.15_27JAN2020/PssWECC.hpp | 71 +- CGMES_2.4.15_27JAN2020/Quality61850.cpp | 332 ++-- CGMES_2.4.15_27JAN2020/Quality61850.hpp | 59 +- CGMES_2.4.15_27JAN2020/RaiseLowerCommand.cpp | 67 +- CGMES_2.4.15_27JAN2020/RaiseLowerCommand.hpp | 39 +- CGMES_2.4.15_27JAN2020/RatioTapChanger.cpp | 138 +- CGMES_2.4.15_27JAN2020/RatioTapChanger.hpp | 49 +- .../RatioTapChangerTable.cpp | 82 +- .../RatioTapChangerTable.hpp | 43 +- .../RatioTapChangerTablePoint.cpp | 67 +- .../RatioTapChangerTablePoint.hpp | 39 +- CGMES_2.4.15_27JAN2020/Reactance.cpp | 101 +- CGMES_2.4.15_27JAN2020/Reactance.hpp | 43 +- .../ReactiveCapabilityCurve.cpp | 82 +- .../ReactiveCapabilityCurve.hpp | 43 +- CGMES_2.4.15_27JAN2020/ReactivePower.cpp | 101 +- CGMES_2.4.15_27JAN2020/ReactivePower.hpp | 43 +- .../RegularIntervalSchedule.cpp | 104 +- .../RegularIntervalSchedule.hpp | 45 +- CGMES_2.4.15_27JAN2020/RegularTimePoint.cpp | 138 +- CGMES_2.4.15_27JAN2020/RegularTimePoint.hpp | 45 +- CGMES_2.4.15_27JAN2020/RegulatingCondEq.cpp | 92 +- CGMES_2.4.15_27JAN2020/RegulatingCondEq.hpp | 41 +- CGMES_2.4.15_27JAN2020/RegulatingControl.cpp | 253 +-- CGMES_2.4.15_27JAN2020/RegulatingControl.hpp | 61 +- .../RegulatingControlModeKind.cpp | 87 +- .../RegulatingControlModeKind.hpp | 95 +- CGMES_2.4.15_27JAN2020/RegulationSchedule.cpp | 67 +- CGMES_2.4.15_27JAN2020/RegulationSchedule.hpp | 39 +- CGMES_2.4.15_27JAN2020/RemoteInputSignal.cpp | 309 +-- CGMES_2.4.15_27JAN2020/RemoteInputSignal.hpp | 73 +- CGMES_2.4.15_27JAN2020/RemoteSignalKind.cpp | 91 +- CGMES_2.4.15_27JAN2020/RemoteSignalKind.hpp | 103 +- CGMES_2.4.15_27JAN2020/ReportingGroup.cpp | 82 +- CGMES_2.4.15_27JAN2020/ReportingGroup.hpp | 43 +- CGMES_2.4.15_27JAN2020/Resistance.cpp | 101 +- CGMES_2.4.15_27JAN2020/Resistance.hpp | 43 +- .../ResistancePerLength.cpp | 146 +- .../ResistancePerLength.hpp | 57 +- CGMES_2.4.15_27JAN2020/RotatingMachine.cpp | 216 ++- CGMES_2.4.15_27JAN2020/RotatingMachine.hpp | 59 +- .../RotatingMachineDynamics.cpp | 176 +- .../RotatingMachineDynamics.hpp | 51 +- CGMES_2.4.15_27JAN2020/RotationSpeed.cpp | 146 +- CGMES_2.4.15_27JAN2020/RotationSpeed.hpp | 57 +- CGMES_2.4.15_27JAN2020/RotorKind.cpp | 63 +- CGMES_2.4.15_27JAN2020/RotorKind.hpp | 47 +- CGMES_2.4.15_27JAN2020/SVCControlMode.cpp | 63 +- CGMES_2.4.15_27JAN2020/SVCControlMode.hpp | 41 +- CGMES_2.4.15_27JAN2020/Season.cpp | 99 +- CGMES_2.4.15_27JAN2020/Season.hpp | 45 +- .../SeasonDayTypeSchedule.cpp | 92 +- .../SeasonDayTypeSchedule.hpp | 43 +- CGMES_2.4.15_27JAN2020/Seconds.cpp | 101 +- CGMES_2.4.15_27JAN2020/Seconds.hpp | 43 +- CGMES_2.4.15_27JAN2020/SeriesCompensator.cpp | 207 +- CGMES_2.4.15_27JAN2020/SeriesCompensator.hpp | 53 +- CGMES_2.4.15_27JAN2020/SetPoint.cpp | 84 +- CGMES_2.4.15_27JAN2020/SetPoint.hpp | 39 +- .../ShortCircuitRotorKind.cpp | 71 +- .../ShortCircuitRotorKind.hpp | 63 +- CGMES_2.4.15_27JAN2020/ShuntCompensator.cpp | 277 +-- CGMES_2.4.15_27JAN2020/ShuntCompensator.hpp | 65 +- CGMES_2.4.15_27JAN2020/Simple_Float.cpp | 101 +- CGMES_2.4.15_27JAN2020/Simple_Float.hpp | 43 +- .../SolarGeneratingUnit.cpp | 38 +- .../SolarGeneratingUnit.hpp | 35 +- CGMES_2.4.15_27JAN2020/Source.cpp | 67 +- CGMES_2.4.15_27JAN2020/Source.hpp | 55 +- .../StateVariablesVersion.cpp | 158 +- .../StateVariablesVersion.hpp | 57 +- .../StaticLoadModelKind.cpp | 71 +- .../StaticLoadModelKind.hpp | 63 +- .../StaticVarCompensator.cpp | 183 +- .../StaticVarCompensator.hpp | 51 +- CGMES_2.4.15_27JAN2020/StationSupply.cpp | 38 +- CGMES_2.4.15_27JAN2020/StationSupply.hpp | 35 +- .../SteadyStateHypothesisVersion.cpp | 158 +- .../SteadyStateHypothesisVersion.hpp | 57 +- CGMES_2.4.15_27JAN2020/String.cpp | 49 + CGMES_2.4.15_27JAN2020/String.hpp | 35 + CGMES_2.4.15_27JAN2020/StringMeasurement.cpp | 61 +- CGMES_2.4.15_27JAN2020/StringMeasurement.hpp | 39 +- .../StringMeasurementValue.cpp | 81 +- .../StringMeasurementValue.hpp | 41 +- .../SubGeographicalRegion.cpp | 132 +- .../SubGeographicalRegion.hpp | 51 +- CGMES_2.4.15_27JAN2020/SubLoadArea.cpp | 88 +- CGMES_2.4.15_27JAN2020/SubLoadArea.hpp | 43 +- CGMES_2.4.15_27JAN2020/Substation.cpp | 107 +- CGMES_2.4.15_27JAN2020/Substation.hpp | 47 +- CGMES_2.4.15_27JAN2020/Susceptance.cpp | 101 +- CGMES_2.4.15_27JAN2020/Susceptance.hpp | 43 +- CGMES_2.4.15_27JAN2020/SvInjection.cpp | 111 +- CGMES_2.4.15_27JAN2020/SvInjection.hpp | 43 +- CGMES_2.4.15_27JAN2020/SvPowerFlow.cpp | 115 +- CGMES_2.4.15_27JAN2020/SvPowerFlow.hpp | 43 +- .../SvShuntCompensatorSections.cpp | 88 +- .../SvShuntCompensatorSections.hpp | 41 +- CGMES_2.4.15_27JAN2020/SvStatus.cpp | 92 +- CGMES_2.4.15_27JAN2020/SvStatus.hpp | 41 +- CGMES_2.4.15_27JAN2020/SvTapStep.cpp | 88 +- CGMES_2.4.15_27JAN2020/SvTapStep.hpp | 41 +- CGMES_2.4.15_27JAN2020/SvVoltage.cpp | 111 +- CGMES_2.4.15_27JAN2020/SvVoltage.hpp | 43 +- CGMES_2.4.15_27JAN2020/Switch.cpp | 153 +- CGMES_2.4.15_27JAN2020/Switch.hpp | 47 +- CGMES_2.4.15_27JAN2020/SwitchSchedule.cpp | 67 +- CGMES_2.4.15_27JAN2020/SwitchSchedule.hpp | 39 +- CGMES_2.4.15_27JAN2020/SynchronousMachine.cpp | 602 +++--- CGMES_2.4.15_27JAN2020/SynchronousMachine.hpp | 99 +- .../SynchronousMachineDetailed.cpp | 161 +- .../SynchronousMachineDetailed.hpp | 49 +- .../SynchronousMachineDynamics.cpp | 169 +- .../SynchronousMachineDynamics.hpp | 55 +- .../SynchronousMachineEquivalentCircuit.cpp | 323 ++-- .../SynchronousMachineEquivalentCircuit.hpp | 57 +- .../SynchronousMachineKind.cpp | 83 +- .../SynchronousMachineKind.hpp | 66 +- .../SynchronousMachineModelKind.cpp | 75 +- .../SynchronousMachineModelKind.hpp | 71 +- .../SynchronousMachineOperatingMode.cpp | 67 +- .../SynchronousMachineOperatingMode.hpp | 46 +- .../SynchronousMachineSimplified.cpp | 38 +- .../SynchronousMachineSimplified.hpp | 35 +- ...ynchronousMachineTimeConstantReactance.cpp | 412 ++-- ...ynchronousMachineTimeConstantReactance.hpp | 69 +- .../SynchronousMachineUserDefined.cpp | 80 +- .../SynchronousMachineUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/TapChanger.cpp | 332 ++-- CGMES_2.4.15_27JAN2020/TapChanger.hpp | 67 +- CGMES_2.4.15_27JAN2020/TapChangerControl.cpp | 61 +- CGMES_2.4.15_27JAN2020/TapChangerControl.hpp | 39 +- .../TapChangerTablePoint.cpp | 176 +- .../TapChangerTablePoint.hpp | 52 +- CGMES_2.4.15_27JAN2020/TapSchedule.cpp | 67 +- CGMES_2.4.15_27JAN2020/TapSchedule.hpp | 39 +- CGMES_2.4.15_27JAN2020/Temperature.cpp | 101 +- CGMES_2.4.15_27JAN2020/Temperature.hpp | 43 +- CGMES_2.4.15_27JAN2020/Terminal.cpp | 337 ++-- CGMES_2.4.15_27JAN2020/Terminal.hpp | 79 +- CGMES_2.4.15_27JAN2020/TextDiagramObject.cpp | 50 +- CGMES_2.4.15_27JAN2020/TextDiagramObject.hpp | 37 +- .../ThermalGeneratingUnit.cpp | 61 +- .../ThermalGeneratingUnit.hpp | 39 +- CGMES_2.4.15_27JAN2020/TieFlow.cpp | 121 +- CGMES_2.4.15_27JAN2020/TieFlow.hpp | 45 +- CGMES_2.4.15_27JAN2020/TopologicalIsland.cpp | 88 +- CGMES_2.4.15_27JAN2020/TopologicalIsland.hpp | 41 +- CGMES_2.4.15_27JAN2020/TopologicalNode.cpp | 382 ++-- CGMES_2.4.15_27JAN2020/TopologicalNode.hpp | 83 +- .../TopologyBoundaryVersion.cpp | 158 +- .../TopologyBoundaryVersion.hpp | 57 +- CGMES_2.4.15_27JAN2020/TopologyVersion.cpp | 158 +- CGMES_2.4.15_27JAN2020/TopologyVersion.hpp | 57 +- .../TransformerControlMode.cpp | 63 +- .../TransformerControlMode.hpp | 47 +- CGMES_2.4.15_27JAN2020/TransformerEnd.cpp | 242 ++- CGMES_2.4.15_27JAN2020/TransformerEnd.hpp | 63 +- CGMES_2.4.15_27JAN2020/TurbLCFB1.cpp | 352 ++-- CGMES_2.4.15_27JAN2020/TurbLCFB1.hpp | 59 +- .../TurbineGovernorDynamics.cpp | 118 +- .../TurbineGovernorDynamics.hpp | 47 +- .../TurbineGovernorUserDefined.cpp | 80 +- .../TurbineGovernorUserDefined.hpp | 41 +- .../TurbineLoadControllerDynamics.cpp | 67 +- .../TurbineLoadControllerDynamics.hpp | 39 +- .../TurbineLoadControllerUserDefined.cpp | 80 +- .../TurbineLoadControllerUserDefined.hpp | 41 +- .../UnderexcLim2Simplified.cpp | 207 +- .../UnderexcLim2Simplified.hpp | 49 +- CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.cpp | 401 ++-- CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.hpp | 65 +- CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.cpp | 1100 ++++++----- CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.hpp | 117 +- CGMES_2.4.15_27JAN2020/UnderexcLimX1.cpp | 186 +- CGMES_2.4.15_27JAN2020/UnderexcLimX1.hpp | 50 +- CGMES_2.4.15_27JAN2020/UnderexcLimX2.cpp | 207 +- CGMES_2.4.15_27JAN2020/UnderexcLimX2.hpp | 52 +- .../UnderexcitationLimiterDynamics.cpp | 95 +- .../UnderexcitationLimiterDynamics.hpp | 43 +- .../UnderexcitationLimiterUserDefined.cpp | 80 +- .../UnderexcitationLimiterUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/UnitMultiplier.cpp | 99 +- CGMES_2.4.15_27JAN2020/UnitMultiplier.hpp | 119 +- CGMES_2.4.15_27JAN2020/UnitSymbol.cpp | 163 +- CGMES_2.4.15_27JAN2020/UnitSymbol.hpp | 247 +-- CGMES_2.4.15_27JAN2020/VAdjIEEE.cpp | 186 +- CGMES_2.4.15_27JAN2020/VAdjIEEE.hpp | 49 +- CGMES_2.4.15_27JAN2020/VCompIEEEType1.cpp | 111 +- CGMES_2.4.15_27JAN2020/VCompIEEEType1.hpp | 41 +- CGMES_2.4.15_27JAN2020/VCompIEEEType2.cpp | 87 +- CGMES_2.4.15_27JAN2020/VCompIEEEType2.hpp | 44 +- CGMES_2.4.15_27JAN2020/Validity.cpp | 67 +- CGMES_2.4.15_27JAN2020/Validity.hpp | 55 +- CGMES_2.4.15_27JAN2020/ValueAliasSet.cpp | 120 +- CGMES_2.4.15_27JAN2020/ValueAliasSet.hpp | 51 +- CGMES_2.4.15_27JAN2020/ValueToAlias.cpp | 92 +- CGMES_2.4.15_27JAN2020/ValueToAlias.hpp | 41 +- CGMES_2.4.15_27JAN2020/VisibilityLayer.cpp | 84 +- CGMES_2.4.15_27JAN2020/VisibilityLayer.hpp | 41 +- CGMES_2.4.15_27JAN2020/Voltage.cpp | 101 +- CGMES_2.4.15_27JAN2020/Voltage.hpp | 43 +- .../VoltageAdjusterDynamics.cpp | 67 +- .../VoltageAdjusterDynamics.hpp | 39 +- .../VoltageAdjusterUserDefined.cpp | 80 +- .../VoltageAdjusterUserDefined.hpp | 41 +- .../VoltageCompensatorDynamics.cpp | 95 +- .../VoltageCompensatorDynamics.hpp | 43 +- .../VoltageCompensatorUserDefined.cpp | 80 +- .../VoltageCompensatorUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/VoltageLevel.cpp | 161 +- CGMES_2.4.15_27JAN2020/VoltageLevel.hpp | 51 +- CGMES_2.4.15_27JAN2020/VoltageLimit.cpp | 61 +- CGMES_2.4.15_27JAN2020/VoltageLimit.hpp | 37 +- .../VoltagePerReactivePower.cpp | 146 +- .../VoltagePerReactivePower.hpp | 57 +- CGMES_2.4.15_27JAN2020/VolumeFlowRate.cpp | 146 +- CGMES_2.4.15_27JAN2020/VolumeFlowRate.hpp | 57 +- CGMES_2.4.15_27JAN2020/VsCapabilityCurve.cpp | 61 +- CGMES_2.4.15_27JAN2020/VsCapabilityCurve.hpp | 39 +- CGMES_2.4.15_27JAN2020/VsConverter.cpp | 348 ++-- CGMES_2.4.15_27JAN2020/VsConverter.hpp | 71 +- CGMES_2.4.15_27JAN2020/VsPpccControlKind.cpp | 75 +- CGMES_2.4.15_27JAN2020/VsPpccControlKind.hpp | 71 +- CGMES_2.4.15_27JAN2020/VsQpccControlKind.cpp | 67 +- CGMES_2.4.15_27JAN2020/VsQpccControlKind.hpp | 49 +- CGMES_2.4.15_27JAN2020/WindAeroConstIEC.cpp | 66 +- CGMES_2.4.15_27JAN2020/WindAeroConstIEC.hpp | 39 +- CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.cpp | 179 +- CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.hpp | 51 +- CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.cpp | 198 +- CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.hpp | 55 +- CGMES_2.4.15_27JAN2020/WindContPType3IEC.cpp | 571 +++--- CGMES_2.4.15_27JAN2020/WindContPType3IEC.hpp | 87 +- CGMES_2.4.15_27JAN2020/WindContPType4aIEC.cpp | 133 +- CGMES_2.4.15_27JAN2020/WindContPType4aIEC.hpp | 45 +- CGMES_2.4.15_27JAN2020/WindContPType4bIEC.cpp | 156 +- CGMES_2.4.15_27JAN2020/WindContPType4bIEC.hpp | 47 +- .../WindContPitchAngleIEC.cpp | 304 +-- .../WindContPitchAngleIEC.hpp | 63 +- CGMES_2.4.15_27JAN2020/WindContQIEC.cpp | 704 +++---- CGMES_2.4.15_27JAN2020/WindContQIEC.hpp | 91 +- CGMES_2.4.15_27JAN2020/WindContRotorRIEC.cpp | 293 +-- CGMES_2.4.15_27JAN2020/WindContRotorRIEC.hpp | 61 +- .../WindDynamicsLookupTable.cpp | 238 ++- .../WindDynamicsLookupTable.hpp | 61 +- .../WindGenTurbineType1IEC.cpp | 67 +- .../WindGenTurbineType1IEC.hpp | 39 +- .../WindGenTurbineType2IEC.cpp | 92 +- .../WindGenTurbineType2IEC.hpp | 43 +- .../WindGenTurbineType3IEC.cpp | 196 +- .../WindGenTurbineType3IEC.hpp | 55 +- .../WindGenTurbineType3aIEC.cpp | 111 +- .../WindGenTurbineType3aIEC.hpp | 43 +- .../WindGenTurbineType3bIEC.cpp | 157 +- .../WindGenTurbineType3bIEC.hpp | 49 +- CGMES_2.4.15_27JAN2020/WindGenType4IEC.cpp | 132 +- CGMES_2.4.15_27JAN2020/WindGenType4IEC.hpp | 43 +- CGMES_2.4.15_27JAN2020/WindGenUnitKind.cpp | 63 +- CGMES_2.4.15_27JAN2020/WindGenUnitKind.hpp | 47 +- CGMES_2.4.15_27JAN2020/WindGeneratingUnit.cpp | 61 +- CGMES_2.4.15_27JAN2020/WindGeneratingUnit.hpp | 37 +- .../WindLVRTQcontrolModesKind.cpp | 67 +- .../WindLVRTQcontrolModesKind.hpp | 55 +- .../WindLookupTableFunctionKind.cpp | 75 +- .../WindLookupTableFunctionKind.hpp | 71 +- CGMES_2.4.15_27JAN2020/WindMechIEC.cpp | 208 +- CGMES_2.4.15_27JAN2020/WindMechIEC.hpp | 55 +- .../WindPitchContEmulIEC.cpp | 302 +-- .../WindPitchContEmulIEC.hpp | 61 +- CGMES_2.4.15_27JAN2020/WindPlantDynamics.cpp | 88 +- CGMES_2.4.15_27JAN2020/WindPlantDynamics.hpp | 43 +- .../WindPlantFreqPcontrolIEC.cpp | 327 ++-- .../WindPlantFreqPcontrolIEC.hpp | 65 +- CGMES_2.4.15_27JAN2020/WindPlantIEC.cpp | 92 +- CGMES_2.4.15_27JAN2020/WindPlantIEC.hpp | 43 +- .../WindPlantReactiveControlIEC.cpp | 381 ++-- .../WindPlantReactiveControlIEC.hpp | 69 +- .../WindPlantUserDefined.cpp | 80 +- .../WindPlantUserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/WindProtectionIEC.cpp | 280 +-- CGMES_2.4.15_27JAN2020/WindProtectionIEC.hpp | 59 +- .../WindQcontrolModesKind.cpp | 71 +- .../WindQcontrolModesKind.hpp | 63 +- .../WindTurbineType1or2Dynamics.cpp | 96 +- .../WindTurbineType1or2Dynamics.hpp | 43 +- .../WindTurbineType1or2IEC.cpp | 92 +- .../WindTurbineType1or2IEC.hpp | 43 +- .../WindTurbineType3or4Dynamics.cpp | 115 +- .../WindTurbineType3or4Dynamics.hpp | 47 +- .../WindTurbineType3or4IEC.cpp | 123 +- .../WindTurbineType3or4IEC.hpp | 47 +- .../WindTurbineType4aIEC.cpp | 67 +- .../WindTurbineType4aIEC.hpp | 39 +- .../WindTurbineType4bIEC.cpp | 92 +- .../WindTurbineType4bIEC.hpp | 43 +- .../WindType1or2UserDefined.cpp | 80 +- .../WindType1or2UserDefined.hpp | 41 +- .../WindType3or4UserDefined.cpp | 80 +- .../WindType3or4UserDefined.hpp | 41 +- CGMES_2.4.15_27JAN2020/WindingConnection.cpp | 83 +- CGMES_2.4.15_27JAN2020/WindingConnection.hpp | 87 +- src/Aliases.hpp | 106 - src/AliasesAssignment.hpp | 2 - src/AliasesTask.hpp | 10 - src/CIMContentHandler.cpp | 11 +- src/CIMExceptions.cpp | 1 - src/CIMExceptions.hpp | 2 +- src/ModelDescriptionHandler.cpp | 45 +- src/ModelDescriptionHandler.hpp | 4 +- static/BaseClass.cpp | 16 +- static/BaseClass.hpp | 19 +- static/Boolean.cpp | 63 +- static/Boolean.hpp | 31 +- static/Date.cpp | 20 - static/Date.hpp | 26 - static/Float.cpp | 67 - static/Float.hpp | 42 - static/IEC61970/IEC61970CIMVersion.cpp | 6 +- static/IEC61970/IEC61970CIMVersion.h | 28 +- static/Integer.cpp | 96 +- static/Integer.hpp | 43 +- static/String.hpp | 14 - static/Task.cpp | 17 +- static/UnknownType.cpp | 3 + static/UnknownType.hpp | 2 + static/assignments.cpp | 1 - 1949 files changed, 150938 insertions(+), 124939 deletions(-) create mode 100644 CGMES_2.4.15_16FEB2016/Date.cpp create mode 100644 CGMES_2.4.15_16FEB2016/Date.hpp create mode 100644 CGMES_2.4.15_16FEB2016/Float.cpp create mode 100644 CGMES_2.4.15_16FEB2016/Float.hpp create mode 100644 CGMES_2.4.15_16FEB2016/String.cpp create mode 100644 CGMES_2.4.15_16FEB2016/String.hpp create mode 100644 CGMES_2.4.15_27JAN2020/Date.cpp create mode 100644 CGMES_2.4.15_27JAN2020/Date.hpp create mode 100644 CGMES_2.4.15_27JAN2020/Float.cpp create mode 100644 CGMES_2.4.15_27JAN2020/Float.hpp create mode 100644 CGMES_2.4.15_27JAN2020/String.cpp create mode 100644 CGMES_2.4.15_27JAN2020/String.hpp delete mode 100644 src/Aliases.hpp delete mode 100644 src/AliasesAssignment.hpp delete mode 100644 src/AliasesTask.hpp delete mode 100644 static/Date.cpp delete mode 100644 static/Date.hpp delete mode 100644 static/Float.cpp delete mode 100644 static/Float.hpp delete mode 100644 static/String.hpp diff --git a/CGMES_2.4.15_16FEB2016/ACDCConverter.cpp b/CGMES_2.4.15_16FEB2016/ACDCConverter.cpp index 80fd0ec7c..8df7daeda 100644 --- a/CGMES_2.4.15_16FEB2016/ACDCConverter.cpp +++ b/CGMES_2.4.15_16FEB2016/ACDCConverter.cpp @@ -1,314 +1,348 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACDCConverter.hpp" +#include +#include + +#include "ACDCConverterDCTerminal.hpp" +#include "Terminal.hpp" #include "ApparentPower.hpp" +#include "CurrentFlow.hpp" #include "ActivePower.hpp" #include "Voltage.hpp" #include "Voltage.hpp" #include "Integer.hpp" +#include "ActivePower.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Voltage.hpp" #include "Resistance.hpp" #include "ActivePowerPerCurrentFlow.hpp" -#include "Voltage.hpp" -#include "ACDCConverterDCTerminal.hpp" -#include "Terminal.hpp" -#include "CurrentFlow.hpp" #include "ActivePower.hpp" #include "Voltage.hpp" #include "Voltage.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" -#include "ActivePower.hpp" +#include "Voltage.hpp" #include "Voltage.hpp" using namespace CIMPP; -ACDCConverter::ACDCConverter(): switchingLoss(nullptr), PccTerminal(nullptr) {}; - +ACDCConverter::ACDCConverter() : PccTerminal(nullptr) {}; ACDCConverter::~ACDCConverter() {}; +bool assign_ACDCConverter_baseS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->baseS; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_idc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->idc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_idleLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->idleLoss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_maxUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_minUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverter_switchingLoss(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - element->switchingLoss = dynamic_cast(BaseClass_ptr2); - if(element->switchingLoss != nullptr) - return true; - } - return false; +bool assign_ACDCConverter_numberOfValves(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->numberOfValves; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ACDCConverter_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverter_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ACDCConverter_poleLossP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->poleLossP; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Terminal_ConverterDCSides(BaseClass*, BaseClass*); -bool assign_ACDCConverter_PccTerminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - element->PccTerminal = dynamic_cast(BaseClass_ptr2); - if(element->PccTerminal != nullptr) - return assign_Terminal_ConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ACDCConverter_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ACDCConverter_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_resistiveLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistiveLoss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_switchingLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->switchingLoss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_targetPpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetPpcc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_targetUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_udc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_valveU0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valveU0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverter_baseS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->baseS; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass*, BaseClass*); +bool assign_ACDCConverter_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCConverter* element = dynamic_cast(BaseClass_ptr1); + ACDCConverterDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ACDCConverter_idleLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->idleLoss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_ConverterDCSides(BaseClass*, BaseClass*); +bool assign_ACDCConverter_PccTerminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCConverter* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PccTerminal != element2) + { + element->PccTerminal = element2; + return assign_Terminal_ConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ACDCConverter_maxUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_minUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_numberOfValves(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->numberOfValves; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_resistiveLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistiveLoss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_valveU0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valveU0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_idc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->idc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_poleLossP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->poleLossP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_udc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_targetPpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetPpcc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_targetUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ACDCConverter_factory() { - return new ACDCConverter; - } +const char ACDCConverter::debugName[] = "ACDCConverter"; +const char* ACDCConverter::debugString() const +{ + return ACDCConverter::debugName; } -void ACDCConverter::addConstructToMap(std::unordered_map& factory_map) { +void ACDCConverter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACDCConverter"), &ACDCConverter_factory)); } -void ACDCConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ACDCConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.baseS"), &assign_ACDCConverter_baseS)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.idc"), &assign_ACDCConverter_idc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.idleLoss"), &assign_ACDCConverter_idleLoss)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.maxUdc"), &assign_ACDCConverter_maxUdc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.minUdc"), &assign_ACDCConverter_minUdc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.numberOfValves"), &assign_ACDCConverter_numberOfValves)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.ratedUdc"), &assign_ACDCConverter_ratedUdc)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.resistiveLoss"), &assign_ACDCConverter_resistiveLoss)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.valveU0"), &assign_ACDCConverter_valveU0)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.idc"), &assign_ACDCConverter_idc)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.poleLossP"), &assign_ACDCConverter_poleLossP)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.uc"), &assign_ACDCConverter_uc)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.udc"), &assign_ACDCConverter_udc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.p"), &assign_ACDCConverter_p)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.poleLossP"), &assign_ACDCConverter_poleLossP)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.q"), &assign_ACDCConverter_q)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.ratedUdc"), &assign_ACDCConverter_ratedUdc)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.resistiveLoss"), &assign_ACDCConverter_resistiveLoss)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.switchingLoss"), &assign_ACDCConverter_switchingLoss)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.targetPpcc"), &assign_ACDCConverter_targetPpcc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.targetUdc"), &assign_ACDCConverter_targetUdc)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.uc"), &assign_ACDCConverter_uc)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.udc"), &assign_ACDCConverter_udc)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.valveU0"), &assign_ACDCConverter_valveU0)); } -void ACDCConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.switchingLoss"), &assign_ACDCConverter_switchingLoss)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.DCTerminals"), &assign_ACDCConverter_DCTerminals)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.PccTerminal"), &assign_ACDCConverter_PccTerminal)); - } - -const char ACDCConverter::debugName[] = "ACDCConverter"; -const char* ACDCConverter::debugString() +void ACDCConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ACDCConverter::debugName; + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.DCTerminals"), &assign_ACDCConverter_DCTerminals)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.PccTerminal"), &assign_ACDCConverter_PccTerminal)); } const BaseClassDefiner ACDCConverter::declare() @@ -316,4 +350,10 @@ const BaseClassDefiner ACDCConverter::declare() return BaseClassDefiner(ACDCConverter::addConstructToMap, ACDCConverter::addPrimitiveAssignFnsToMap, ACDCConverter::addClassAssignFnsToMap, ACDCConverter::debugName); } - +namespace CIMPP +{ + BaseClass* ACDCConverter_factory() + { + return new ACDCConverter; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ACDCConverter.hpp b/CGMES_2.4.15_16FEB2016/ACDCConverter.hpp index f1b69862a..ea38875a1 100644 --- a/CGMES_2.4.15_16FEB2016/ACDCConverter.hpp +++ b/CGMES_2.4.15_16FEB2016/ACDCConverter.hpp @@ -1,65 +1,66 @@ #ifndef ACDCConverter_H #define ACDCConverter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "ApparentPower.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Voltage.hpp" -#include "Integer.hpp" -#include "Resistance.hpp" +#include "ActivePowerPerCurrentFlow.hpp" +#include "ApparentPower.hpp" #include "CurrentFlow.hpp" +#include "Integer.hpp" #include "ReactivePower.hpp" +#include "Resistance.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ACDCConverterDCTerminal; + class Terminal; -class ActivePowerPerCurrentFlow; -class ACDCConverterDCTerminal; -class Terminal; /* A unit with valves for three phases, together with unit control equipment, essential protective and switching devices, DC storage capacitors, phase reactors and auxiliaries, if any, used for conversion. */ - class ACDCConverter: public ConductingEquipment + class ACDCConverter : public ConductingEquipment { - public: - CIMPP::ApparentPower baseS; /* Base apparent power of the converter pole. Default: nullptr */ - CIMPP::ActivePower idleLoss; /* Active power loss in pole at no power transfer. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Voltage maxUdc; /* The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Voltage minUdc; /* Min allowed converter DC voltage. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Integer numberOfValves; /* Number of valves in the converter. Used in loss calculations. Default: 0 */ - CIMPP::Voltage ratedUdc; /* Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Resistance resistiveLoss; /* Converter configuration data used in power flow. Refer to poleLossP. Default: nullptr */ - CIMPP::ActivePowerPerCurrentFlow* switchingLoss; /* Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: nullptr */ - CIMPP::Voltage valveU0; /* Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: nullptr */ - std::list DCTerminals; /* Default: 0 */ - CIMPP::Terminal* PccTerminal; /* All converters` DC sides linked to this point of common coupling terminal. Default: 0 */ - CIMPP::CurrentFlow idc; /* Converter DC current, also called Id. Converter state variable, result from power flow. Default: nullptr */ - CIMPP::ActivePower poleLossP; /* The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: nullptr */ - CIMPP::Voltage uc; /* Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: nullptr */ - CIMPP::Voltage udc; /* Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: nullptr */ - CIMPP::ActivePower p; /* Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ - CIMPP::ActivePower targetPpcc; /* Real power injection target in AC grid, at point of common coupling. Default: nullptr */ - CIMPP::Voltage targetUdc; /* Target value for DC voltage magnitude. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACDCConverter(); - virtual ~ACDCConverter(); - + ~ACDCConverter() override; + + std::list DCTerminals; /* Default: 0 */ + CIMPP::Terminal* PccTerminal; /* All converters` DC sides linked to this point of common coupling terminal. Default: 0 */ + CIMPP::ApparentPower baseS; /* Base apparent power of the converter pole. Default: nullptr */ + CIMPP::CurrentFlow idc; /* Converter DC current, also called Id. Converter state variable, result from power flow. Default: nullptr */ + CIMPP::ActivePower idleLoss; /* Active power loss in pole at no power transfer. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Voltage maxUdc; /* The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Voltage minUdc; /* Min allowed converter DC voltage. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Integer numberOfValves; /* Number of valves in the converter. Used in loss calculations. Default: 0 */ + CIMPP::ActivePower p; /* Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ + CIMPP::ActivePower poleLossP; /* The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ + CIMPP::Voltage ratedUdc; /* Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Resistance resistiveLoss; /* Converter configuration data used in power flow. Refer to poleLossP. Default: nullptr */ + CIMPP::ActivePowerPerCurrentFlow switchingLoss; /* Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: nullptr */ + CIMPP::ActivePower targetPpcc; /* Real power injection target in AC grid, at point of common coupling. Default: nullptr */ + CIMPP::Voltage targetUdc; /* Target value for DC voltage magnitude. Default: nullptr */ + CIMPP::Voltage uc; /* Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: nullptr */ + CIMPP::Voltage udc; /* Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: nullptr */ + CIMPP::Voltage valveU0; /* Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACDCConverter_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.cpp b/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.cpp index e89ec289f..59998ff38 100644 --- a/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.cpp +++ b/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.cpp @@ -1,64 +1,72 @@ -#include -#include "DCBaseTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACDCConverterDCTerminal.hpp" -#include "DCPolarityKind.hpp" +#include +#include + #include "ACDCConverter.hpp" +#include "DCPolarityKind.hpp" using namespace CIMPP; -ACDCConverterDCTerminal::ACDCConverterDCTerminal(): DCConductingEquipment(nullptr) {}; - +ACDCConverterDCTerminal::ACDCConverterDCTerminal() : DCConductingEquipment(nullptr) {}; ACDCConverterDCTerminal::~ACDCConverterDCTerminal() {}; -bool assign_ACDCConverter_DCTerminals(BaseClass*, BaseClass*); -bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->DCConductingEquipment != nullptr) - return assign_ACDCConverter_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ACDCConverterDCTerminal_polarity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->polarity; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ACDCConverterDCTerminal_polarity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->polarity; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ACDCConverter_DCTerminals(BaseClass*, BaseClass*); +bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1); + ACDCConverter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCConductingEquipment != element2) + { + element->DCConductingEquipment = element2; + return assign_ACDCConverter_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ACDCConverterDCTerminal_factory() { - return new ACDCConverterDCTerminal; - } +const char ACDCConverterDCTerminal::debugName[] = "ACDCConverterDCTerminal"; +const char* ACDCConverterDCTerminal::debugString() const +{ + return ACDCConverterDCTerminal::debugName; } -void ACDCConverterDCTerminal::addConstructToMap(std::unordered_map& factory_map) { +void ACDCConverterDCTerminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal"), &ACDCConverterDCTerminal_factory)); } -void ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.polarity"), &assign_ACDCConverterDCTerminal_polarity)); - } - -void ACDCConverterDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.DCConductingEquipment"), &assign_ACDCConverterDCTerminal_DCConductingEquipment)); } -const char ACDCConverterDCTerminal::debugName[] = "ACDCConverterDCTerminal"; -const char* ACDCConverterDCTerminal::debugString() +void ACDCConverterDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ACDCConverterDCTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.DCConductingEquipment"), &assign_ACDCConverterDCTerminal_DCConductingEquipment)); } const BaseClassDefiner ACDCConverterDCTerminal::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner ACDCConverterDCTerminal::declare() return BaseClassDefiner(ACDCConverterDCTerminal::addConstructToMap, ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap, ACDCConverterDCTerminal::addClassAssignFnsToMap, ACDCConverterDCTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* ACDCConverterDCTerminal_factory() + { + return new ACDCConverterDCTerminal; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.hpp b/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.hpp index 2684397cf..3096f6dad 100644 --- a/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.hpp +++ b/CGMES_2.4.15_16FEB2016/ACDCConverterDCTerminal.hpp @@ -1,40 +1,41 @@ #ifndef ACDCConverterDCTerminal_H #define ACDCConverterDCTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCBaseTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCBaseTerminal.hpp" +#include "BaseClassDefiner.hpp" #include "DCPolarityKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ACDCConverter; - -class ACDCConverter; /* A DC electrical connection point at the AC/DC converter. The AC/DC converter is electrically connected also to the AC side. The AC connection is inherited from the AC conducting equipment in the same way as any other AC equipment. The AC/DC converter DC terminal is separate from generic DC terminal to restrict the connection with the AC side to AC/DC converter and so that no other DC conducting equipment can be connected to the AC side. */ - class ACDCConverterDCTerminal: public DCBaseTerminal + class ACDCConverterDCTerminal : public DCBaseTerminal { - public: - CIMPP::DCPolarityKind polarity; /* Represents the normal network polarity condition. Default: 0 */ - CIMPP::ACDCConverter* DCConductingEquipment; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACDCConverterDCTerminal(); - virtual ~ACDCConverterDCTerminal(); - + ~ACDCConverterDCTerminal() override; + + CIMPP::ACDCConverter* DCConductingEquipment; /* Default: 0 */ + CIMPP::DCPolarityKind polarity; /* Represents the normal network polarity condition. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACDCConverterDCTerminal_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ACDCTerminal.cpp b/CGMES_2.4.15_16FEB2016/ACDCTerminal.cpp index e1404e7e7..b1c7a092b 100644 --- a/CGMES_2.4.15_16FEB2016/ACDCTerminal.cpp +++ b/CGMES_2.4.15_16FEB2016/ACDCTerminal.cpp @@ -1,105 +1,128 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACDCTerminal.hpp" -#include "Measurement.hpp" -#include "Integer.hpp" +#include +#include + #include "BusNameMarker.hpp" +#include "Measurement.hpp" #include "OperationalLimitSet.hpp" #include "Boolean.hpp" +#include "Integer.hpp" using namespace CIMPP; -ACDCTerminal::ACDCTerminal(): BusNameMarker(nullptr) {}; - +ACDCTerminal::ACDCTerminal() : BusNameMarker(nullptr) {}; ACDCTerminal::~ACDCTerminal() {}; -bool assign_ACDCTerminal_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); + + + +bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->connected; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else return true; - } } return false; } bool assign_BusNameMarker_Terminal(BaseClass*, BaseClass*); -bool assign_ACDCTerminal_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->BusNameMarker = dynamic_cast(BaseClass_ptr2); - if(element->BusNameMarker != nullptr) - return assign_BusNameMarker_Terminal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ACDCTerminal_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCTerminal* element = dynamic_cast(BaseClass_ptr1); + BusNameMarker* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BusNameMarker != element2) + { + element->BusNameMarker = element2; + return assign_BusNameMarker_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ACDCTerminal_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimitSet.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Measurement_Terminal(BaseClass*, BaseClass*); +bool assign_ACDCTerminal_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCTerminal* element = dynamic_cast(BaseClass_ptr1); + Measurement* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Measurement_Terminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_OperationalLimitSet_Terminal(BaseClass*, BaseClass*); +bool assign_ACDCTerminal_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCTerminal* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimitSet.begin(), element->OperationalLimitSet.end(), element2) == element->OperationalLimitSet.end()) + { + element->OperationalLimitSet.push_back(element2); + return assign_OperationalLimitSet_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->connected; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ACDCTerminal_factory() { - return new ACDCTerminal; - } +const char ACDCTerminal::debugName[] = "ACDCTerminal"; +const char* ACDCTerminal::debugString() const +{ + return ACDCTerminal::debugName; } -void ACDCTerminal::addConstructToMap(std::unordered_map& factory_map) { +void ACDCTerminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACDCTerminal"), &ACDCTerminal_factory)); } -void ACDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber)); - assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.connected"), &assign_ACDCTerminal_connected)); +void ACDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.connected"), &assign_ACDCTerminal_connected)); + assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber)); } -void ACDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void ACDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.BusNameMarker"), &assign_ACDCTerminal_BusNameMarker)); assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.Measurements"), &assign_ACDCTerminal_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.BusNameMarker"), &assign_ACDCTerminal_BusNameMarker)); assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.OperationalLimitSet"), &assign_ACDCTerminal_OperationalLimitSet)); - } - -const char ACDCTerminal::debugName[] = "ACDCTerminal"; -const char* ACDCTerminal::debugString() -{ - return ACDCTerminal::debugName; } const BaseClassDefiner ACDCTerminal::declare() @@ -107,4 +130,10 @@ const BaseClassDefiner ACDCTerminal::declare() return BaseClassDefiner(ACDCTerminal::addConstructToMap, ACDCTerminal::addPrimitiveAssignFnsToMap, ACDCTerminal::addClassAssignFnsToMap, ACDCTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* ACDCTerminal_factory() + { + return new ACDCTerminal; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ACDCTerminal.hpp b/CGMES_2.4.15_16FEB2016/ACDCTerminal.hpp index 3a48a780f..1c5d0bc7d 100644 --- a/CGMES_2.4.15_16FEB2016/ACDCTerminal.hpp +++ b/CGMES_2.4.15_16FEB2016/ACDCTerminal.hpp @@ -1,46 +1,47 @@ #ifndef ACDCTerminal_H #define ACDCTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "Integer.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class BusNameMarker; + class Measurement; + class OperationalLimitSet; -class Measurement; -class BusNameMarker; -class OperationalLimitSet; /* An electrical connection point (AC or DC) to a piece of conducting equipment. Terminals are connected at physical connection points called connectivity nodes. */ - class ACDCTerminal: public IdentifiedObject + class ACDCTerminal : public IdentifiedObject { - public: - std::list Measurements; /* Measurements associated with this terminal defining where the measurement is placed in the network topology. It may be used, for instance, to capture the sensor position, such as a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. Default: 0 */ - CIMPP::Integer sequenceNumber; /* The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the `starting point` for a two terminal branch. Default: 0 */ - CIMPP::BusNameMarker* BusNameMarker; /* The bus name marker used to name the bus (topological node). Default: 0 */ - std::list OperationalLimitSet; /* Default: 0 */ - CIMPP::Boolean connected; /* The connected status is related to a bus-branch model and the topological node to terminal relation. True implies the terminal is connected to the related topological node and false implies it is not. In a bus-branch model, the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the topological node to terminal relation. A valid case is that conducting equipment can be connected in one end and open in the other. In particular for an AC line segment, where the reactive line charging can be significant, this is a relevant case. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACDCTerminal(); - virtual ~ACDCTerminal(); - + ~ACDCTerminal() override; + + CIMPP::BusNameMarker* BusNameMarker; /* The bus name marker used to name the bus (topological node). Default: 0 */ + std::list Measurements; /* Measurements associated with this terminal defining where the measurement is placed in the network topology. It may be used, for instance, to capture the sensor position, such as a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. Default: 0 */ + std::list OperationalLimitSet; /* Default: 0 */ + CIMPP::Boolean connected; /* The connected status is related to a bus-branch model and the topological node to terminal relation. True implies the terminal is connected to the related topological node and false implies it is not. In a bus-branch model, the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the topological node to terminal relation. A valid case is that conducting equipment can be connected in one end and open in the other. In particular for an AC line segment, where the reactive line charging can be significant, this is a relevant case. Default: false */ + CIMPP::Integer sequenceNumber; /* The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the `starting point` for a two terminal branch. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACDCTerminal_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ACLineSegment.cpp b/CGMES_2.4.15_16FEB2016/ACLineSegment.cpp index 5ceb0b237..2843fb464 100644 --- a/CGMES_2.4.15_16FEB2016/ACLineSegment.cpp +++ b/CGMES_2.4.15_16FEB2016/ACLineSegment.cpp @@ -1,171 +1,180 @@ -#include -#include "Conductor.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACLineSegment.hpp" +#include +#include + #include "Susceptance.hpp" -#include "Conductance.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" #include "Susceptance.hpp" #include "Conductance.hpp" +#include "Conductance.hpp" +#include "Resistance.hpp" #include "Resistance.hpp" #include "Temperature.hpp" #include "Reactance.hpp" +#include "Reactance.hpp" using namespace CIMPP; ACLineSegment::ACLineSegment() {}; - ACLineSegment::~ACLineSegment() {}; +bool assign_ACLineSegment_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_bch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_gch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_shortCircuitEndTemperature(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->shortCircuitEndTemperature; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACLineSegment_bch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_gch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_shortCircuitEndTemperature(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->shortCircuitEndTemperature; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ACLineSegment_factory() { - return new ACLineSegment; - } +const char ACLineSegment::debugName[] = "ACLineSegment"; +const char* ACLineSegment::debugString() const +{ + return ACLineSegment::debugName; } -void ACLineSegment::addConstructToMap(std::unordered_map& factory_map) { +void ACLineSegment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACLineSegment"), &ACLineSegment_factory)); } -void ACLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ACLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.b0ch"), &assign_ACLineSegment_b0ch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.bch"), &assign_ACLineSegment_bch)); + assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.g0ch"), &assign_ACLineSegment_g0ch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.gch"), &assign_ACLineSegment_gch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.r"), &assign_ACLineSegment_r)); - assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.x"), &assign_ACLineSegment_x)); - assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.b0ch"), &assign_ACLineSegment_b0ch)); - assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.g0ch"), &assign_ACLineSegment_g0ch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.r0"), &assign_ACLineSegment_r0)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.shortCircuitEndTemperature"), &assign_ACLineSegment_shortCircuitEndTemperature)); + assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.x"), &assign_ACLineSegment_x)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.x0"), &assign_ACLineSegment_x0)); } -void ACLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ACLineSegment::debugName[] = "ACLineSegment"; -const char* ACLineSegment::debugString() +void ACLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ACLineSegment::debugName; } const BaseClassDefiner ACLineSegment::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner ACLineSegment::declare() return BaseClassDefiner(ACLineSegment::addConstructToMap, ACLineSegment::addPrimitiveAssignFnsToMap, ACLineSegment::addClassAssignFnsToMap, ACLineSegment::debugName); } - +namespace CIMPP +{ + BaseClass* ACLineSegment_factory() + { + return new ACLineSegment; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ACLineSegment.hpp b/CGMES_2.4.15_16FEB2016/ACLineSegment.hpp index 580be3702..2f3f0ecc8 100644 --- a/CGMES_2.4.15_16FEB2016/ACLineSegment.hpp +++ b/CGMES_2.4.15_16FEB2016/ACLineSegment.hpp @@ -1,50 +1,51 @@ #ifndef ACLineSegment_H #define ACLineSegment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Conductor.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "Conductor.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" -#include "Resistance.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" +#include "Susceptance.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use attributes of the line segment, which describe impedances and admittances for the entire length of the segment. Additionally impedances can be computed by using length and associated per length impedances. The BaseVoltage at the two ends of ACLineSegments in a Line shall have the same BaseVoltage.nominalVoltage. However, boundary lines may have slightly different BaseVoltage.nominalVoltages and variation is allowed. Larger voltage difference in general requires use of an equivalent branch. */ - class ACLineSegment: public Conductor + class ACLineSegment : public Conductor { - public: - CIMPP::Susceptance bch; /* Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. Default: nullptr */ - CIMPP::Conductance gch; /* Positive sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Resistance r; /* Positive sequence series resistance of the entire line section. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence series reactance of the entire line section. Default: nullptr */ - CIMPP::Susceptance b0ch; /* Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Conductance g0ch; /* Zero sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence series resistance of the entire line section. Default: nullptr */ - CIMPP::Temperature shortCircuitEndTemperature; /* Maximum permitted temperature at the end of SC for the calculation of minimum short-circuit currents. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence series reactance of the entire line section. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACLineSegment(); - virtual ~ACLineSegment(); - + ~ACLineSegment() override; + + CIMPP::Susceptance b0ch; /* Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Susceptance bch; /* Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. Default: nullptr */ + CIMPP::Conductance g0ch; /* Zero sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Conductance gch; /* Positive sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence series resistance of the entire line section. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence series resistance of the entire line section. Default: nullptr */ + CIMPP::Temperature shortCircuitEndTemperature; /* Maximum permitted temperature at the end of SC for the calculation of minimum short-circuit currents. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence series reactance of the entire line section. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence series reactance of the entire line section. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACLineSegment_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Accumulator.cpp b/CGMES_2.4.15_16FEB2016/Accumulator.cpp index 0b9c386bb..bc61e4d79 100644 --- a/CGMES_2.4.15_16FEB2016/Accumulator.cpp +++ b/CGMES_2.4.15_16FEB2016/Accumulator.cpp @@ -1,62 +1,76 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Accumulator.hpp" -#include "AccumulatorLimitSet.hpp" +#include +#include + #include "AccumulatorValue.hpp" +#include "AccumulatorLimitSet.hpp" using namespace CIMPP; Accumulator::Accumulator() {}; - Accumulator::~Accumulator() {}; -bool assign_Accumulator_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Accumulator* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->LimitSets.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_AccumulatorValue_Accumulator(BaseClass*, BaseClass*); +bool assign_Accumulator_AccumulatorValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Accumulator* element = dynamic_cast(BaseClass_ptr1); + AccumulatorValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->AccumulatorValues.begin(), element->AccumulatorValues.end(), element2) == element->AccumulatorValues.end()) + { + element->AccumulatorValues.push_back(element2); + return assign_AccumulatorValue_Accumulator(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Accumulator_AccumulatorValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Accumulator* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->AccumulatorValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_AccumulatorLimitSet_Measurements(BaseClass*, BaseClass*); +bool assign_Accumulator_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Accumulator* element = dynamic_cast(BaseClass_ptr1); + AccumulatorLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->LimitSets.begin(), element->LimitSets.end(), element2) == element->LimitSets.end()) + { + element->LimitSets.push_back(element2); + return assign_AccumulatorLimitSet_Measurements(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* Accumulator_factory() { - return new Accumulator; - } +const char Accumulator::debugName[] = "Accumulator"; +const char* Accumulator::debugString() const +{ + return Accumulator::debugName; } -void Accumulator::addConstructToMap(std::unordered_map& factory_map) { +void Accumulator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Accumulator"), &Accumulator_factory)); } -void Accumulator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Accumulator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Accumulator.LimitSets"), &assign_Accumulator_LimitSets)); - assign_map.insert(std::make_pair(std::string("cim:Accumulator.AccumulatorValues"), &assign_Accumulator_AccumulatorValues)); +void Accumulator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Accumulator::debugName[] = "Accumulator"; -const char* Accumulator::debugString() +void Accumulator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Accumulator::debugName; + assign_map.insert(std::make_pair(std::string("cim:Accumulator.AccumulatorValues"), &assign_Accumulator_AccumulatorValues)); + assign_map.insert(std::make_pair(std::string("cim:Accumulator.LimitSets"), &assign_Accumulator_LimitSets)); } const BaseClassDefiner Accumulator::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner Accumulator::declare() return BaseClassDefiner(Accumulator::addConstructToMap, Accumulator::addPrimitiveAssignFnsToMap, Accumulator::addClassAssignFnsToMap, Accumulator::debugName); } - +namespace CIMPP +{ + BaseClass* Accumulator_factory() + { + return new Accumulator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Accumulator.hpp b/CGMES_2.4.15_16FEB2016/Accumulator.hpp index e1cf32557..04682bcea 100644 --- a/CGMES_2.4.15_16FEB2016/Accumulator.hpp +++ b/CGMES_2.4.15_16FEB2016/Accumulator.hpp @@ -1,40 +1,41 @@ #ifndef Accumulator_H #define Accumulator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AccumulatorLimitSet; + class AccumulatorValue; -class AccumulatorLimitSet; -class AccumulatorValue; /* Accumulator represents an accumulated (counted) Measurement, e.g. an energy value. */ - class Accumulator: public Measurement + class Accumulator : public Measurement { - public: - std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ - std::list AccumulatorValues; /* Measurement to which this value is connected. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Accumulator(); - virtual ~Accumulator(); - + ~Accumulator() override; + + std::list AccumulatorValues; /* Measurement to which this value is connected. Default: 0 */ + std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Accumulator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorLimit.cpp b/CGMES_2.4.15_16FEB2016/AccumulatorLimit.cpp index 679b05eaf..93e5dbd54 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorLimit.cpp @@ -1,64 +1,72 @@ -#include -#include "Limit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorLimit.hpp" -#include "Integer.hpp" +#include +#include + #include "AccumulatorLimitSet.hpp" +#include "Integer.hpp" using namespace CIMPP; -AccumulatorLimit::AccumulatorLimit(): LimitSet(nullptr) {}; - +AccumulatorLimit::AccumulatorLimit() : LimitSet(nullptr) {}; AccumulatorLimit::~AccumulatorLimit() {}; -bool assign_AccumulatorLimitSet_Limits(BaseClass*, BaseClass*); -bool assign_AccumulatorLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->LimitSet = dynamic_cast(BaseClass_ptr2); - if(element->LimitSet != nullptr) - return assign_AccumulatorLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_AccumulatorLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AccumulatorLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AccumulatorLimitSet_Limits(BaseClass*, BaseClass*); +bool assign_AccumulatorLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1); + AccumulatorLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LimitSet != element2) + { + element->LimitSet = element2; + return assign_AccumulatorLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AccumulatorLimit_factory() { - return new AccumulatorLimit; - } +const char AccumulatorLimit::debugName[] = "AccumulatorLimit"; +const char* AccumulatorLimit::debugString() const +{ + return AccumulatorLimit::debugName; } -void AccumulatorLimit::addConstructToMap(std::unordered_map& factory_map) { +void AccumulatorLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AccumulatorLimit"), &AccumulatorLimit_factory)); } -void AccumulatorLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AccumulatorLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimit.value"), &assign_AccumulatorLimit_value)); - } - -void AccumulatorLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimit.LimitSet"), &assign_AccumulatorLimit_LimitSet)); } -const char AccumulatorLimit::debugName[] = "AccumulatorLimit"; -const char* AccumulatorLimit::debugString() +void AccumulatorLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AccumulatorLimit::debugName; + assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimit.LimitSet"), &assign_AccumulatorLimit_LimitSet)); } const BaseClassDefiner AccumulatorLimit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner AccumulatorLimit::declare() return BaseClassDefiner(AccumulatorLimit::addConstructToMap, AccumulatorLimit::addPrimitiveAssignFnsToMap, AccumulatorLimit::addClassAssignFnsToMap, AccumulatorLimit::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorLimit_factory() + { + return new AccumulatorLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorLimit.hpp b/CGMES_2.4.15_16FEB2016/AccumulatorLimit.hpp index 33542e26a..a5959d35c 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorLimit.hpp @@ -1,40 +1,41 @@ #ifndef AccumulatorLimit_H #define AccumulatorLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Limit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Limit.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class AccumulatorLimitSet; - -class AccumulatorLimitSet; /* Limit values for Accumulator measurements. */ - class AccumulatorLimit: public Limit + class AccumulatorLimit : public Limit { - public: - CIMPP::Integer value; /* The value to supervise against. The value is positive. Default: 0 */ - CIMPP::AccumulatorLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorLimit(); - virtual ~AccumulatorLimit(); - + ~AccumulatorLimit() override; + + CIMPP::AccumulatorLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ + CIMPP::Integer value; /* The value to supervise against. The value is positive. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.cpp b/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.cpp index efb6fad72..095a74310 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.cpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.cpp @@ -1,62 +1,76 @@ -#include -#include "LimitSet.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorLimitSet.hpp" -#include "Accumulator.hpp" +#include +#include + #include "AccumulatorLimit.hpp" +#include "Accumulator.hpp" using namespace CIMPP; AccumulatorLimitSet::AccumulatorLimitSet() {}; - AccumulatorLimitSet::~AccumulatorLimitSet() {}; -bool assign_AccumulatorLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_AccumulatorLimit_LimitSet(BaseClass*, BaseClass*); +bool assign_AccumulatorLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1); + AccumulatorLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Limits.begin(), element->Limits.end(), element2) == element->Limits.end()) + { + element->Limits.push_back(element2); + return assign_AccumulatorLimit_LimitSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_AccumulatorLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Limits.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Accumulator_LimitSets(BaseClass*, BaseClass*); +bool assign_AccumulatorLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1); + Accumulator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Accumulator_LimitSets(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* AccumulatorLimitSet_factory() { - return new AccumulatorLimitSet; - } +const char AccumulatorLimitSet::debugName[] = "AccumulatorLimitSet"; +const char* AccumulatorLimitSet::debugString() const +{ + return AccumulatorLimitSet::debugName; } -void AccumulatorLimitSet::addConstructToMap(std::unordered_map& factory_map) { +void AccumulatorLimitSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet"), &AccumulatorLimitSet_factory)); } -void AccumulatorLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void AccumulatorLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Measurements"), &assign_AccumulatorLimitSet_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Limits"), &assign_AccumulatorLimitSet_Limits)); +void AccumulatorLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char AccumulatorLimitSet::debugName[] = "AccumulatorLimitSet"; -const char* AccumulatorLimitSet::debugString() +void AccumulatorLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AccumulatorLimitSet::debugName; + assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Limits"), &assign_AccumulatorLimitSet_Limits)); + assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Measurements"), &assign_AccumulatorLimitSet_Measurements)); } const BaseClassDefiner AccumulatorLimitSet::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner AccumulatorLimitSet::declare() return BaseClassDefiner(AccumulatorLimitSet::addConstructToMap, AccumulatorLimitSet::addPrimitiveAssignFnsToMap, AccumulatorLimitSet::addClassAssignFnsToMap, AccumulatorLimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorLimitSet_factory() + { + return new AccumulatorLimitSet; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.hpp b/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.hpp index f95867e74..54cc2b628 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.hpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorLimitSet.hpp @@ -1,40 +1,41 @@ #ifndef AccumulatorLimitSet_H #define AccumulatorLimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LimitSet.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LimitSet.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Accumulator; + class AccumulatorLimit; -class Accumulator; -class AccumulatorLimit; /* An AccumulatorLimitSet specifies a set of Limits that are associated with an Accumulator measurement. */ - class AccumulatorLimitSet: public LimitSet + class AccumulatorLimitSet : public LimitSet { - public: - std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ - std::list Limits; /* The set of limits. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorLimitSet(); - virtual ~AccumulatorLimitSet(); - + ~AccumulatorLimitSet() override; + + std::list Limits; /* The set of limits. Default: 0 */ + std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorLimitSet_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorReset.cpp b/CGMES_2.4.15_16FEB2016/AccumulatorReset.cpp index cdfd14736..2a11e50b8 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorReset.cpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorReset.cpp @@ -1,49 +1,56 @@ -#include -#include "Control.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorReset.hpp" +#include +#include + #include "AccumulatorValue.hpp" using namespace CIMPP; -AccumulatorReset::AccumulatorReset(): AccumulatorValue(nullptr) {}; - +AccumulatorReset::AccumulatorReset() : AccumulatorValue(nullptr) {}; AccumulatorReset::~AccumulatorReset() {}; -bool assign_AccumulatorValue_AccumulatorReset(BaseClass*, BaseClass*); -bool assign_AccumulatorReset_AccumulatorValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorReset* element = dynamic_cast(BaseClass_ptr1)) { - element->AccumulatorValue = dynamic_cast(BaseClass_ptr2); - if(element->AccumulatorValue != nullptr) - return assign_AccumulatorValue_AccumulatorReset(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* AccumulatorReset_factory() { - return new AccumulatorReset; +bool assign_AccumulatorValue_AccumulatorReset(BaseClass*, BaseClass*); +bool assign_AccumulatorReset_AccumulatorValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorReset* element = dynamic_cast(BaseClass_ptr1); + AccumulatorValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AccumulatorValue != element2) + { + element->AccumulatorValue = element2; + return assign_AccumulatorValue_AccumulatorReset(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void AccumulatorReset::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:AccumulatorReset"), &AccumulatorReset_factory)); +const char AccumulatorReset::debugName[] = "AccumulatorReset"; +const char* AccumulatorReset::debugString() const +{ + return AccumulatorReset::debugName; } -void AccumulatorReset::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void AccumulatorReset::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:AccumulatorReset"), &AccumulatorReset_factory)); +} -void AccumulatorReset::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorReset.AccumulatorValue"), &assign_AccumulatorReset_AccumulatorValue)); +void AccumulatorReset::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char AccumulatorReset::debugName[] = "AccumulatorReset"; -const char* AccumulatorReset::debugString() +void AccumulatorReset::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AccumulatorReset::debugName; + assign_map.insert(std::make_pair(std::string("cim:AccumulatorReset.AccumulatorValue"), &assign_AccumulatorReset_AccumulatorValue)); } const BaseClassDefiner AccumulatorReset::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner AccumulatorReset::declare() return BaseClassDefiner(AccumulatorReset::addConstructToMap, AccumulatorReset::addPrimitiveAssignFnsToMap, AccumulatorReset::addClassAssignFnsToMap, AccumulatorReset::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorReset_factory() + { + return new AccumulatorReset; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorReset.hpp b/CGMES_2.4.15_16FEB2016/AccumulatorReset.hpp index 176064b6c..95415e7b0 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorReset.hpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorReset.hpp @@ -1,38 +1,39 @@ #ifndef AccumulatorReset_H #define AccumulatorReset_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Control.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Control.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AccumulatorValue; -class AccumulatorValue; /* This command reset the counter value to zero. */ - class AccumulatorReset: public Control + class AccumulatorReset : public Control { - public: - CIMPP::AccumulatorValue* AccumulatorValue; /* The accumulator value that is reset by the command. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorReset(); - virtual ~AccumulatorReset(); - + ~AccumulatorReset() override; + + CIMPP::AccumulatorValue* AccumulatorValue; /* The accumulator value that is reset by the command. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorReset_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorValue.cpp b/CGMES_2.4.15_16FEB2016/AccumulatorValue.cpp index ccb4f0df1..23e87f8d2 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorValue.cpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorValue.cpp @@ -1,76 +1,92 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorValue.hpp" +#include +#include + #include "Accumulator.hpp" #include "AccumulatorReset.hpp" #include "Integer.hpp" using namespace CIMPP; -AccumulatorValue::AccumulatorValue(): Accumulator(nullptr), AccumulatorReset(nullptr) {}; - +AccumulatorValue::AccumulatorValue() : Accumulator(nullptr), AccumulatorReset(nullptr) {}; AccumulatorValue::~AccumulatorValue() {}; -bool assign_Accumulator_AccumulatorValues(BaseClass*, BaseClass*); -bool assign_AccumulatorValue_Accumulator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Accumulator = dynamic_cast(BaseClass_ptr2); - if(element->Accumulator != nullptr) - return assign_Accumulator_AccumulatorValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AccumulatorValue_AccumulatorReset(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) { - element->AccumulatorReset = dynamic_cast(BaseClass_ptr2); - if(element->AccumulatorReset != nullptr) - return true; - } - return false; -} - +bool assign_AccumulatorValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AccumulatorValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Accumulator_AccumulatorValues(BaseClass*, BaseClass*); +bool assign_AccumulatorValue_Accumulator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorValue* element = dynamic_cast(BaseClass_ptr1); + Accumulator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Accumulator != element2) + { + element->Accumulator = element2; + return assign_Accumulator_AccumulatorValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AccumulatorValue_factory() { - return new AccumulatorValue; +bool assign_AccumulatorReset_AccumulatorValue(BaseClass*, BaseClass*); +bool assign_AccumulatorValue_AccumulatorReset(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorValue* element = dynamic_cast(BaseClass_ptr1); + AccumulatorReset* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AccumulatorReset != element2) + { + element->AccumulatorReset = element2; + return assign_AccumulatorReset_AccumulatorValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + +const char AccumulatorValue::debugName[] = "AccumulatorValue"; +const char* AccumulatorValue::debugString() const +{ + return AccumulatorValue::debugName; } -void AccumulatorValue::addConstructToMap(std::unordered_map& factory_map) { +void AccumulatorValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AccumulatorValue"), &AccumulatorValue_factory)); } -void AccumulatorValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.value"), &assign_AccumulatorValue_value)); +void AccumulatorValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.value"), &assign_AccumulatorValue_value)); } -void AccumulatorValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void AccumulatorValue::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.Accumulator"), &assign_AccumulatorValue_Accumulator)); assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.AccumulatorReset"), &assign_AccumulatorValue_AccumulatorReset)); - } - -const char AccumulatorValue::debugName[] = "AccumulatorValue"; -const char* AccumulatorValue::debugString() -{ - return AccumulatorValue::debugName; } const BaseClassDefiner AccumulatorValue::declare() @@ -78,4 +94,10 @@ const BaseClassDefiner AccumulatorValue::declare() return BaseClassDefiner(AccumulatorValue::addConstructToMap, AccumulatorValue::addPrimitiveAssignFnsToMap, AccumulatorValue::addClassAssignFnsToMap, AccumulatorValue::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorValue_factory() + { + return new AccumulatorValue; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AccumulatorValue.hpp b/CGMES_2.4.15_16FEB2016/AccumulatorValue.hpp index a9b97b547..4a119c559 100644 --- a/CGMES_2.4.15_16FEB2016/AccumulatorValue.hpp +++ b/CGMES_2.4.15_16FEB2016/AccumulatorValue.hpp @@ -1,42 +1,43 @@ #ifndef AccumulatorValue_H #define AccumulatorValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Accumulator; + class AccumulatorReset; - -class Accumulator; -class AccumulatorReset; /* AccumulatorValue represents an accumulated (counted) MeasurementValue. */ - class AccumulatorValue: public MeasurementValue + class AccumulatorValue : public MeasurementValue { - public: - CIMPP::Accumulator* Accumulator; /* The values connected to this measurement. Default: 0 */ - CIMPP::AccumulatorReset* AccumulatorReset; /* The command that reset the accumulator value. Default: 0 */ - CIMPP::Integer value; /* The value to supervise. The value is positive. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorValue(); - virtual ~AccumulatorValue(); - + ~AccumulatorValue() override; + + CIMPP::Accumulator* Accumulator; /* The values connected to this measurement. Default: 0 */ + CIMPP::AccumulatorReset* AccumulatorReset; /* The command that reset the accumulator value. Default: 0 */ + CIMPP::Integer value; /* The value to supervise. The value is positive. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorValue_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ActivePower.cpp b/CGMES_2.4.15_16FEB2016/ActivePower.cpp index e422a62cc..d6f48a52a 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePower.cpp +++ b/CGMES_2.4.15_16FEB2016/ActivePower.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePower.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -ActivePower::ActivePower() {} -ActivePower::~ActivePower(){} +#include -ActivePower::ActivePower(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void ActivePower::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void ActivePower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +ActivePower& ActivePower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void ActivePower::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +ActivePower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char ActivePower::debugName[] = "ActivePower"; -const char* ActivePower::debugString() { +const char* ActivePower::debugString() const +{ return ActivePower::debugName; } - -const BaseClassDefiner ActivePower::declare() { - return BaseClassDefiner(ActivePower::addConstructToMap, ActivePower::addPrimitiveAssignFnsToMap, ActivePower::addClassAssignFnsToMap, ActivePower::debugName); +ActivePower& ActivePower::operator+=(const ActivePower& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - ActivePower& ActivePower::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - ActivePower& ActivePower::operator-=(const ActivePower& rhs) { - value -= rhs.value; - return *this; - } - - ActivePower& ActivePower::operator*=(const ActivePower& rhs) { - value *= rhs.value; - return *this; - } - - ActivePower& ActivePower::operator/=(const ActivePower& rhs) { - value /= rhs.value; - return *this; - } +ActivePower& ActivePower::operator-=(const ActivePower& rhs) +{ + value -= rhs.value; + return *this; +} - ActivePower& ActivePower::operator+=(const ActivePower& rhs) { - value += rhs.value; - return *this; - } +ActivePower& ActivePower::operator*=(const ActivePower& rhs) +{ + value *= rhs.value; + return *this; +} - ActivePower::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +ActivePower& ActivePower::operator/=(const ActivePower& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, ActivePower& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ActivePower& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const ActivePower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/ActivePower.hpp b/CGMES_2.4.15_16FEB2016/ActivePower.hpp index 06e848e44..d1a142af8 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePower.hpp +++ b/CGMES_2.4.15_16FEB2016/ActivePower.hpp @@ -1,38 +1,39 @@ #ifndef ActivePower_H #define ActivePower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class ActivePower : public BaseClass + /* + Product of RMS value of the voltage and the RMS value of the in-phase component of the current. + */ + class ActivePower { - public: - ActivePower(); - virtual ~ActivePower(); - ActivePower(long double value); - static const BaseClassDefiner declare(); - ActivePower& operator=(long double &rop); + ActivePower() : value(0.0), initialized(false) {} + ActivePower(long double value) : value(value), initialized(true) {} + + ActivePower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + ActivePower& operator+=(const ActivePower& rhs); ActivePower& operator-=(const ActivePower& rhs); ActivePower& operator*=(const ActivePower& rhs); ActivePower& operator/=(const ActivePower& rhs); + friend std::istream& operator>>(std::istream& lop, ActivePower& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const ActivePower& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ActivePowerLimit.cpp b/CGMES_2.4.15_16FEB2016/ActivePowerLimit.cpp index 6697e04c8..d95377339 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePowerLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/ActivePowerLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePowerLimit.hpp" +#include +#include + #include "ActivePower.hpp" using namespace CIMPP; ActivePowerLimit::ActivePowerLimit() {}; - ActivePowerLimit::~ActivePowerLimit() {}; +bool assign_ActivePowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ActivePowerLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ActivePowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ActivePowerLimit_factory() { - return new ActivePowerLimit; - } +const char ActivePowerLimit::debugName[] = "ActivePowerLimit"; +const char* ActivePowerLimit::debugString() const +{ + return ActivePowerLimit::debugName; } -void ActivePowerLimit::addConstructToMap(std::unordered_map& factory_map) { +void ActivePowerLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ActivePowerLimit"), &ActivePowerLimit_factory)); } -void ActivePowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ActivePowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ActivePowerLimit.value"), &assign_ActivePowerLimit_value)); } -void ActivePowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ActivePowerLimit::debugName[] = "ActivePowerLimit"; -const char* ActivePowerLimit::debugString() +void ActivePowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ActivePowerLimit::debugName; } const BaseClassDefiner ActivePowerLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner ActivePowerLimit::declare() return BaseClassDefiner(ActivePowerLimit::addConstructToMap, ActivePowerLimit::addPrimitiveAssignFnsToMap, ActivePowerLimit::addClassAssignFnsToMap, ActivePowerLimit::debugName); } - +namespace CIMPP +{ + BaseClass* ActivePowerLimit_factory() + { + return new ActivePowerLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ActivePowerLimit.hpp b/CGMES_2.4.15_16FEB2016/ActivePowerLimit.hpp index 5c0a031b9..bc0c71cdb 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePowerLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/ActivePowerLimit.hpp @@ -1,38 +1,39 @@ #ifndef ActivePowerLimit_H #define ActivePowerLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Limit on active power flow. */ - class ActivePowerLimit: public OperationalLimit + class ActivePowerLimit : public OperationalLimit { - public: - CIMPP::ActivePower value; /* Value of active power limit. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ActivePowerLimit(); - virtual ~ActivePowerLimit(); - + ~ActivePowerLimit() override; + + CIMPP::ActivePower value; /* Value of active power limit. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ActivePowerLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.cpp b/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.cpp index e03840cb5..ccc704f3a 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.cpp +++ b/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePowerPerCurrentFlow.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "Float.hpp" - -using namespace CIMPP; - -ActivePowerPerCurrentFlow::ActivePowerPerCurrentFlow(): value(nullptr) {}; - -ActivePowerPerCurrentFlow::~ActivePowerPerCurrentFlow() {}; - +#include +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; - - -bool assign_ActivePowerPerCurrentFlow_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - -bool assign_ActivePowerPerCurrentFlow_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerCurrentFlow_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerCurrentFlow_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerCurrentFlow_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } - -namespace CIMPP { - BaseClass* ActivePowerPerCurrentFlow_factory() { - return new ActivePowerPerCurrentFlow; +ActivePowerPerCurrentFlow::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void ActivePowerPerCurrentFlow::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow"), &ActivePowerPerCurrentFlow_factory)); +const char ActivePowerPerCurrentFlow::debugName[] = "ActivePowerPerCurrentFlow"; +const char* ActivePowerPerCurrentFlow::debugString() const +{ + return ActivePowerPerCurrentFlow::debugName; } -void ActivePowerPerCurrentFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.denominatorMultiplier"), &assign_ActivePowerPerCurrentFlow_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.denominatorUnit"), &assign_ActivePowerPerCurrentFlow_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.multiplier"), &assign_ActivePowerPerCurrentFlow_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.unit"), &assign_ActivePowerPerCurrentFlow_unit)); - } +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator+=(const ActivePowerPerCurrentFlow& rhs) +{ + value += rhs.value; + return *this; +} -void ActivePowerPerCurrentFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.value"), &assign_ActivePowerPerCurrentFlow_value)); +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator-=(const ActivePowerPerCurrentFlow& rhs) +{ + value -= rhs.value; + return *this; } -const char ActivePowerPerCurrentFlow::debugName[] = "ActivePowerPerCurrentFlow"; -const char* ActivePowerPerCurrentFlow::debugString() +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator*=(const ActivePowerPerCurrentFlow& rhs) { - return ActivePowerPerCurrentFlow::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner ActivePowerPerCurrentFlow::declare() +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator/=(const ActivePowerPerCurrentFlow& rhs) { - return BaseClassDefiner(ActivePowerPerCurrentFlow::addConstructToMap, ActivePowerPerCurrentFlow::addPrimitiveAssignFnsToMap, ActivePowerPerCurrentFlow::addClassAssignFnsToMap, ActivePowerPerCurrentFlow::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ActivePowerPerCurrentFlow& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const ActivePowerPerCurrentFlow& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.hpp b/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.hpp index 27bea5b40..9f7c724db 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.hpp +++ b/CGMES_2.4.15_16FEB2016/ActivePowerPerCurrentFlow.hpp @@ -1,46 +1,36 @@ #ifndef ActivePowerPerCurrentFlow_H #define ActivePowerPerCurrentFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include +namespace CIMPP +{ + class ActivePowerPerCurrentFlow + { + public: + ActivePowerPerCurrentFlow() : value(0.0), initialized(false) {} + ActivePowerPerCurrentFlow(long double value) : value(value), initialized(true) {} -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" - -namespace CIMPP { - + ActivePowerPerCurrentFlow& operator=(long double rop); + operator long double() const; -class Float; - /* - - */ - class ActivePowerPerCurrentFlow: public BaseClass - { + long double value; + bool initialized; - public: - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::Float* value; /* Default: nullptr */ - static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - ActivePowerPerCurrentFlow(); - virtual ~ActivePowerPerCurrentFlow(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + ActivePowerPerCurrentFlow& operator+=(const ActivePowerPerCurrentFlow& rhs); + ActivePowerPerCurrentFlow& operator-=(const ActivePowerPerCurrentFlow& rhs); + ActivePowerPerCurrentFlow& operator*=(const ActivePowerPerCurrentFlow& rhs); + ActivePowerPerCurrentFlow& operator/=(const ActivePowerPerCurrentFlow& rhs); - BaseClass* ActivePowerPerCurrentFlow_factory(); + friend std::istream& operator>>(std::istream& lop, ActivePowerPerCurrentFlow& rop); + friend std::ostream& operator<<(std::ostream& os, const ActivePowerPerCurrentFlow& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.cpp b/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.cpp index c9a075670..9f3064d3a 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.cpp +++ b/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePowerPerFrequency.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "Float.hpp" - -using namespace CIMPP; - -ActivePowerPerFrequency::ActivePowerPerFrequency(): value(nullptr) {}; - -ActivePowerPerFrequency::~ActivePowerPerFrequency() {}; - +#include +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; - - -bool assign_ActivePowerPerFrequency_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - -bool assign_ActivePowerPerFrequency_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerFrequency_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerFrequency_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerFrequency_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +ActivePowerPerFrequency& ActivePowerPerFrequency::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } - -namespace CIMPP { - BaseClass* ActivePowerPerFrequency_factory() { - return new ActivePowerPerFrequency; +ActivePowerPerFrequency::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void ActivePowerPerFrequency::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency"), &ActivePowerPerFrequency_factory)); +const char ActivePowerPerFrequency::debugName[] = "ActivePowerPerFrequency"; +const char* ActivePowerPerFrequency::debugString() const +{ + return ActivePowerPerFrequency::debugName; } -void ActivePowerPerFrequency::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.denominatorMultiplier"), &assign_ActivePowerPerFrequency_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.denominatorUnit"), &assign_ActivePowerPerFrequency_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.multiplier"), &assign_ActivePowerPerFrequency_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.unit"), &assign_ActivePowerPerFrequency_unit)); - } +ActivePowerPerFrequency& ActivePowerPerFrequency::operator+=(const ActivePowerPerFrequency& rhs) +{ + value += rhs.value; + return *this; +} -void ActivePowerPerFrequency::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.value"), &assign_ActivePowerPerFrequency_value)); +ActivePowerPerFrequency& ActivePowerPerFrequency::operator-=(const ActivePowerPerFrequency& rhs) +{ + value -= rhs.value; + return *this; } -const char ActivePowerPerFrequency::debugName[] = "ActivePowerPerFrequency"; -const char* ActivePowerPerFrequency::debugString() +ActivePowerPerFrequency& ActivePowerPerFrequency::operator*=(const ActivePowerPerFrequency& rhs) { - return ActivePowerPerFrequency::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner ActivePowerPerFrequency::declare() +ActivePowerPerFrequency& ActivePowerPerFrequency::operator/=(const ActivePowerPerFrequency& rhs) { - return BaseClassDefiner(ActivePowerPerFrequency::addConstructToMap, ActivePowerPerFrequency::addPrimitiveAssignFnsToMap, ActivePowerPerFrequency::addClassAssignFnsToMap, ActivePowerPerFrequency::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ActivePowerPerFrequency& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const ActivePowerPerFrequency& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.hpp b/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.hpp index 51127c5dd..f8b5bd3ab 100644 --- a/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.hpp +++ b/CGMES_2.4.15_16FEB2016/ActivePowerPerFrequency.hpp @@ -1,46 +1,39 @@ #ifndef ActivePowerPerFrequency_H #define ActivePowerPerFrequency_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Active power variation with frequency. */ - class ActivePowerPerFrequency: public BaseClass + class ActivePowerPerFrequency { - public: - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::Float* value; /* Default: nullptr */ - + ActivePowerPerFrequency() : value(0.0), initialized(false) {} + ActivePowerPerFrequency(long double value) : value(value), initialized(true) {} + + ActivePowerPerFrequency& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - ActivePowerPerFrequency(); - virtual ~ActivePowerPerFrequency(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + ActivePowerPerFrequency& operator+=(const ActivePowerPerFrequency& rhs); + ActivePowerPerFrequency& operator-=(const ActivePowerPerFrequency& rhs); + ActivePowerPerFrequency& operator*=(const ActivePowerPerFrequency& rhs); + ActivePowerPerFrequency& operator/=(const ActivePowerPerFrequency& rhs); - BaseClass* ActivePowerPerFrequency_factory(); + friend std::istream& operator>>(std::istream& lop, ActivePowerPerFrequency& rop); + friend std::ostream& operator<<(std::ostream& os, const ActivePowerPerFrequency& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/Analog.cpp b/CGMES_2.4.15_16FEB2016/Analog.cpp index a4770d988..ed286e5f9 100644 --- a/CGMES_2.4.15_16FEB2016/Analog.cpp +++ b/CGMES_2.4.15_16FEB2016/Analog.cpp @@ -1,77 +1,92 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Analog.hpp" -#include "Boolean.hpp" +#include +#include + #include "AnalogValue.hpp" #include "AnalogLimitSet.hpp" +#include "Boolean.hpp" using namespace CIMPP; Analog::Analog() {}; - Analog::~Analog() {}; -bool assign_Analog_AnalogValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Analog* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->AnalogValues.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_Analog_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Analog* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveFlowIn; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Analog_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Analog* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->LimitSets.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + +bool assign_AnalogValue_Analog(BaseClass*, BaseClass*); +bool assign_Analog_AnalogValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Analog* element = dynamic_cast(BaseClass_ptr1); + AnalogValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->AnalogValues.begin(), element->AnalogValues.end(), element2) == element->AnalogValues.end()) + { + element->AnalogValues.push_back(element2); + return assign_AnalogValue_Analog(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - -bool assign_Analog_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Analog* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveFlowIn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AnalogLimitSet_Measurements(BaseClass*, BaseClass*); +bool assign_Analog_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Analog* element = dynamic_cast(BaseClass_ptr1); + AnalogLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->LimitSets.begin(), element->LimitSets.end(), element2) == element->LimitSets.end()) + { + element->LimitSets.push_back(element2); + return assign_AnalogLimitSet_Measurements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - -namespace CIMPP { - BaseClass* Analog_factory() { - return new Analog; - } +const char Analog::debugName[] = "Analog"; +const char* Analog::debugString() const +{ + return Analog::debugName; } -void Analog::addConstructToMap(std::unordered_map& factory_map) { +void Analog::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Analog"), &Analog_factory)); } -void Analog::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Analog::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Analog.positiveFlowIn"), &assign_Analog_positiveFlowIn)); - } - -void Analog::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Analog.AnalogValues"), &assign_Analog_AnalogValues)); - assign_map.insert(std::make_pair(std::string("cim:Analog.LimitSets"), &assign_Analog_LimitSets)); } -const char Analog::debugName[] = "Analog"; -const char* Analog::debugString() +void Analog::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Analog::debugName; + assign_map.insert(std::make_pair(std::string("cim:Analog.AnalogValues"), &assign_Analog_AnalogValues)); + assign_map.insert(std::make_pair(std::string("cim:Analog.LimitSets"), &assign_Analog_LimitSets)); } const BaseClassDefiner Analog::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner Analog::declare() return BaseClassDefiner(Analog::addConstructToMap, Analog::addPrimitiveAssignFnsToMap, Analog::addClassAssignFnsToMap, Analog::debugName); } - +namespace CIMPP +{ + BaseClass* Analog_factory() + { + return new Analog; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Analog.hpp b/CGMES_2.4.15_16FEB2016/Analog.hpp index 38bdaa8ab..bbe3e8612 100644 --- a/CGMES_2.4.15_16FEB2016/Analog.hpp +++ b/CGMES_2.4.15_16FEB2016/Analog.hpp @@ -1,42 +1,43 @@ #ifndef Analog_H #define Analog_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class AnalogLimitSet; + class AnalogValue; -class AnalogValue; -class AnalogLimitSet; /* Analog represents an analog Measurement. */ - class Analog: public Measurement + class Analog : public Measurement { - public: - CIMPP::Boolean positiveFlowIn; /* If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. Default: false */ - std::list AnalogValues; /* Measurement to which this value is connected. Default: 0 */ - std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Analog(); - virtual ~Analog(); - + ~Analog() override; + + std::list AnalogValues; /* Measurement to which this value is connected. Default: 0 */ + std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ + CIMPP::Boolean positiveFlowIn; /* If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Analog_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AnalogControl.cpp b/CGMES_2.4.15_16FEB2016/AnalogControl.cpp index c376b103f..535c82dea 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogControl.cpp +++ b/CGMES_2.4.15_16FEB2016/AnalogControl.cpp @@ -1,79 +1,88 @@ -#include -#include "Control.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogControl.hpp" +#include +#include + +#include "AnalogValue.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "AnalogValue.hpp" using namespace CIMPP; -AnalogControl::AnalogControl(): AnalogValue(nullptr) {}; - +AnalogControl::AnalogControl() : AnalogValue(nullptr) {}; AnalogControl::~AnalogControl() {}; +bool assign_AnalogControl_maxValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AnalogValue_AnalogControl(BaseClass*, BaseClass*); -bool assign_AnalogControl_AnalogValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogControl* element = dynamic_cast(BaseClass_ptr1)) { - element->AnalogValue = dynamic_cast(BaseClass_ptr2); - if(element->AnalogValue != nullptr) - return assign_AnalogValue_AnalogControl(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_AnalogControl_minValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AnalogControl_maxValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AnalogValue_AnalogControl(BaseClass*, BaseClass*); +bool assign_AnalogControl_AnalogValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogControl* element = dynamic_cast(BaseClass_ptr1); + AnalogValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AnalogValue != element2) + { + element->AnalogValue = element2; + return assign_AnalogValue_AnalogControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_AnalogControl_minValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* AnalogControl_factory() { - return new AnalogControl; - } +const char AnalogControl::debugName[] = "AnalogControl"; +const char* AnalogControl::debugString() const +{ + return AnalogControl::debugName; } -void AnalogControl::addConstructToMap(std::unordered_map& factory_map) { +void AnalogControl::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogControl"), &AnalogControl_factory)); } -void AnalogControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AnalogControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AnalogControl.maxValue"), &assign_AnalogControl_maxValue)); assign_map.insert(std::make_pair(std::string("cim:AnalogControl.minValue"), &assign_AnalogControl_minValue)); - } - -void AnalogControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogControl.AnalogValue"), &assign_AnalogControl_AnalogValue)); } -const char AnalogControl::debugName[] = "AnalogControl"; -const char* AnalogControl::debugString() +void AnalogControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AnalogControl::debugName; + assign_map.insert(std::make_pair(std::string("cim:AnalogControl.AnalogValue"), &assign_AnalogControl_AnalogValue)); } const BaseClassDefiner AnalogControl::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner AnalogControl::declare() return BaseClassDefiner(AnalogControl::addConstructToMap, AnalogControl::addPrimitiveAssignFnsToMap, AnalogControl::addClassAssignFnsToMap, AnalogControl::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogControl_factory() + { + return new AnalogControl; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AnalogControl.hpp b/CGMES_2.4.15_16FEB2016/AnalogControl.hpp index 6be2810ab..758a9446b 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogControl.hpp +++ b/CGMES_2.4.15_16FEB2016/AnalogControl.hpp @@ -1,41 +1,42 @@ #ifndef AnalogControl_H #define AnalogControl_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Control.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Control.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class AnalogValue; - -class AnalogValue; /* An analog control used for supervisory control. */ - class AnalogControl: public Control + class AnalogControl : public Control { - public: - CIMPP::Simple_Float maxValue; /* Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ - CIMPP::Simple_Float minValue; /* Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ - CIMPP::AnalogValue* AnalogValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogControl(); - virtual ~AnalogControl(); - + ~AnalogControl() override; + + CIMPP::AnalogValue* AnalogValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ + CIMPP::Simple_Float maxValue; /* Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ + CIMPP::Simple_Float minValue; /* Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogControl_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AnalogLimit.cpp b/CGMES_2.4.15_16FEB2016/AnalogLimit.cpp index c71b50087..272232d9d 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/AnalogLimit.cpp @@ -1,64 +1,72 @@ -#include -#include "Limit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogLimit.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "AnalogLimitSet.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; -AnalogLimit::AnalogLimit(): LimitSet(nullptr) {}; - +AnalogLimit::AnalogLimit() : LimitSet(nullptr) {}; AnalogLimit::~AnalogLimit() {}; -bool assign_AnalogLimitSet_Limits(BaseClass*, BaseClass*); -bool assign_AnalogLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->LimitSet = dynamic_cast(BaseClass_ptr2); - if(element->LimitSet != nullptr) - return assign_AnalogLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_AnalogLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AnalogLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AnalogLimitSet_Limits(BaseClass*, BaseClass*); +bool assign_AnalogLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogLimit* element = dynamic_cast(BaseClass_ptr1); + AnalogLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LimitSet != element2) + { + element->LimitSet = element2; + return assign_AnalogLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AnalogLimit_factory() { - return new AnalogLimit; - } +const char AnalogLimit::debugName[] = "AnalogLimit"; +const char* AnalogLimit::debugString() const +{ + return AnalogLimit::debugName; } -void AnalogLimit::addConstructToMap(std::unordered_map& factory_map) { +void AnalogLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogLimit"), &AnalogLimit_factory)); } -void AnalogLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AnalogLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AnalogLimit.value"), &assign_AnalogLimit_value)); - } - -void AnalogLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogLimit.LimitSet"), &assign_AnalogLimit_LimitSet)); } -const char AnalogLimit::debugName[] = "AnalogLimit"; -const char* AnalogLimit::debugString() +void AnalogLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AnalogLimit::debugName; + assign_map.insert(std::make_pair(std::string("cim:AnalogLimit.LimitSet"), &assign_AnalogLimit_LimitSet)); } const BaseClassDefiner AnalogLimit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner AnalogLimit::declare() return BaseClassDefiner(AnalogLimit::addConstructToMap, AnalogLimit::addPrimitiveAssignFnsToMap, AnalogLimit::addClassAssignFnsToMap, AnalogLimit::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogLimit_factory() + { + return new AnalogLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AnalogLimit.hpp b/CGMES_2.4.15_16FEB2016/AnalogLimit.hpp index 966da9276..52cc400d3 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/AnalogLimit.hpp @@ -1,40 +1,41 @@ #ifndef AnalogLimit_H #define AnalogLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Limit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Limit.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class AnalogLimitSet; - -class AnalogLimitSet; /* Limit values for Analog measurements. */ - class AnalogLimit: public Limit + class AnalogLimit : public Limit { - public: - CIMPP::Simple_Float value; /* The value to supervise against. Default: nullptr */ - CIMPP::AnalogLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogLimit(); - virtual ~AnalogLimit(); - + ~AnalogLimit() override; + + CIMPP::AnalogLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ + CIMPP::Simple_Float value; /* The value to supervise against. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AnalogLimitSet.cpp b/CGMES_2.4.15_16FEB2016/AnalogLimitSet.cpp index f912f49cb..242bdb236 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogLimitSet.cpp +++ b/CGMES_2.4.15_16FEB2016/AnalogLimitSet.cpp @@ -1,62 +1,76 @@ -#include -#include "LimitSet.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogLimitSet.hpp" -#include "Analog.hpp" +#include +#include + #include "AnalogLimit.hpp" +#include "Analog.hpp" using namespace CIMPP; AnalogLimitSet::AnalogLimitSet() {}; - AnalogLimitSet::~AnalogLimitSet() {}; -bool assign_AnalogLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_AnalogLimit_LimitSet(BaseClass*, BaseClass*); +bool assign_AnalogLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1); + AnalogLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Limits.begin(), element->Limits.end(), element2) == element->Limits.end()) + { + element->Limits.push_back(element2); + return assign_AnalogLimit_LimitSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_AnalogLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Limits.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Analog_LimitSets(BaseClass*, BaseClass*); +bool assign_AnalogLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1); + Analog* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Analog_LimitSets(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* AnalogLimitSet_factory() { - return new AnalogLimitSet; - } +const char AnalogLimitSet::debugName[] = "AnalogLimitSet"; +const char* AnalogLimitSet::debugString() const +{ + return AnalogLimitSet::debugName; } -void AnalogLimitSet::addConstructToMap(std::unordered_map& factory_map) { +void AnalogLimitSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogLimitSet"), &AnalogLimitSet_factory)); } -void AnalogLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void AnalogLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Measurements"), &assign_AnalogLimitSet_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Limits"), &assign_AnalogLimitSet_Limits)); +void AnalogLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char AnalogLimitSet::debugName[] = "AnalogLimitSet"; -const char* AnalogLimitSet::debugString() +void AnalogLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AnalogLimitSet::debugName; + assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Limits"), &assign_AnalogLimitSet_Limits)); + assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Measurements"), &assign_AnalogLimitSet_Measurements)); } const BaseClassDefiner AnalogLimitSet::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner AnalogLimitSet::declare() return BaseClassDefiner(AnalogLimitSet::addConstructToMap, AnalogLimitSet::addPrimitiveAssignFnsToMap, AnalogLimitSet::addClassAssignFnsToMap, AnalogLimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogLimitSet_factory() + { + return new AnalogLimitSet; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AnalogLimitSet.hpp b/CGMES_2.4.15_16FEB2016/AnalogLimitSet.hpp index 2ecb2b94e..463efd26b 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogLimitSet.hpp +++ b/CGMES_2.4.15_16FEB2016/AnalogLimitSet.hpp @@ -1,40 +1,41 @@ #ifndef AnalogLimitSet_H #define AnalogLimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LimitSet.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LimitSet.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Analog; + class AnalogLimit; -class Analog; -class AnalogLimit; /* An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement. */ - class AnalogLimitSet: public LimitSet + class AnalogLimitSet : public LimitSet { - public: - std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ - std::list Limits; /* The set of limits. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogLimitSet(); - virtual ~AnalogLimitSet(); - + ~AnalogLimitSet() override; + + std::list Limits; /* The set of limits. Default: 0 */ + std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogLimitSet_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AnalogValue.cpp b/CGMES_2.4.15_16FEB2016/AnalogValue.cpp index dc9c42dfa..852593e60 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogValue.cpp +++ b/CGMES_2.4.15_16FEB2016/AnalogValue.cpp @@ -1,76 +1,92 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogValue.hpp" +#include +#include + #include "Analog.hpp" #include "AnalogControl.hpp" #include "Simple_Float.hpp" using namespace CIMPP; -AnalogValue::AnalogValue(): Analog(nullptr), AnalogControl(nullptr) {}; - +AnalogValue::AnalogValue() : Analog(nullptr), AnalogControl(nullptr) {}; AnalogValue::~AnalogValue() {}; -bool assign_Analog_AnalogValues(BaseClass*, BaseClass*); -bool assign_AnalogValue_Analog(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Analog = dynamic_cast(BaseClass_ptr2); - if(element->Analog != nullptr) - return assign_Analog_AnalogValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AnalogValue_AnalogControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogValue* element = dynamic_cast(BaseClass_ptr1)) { - element->AnalogControl = dynamic_cast(BaseClass_ptr2); - if(element->AnalogControl != nullptr) - return true; - } - return false; -} - +bool assign_AnalogValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AnalogValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Analog_AnalogValues(BaseClass*, BaseClass*); +bool assign_AnalogValue_Analog(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogValue* element = dynamic_cast(BaseClass_ptr1); + Analog* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Analog != element2) + { + element->Analog = element2; + return assign_Analog_AnalogValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AnalogValue_factory() { - return new AnalogValue; +bool assign_AnalogControl_AnalogValue(BaseClass*, BaseClass*); +bool assign_AnalogValue_AnalogControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogValue* element = dynamic_cast(BaseClass_ptr1); + AnalogControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AnalogControl != element2) + { + element->AnalogControl = element2; + return assign_AnalogControl_AnalogValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + +const char AnalogValue::debugName[] = "AnalogValue"; +const char* AnalogValue::debugString() const +{ + return AnalogValue::debugName; } -void AnalogValue::addConstructToMap(std::unordered_map& factory_map) { +void AnalogValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogValue"), &AnalogValue_factory)); } -void AnalogValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogValue.value"), &assign_AnalogValue_value)); +void AnalogValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:AnalogValue.value"), &assign_AnalogValue_value)); } -void AnalogValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void AnalogValue::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AnalogValue.Analog"), &assign_AnalogValue_Analog)); assign_map.insert(std::make_pair(std::string("cim:AnalogValue.AnalogControl"), &assign_AnalogValue_AnalogControl)); - } - -const char AnalogValue::debugName[] = "AnalogValue"; -const char* AnalogValue::debugString() -{ - return AnalogValue::debugName; } const BaseClassDefiner AnalogValue::declare() @@ -78,4 +94,10 @@ const BaseClassDefiner AnalogValue::declare() return BaseClassDefiner(AnalogValue::addConstructToMap, AnalogValue::addPrimitiveAssignFnsToMap, AnalogValue::addClassAssignFnsToMap, AnalogValue::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogValue_factory() + { + return new AnalogValue; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AnalogValue.hpp b/CGMES_2.4.15_16FEB2016/AnalogValue.hpp index 59d5219e9..41f13d9b0 100644 --- a/CGMES_2.4.15_16FEB2016/AnalogValue.hpp +++ b/CGMES_2.4.15_16FEB2016/AnalogValue.hpp @@ -1,42 +1,43 @@ #ifndef AnalogValue_H #define AnalogValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Analog; + class AnalogControl; - -class Analog; -class AnalogControl; /* AnalogValue represents an analog MeasurementValue. */ - class AnalogValue: public MeasurementValue + class AnalogValue : public MeasurementValue { - public: - CIMPP::Analog* Analog; /* The values connected to this measurement. Default: 0 */ - CIMPP::AnalogControl* AnalogControl; /* The MeasurementValue that is controlled. Default: 0 */ - CIMPP::Simple_Float value; /* The value to supervise. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogValue(); - virtual ~AnalogValue(); - + ~AnalogValue() override; + + CIMPP::Analog* Analog; /* The values connected to this measurement. Default: 0 */ + CIMPP::AnalogControl* AnalogControl; /* The MeasurementValue that is controlled. Default: 0 */ + CIMPP::Simple_Float value; /* The value to supervise. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogValue_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AngleDegrees.cpp b/CGMES_2.4.15_16FEB2016/AngleDegrees.cpp index 6651b2ed8..01475444f 100644 --- a/CGMES_2.4.15_16FEB2016/AngleDegrees.cpp +++ b/CGMES_2.4.15_16FEB2016/AngleDegrees.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AngleDegrees.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -AngleDegrees::AngleDegrees() {} -AngleDegrees::~AngleDegrees(){} +#include -AngleDegrees::AngleDegrees(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void AngleDegrees::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void AngleDegrees::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +AngleDegrees& AngleDegrees::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void AngleDegrees::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +AngleDegrees::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char AngleDegrees::debugName[] = "AngleDegrees"; -const char* AngleDegrees::debugString() { +const char* AngleDegrees::debugString() const +{ return AngleDegrees::debugName; } - -const BaseClassDefiner AngleDegrees::declare() { - return BaseClassDefiner(AngleDegrees::addConstructToMap, AngleDegrees::addPrimitiveAssignFnsToMap, AngleDegrees::addClassAssignFnsToMap, AngleDegrees::debugName); +AngleDegrees& AngleDegrees::operator+=(const AngleDegrees& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - AngleDegrees& AngleDegrees::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - AngleDegrees& AngleDegrees::operator-=(const AngleDegrees& rhs) { - value -= rhs.value; - return *this; - } - - AngleDegrees& AngleDegrees::operator*=(const AngleDegrees& rhs) { - value *= rhs.value; - return *this; - } - - AngleDegrees& AngleDegrees::operator/=(const AngleDegrees& rhs) { - value /= rhs.value; - return *this; - } +AngleDegrees& AngleDegrees::operator-=(const AngleDegrees& rhs) +{ + value -= rhs.value; + return *this; +} - AngleDegrees& AngleDegrees::operator+=(const AngleDegrees& rhs) { - value += rhs.value; - return *this; - } +AngleDegrees& AngleDegrees::operator*=(const AngleDegrees& rhs) +{ + value *= rhs.value; + return *this; +} - AngleDegrees::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +AngleDegrees& AngleDegrees::operator/=(const AngleDegrees& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, AngleDegrees& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, AngleDegrees& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const AngleDegrees& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/AngleDegrees.hpp b/CGMES_2.4.15_16FEB2016/AngleDegrees.hpp index c8603c675..39204363b 100644 --- a/CGMES_2.4.15_16FEB2016/AngleDegrees.hpp +++ b/CGMES_2.4.15_16FEB2016/AngleDegrees.hpp @@ -1,38 +1,39 @@ #ifndef AngleDegrees_H #define AngleDegrees_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class AngleDegrees : public BaseClass + /* + Measurement of angle in degrees. + */ + class AngleDegrees { - public: - AngleDegrees(); - virtual ~AngleDegrees(); - AngleDegrees(long double value); - static const BaseClassDefiner declare(); - AngleDegrees& operator=(long double &rop); + AngleDegrees() : value(0.0), initialized(false) {} + AngleDegrees(long double value) : value(value), initialized(true) {} + + AngleDegrees& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + AngleDegrees& operator+=(const AngleDegrees& rhs); AngleDegrees& operator-=(const AngleDegrees& rhs); AngleDegrees& operator*=(const AngleDegrees& rhs); AngleDegrees& operator/=(const AngleDegrees& rhs); + friend std::istream& operator>>(std::istream& lop, AngleDegrees& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const AngleDegrees& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/AngleRadians.cpp b/CGMES_2.4.15_16FEB2016/AngleRadians.cpp index 88132505b..bd1b77dbb 100644 --- a/CGMES_2.4.15_16FEB2016/AngleRadians.cpp +++ b/CGMES_2.4.15_16FEB2016/AngleRadians.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AngleRadians.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -AngleRadians::AngleRadians() {} -AngleRadians::~AngleRadians(){} +#include -AngleRadians::AngleRadians(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void AngleRadians::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void AngleRadians::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +AngleRadians& AngleRadians::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void AngleRadians::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +AngleRadians::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char AngleRadians::debugName[] = "AngleRadians"; -const char* AngleRadians::debugString() { +const char* AngleRadians::debugString() const +{ return AngleRadians::debugName; } - -const BaseClassDefiner AngleRadians::declare() { - return BaseClassDefiner(AngleRadians::addConstructToMap, AngleRadians::addPrimitiveAssignFnsToMap, AngleRadians::addClassAssignFnsToMap, AngleRadians::debugName); +AngleRadians& AngleRadians::operator+=(const AngleRadians& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - AngleRadians& AngleRadians::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - AngleRadians& AngleRadians::operator-=(const AngleRadians& rhs) { - value -= rhs.value; - return *this; - } - - AngleRadians& AngleRadians::operator*=(const AngleRadians& rhs) { - value *= rhs.value; - return *this; - } - - AngleRadians& AngleRadians::operator/=(const AngleRadians& rhs) { - value /= rhs.value; - return *this; - } +AngleRadians& AngleRadians::operator-=(const AngleRadians& rhs) +{ + value -= rhs.value; + return *this; +} - AngleRadians& AngleRadians::operator+=(const AngleRadians& rhs) { - value += rhs.value; - return *this; - } +AngleRadians& AngleRadians::operator*=(const AngleRadians& rhs) +{ + value *= rhs.value; + return *this; +} - AngleRadians::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +AngleRadians& AngleRadians::operator/=(const AngleRadians& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, AngleRadians& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, AngleRadians& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const AngleRadians& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/AngleRadians.hpp b/CGMES_2.4.15_16FEB2016/AngleRadians.hpp index 99ad6cce1..2ac29ff28 100644 --- a/CGMES_2.4.15_16FEB2016/AngleRadians.hpp +++ b/CGMES_2.4.15_16FEB2016/AngleRadians.hpp @@ -1,38 +1,39 @@ #ifndef AngleRadians_H #define AngleRadians_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class AngleRadians : public BaseClass + /* + Phase angle in radians. + */ + class AngleRadians { - public: - AngleRadians(); - virtual ~AngleRadians(); - AngleRadians(long double value); - static const BaseClassDefiner declare(); - AngleRadians& operator=(long double &rop); + AngleRadians() : value(0.0), initialized(false) {} + AngleRadians(long double value) : value(value), initialized(true) {} + + AngleRadians& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + AngleRadians& operator+=(const AngleRadians& rhs); AngleRadians& operator-=(const AngleRadians& rhs); AngleRadians& operator*=(const AngleRadians& rhs); AngleRadians& operator/=(const AngleRadians& rhs); + friend std::istream& operator>>(std::istream& lop, AngleRadians& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const AngleRadians& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ApparentPower.cpp b/CGMES_2.4.15_16FEB2016/ApparentPower.cpp index d62bbb332..0b8976a61 100644 --- a/CGMES_2.4.15_16FEB2016/ApparentPower.cpp +++ b/CGMES_2.4.15_16FEB2016/ApparentPower.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ApparentPower.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -ApparentPower::ApparentPower() {} -ApparentPower::~ApparentPower(){} +#include -ApparentPower::ApparentPower(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void ApparentPower::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void ApparentPower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +ApparentPower& ApparentPower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void ApparentPower::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +ApparentPower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char ApparentPower::debugName[] = "ApparentPower"; -const char* ApparentPower::debugString() { +const char* ApparentPower::debugString() const +{ return ApparentPower::debugName; } - -const BaseClassDefiner ApparentPower::declare() { - return BaseClassDefiner(ApparentPower::addConstructToMap, ApparentPower::addPrimitiveAssignFnsToMap, ApparentPower::addClassAssignFnsToMap, ApparentPower::debugName); +ApparentPower& ApparentPower::operator+=(const ApparentPower& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - ApparentPower& ApparentPower::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - ApparentPower& ApparentPower::operator-=(const ApparentPower& rhs) { - value -= rhs.value; - return *this; - } - - ApparentPower& ApparentPower::operator*=(const ApparentPower& rhs) { - value *= rhs.value; - return *this; - } - - ApparentPower& ApparentPower::operator/=(const ApparentPower& rhs) { - value /= rhs.value; - return *this; - } +ApparentPower& ApparentPower::operator-=(const ApparentPower& rhs) +{ + value -= rhs.value; + return *this; +} - ApparentPower& ApparentPower::operator+=(const ApparentPower& rhs) { - value += rhs.value; - return *this; - } +ApparentPower& ApparentPower::operator*=(const ApparentPower& rhs) +{ + value *= rhs.value; + return *this; +} - ApparentPower::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +ApparentPower& ApparentPower::operator/=(const ApparentPower& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, ApparentPower& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ApparentPower& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const ApparentPower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/ApparentPower.hpp b/CGMES_2.4.15_16FEB2016/ApparentPower.hpp index 0614d5728..bcb8201e6 100644 --- a/CGMES_2.4.15_16FEB2016/ApparentPower.hpp +++ b/CGMES_2.4.15_16FEB2016/ApparentPower.hpp @@ -1,38 +1,39 @@ #ifndef ApparentPower_H #define ApparentPower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class ApparentPower : public BaseClass + /* + Product of the RMS value of the voltage and the RMS value of the current. + */ + class ApparentPower { - public: - ApparentPower(); - virtual ~ApparentPower(); - ApparentPower(long double value); - static const BaseClassDefiner declare(); - ApparentPower& operator=(long double &rop); + ApparentPower() : value(0.0), initialized(false) {} + ApparentPower(long double value) : value(value), initialized(true) {} + + ApparentPower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + ApparentPower& operator+=(const ApparentPower& rhs); ApparentPower& operator-=(const ApparentPower& rhs); ApparentPower& operator*=(const ApparentPower& rhs); ApparentPower& operator/=(const ApparentPower& rhs); + friend std::istream& operator>>(std::istream& lop, ApparentPower& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const ApparentPower& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.cpp b/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.cpp index 8daa9d935..a4c8c9843 100644 --- a/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ApparentPowerLimit.hpp" +#include +#include + #include "ApparentPower.hpp" using namespace CIMPP; ApparentPowerLimit::ApparentPowerLimit() {}; - ApparentPowerLimit::~ApparentPowerLimit() {}; +bool assign_ApparentPowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ApparentPowerLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ApparentPowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ApparentPowerLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ApparentPowerLimit_factory() { - return new ApparentPowerLimit; - } +const char ApparentPowerLimit::debugName[] = "ApparentPowerLimit"; +const char* ApparentPowerLimit::debugString() const +{ + return ApparentPowerLimit::debugName; } -void ApparentPowerLimit::addConstructToMap(std::unordered_map& factory_map) { +void ApparentPowerLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ApparentPowerLimit"), &ApparentPowerLimit_factory)); } -void ApparentPowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ApparentPowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ApparentPowerLimit.value"), &assign_ApparentPowerLimit_value)); } -void ApparentPowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ApparentPowerLimit::debugName[] = "ApparentPowerLimit"; -const char* ApparentPowerLimit::debugString() +void ApparentPowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ApparentPowerLimit::debugName; } const BaseClassDefiner ApparentPowerLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner ApparentPowerLimit::declare() return BaseClassDefiner(ApparentPowerLimit::addConstructToMap, ApparentPowerLimit::addPrimitiveAssignFnsToMap, ApparentPowerLimit::addClassAssignFnsToMap, ApparentPowerLimit::debugName); } - +namespace CIMPP +{ + BaseClass* ApparentPowerLimit_factory() + { + return new ApparentPowerLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.hpp b/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.hpp index 3af1691f8..3d95bd8fe 100644 --- a/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/ApparentPowerLimit.hpp @@ -1,38 +1,39 @@ #ifndef ApparentPowerLimit_H #define ApparentPowerLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "ApparentPower.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Apparent power limit. */ - class ApparentPowerLimit: public OperationalLimit + class ApparentPowerLimit : public OperationalLimit { - public: - CIMPP::ApparentPower value; /* The apparent power limit. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ApparentPowerLimit(); - virtual ~ApparentPowerLimit(); - + ~ApparentPowerLimit() override; + + CIMPP::ApparentPower value; /* The apparent power limit. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ApparentPowerLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Area.cpp b/CGMES_2.4.15_16FEB2016/Area.cpp index 236e60bec..4a7457802 100644 --- a/CGMES_2.4.15_16FEB2016/Area.cpp +++ b/CGMES_2.4.15_16FEB2016/Area.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Area.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Area::Area() {} -Area::~Area(){} +#include -Area::Area(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Area::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Area::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Area& Area::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Area::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Area::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Area::debugName[] = "Area"; -const char* Area::debugString() { +const char* Area::debugString() const +{ return Area::debugName; } - -const BaseClassDefiner Area::declare() { - return BaseClassDefiner(Area::addConstructToMap, Area::addPrimitiveAssignFnsToMap, Area::addClassAssignFnsToMap, Area::debugName); +Area& Area::operator+=(const Area& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Area& Area::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Area& Area::operator-=(const Area& rhs) { - value -= rhs.value; - return *this; - } - - Area& Area::operator*=(const Area& rhs) { - value *= rhs.value; - return *this; - } - - Area& Area::operator/=(const Area& rhs) { - value /= rhs.value; - return *this; - } +Area& Area::operator-=(const Area& rhs) +{ + value -= rhs.value; + return *this; +} - Area& Area::operator+=(const Area& rhs) { - value += rhs.value; - return *this; - } +Area& Area::operator*=(const Area& rhs) +{ + value *= rhs.value; + return *this; +} - Area::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Area& Area::operator/=(const Area& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Area& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Area& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Area& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Area.hpp b/CGMES_2.4.15_16FEB2016/Area.hpp index 6434bed58..681c909b6 100644 --- a/CGMES_2.4.15_16FEB2016/Area.hpp +++ b/CGMES_2.4.15_16FEB2016/Area.hpp @@ -1,38 +1,39 @@ #ifndef Area_H #define Area_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Area : public BaseClass + /* + Area. + */ + class Area { - public: - Area(); - virtual ~Area(); - Area(long double value); - static const BaseClassDefiner declare(); - Area& operator=(long double &rop); + Area() : value(0.0), initialized(false) {} + Area(long double value) : value(value), initialized(true) {} + + Area& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Area& operator+=(const Area& rhs); Area& operator-=(const Area& rhs); Area& operator*=(const Area& rhs); Area& operator/=(const Area& rhs); + friend std::istream& operator>>(std::istream& lop, Area& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Area& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachine.cpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachine.cpp index 485e07c09..bfaa21afb 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachine.cpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachine.cpp @@ -1,195 +1,216 @@ -#include -#include "RotatingMachine.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachine.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" -#include "Frequency.hpp" -#include "RotationSpeed.hpp" +#include "AsynchronousMachineKind.hpp" #include "Boolean.hpp" #include "PerCent.hpp" #include "Simple_Float.hpp" +#include "Frequency.hpp" +#include "RotationSpeed.hpp" #include "Integer.hpp" #include "ActivePower.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" -#include "AsynchronousMachineKind.hpp" using namespace CIMPP; -AsynchronousMachine::AsynchronousMachine(): AsynchronousMachineDynamics(nullptr), nominalSpeed(nullptr) {}; - +AsynchronousMachine::AsynchronousMachine() : AsynchronousMachineDynamics(nullptr) {}; AsynchronousMachine::~AsynchronousMachine() {}; -bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return true; - } - return false; + +bool assign_AsynchronousMachine_asynchronousMachineType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->asynchronousMachineType; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_AsynchronousMachine_converterFedDrive(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->converterFedDrive; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AsynchronousMachine_nominalSpeed(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->nominalSpeed = dynamic_cast(BaseClass_ptr2); - if(element->nominalSpeed != nullptr) - return true; - } - return false; +bool assign_AsynchronousMachine_efficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efficiency; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_AsynchronousMachine_iaIrRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iaIrRatio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_nominalFrequency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalFrequency; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_nominalSpeed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalSpeed; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_polePairNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->polePairNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_ratedMechanicalPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedMechanicalPower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_reversible(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->reversible; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_rxLockedRotorRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rxLockedRotorRatio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass*, BaseClass*); +bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_AsynchronousMachine_nominalFrequency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalFrequency; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_converterFedDrive(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->converterFedDrive; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_efficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efficiency; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_iaIrRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iaIrRatio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_polePairNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->polePairNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_ratedMechanicalPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedMechanicalPower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_reversible(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->reversible; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_rxLockedRotorRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rxLockedRotorRatio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_AsynchronousMachine_asynchronousMachineType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->asynchronousMachineType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* AsynchronousMachine_factory() { - return new AsynchronousMachine; - } + +const char AsynchronousMachine::debugName[] = "AsynchronousMachine"; +const char* AsynchronousMachine::debugString() const +{ + return AsynchronousMachine::debugName; } -void AsynchronousMachine::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachine::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachine"), &AsynchronousMachine_factory)); } -void AsynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalFrequency"), &assign_AsynchronousMachine_nominalFrequency)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.converterFedDrive"), &assign_AsynchronousMachine_converterFedDrive)); +void AsynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.asynchronousMachineType"), &assign_AsynchronousMachine_asynchronousMachineType)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.converterFedDrive"), &assign_AsynchronousMachine_converterFedDrive)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.efficiency"), &assign_AsynchronousMachine_efficiency)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.iaIrRatio"), &assign_AsynchronousMachine_iaIrRatio)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalFrequency"), &assign_AsynchronousMachine_nominalFrequency)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalSpeed"), &assign_AsynchronousMachine_nominalSpeed)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.polePairNumber"), &assign_AsynchronousMachine_polePairNumber)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.ratedMechanicalPower"), &assign_AsynchronousMachine_ratedMechanicalPower)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.reversible"), &assign_AsynchronousMachine_reversible)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.rxLockedRotorRatio"), &assign_AsynchronousMachine_rxLockedRotorRatio)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.asynchronousMachineType"), &assign_AsynchronousMachine_asynchronousMachineType)); } -void AsynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.AsynchronousMachineDynamics"), &assign_AsynchronousMachine_AsynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalSpeed"), &assign_AsynchronousMachine_nominalSpeed)); - } - -const char AsynchronousMachine::debugName[] = "AsynchronousMachine"; -const char* AsynchronousMachine::debugString() +void AsynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachine::debugName; + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.AsynchronousMachineDynamics"), &assign_AsynchronousMachine_AsynchronousMachineDynamics)); } const BaseClassDefiner AsynchronousMachine::declare() @@ -197,4 +218,10 @@ const BaseClassDefiner AsynchronousMachine::declare() return BaseClassDefiner(AsynchronousMachine::addConstructToMap, AsynchronousMachine::addPrimitiveAssignFnsToMap, AsynchronousMachine::addClassAssignFnsToMap, AsynchronousMachine::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachine_factory() + { + return new AsynchronousMachine; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachine.hpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachine.hpp index 367dcd44d..70f2dc771 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachine.hpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachine.hpp @@ -1,56 +1,57 @@ #ifndef AsynchronousMachine_H #define AsynchronousMachine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachine.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Frequency.hpp" +#include "RotatingMachine.hpp" +#include "BaseClassDefiner.hpp" +#include "ActivePower.hpp" +#include "AsynchronousMachineKind.hpp" #include "Boolean.hpp" +#include "Frequency.hpp" +#include "Integer.hpp" #include "PerCent.hpp" +#include "RotationSpeed.hpp" #include "Simple_Float.hpp" -#include "Integer.hpp" -#include "ActivePower.hpp" -#include "AsynchronousMachineKind.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class AsynchronousMachineDynamics; -class AsynchronousMachineDynamics; -class RotationSpeed; /* A rotating machine whose shaft rotates asynchronously with the electrical field. Also known as an induction machine with no external connection to the rotor windings, e.g squirrel-cage induction machine. */ - class AsynchronousMachine: public RotatingMachine + class AsynchronousMachine : public RotatingMachine { - public: - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine dynamics model used to describe dynamic behavior of this asynchronous machine. Default: 0 */ - CIMPP::Frequency nominalFrequency; /* Nameplate data indicates if the machine is 50 or 60 Hz. Default: nullptr */ - CIMPP::RotationSpeed* nominalSpeed; /* Nameplate data. Depends on the slip and number of pole pairs. Default: nullptr */ - CIMPP::Boolean converterFedDrive; /* Indicates whether the machine is a converter fed drive. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::PerCent efficiency; /* Efficiency of the asynchronous machine at nominal operation in percent. Indicator for converter drive motors. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float iaIrRatio; /* Ratio of locked-rotor current to the rated current of the motor (Ia/Ir). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Integer polePairNumber; /* Number of pole pairs of stator. Used for short circuit data exchange according to IEC 60909 Default: 0 */ - CIMPP::ActivePower ratedMechanicalPower; /* Rated mechanical power (Pr in the IEC 60909-0). Used for short circuit data exchange according to IEC 60909. Default: nullptr */ - CIMPP::Boolean reversible; /* Indicates for converter drive motors if the power can be reversible. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::Simple_Float rxLockedRotorRatio; /* Locked rotor ratio (R/X). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::AsynchronousMachineKind asynchronousMachineType; /* Indicates the type of Asynchronous Machine (motor or generator). Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachine(); - virtual ~AsynchronousMachine(); - + ~AsynchronousMachine() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine dynamics model used to describe dynamic behavior of this asynchronous machine. Default: 0 */ + CIMPP::AsynchronousMachineKind asynchronousMachineType; /* Indicates the type of Asynchronous Machine (motor or generator). Default: 0 */ + CIMPP::Boolean converterFedDrive; /* Indicates whether the machine is a converter fed drive. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::PerCent efficiency; /* Efficiency of the asynchronous machine at nominal operation in percent. Indicator for converter drive motors. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float iaIrRatio; /* Ratio of locked-rotor current to the rated current of the motor (Ia/Ir). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Frequency nominalFrequency; /* Nameplate data indicates if the machine is 50 or 60 Hz. Default: nullptr */ + CIMPP::RotationSpeed nominalSpeed; /* Nameplate data. Depends on the slip and number of pole pairs. Default: nullptr */ + CIMPP::Integer polePairNumber; /* Number of pole pairs of stator. Used for short circuit data exchange according to IEC 60909 Default: 0 */ + CIMPP::ActivePower ratedMechanicalPower; /* Rated mechanical power (Pr in the IEC 60909-0). Used for short circuit data exchange according to IEC 60909. Default: nullptr */ + CIMPP::Boolean reversible; /* Indicates for converter drive motors if the power can be reversible. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::Simple_Float rxLockedRotorRatio; /* Locked rotor ratio (R/X). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachine_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.cpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.cpp index a059ace41..f811c69f4 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.cpp @@ -1,85 +1,116 @@ -#include -#include "RotatingMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineDynamics.hpp" +#include +#include + #include "AsynchronousMachine.hpp" #include "MechanicalLoadDynamics.hpp" -#include "WindTurbineType1or2Dynamics.hpp" #include "TurbineGovernorDynamics.hpp" +#include "WindTurbineType1or2Dynamics.hpp" using namespace CIMPP; -AsynchronousMachineDynamics::AsynchronousMachineDynamics(): AsynchronousMachine(nullptr), MechanicalLoadDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr), TurbineGovernorDynamics(nullptr) {}; - +AsynchronousMachineDynamics::AsynchronousMachineDynamics() : AsynchronousMachine(nullptr), MechanicalLoadDynamics(nullptr), TurbineGovernorDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr) {}; AsynchronousMachineDynamics::~AsynchronousMachineDynamics() {}; -bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass*, BaseClass*); -bool assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachine = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachine != nullptr) - return assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->MechanicalLoadDynamics = dynamic_cast(BaseClass_ptr2); - if(element->MechanicalLoadDynamics != nullptr) - return true; - } - return false; -} -bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2Dynamics != nullptr) - return true; - } - return false; -} -bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineGovernorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->TurbineGovernorDynamics != nullptr) - return true; - } - return false; -} +bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachine != element2) + { + element->AsynchronousMachine = element2; + return assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + MechanicalLoadDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MechanicalLoadDynamics != element2) + { + element->MechanicalLoadDynamics = element2; + return assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineGovernorDynamics != element2) + { + element->TurbineGovernorDynamics = element2; + return assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* AsynchronousMachineDynamics_factory() { - return new AsynchronousMachineDynamics; +bool assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2Dynamics != element2) + { + element->WindTurbineType1or2Dynamics = element2; + return assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + +const char AsynchronousMachineDynamics::debugName[] = "AsynchronousMachineDynamics"; +const char* AsynchronousMachineDynamics::debugString() const +{ + return AsynchronousMachineDynamics::debugName; } -void AsynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics"), &AsynchronousMachineDynamics_factory)); } -void AsynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void AsynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void AsynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void AsynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.AsynchronousMachine"), &assign_AsynchronousMachineDynamics_AsynchronousMachine)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.MechanicalLoadDynamics"), &assign_AsynchronousMachineDynamics_MechanicalLoadDynamics)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.WindTurbineType1or2Dynamics"), &assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.TurbineGovernorDynamics"), &assign_AsynchronousMachineDynamics_TurbineGovernorDynamics)); -} - -const char AsynchronousMachineDynamics::debugName[] = "AsynchronousMachineDynamics"; -const char* AsynchronousMachineDynamics::debugString() -{ - return AsynchronousMachineDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.WindTurbineType1or2Dynamics"), &assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics)); } const BaseClassDefiner AsynchronousMachineDynamics::declare() @@ -87,4 +118,10 @@ const BaseClassDefiner AsynchronousMachineDynamics::declare() return BaseClassDefiner(AsynchronousMachineDynamics::addConstructToMap, AsynchronousMachineDynamics::addPrimitiveAssignFnsToMap, AsynchronousMachineDynamics::addClassAssignFnsToMap, AsynchronousMachineDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineDynamics_factory() + { + return new AsynchronousMachineDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.hpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.hpp index 8febb5864..f38f33eab 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineDynamics.hpp @@ -1,44 +1,45 @@ #ifndef AsynchronousMachineDynamics_H #define AsynchronousMachineDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RotatingMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachine; + class MechanicalLoadDynamics; + class TurbineGovernorDynamics; + class WindTurbineType1or2Dynamics; -class AsynchronousMachine; -class MechanicalLoadDynamics; -class WindTurbineType1or2Dynamics; -class TurbineGovernorDynamics; /* Asynchronous machine whose behaviour is described by reference to a standard model expressed in either time constant reactance form or equivalent circuit form */ - class AsynchronousMachineDynamics: public RotatingMachineDynamics + class AsynchronousMachineDynamics : public RotatingMachineDynamics { - public: - CIMPP::AsynchronousMachine* AsynchronousMachine; /* Asynchronous machine to which this asynchronous machine dynamics model applies. Default: 0 */ - CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this asynchronous machine model. Default: 0 */ - CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator type 1 or 2 model associated with this asynchronous machine model. Default: 0 */ - CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor model associated with this asynchronous machine model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineDynamics(); - virtual ~AsynchronousMachineDynamics(); - + ~AsynchronousMachineDynamics() override; + + CIMPP::AsynchronousMachine* AsynchronousMachine; /* Asynchronous machine to which this asynchronous machine dynamics model applies. Default: 0 */ + CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this asynchronous machine model. Default: 0 */ + CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor model associated with this asynchronous machine model. Default: 0 */ + CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator type 1 or 2 model associated with this asynchronous machine model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.cpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.cpp index 30dd6fe46..b9fb954b4 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.cpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.cpp @@ -1,7 +1,11 @@ -#include -#include "AsynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineEquivalentCircuit.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -11,101 +15,102 @@ using namespace CIMPP; AsynchronousMachineEquivalentCircuit::AsynchronousMachineEquivalentCircuit() {}; - AsynchronousMachineEquivalentCircuit::~AsynchronousMachineEquivalentCircuit() {}; +bool assign_AsynchronousMachineEquivalentCircuit_rr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_rr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_xlr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xlr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_xlr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xlr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_xm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AsynchronousMachineEquivalentCircuit_xm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_rr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_xlr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xlr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_rr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_xlr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xlr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* AsynchronousMachineEquivalentCircuit_factory() { - return new AsynchronousMachineEquivalentCircuit; - } +const char AsynchronousMachineEquivalentCircuit::debugName[] = "AsynchronousMachineEquivalentCircuit"; +const char* AsynchronousMachineEquivalentCircuit::debugString() const +{ + return AsynchronousMachineEquivalentCircuit::debugName; } -void AsynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit"), &AsynchronousMachineEquivalentCircuit_factory)); } -void AsynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xm"), &assign_AsynchronousMachineEquivalentCircuit_xm)); +void AsynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.rr1"), &assign_AsynchronousMachineEquivalentCircuit_rr1)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xlr1"), &assign_AsynchronousMachineEquivalentCircuit_xlr1)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.rr2"), &assign_AsynchronousMachineEquivalentCircuit_rr2)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xlr1"), &assign_AsynchronousMachineEquivalentCircuit_xlr1)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xlr2"), &assign_AsynchronousMachineEquivalentCircuit_xlr2)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xm"), &assign_AsynchronousMachineEquivalentCircuit_xm)); } -void AsynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char AsynchronousMachineEquivalentCircuit::debugName[] = "AsynchronousMachineEquivalentCircuit"; -const char* AsynchronousMachineEquivalentCircuit::debugString() +void AsynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachineEquivalentCircuit::debugName; } const BaseClassDefiner AsynchronousMachineEquivalentCircuit::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner AsynchronousMachineEquivalentCircuit::declare() return BaseClassDefiner(AsynchronousMachineEquivalentCircuit::addConstructToMap, AsynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap, AsynchronousMachineEquivalentCircuit::addClassAssignFnsToMap, AsynchronousMachineEquivalentCircuit::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineEquivalentCircuit_factory() + { + return new AsynchronousMachineEquivalentCircuit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.hpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.hpp index b35af9d7b..5519c7eba 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.hpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineEquivalentCircuit.hpp @@ -1,42 +1,43 @@ #ifndef AsynchronousMachineEquivalentCircuit_H #define AsynchronousMachineEquivalentCircuit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AsynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AsynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The electrical equations of all variations of the asynchronous model are based on the AsynchronousEquivalentCircuit diagram for the direct and quadrature axes, with two equivalent rotor windings in each axis. = + = + * / ( + ) = + * * / ( * + * + * ) = ( + ) / ( * ) = ( * + * + * ) / ( * * (+ ) Same equations using CIM attributes from AsynchronousMachineTimeConstantReactance class on left of = sign and AsynchronousMachineEquivalentCircuit class on right (except as noted): xs = xm + RotatingMachineDynamics.statorLeakageReactance xp = RotatingMachineDynamics.statorLeakageReactance + xm * xlr1 / (xm + xlr1) xpp = RotatingMachineDynamics.statorLeakageReactance + xm * xlr1* xlr2 / (xm * xlr1 + xm * xlr2 + xlr1 * xlr2) tpo = (xm + xlr1) / (2*pi*nominal frequency * rr1) tppo = (xm * xlr1 + xm * xlr2 + xlr1 * xlr2) / (2*pi*nominal frequency * rr2 * (xm + xlr1). */ - class AsynchronousMachineEquivalentCircuit: public AsynchronousMachineDynamics + class AsynchronousMachineEquivalentCircuit : public AsynchronousMachineDynamics { - public: - CIMPP::PU xm; /* Magnetizing reactance. Default: nullptr */ - CIMPP::PU rr1; /* Damper 1 winding resistance. Default: nullptr */ - CIMPP::PU xlr1; /* Damper 1 winding leakage reactance. Default: nullptr */ - CIMPP::PU rr2; /* Damper 2 winding resistance. Default: nullptr */ - CIMPP::PU xlr2; /* Damper 2 winding leakage reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineEquivalentCircuit(); - virtual ~AsynchronousMachineEquivalentCircuit(); - + ~AsynchronousMachineEquivalentCircuit() override; + + CIMPP::PU rr1; /* Damper 1 winding resistance. Default: nullptr */ + CIMPP::PU rr2; /* Damper 2 winding resistance. Default: nullptr */ + CIMPP::PU xlr1; /* Damper 1 winding leakage reactance. Default: nullptr */ + CIMPP::PU xlr2; /* Damper 2 winding leakage reactance. Default: nullptr */ + CIMPP::PU xm; /* Magnetizing reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineEquivalentCircuit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.cpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.cpp index 219cfc23e..d9b39ecb0 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.cpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::AsynchronousMachineKind& rop) +AsynchronousMachineKind& AsynchronousMachineKind::operator=(AsynchronousMachineKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +AsynchronousMachineKind::operator AsynchronousMachineKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char AsynchronousMachineKind::debugName[] = "AsynchronousMachineKind"; +const char* AsynchronousMachineKind::debugString() const +{ + return AsynchronousMachineKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, AsynchronousMachineKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const AsynchronousMachineKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == AsynchronousMachineKind::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == AsynchronousMachineKind::motor) + { + EnumSymbol = "motor"; + } + + if (!EnumSymbol.empty()) + { + os << "AsynchronousMachineKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.hpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.hpp index af35aae99..8b8e54e57 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.hpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineKind.hpp @@ -1,21 +1,46 @@ #ifndef AsynchronousMachineKind_H #define AsynchronousMachineKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Kind of Asynchronous Machine. */ - enum class AsynchronousMachineKind + class AsynchronousMachineKind { - /** - * The Asynchronous Machine is a generator. - */ - generator, - /** - * The Asynchronous Machine is a motor. - */ - motor, + public: + enum AsynchronousMachineKind_ENUM + { + /** + * The Asynchronous Machine is a generator. + */ + generator, + /** + * The Asynchronous Machine is a motor. + */ + motor, + }; + + AsynchronousMachineKind() : value(), initialized(false) {} + AsynchronousMachineKind(AsynchronousMachineKind_ENUM value) : value(value), initialized(true) {} + + AsynchronousMachineKind& operator=(AsynchronousMachineKind_ENUM rop); + operator AsynchronousMachineKind_ENUM() const; + + AsynchronousMachineKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, AsynchronousMachineKind& rop); + friend std::ostream& operator<<(std::ostream& os, const AsynchronousMachineKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::AsynchronousMachineKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.cpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.cpp index f5bfbc5d0..94ba0f056 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.cpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.cpp @@ -1,111 +1,116 @@ -#include -#include "AsynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineTimeConstantReactance.hpp" +#include +#include + +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; AsynchronousMachineTimeConstantReactance::AsynchronousMachineTimeConstantReactance() {}; - AsynchronousMachineTimeConstantReactance::~AsynchronousMachineTimeConstantReactance() {}; +bool assign_AsynchronousMachineTimeConstantReactance_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_xpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AsynchronousMachineTimeConstantReactance_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_xpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* AsynchronousMachineTimeConstantReactance_factory() { - return new AsynchronousMachineTimeConstantReactance; - } +const char AsynchronousMachineTimeConstantReactance::debugName[] = "AsynchronousMachineTimeConstantReactance"; +const char* AsynchronousMachineTimeConstantReactance::debugString() const +{ + return AsynchronousMachineTimeConstantReactance::debugName; } -void AsynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance"), &AsynchronousMachineTimeConstantReactance_factory)); } -void AsynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xs"), &assign_AsynchronousMachineTimeConstantReactance_xs)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xp"), &assign_AsynchronousMachineTimeConstantReactance_xp)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xpp"), &assign_AsynchronousMachineTimeConstantReactance_xpp)); +void AsynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.tpo"), &assign_AsynchronousMachineTimeConstantReactance_tpo)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.tppo"), &assign_AsynchronousMachineTimeConstantReactance_tppo)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xp"), &assign_AsynchronousMachineTimeConstantReactance_xp)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xpp"), &assign_AsynchronousMachineTimeConstantReactance_xpp)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xs"), &assign_AsynchronousMachineTimeConstantReactance_xs)); } -void AsynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char AsynchronousMachineTimeConstantReactance::debugName[] = "AsynchronousMachineTimeConstantReactance"; -const char* AsynchronousMachineTimeConstantReactance::debugString() +void AsynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachineTimeConstantReactance::debugName; } const BaseClassDefiner AsynchronousMachineTimeConstantReactance::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner AsynchronousMachineTimeConstantReactance::declare() return BaseClassDefiner(AsynchronousMachineTimeConstantReactance::addConstructToMap, AsynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap, AsynchronousMachineTimeConstantReactance::addClassAssignFnsToMap, AsynchronousMachineTimeConstantReactance::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineTimeConstantReactance_factory() + { + return new AsynchronousMachineTimeConstantReactance; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.hpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.hpp index 4f3e1237c..41439b66e 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.hpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineTimeConstantReactance.hpp @@ -1,43 +1,44 @@ #ifndef AsynchronousMachineTimeConstantReactance_H #define AsynchronousMachineTimeConstantReactance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AsynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AsynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The parameters used for models expressed in time constant reactance form include: */ - class AsynchronousMachineTimeConstantReactance: public AsynchronousMachineDynamics + class AsynchronousMachineTimeConstantReactance : public AsynchronousMachineDynamics { - public: - CIMPP::PU xs; /* Synchronous reactance (Xs) (>= X`). Typical Value = 1.8. Default: nullptr */ - CIMPP::PU xp; /* Transient reactance (unsaturated) (X`) (>=X``). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU xpp; /* Subtransient reactance (unsaturated) (X``) (> Xl). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tpo; /* Transient rotor time constant (T`o) (> T``o). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tppo; /* Subtransient rotor time constant (T``o) (> 0). Typical Value = 0.03. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineTimeConstantReactance(); - virtual ~AsynchronousMachineTimeConstantReactance(); - + ~AsynchronousMachineTimeConstantReactance() override; + + CIMPP::Seconds tpo; /* Transient rotor time constant (T`o) (> T``o). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tppo; /* Subtransient rotor time constant (T``o) (> 0). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU xp; /* Transient reactance (unsaturated) (X`) (>=X``). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU xpp; /* Subtransient reactance (unsaturated) (X``) (> Xl). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU xs; /* Synchronous reactance (Xs) (>= X`). Typical Value = 1.8. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineTimeConstantReactance_factory(); diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.cpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.cpp index 6d883be59..d156c07b9 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "AsynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; AsynchronousMachineUserDefined::AsynchronousMachineUserDefined() {}; - AsynchronousMachineUserDefined::~AsynchronousMachineUserDefined() {}; -bool assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_AsynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_AsynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AsynchronousMachineUserDefined_factory() { - return new AsynchronousMachineUserDefined; - } +const char AsynchronousMachineUserDefined::debugName[] = "AsynchronousMachineUserDefined"; +const char* AsynchronousMachineUserDefined::debugString() const +{ + return AsynchronousMachineUserDefined::debugName; } -void AsynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined"), &AsynchronousMachineUserDefined_factory)); } -void AsynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AsynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined.proprietary"), &assign_AsynchronousMachineUserDefined_proprietary)); - } - -void AsynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics)); } -const char AsynchronousMachineUserDefined::debugName[] = "AsynchronousMachineUserDefined"; -const char* AsynchronousMachineUserDefined::debugString() +void AsynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachineUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner AsynchronousMachineUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner AsynchronousMachineUserDefined::declare() return BaseClassDefiner(AsynchronousMachineUserDefined::addConstructToMap, AsynchronousMachineUserDefined::addPrimitiveAssignFnsToMap, AsynchronousMachineUserDefined::addClassAssignFnsToMap, AsynchronousMachineUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineUserDefined_factory() + { + return new AsynchronousMachineUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.hpp b/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.hpp index 41cb98f81..cd49c741b 100644 --- a/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/AsynchronousMachineUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef AsynchronousMachineUserDefined_H #define AsynchronousMachineUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AsynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AsynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Asynchronous machine whose dynamic behaviour is described by a user-defined model. */ - class AsynchronousMachineUserDefined: public AsynchronousMachineDynamics + class AsynchronousMachineUserDefined : public AsynchronousMachineDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineUserDefined(); - virtual ~AsynchronousMachineUserDefined(); - + ~AsynchronousMachineUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/BaseVoltage.cpp b/CGMES_2.4.15_16FEB2016/BaseVoltage.cpp index 6b1513f67..606b000c3 100644 --- a/CGMES_2.4.15_16FEB2016/BaseVoltage.cpp +++ b/CGMES_2.4.15_16FEB2016/BaseVoltage.cpp @@ -1,103 +1,132 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BaseVoltage.hpp" -#include "Voltage.hpp" +#include +#include + #include "ConductingEquipment.hpp" -#include "VoltageLevel.hpp" -#include "TransformerEnd.hpp" #include "TopologicalNode.hpp" +#include "TransformerEnd.hpp" +#include "VoltageLevel.hpp" +#include "Voltage.hpp" using namespace CIMPP; BaseVoltage::BaseVoltage() {}; - BaseVoltage::~BaseVoltage() {}; -bool assign_BaseVoltage_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConductingEquipment.push_back(dynamic_cast(BaseClass_ptr2)); + + + +bool assign_BaseVoltage_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalVoltage; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_BaseVoltage_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VoltageLevel.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + +bool assign_ConductingEquipment_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + ConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConductingEquipment.begin(), element->ConductingEquipment.end(), element2) == element->ConductingEquipment.end()) + { + element->ConductingEquipment.push_back(element2); + return assign_ConductingEquipment_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_BaseVoltage_TransformerEnds(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TransformerEnds.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNode.begin(), element->TopologicalNode.end(), element2) == element->TopologicalNode.end()) + { + element->TopologicalNode.push_back(element2); + return assign_TopologicalNode_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_BaseVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TransformerEnd_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_TransformerEnds(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TransformerEnds.begin(), element->TransformerEnds.end(), element2) == element->TransformerEnds.end()) + { + element->TransformerEnds.push_back(element2); + return assign_TransformerEnd_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - -bool assign_BaseVoltage_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalVoltage; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_VoltageLevel_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + VoltageLevel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VoltageLevel.begin(), element->VoltageLevel.end(), element2) == element->VoltageLevel.end()) + { + element->VoltageLevel.push_back(element2); + return assign_VoltageLevel_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* BaseVoltage_factory() { - return new BaseVoltage; - } +const char BaseVoltage::debugName[] = "BaseVoltage"; +const char* BaseVoltage::debugString() const +{ + return BaseVoltage::debugName; } -void BaseVoltage::addConstructToMap(std::unordered_map& factory_map) { +void BaseVoltage::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BaseVoltage"), &BaseVoltage_factory)); } -void BaseVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void BaseVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.nominalVoltage"), &assign_BaseVoltage_nominalVoltage)); - } - -void BaseVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.ConductingEquipment"), &assign_BaseVoltage_ConductingEquipment)); - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.VoltageLevel"), &assign_BaseVoltage_VoltageLevel)); - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TransformerEnds"), &assign_BaseVoltage_TransformerEnds)); - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TopologicalNode"), &assign_BaseVoltage_TopologicalNode)); } -const char BaseVoltage::debugName[] = "BaseVoltage"; -const char* BaseVoltage::debugString() +void BaseVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BaseVoltage::debugName; + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.ConductingEquipment"), &assign_BaseVoltage_ConductingEquipment)); + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TopologicalNode"), &assign_BaseVoltage_TopologicalNode)); + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TransformerEnds"), &assign_BaseVoltage_TransformerEnds)); + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.VoltageLevel"), &assign_BaseVoltage_VoltageLevel)); } const BaseClassDefiner BaseVoltage::declare() @@ -105,4 +134,10 @@ const BaseClassDefiner BaseVoltage::declare() return BaseClassDefiner(BaseVoltage::addConstructToMap, BaseVoltage::addPrimitiveAssignFnsToMap, BaseVoltage::addClassAssignFnsToMap, BaseVoltage::debugName); } - +namespace CIMPP +{ + BaseClass* BaseVoltage_factory() + { + return new BaseVoltage; + } +} diff --git a/CGMES_2.4.15_16FEB2016/BaseVoltage.hpp b/CGMES_2.4.15_16FEB2016/BaseVoltage.hpp index 11ec6714e..063a85c09 100644 --- a/CGMES_2.4.15_16FEB2016/BaseVoltage.hpp +++ b/CGMES_2.4.15_16FEB2016/BaseVoltage.hpp @@ -1,46 +1,47 @@ #ifndef BaseVoltage_H #define BaseVoltage_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ConductingEquipment; + class TopologicalNode; + class TransformerEnd; + class VoltageLevel; - -class ConductingEquipment; -class VoltageLevel; -class TransformerEnd; -class TopologicalNode; /* Defines a system base voltage which is referenced. */ - class BaseVoltage: public IdentifiedObject + class BaseVoltage : public IdentifiedObject { - public: - CIMPP::Voltage nominalVoltage; /* The power system resource`s base voltage. Default: nullptr */ - std::list ConductingEquipment; /* Base voltage of this conducting equipment. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ - std::list VoltageLevel; /* The voltage levels having this base voltage. Default: 0 */ - std::list TransformerEnds; /* Transformer ends at the base voltage. This is essential for PU calculation. Default: 0 */ - std::list TopologicalNode; /* The topological nodes at the base voltage. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BaseVoltage(); - virtual ~BaseVoltage(); - + ~BaseVoltage() override; + + std::list ConductingEquipment; /* Base voltage of this conducting equipment. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ + std::list TopologicalNode; /* The topological nodes at the base voltage. Default: 0 */ + std::list TransformerEnds; /* Transformer ends at the base voltage. This is essential for PU calculation. Default: 0 */ + std::list VoltageLevel; /* The voltage levels having this base voltage. Default: 0 */ + CIMPP::Voltage nominalVoltage; /* The power system resource`s base voltage. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BaseVoltage_factory(); diff --git a/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.cpp b/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.cpp index 8d87cdc00..a860a0268 100644 --- a/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.cpp @@ -1,78 +1,84 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BasicIntervalSchedule.hpp" +#include +#include + #include "DateTime.hpp" #include "UnitSymbol.hpp" #include "UnitSymbol.hpp" using namespace CIMPP; -BasicIntervalSchedule::BasicIntervalSchedule(): startTime(nullptr) {}; - +BasicIntervalSchedule::BasicIntervalSchedule() {}; BasicIntervalSchedule::~BasicIntervalSchedule() {}; -bool assign_BasicIntervalSchedule_startTime(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->startTime = dynamic_cast(BaseClass_ptr2); - if(element->startTime != nullptr) - return true; - } - return false; +bool assign_BasicIntervalSchedule_startTime(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + element->startTime = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_BasicIntervalSchedule_value1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value1Unit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_BasicIntervalSchedule_value2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value2Unit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_BasicIntervalSchedule_value1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value1Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_BasicIntervalSchedule_value2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value2Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* BasicIntervalSchedule_factory() { - return new BasicIntervalSchedule; - } +const char BasicIntervalSchedule::debugName[] = "BasicIntervalSchedule"; +const char* BasicIntervalSchedule::debugString() const +{ + return BasicIntervalSchedule::debugName; } -void BasicIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) { +void BasicIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule"), &BasicIntervalSchedule_factory)); } -void BasicIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.value1Unit"), &assign_BasicIntervalSchedule_value1Unit)); +void BasicIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.startTime"), &assign_BasicIntervalSchedule_startTime)); + assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.value1Unit"), &assign_BasicIntervalSchedule_value1Unit)); assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.value2Unit"), &assign_BasicIntervalSchedule_value2Unit)); } -void BasicIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.startTime"), &assign_BasicIntervalSchedule_startTime)); - } - -const char BasicIntervalSchedule::debugName[] = "BasicIntervalSchedule"; -const char* BasicIntervalSchedule::debugString() +void BasicIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BasicIntervalSchedule::debugName; } const BaseClassDefiner BasicIntervalSchedule::declare() @@ -80,4 +86,10 @@ const BaseClassDefiner BasicIntervalSchedule::declare() return BaseClassDefiner(BasicIntervalSchedule::addConstructToMap, BasicIntervalSchedule::addPrimitiveAssignFnsToMap, BasicIntervalSchedule::addClassAssignFnsToMap, BasicIntervalSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* BasicIntervalSchedule_factory() + { + return new BasicIntervalSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.hpp b/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.hpp index ab0558475..f6234c2db 100644 --- a/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/BasicIntervalSchedule.hpp @@ -1,41 +1,42 @@ #ifndef BasicIntervalSchedule_H #define BasicIntervalSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "DateTime.hpp" #include "UnitSymbol.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class DateTime; /* Schedule of values at points in time. */ - class BasicIntervalSchedule: public IdentifiedObject + class BasicIntervalSchedule : public IdentifiedObject { - public: - CIMPP::DateTime* startTime; /* The time for the first time point. Default: '' */ - CIMPP::UnitSymbol value1Unit; /* Value1 units of measure. Default: 0 */ - CIMPP::UnitSymbol value2Unit; /* Value2 units of measure. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BasicIntervalSchedule(); - virtual ~BasicIntervalSchedule(); - + ~BasicIntervalSchedule() override; + + CIMPP::DateTime startTime; /* The time for the first time point. Default: '' */ + CIMPP::UnitSymbol value1Unit; /* Value1 units of measure. Default: 0 */ + CIMPP::UnitSymbol value2Unit; /* Value2 units of measure. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BasicIntervalSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Bay.cpp b/CGMES_2.4.15_16FEB2016/Bay.cpp index 14dddc78f..0213393ce 100644 --- a/CGMES_2.4.15_16FEB2016/Bay.cpp +++ b/CGMES_2.4.15_16FEB2016/Bay.cpp @@ -1,49 +1,56 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Bay.hpp" +#include +#include + #include "VoltageLevel.hpp" using namespace CIMPP; -Bay::Bay(): VoltageLevel(nullptr) {}; - +Bay::Bay() : VoltageLevel(nullptr) {}; Bay::~Bay() {}; -bool assign_VoltageLevel_Bays(BaseClass*, BaseClass*); -bool assign_Bay_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Bay* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageLevel = dynamic_cast(BaseClass_ptr2); - if(element->VoltageLevel != nullptr) - return assign_VoltageLevel_Bays(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* Bay_factory() { - return new Bay; +bool assign_VoltageLevel_Bays(BaseClass*, BaseClass*); +bool assign_Bay_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Bay* element = dynamic_cast(BaseClass_ptr1); + VoltageLevel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageLevel != element2) + { + element->VoltageLevel = element2; + return assign_VoltageLevel_Bays(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void Bay::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:Bay"), &Bay_factory)); +const char Bay::debugName[] = "Bay"; +const char* Bay::debugString() const +{ + return Bay::debugName; } -void Bay::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void Bay::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:Bay"), &Bay_factory)); +} -void Bay::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Bay.VoltageLevel"), &assign_Bay_VoltageLevel)); +void Bay::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Bay::debugName[] = "Bay"; -const char* Bay::debugString() +void Bay::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Bay::debugName; + assign_map.insert(std::make_pair(std::string("cim:Bay.VoltageLevel"), &assign_Bay_VoltageLevel)); } const BaseClassDefiner Bay::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner Bay::declare() return BaseClassDefiner(Bay::addConstructToMap, Bay::addPrimitiveAssignFnsToMap, Bay::addClassAssignFnsToMap, Bay::debugName); } - +namespace CIMPP +{ + BaseClass* Bay_factory() + { + return new Bay; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Bay.hpp b/CGMES_2.4.15_16FEB2016/Bay.hpp index b3bcfc4fe..4f08b2d5e 100644 --- a/CGMES_2.4.15_16FEB2016/Bay.hpp +++ b/CGMES_2.4.15_16FEB2016/Bay.hpp @@ -1,38 +1,39 @@ #ifndef Bay_H #define Bay_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class VoltageLevel; -class VoltageLevel; /* A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry. A bay typically represents a physical grouping related to modularization of equipment. */ - class Bay: public EquipmentContainer + class Bay : public EquipmentContainer { - public: - CIMPP::VoltageLevel* VoltageLevel; /* The voltage level containing this bay. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Bay(); - virtual ~Bay(); - + ~Bay() override; + + CIMPP::VoltageLevel* VoltageLevel; /* The voltage level containing this bay. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Bay_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Breaker.cpp b/CGMES_2.4.15_16FEB2016/Breaker.cpp index d45b7e553..ecee41d5b 100644 --- a/CGMES_2.4.15_16FEB2016/Breaker.cpp +++ b/CGMES_2.4.15_16FEB2016/Breaker.cpp @@ -1,36 +1,36 @@ -#include -#include "ProtectedSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Breaker.hpp" +#include +#include + using namespace CIMPP; Breaker::Breaker() {}; - Breaker::~Breaker() {}; -namespace CIMPP { - BaseClass* Breaker_factory() { - return new Breaker; - } +const char Breaker::debugName[] = "Breaker"; +const char* Breaker::debugString() const +{ + return Breaker::debugName; } -void Breaker::addConstructToMap(std::unordered_map& factory_map) { +void Breaker::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Breaker"), &Breaker_factory)); } -void Breaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Breaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Breaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Breaker::debugName[] = "Breaker"; -const char* Breaker::debugString() +void Breaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Breaker::debugName; } const BaseClassDefiner Breaker::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Breaker::declare() return BaseClassDefiner(Breaker::addConstructToMap, Breaker::addPrimitiveAssignFnsToMap, Breaker::addClassAssignFnsToMap, Breaker::debugName); } - +namespace CIMPP +{ + BaseClass* Breaker_factory() + { + return new Breaker; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Breaker.hpp b/CGMES_2.4.15_16FEB2016/Breaker.hpp index 3f4783b3a..b1047a3fd 100644 --- a/CGMES_2.4.15_16FEB2016/Breaker.hpp +++ b/CGMES_2.4.15_16FEB2016/Breaker.hpp @@ -1,36 +1,37 @@ #ifndef Breaker_H #define Breaker_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ProtectedSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ProtectedSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit. */ - class Breaker: public ProtectedSwitch + class Breaker : public ProtectedSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Breaker(); - virtual ~Breaker(); - + ~Breaker() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Breaker_factory(); diff --git a/CGMES_2.4.15_16FEB2016/BusNameMarker.cpp b/CGMES_2.4.15_16FEB2016/BusNameMarker.cpp index 2277d6c25..a3e65dbd1 100644 --- a/CGMES_2.4.15_16FEB2016/BusNameMarker.cpp +++ b/CGMES_2.4.15_16FEB2016/BusNameMarker.cpp @@ -1,77 +1,92 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BusNameMarker.hpp" -#include "Integer.hpp" +#include +#include + #include "ReportingGroup.hpp" #include "ACDCTerminal.hpp" +#include "Integer.hpp" using namespace CIMPP; -BusNameMarker::BusNameMarker(): ReportingGroup(nullptr) {}; - +BusNameMarker::BusNameMarker() : ReportingGroup(nullptr) {}; BusNameMarker::~BusNameMarker() {}; -bool assign_ReportingGroup_BusNameMarker(BaseClass*, BaseClass*); -bool assign_BusNameMarker_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) { - element->ReportingGroup = dynamic_cast(BaseClass_ptr2); - if(element->ReportingGroup != nullptr) - return assign_ReportingGroup_BusNameMarker(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_BusNameMarker_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminal.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_BusNameMarker_priority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->priority; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_BusNameMarker_priority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->priority; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ReportingGroup_BusNameMarker(BaseClass*, BaseClass*); +bool assign_BusNameMarker_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BusNameMarker* element = dynamic_cast(BaseClass_ptr1); + ReportingGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ReportingGroup != element2) + { + element->ReportingGroup = element2; + return assign_ReportingGroup_BusNameMarker(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_ACDCTerminal_BusNameMarker(BaseClass*, BaseClass*); +bool assign_BusNameMarker_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BusNameMarker* element = dynamic_cast(BaseClass_ptr1); + ACDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminal.begin(), element->Terminal.end(), element2) == element->Terminal.end()) + { + element->Terminal.push_back(element2); + return assign_ACDCTerminal_BusNameMarker(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* BusNameMarker_factory() { - return new BusNameMarker; - } +const char BusNameMarker::debugName[] = "BusNameMarker"; +const char* BusNameMarker::debugString() const +{ + return BusNameMarker::debugName; } -void BusNameMarker::addConstructToMap(std::unordered_map& factory_map) { +void BusNameMarker::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BusNameMarker"), &BusNameMarker_factory)); } -void BusNameMarker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void BusNameMarker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.priority"), &assign_BusNameMarker_priority)); - } - -void BusNameMarker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.ReportingGroup"), &assign_BusNameMarker_ReportingGroup)); - assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.Terminal"), &assign_BusNameMarker_Terminal)); } -const char BusNameMarker::debugName[] = "BusNameMarker"; -const char* BusNameMarker::debugString() +void BusNameMarker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BusNameMarker::debugName; + assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.ReportingGroup"), &assign_BusNameMarker_ReportingGroup)); + assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.Terminal"), &assign_BusNameMarker_Terminal)); } const BaseClassDefiner BusNameMarker::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner BusNameMarker::declare() return BaseClassDefiner(BusNameMarker::addConstructToMap, BusNameMarker::addPrimitiveAssignFnsToMap, BusNameMarker::addClassAssignFnsToMap, BusNameMarker::debugName); } - +namespace CIMPP +{ + BaseClass* BusNameMarker_factory() + { + return new BusNameMarker; + } +} diff --git a/CGMES_2.4.15_16FEB2016/BusNameMarker.hpp b/CGMES_2.4.15_16FEB2016/BusNameMarker.hpp index 992a10da9..353cf9798 100644 --- a/CGMES_2.4.15_16FEB2016/BusNameMarker.hpp +++ b/CGMES_2.4.15_16FEB2016/BusNameMarker.hpp @@ -1,42 +1,43 @@ #ifndef BusNameMarker_H #define BusNameMarker_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ACDCTerminal; + class ReportingGroup; - -class ReportingGroup; -class ACDCTerminal; /* Used to apply user standard names to topology buses. Typically used for "bus/branch" case generation. Associated with one or more terminals that are normally connected with the bus name. The associated terminals are normally connected by non-retained switches. For a ring bus station configuration, all busbar terminals in the ring are typically associated. For a breaker and a half scheme, both busbars would normally be associated. For a ring bus, all busbars would normally be associated. For a "straight" busbar configuration, normally only the main terminal at the busbar would be associated. */ - class BusNameMarker: public IdentifiedObject + class BusNameMarker : public IdentifiedObject { - public: - CIMPP::Integer priority; /* Priority of bus name marker for use as topology bus name. Use 0 for don t care. Use 1 for highest priority. Use 2 as priority is less than 1 and so on. Default: 0 */ - CIMPP::ReportingGroup* ReportingGroup; /* The bus name markers that belong to this reporting group. Default: 0 */ - std::list Terminal; /* The terminals associated with this bus name marker. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BusNameMarker(); - virtual ~BusNameMarker(); - + ~BusNameMarker() override; + + CIMPP::ReportingGroup* ReportingGroup; /* The bus name markers that belong to this reporting group. Default: 0 */ + std::list Terminal; /* The terminals associated with this bus name marker. Default: 0 */ + CIMPP::Integer priority; /* Priority of bus name marker for use as topology bus name. Use 0 for don t care. Use 1 for highest priority. Use 2 as priority is less than 1 and so on. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BusNameMarker_factory(); diff --git a/CGMES_2.4.15_16FEB2016/BusbarSection.cpp b/CGMES_2.4.15_16FEB2016/BusbarSection.cpp index 2b6e7a9a0..eff584525 100644 --- a/CGMES_2.4.15_16FEB2016/BusbarSection.cpp +++ b/CGMES_2.4.15_16FEB2016/BusbarSection.cpp @@ -1,51 +1,52 @@ -#include -#include "Connector.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BusbarSection.hpp" +#include +#include + #include "CurrentFlow.hpp" using namespace CIMPP; BusbarSection::BusbarSection() {}; - BusbarSection::~BusbarSection() {}; +bool assign_BusbarSection_ipMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BusbarSection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ipMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_BusbarSection_ipMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BusbarSection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ipMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* BusbarSection_factory() { - return new BusbarSection; - } +const char BusbarSection::debugName[] = "BusbarSection"; +const char* BusbarSection::debugString() const +{ + return BusbarSection::debugName; } -void BusbarSection::addConstructToMap(std::unordered_map& factory_map) { +void BusbarSection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BusbarSection"), &BusbarSection_factory)); } -void BusbarSection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void BusbarSection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:BusbarSection.ipMax"), &assign_BusbarSection_ipMax)); } -void BusbarSection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char BusbarSection::debugName[] = "BusbarSection"; -const char* BusbarSection::debugString() +void BusbarSection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BusbarSection::debugName; } const BaseClassDefiner BusbarSection::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner BusbarSection::declare() return BaseClassDefiner(BusbarSection::addConstructToMap, BusbarSection::addPrimitiveAssignFnsToMap, BusbarSection::addClassAssignFnsToMap, BusbarSection::debugName); } - +namespace CIMPP +{ + BaseClass* BusbarSection_factory() + { + return new BusbarSection; + } +} diff --git a/CGMES_2.4.15_16FEB2016/BusbarSection.hpp b/CGMES_2.4.15_16FEB2016/BusbarSection.hpp index aa0d1e41f..46d62de78 100644 --- a/CGMES_2.4.15_16FEB2016/BusbarSection.hpp +++ b/CGMES_2.4.15_16FEB2016/BusbarSection.hpp @@ -1,38 +1,39 @@ #ifndef BusbarSection_H #define BusbarSection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Connector.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Connector.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal. */ - class BusbarSection: public Connector + class BusbarSection : public Connector { - public: - CIMPP::CurrentFlow ipMax; /* Maximum allowable peak short-circuit current of busbar (Ipmax in the IEC 60909-0). Mechanical limit of the busbar in the substation itself. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BusbarSection(); - virtual ~BusbarSection(); - + ~BusbarSection() override; + + CIMPP::CurrentFlow ipMax; /* Maximum allowable peak short-circuit current of busbar (Ipmax in the IEC 60909-0). Mechanical limit of the busbar in the substation itself. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BusbarSection_factory(); diff --git a/CGMES_2.4.15_16FEB2016/CIMClassList.hpp b/CGMES_2.4.15_16FEB2016/CIMClassList.hpp index 959524475..8a65daee6 100644 --- a/CGMES_2.4.15_16FEB2016/CIMClassList.hpp +++ b/CGMES_2.4.15_16FEB2016/CIMClassList.hpp @@ -1,440 +1,409 @@ #ifndef CIMCLASSLIST_H #define CIMCLASSLIST_H -using namespace CIMPP; +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include -static std::list CIMClassList = { - ACDCConverter::declare(), - ACDCConverterDCTerminal::declare(), - ACDCTerminal::declare(), - ACLineSegment::declare(), - Accumulator::declare(), - AccumulatorLimit::declare(), - AccumulatorLimitSet::declare(), - AccumulatorReset::declare(), - AccumulatorValue::declare(), - ActivePower::declare(), - ActivePowerLimit::declare(), - ActivePowerPerCurrentFlow::declare(), - ActivePowerPerFrequency::declare(), - Analog::declare(), - AnalogControl::declare(), - AnalogLimit::declare(), - AnalogLimitSet::declare(), - AnalogValue::declare(), - AngleDegrees::declare(), - AngleRadians::declare(), - ApparentPower::declare(), - ApparentPowerLimit::declare(), - Area::declare(), - AsynchronousMachine::declare(), - AsynchronousMachineDynamics::declare(), - AsynchronousMachineEquivalentCircuit::declare(), - AsynchronousMachineTimeConstantReactance::declare(), - AsynchronousMachineUserDefined::declare(), - BaseVoltage::declare(), - BasicIntervalSchedule::declare(), - Bay::declare(), - Boolean::declare(), - Breaker::declare(), - BusNameMarker::declare(), - BusbarSection::declare(), - Capacitance::declare(), - CapacitancePerLength::declare(), - Command::declare(), - Conductance::declare(), - ConductingEquipment::declare(), - Conductor::declare(), - ConformLoad::declare(), - ConformLoadGroup::declare(), - ConformLoadSchedule::declare(), - ConnectivityNode::declare(), - ConnectivityNodeContainer::declare(), - Connector::declare(), - Control::declare(), - ControlArea::declare(), - ControlAreaGeneratingUnit::declare(), - CoordinateSystem::declare(), - CsConverter::declare(), - CurrentFlow::declare(), - CurrentLimit::declare(), - Curve::declare(), - CurveData::declare(), - DCBaseTerminal::declare(), - DCBreaker::declare(), - DCBusbar::declare(), - DCChopper::declare(), - DCConductingEquipment::declare(), - DCConverterUnit::declare(), - DCDisconnector::declare(), - DCEquipmentContainer::declare(), - DCGround::declare(), - DCLine::declare(), - DCLineSegment::declare(), - DCNode::declare(), - DCSeriesDevice::declare(), - DCShunt::declare(), - DCSwitch::declare(), - DCTerminal::declare(), - DCTopologicalIsland::declare(), - DCTopologicalNode::declare(), - Date::declare(), - DateTime::declare(), - DayType::declare(), - Decimal::declare(), - Diagram::declare(), - DiagramLayoutVersion::declare(), - DiagramObject::declare(), - DiagramObjectGluePoint::declare(), - DiagramObjectPoint::declare(), - DiagramObjectStyle::declare(), - DiagramStyle::declare(), - DiscExcContIEEEDEC1A::declare(), - DiscExcContIEEEDEC2A::declare(), - DiscExcContIEEEDEC3A::declare(), - Disconnector::declare(), - DiscontinuousExcitationControlDynamics::declare(), - DiscontinuousExcitationControlUserDefined::declare(), - Discrete::declare(), - DiscreteValue::declare(), - DynamicsFunctionBlock::declare(), - DynamicsVersion::declare(), - EarthFaultCompensator::declare(), - EnergyArea::declare(), - EnergyConsumer::declare(), - EnergySchedulingType::declare(), - EnergySource::declare(), - Equipment::declare(), - EquipmentBoundaryVersion::declare(), - EquipmentContainer::declare(), - EquipmentVersion::declare(), - EquivalentBranch::declare(), - EquivalentEquipment::declare(), - EquivalentInjection::declare(), - EquivalentNetwork::declare(), - EquivalentShunt::declare(), - ExcAC1A::declare(), - ExcAC2A::declare(), - ExcAC3A::declare(), - ExcAC4A::declare(), - ExcAC5A::declare(), - ExcAC6A::declare(), - ExcAC8B::declare(), - ExcANS::declare(), - ExcAVR1::declare(), - ExcAVR2::declare(), - ExcAVR3::declare(), - ExcAVR4::declare(), - ExcAVR5::declare(), - ExcAVR7::declare(), - ExcBBC::declare(), - ExcCZ::declare(), - ExcDC1A::declare(), - ExcDC2A::declare(), - ExcDC3A1::declare(), - ExcDC3A::declare(), - ExcELIN1::declare(), - ExcELIN2::declare(), - ExcHU::declare(), - ExcIEEEAC1A::declare(), - ExcIEEEAC2A::declare(), - ExcIEEEAC3A::declare(), - ExcIEEEAC4A::declare(), - ExcIEEEAC5A::declare(), - ExcIEEEAC6A::declare(), - ExcIEEEAC7B::declare(), - ExcIEEEAC8B::declare(), - ExcIEEEDC1A::declare(), - ExcIEEEDC2A::declare(), - ExcIEEEDC3A::declare(), - ExcIEEEDC4B::declare(), - ExcIEEEST1A::declare(), - ExcIEEEST2A::declare(), - ExcIEEEST3A::declare(), - ExcIEEEST4B::declare(), - ExcIEEEST5B::declare(), - ExcIEEEST6B::declare(), - ExcIEEEST7B::declare(), - ExcOEX3T::declare(), - ExcPIC::declare(), - ExcREXS::declare(), - ExcSCRX::declare(), - ExcSEXS::declare(), - ExcSK::declare(), - ExcST1A::declare(), - ExcST2A::declare(), - ExcST3A::declare(), - ExcST4B::declare(), - ExcST6B::declare(), - ExcST7B::declare(), - ExcitationSystemDynamics::declare(), - ExcitationSystemUserDefined::declare(), - ExternalNetworkInjection::declare(), - Float::declare(), - FossilFuel::declare(), - Frequency::declare(), - GenICompensationForGenJ::declare(), - GeneratingUnit::declare(), - GeographicalLocationVersion::declare(), - GeographicalRegion::declare(), - GovCT1::declare(), - GovCT2::declare(), - GovGAST1::declare(), - GovGAST2::declare(), - GovGAST3::declare(), - GovGAST4::declare(), - GovGAST::declare(), - GovGASTWD::declare(), - GovHydro1::declare(), - GovHydro2::declare(), - GovHydro3::declare(), - GovHydro4::declare(), - GovHydroDD::declare(), - GovHydroFrancis::declare(), - GovHydroIEEE0::declare(), - GovHydroIEEE2::declare(), - GovHydroPID2::declare(), - GovHydroPID::declare(), - GovHydroPelton::declare(), - GovHydroR::declare(), - GovHydroWEH::declare(), - GovHydroWPID::declare(), - GovSteam0::declare(), - GovSteam1::declare(), - GovSteam2::declare(), - GovSteamCC::declare(), - GovSteamEU::declare(), - GovSteamFV2::declare(), - GovSteamFV3::declare(), - GovSteamFV4::declare(), - GovSteamIEEE1::declare(), - GovSteamSGO::declare(), - GrossToNetActivePowerCurve::declare(), - Ground::declare(), - GroundDisconnector::declare(), - GroundingImpedance::declare(), - HydroGeneratingUnit::declare(), - HydroPowerPlant::declare(), - HydroPump::declare(), - IdentifiedObject::declare(), - Inductance::declare(), - InductancePerLength::declare(), - Integer::declare(), - Junction::declare(), - Length::declare(), - Limit::declare(), - LimitSet::declare(), - Line::declare(), - LinearShuntCompensator::declare(), - LoadAggregate::declare(), - LoadArea::declare(), - LoadBreakSwitch::declare(), - LoadComposite::declare(), - LoadDynamics::declare(), - LoadGenericNonLinear::declare(), - LoadGroup::declare(), - LoadMotor::declare(), - LoadResponseCharacteristic::declare(), - LoadStatic::declare(), - LoadUserDefined::declare(), - Location::declare(), - Measurement::declare(), - MeasurementValue::declare(), - MeasurementValueQuality::declare(), - MeasurementValueSource::declare(), - MechLoad1::declare(), - MechanicalLoadDynamics::declare(), - MechanicalLoadUserDefined::declare(), - Money::declare(), - MonthDay::declare(), - MutualCoupling::declare(), - NonConformLoad::declare(), - NonConformLoadGroup::declare(), - NonConformLoadSchedule::declare(), - NonlinearShuntCompensator::declare(), - NonlinearShuntCompensatorPoint::declare(), - NuclearGeneratingUnit::declare(), - OperationalLimit::declare(), - OperationalLimitSet::declare(), - OperationalLimitType::declare(), - OverexcLim2::declare(), - OverexcLimIEEE::declare(), - OverexcLimX1::declare(), - OverexcLimX2::declare(), - OverexcitationLimiterDynamics::declare(), - OverexcitationLimiterUserDefined::declare(), - PFVArControllerType1Dynamics::declare(), - PFVArControllerType1UserDefined::declare(), - PFVArControllerType2Dynamics::declare(), - PFVArControllerType2UserDefined::declare(), - PFVArType1IEEEPFController::declare(), - PFVArType1IEEEVArController::declare(), - PFVArType2Common1::declare(), - PFVArType2IEEEPFController::declare(), - PFVArType2IEEEVArController::declare(), - PU::declare(), - PerCent::declare(), - PerLengthDCLineParameter::declare(), - PetersenCoil::declare(), - PhaseTapChanger::declare(), - PhaseTapChangerAsymmetrical::declare(), - PhaseTapChangerLinear::declare(), - PhaseTapChangerNonLinear::declare(), - PhaseTapChangerSymmetrical::declare(), - PhaseTapChangerTable::declare(), - PhaseTapChangerTablePoint::declare(), - PhaseTapChangerTabular::declare(), - PositionPoint::declare(), - PowerSystemResource::declare(), - PowerSystemStabilizerDynamics::declare(), - PowerSystemStabilizerUserDefined::declare(), - PowerTransformer::declare(), - PowerTransformerEnd::declare(), - ProprietaryParameterDynamics::declare(), - ProtectedSwitch::declare(), - Pss1::declare(), - Pss1A::declare(), - Pss2B::declare(), - Pss2ST::declare(), - Pss5::declare(), - PssELIN2::declare(), - PssIEEE1A::declare(), - PssIEEE2B::declare(), - PssIEEE3B::declare(), - PssIEEE4B::declare(), - PssPTIST1::declare(), - PssPTIST3::declare(), - PssSB4::declare(), - PssSH::declare(), - PssSK::declare(), - PssWECC::declare(), - Quality61850::declare(), - RaiseLowerCommand::declare(), - RatioTapChanger::declare(), - RatioTapChangerTable::declare(), - RatioTapChangerTablePoint::declare(), - Reactance::declare(), - ReactiveCapabilityCurve::declare(), - ReactivePower::declare(), - RegularIntervalSchedule::declare(), - RegularTimePoint::declare(), - RegulatingCondEq::declare(), - RegulatingControl::declare(), - RegulationSchedule::declare(), - RemoteInputSignal::declare(), - ReportingGroup::declare(), - Resistance::declare(), - ResistancePerLength::declare(), - RotatingMachine::declare(), - RotatingMachineDynamics::declare(), - RotationSpeed::declare(), - Season::declare(), - SeasonDayTypeSchedule::declare(), - Seconds::declare(), - SeriesCompensator::declare(), - SetPoint::declare(), - ShuntCompensator::declare(), - Simple_Float::declare(), - SolarGeneratingUnit::declare(), - StateVariablesVersion::declare(), - StaticVarCompensator::declare(), - StationSupply::declare(), - SteadyStateHypothesisVersion::declare(), - StringMeasurement::declare(), - StringMeasurementValue::declare(), - SubGeographicalRegion::declare(), - SubLoadArea::declare(), - Substation::declare(), - Susceptance::declare(), - SvInjection::declare(), - SvPowerFlow::declare(), - SvShuntCompensatorSections::declare(), - SvStatus::declare(), - SvTapStep::declare(), - SvVoltage::declare(), - Switch::declare(), - SwitchSchedule::declare(), - SynchronousMachine::declare(), - SynchronousMachineDetailed::declare(), - SynchronousMachineDynamics::declare(), - SynchronousMachineEquivalentCircuit::declare(), - SynchronousMachineSimplified::declare(), - SynchronousMachineTimeConstantReactance::declare(), - SynchronousMachineUserDefined::declare(), - TapChanger::declare(), - TapChangerControl::declare(), - TapChangerTablePoint::declare(), - TapSchedule::declare(), - Temperature::declare(), - Terminal::declare(), - TextDiagramObject::declare(), - ThermalGeneratingUnit::declare(), - TieFlow::declare(), - TopologicalIsland::declare(), - TopologicalNode::declare(), - TopologyBoundaryVersion::declare(), - TopologyVersion::declare(), - TransformerEnd::declare(), - TurbLCFB1::declare(), - TurbineGovernorDynamics::declare(), - TurbineGovernorUserDefined::declare(), - TurbineLoadControllerDynamics::declare(), - TurbineLoadControllerUserDefined::declare(), - UnderexcLim2Simplified::declare(), - UnderexcLimIEEE1::declare(), - UnderexcLimIEEE2::declare(), - UnderexcLimX1::declare(), - UnderexcLimX2::declare(), - UnderexcitationLimiterDynamics::declare(), - UnderexcitationLimiterUserDefined::declare(), - VAdjIEEE::declare(), - VCompIEEEType1::declare(), - VCompIEEEType2::declare(), - ValueAliasSet::declare(), - ValueToAlias::declare(), - VisibilityLayer::declare(), - Voltage::declare(), - VoltageAdjusterDynamics::declare(), - VoltageAdjusterUserDefined::declare(), - VoltageCompensatorDynamics::declare(), - VoltageCompensatorUserDefined::declare(), - VoltageLevel::declare(), - VoltageLimit::declare(), - VoltagePerReactivePower::declare(), - VolumeFlowRate::declare(), - VsCapabilityCurve::declare(), - VsConverter::declare(), - WindAeroConstIEC::declare(), - WindAeroLinearIEC::declare(), - WindContCurrLimIEC::declare(), - WindContPType3IEC::declare(), - WindContPType4aIEC::declare(), - WindContPType4bIEC::declare(), - WindContPitchAngleIEC::declare(), - WindContQIEC::declare(), - WindContRotorRIEC::declare(), - WindDynamicsLookupTable::declare(), - WindGenTurbineType1IEC::declare(), - WindGenTurbineType2IEC::declare(), - WindGenTurbineType3IEC::declare(), - WindGenTurbineType3aIEC::declare(), - WindGenTurbineType3bIEC::declare(), - WindGenType4IEC::declare(), - WindGeneratingUnit::declare(), - WindMechIEC::declare(), - WindPitchContEmulIEC::declare(), - WindPlantDynamics::declare(), - WindPlantFreqPcontrolIEC::declare(), - WindPlantIEC::declare(), - WindPlantReactiveControlIEC::declare(), - WindPlantUserDefined::declare(), - WindProtectionIEC::declare(), - WindTurbineType1or2Dynamics::declare(), - WindTurbineType1or2IEC::declare(), - WindTurbineType3or4Dynamics::declare(), - WindTurbineType3or4IEC::declare(), - WindTurbineType4aIEC::declare(), - WindTurbineType4bIEC::declare(), - WindType1or2UserDefined::declare(), - WindType3or4UserDefined::declare(), - UnknownType::declare() }; +#include "IEC61970.hpp" +using namespace CIMPP; +static std::list CIMClassList = +{ + ACDCConverter::declare(), + ACDCConverterDCTerminal::declare(), + ACDCTerminal::declare(), + ACLineSegment::declare(), + Accumulator::declare(), + AccumulatorLimit::declare(), + AccumulatorLimitSet::declare(), + AccumulatorReset::declare(), + AccumulatorValue::declare(), + ActivePowerLimit::declare(), + Analog::declare(), + AnalogControl::declare(), + AnalogLimit::declare(), + AnalogLimitSet::declare(), + AnalogValue::declare(), + ApparentPowerLimit::declare(), + AsynchronousMachine::declare(), + AsynchronousMachineDynamics::declare(), + AsynchronousMachineEquivalentCircuit::declare(), + AsynchronousMachineTimeConstantReactance::declare(), + AsynchronousMachineUserDefined::declare(), + BaseVoltage::declare(), + BasicIntervalSchedule::declare(), + Bay::declare(), + Breaker::declare(), + BusNameMarker::declare(), + BusbarSection::declare(), + Command::declare(), + ConductingEquipment::declare(), + Conductor::declare(), + ConformLoad::declare(), + ConformLoadGroup::declare(), + ConformLoadSchedule::declare(), + ConnectivityNode::declare(), + ConnectivityNodeContainer::declare(), + Connector::declare(), + Control::declare(), + ControlArea::declare(), + ControlAreaGeneratingUnit::declare(), + CoordinateSystem::declare(), + CsConverter::declare(), + CurrentLimit::declare(), + Curve::declare(), + CurveData::declare(), + DCBaseTerminal::declare(), + DCBreaker::declare(), + DCBusbar::declare(), + DCChopper::declare(), + DCConductingEquipment::declare(), + DCConverterUnit::declare(), + DCDisconnector::declare(), + DCEquipmentContainer::declare(), + DCGround::declare(), + DCLine::declare(), + DCLineSegment::declare(), + DCNode::declare(), + DCSeriesDevice::declare(), + DCShunt::declare(), + DCSwitch::declare(), + DCTerminal::declare(), + DCTopologicalIsland::declare(), + DCTopologicalNode::declare(), + DayType::declare(), + Diagram::declare(), + DiagramLayoutVersion::declare(), + DiagramObject::declare(), + DiagramObjectGluePoint::declare(), + DiagramObjectPoint::declare(), + DiagramObjectStyle::declare(), + DiagramStyle::declare(), + DiscExcContIEEEDEC1A::declare(), + DiscExcContIEEEDEC2A::declare(), + DiscExcContIEEEDEC3A::declare(), + Disconnector::declare(), + DiscontinuousExcitationControlDynamics::declare(), + DiscontinuousExcitationControlUserDefined::declare(), + Discrete::declare(), + DiscreteValue::declare(), + DynamicsFunctionBlock::declare(), + DynamicsVersion::declare(), + EarthFaultCompensator::declare(), + EnergyArea::declare(), + EnergyConsumer::declare(), + EnergySchedulingType::declare(), + EnergySource::declare(), + Equipment::declare(), + EquipmentBoundaryVersion::declare(), + EquipmentContainer::declare(), + EquipmentVersion::declare(), + EquivalentBranch::declare(), + EquivalentEquipment::declare(), + EquivalentInjection::declare(), + EquivalentNetwork::declare(), + EquivalentShunt::declare(), + ExcAC1A::declare(), + ExcAC2A::declare(), + ExcAC3A::declare(), + ExcAC4A::declare(), + ExcAC5A::declare(), + ExcAC6A::declare(), + ExcAC8B::declare(), + ExcANS::declare(), + ExcAVR1::declare(), + ExcAVR2::declare(), + ExcAVR3::declare(), + ExcAVR4::declare(), + ExcAVR5::declare(), + ExcAVR7::declare(), + ExcBBC::declare(), + ExcCZ::declare(), + ExcDC1A::declare(), + ExcDC2A::declare(), + ExcDC3A::declare(), + ExcDC3A1::declare(), + ExcELIN1::declare(), + ExcELIN2::declare(), + ExcHU::declare(), + ExcIEEEAC1A::declare(), + ExcIEEEAC2A::declare(), + ExcIEEEAC3A::declare(), + ExcIEEEAC4A::declare(), + ExcIEEEAC5A::declare(), + ExcIEEEAC6A::declare(), + ExcIEEEAC7B::declare(), + ExcIEEEAC8B::declare(), + ExcIEEEDC1A::declare(), + ExcIEEEDC2A::declare(), + ExcIEEEDC3A::declare(), + ExcIEEEDC4B::declare(), + ExcIEEEST1A::declare(), + ExcIEEEST2A::declare(), + ExcIEEEST3A::declare(), + ExcIEEEST4B::declare(), + ExcIEEEST5B::declare(), + ExcIEEEST6B::declare(), + ExcIEEEST7B::declare(), + ExcOEX3T::declare(), + ExcPIC::declare(), + ExcREXS::declare(), + ExcSCRX::declare(), + ExcSEXS::declare(), + ExcSK::declare(), + ExcST1A::declare(), + ExcST2A::declare(), + ExcST3A::declare(), + ExcST4B::declare(), + ExcST6B::declare(), + ExcST7B::declare(), + ExcitationSystemDynamics::declare(), + ExcitationSystemUserDefined::declare(), + ExternalNetworkInjection::declare(), + FossilFuel::declare(), + GenICompensationForGenJ::declare(), + GeneratingUnit::declare(), + GeographicalLocationVersion::declare(), + GeographicalRegion::declare(), + GovCT1::declare(), + GovCT2::declare(), + GovGAST::declare(), + GovGAST1::declare(), + GovGAST2::declare(), + GovGAST3::declare(), + GovGAST4::declare(), + GovGASTWD::declare(), + GovHydro1::declare(), + GovHydro2::declare(), + GovHydro3::declare(), + GovHydro4::declare(), + GovHydroDD::declare(), + GovHydroFrancis::declare(), + GovHydroIEEE0::declare(), + GovHydroIEEE2::declare(), + GovHydroPID::declare(), + GovHydroPID2::declare(), + GovHydroPelton::declare(), + GovHydroR::declare(), + GovHydroWEH::declare(), + GovHydroWPID::declare(), + GovSteam0::declare(), + GovSteam1::declare(), + GovSteam2::declare(), + GovSteamCC::declare(), + GovSteamEU::declare(), + GovSteamFV2::declare(), + GovSteamFV3::declare(), + GovSteamFV4::declare(), + GovSteamIEEE1::declare(), + GovSteamSGO::declare(), + GrossToNetActivePowerCurve::declare(), + Ground::declare(), + GroundDisconnector::declare(), + GroundingImpedance::declare(), + HydroGeneratingUnit::declare(), + HydroPowerPlant::declare(), + HydroPump::declare(), + IdentifiedObject::declare(), + Junction::declare(), + Limit::declare(), + LimitSet::declare(), + Line::declare(), + LinearShuntCompensator::declare(), + LoadAggregate::declare(), + LoadArea::declare(), + LoadBreakSwitch::declare(), + LoadComposite::declare(), + LoadDynamics::declare(), + LoadGenericNonLinear::declare(), + LoadGroup::declare(), + LoadMotor::declare(), + LoadResponseCharacteristic::declare(), + LoadStatic::declare(), + LoadUserDefined::declare(), + Location::declare(), + Measurement::declare(), + MeasurementValue::declare(), + MeasurementValueQuality::declare(), + MeasurementValueSource::declare(), + MechLoad1::declare(), + MechanicalLoadDynamics::declare(), + MechanicalLoadUserDefined::declare(), + MutualCoupling::declare(), + NonConformLoad::declare(), + NonConformLoadGroup::declare(), + NonConformLoadSchedule::declare(), + NonlinearShuntCompensator::declare(), + NonlinearShuntCompensatorPoint::declare(), + NuclearGeneratingUnit::declare(), + OperationalLimit::declare(), + OperationalLimitSet::declare(), + OperationalLimitType::declare(), + OverexcLim2::declare(), + OverexcLimIEEE::declare(), + OverexcLimX1::declare(), + OverexcLimX2::declare(), + OverexcitationLimiterDynamics::declare(), + OverexcitationLimiterUserDefined::declare(), + PFVArControllerType1Dynamics::declare(), + PFVArControllerType1UserDefined::declare(), + PFVArControllerType2Dynamics::declare(), + PFVArControllerType2UserDefined::declare(), + PFVArType1IEEEPFController::declare(), + PFVArType1IEEEVArController::declare(), + PFVArType2Common1::declare(), + PFVArType2IEEEPFController::declare(), + PFVArType2IEEEVArController::declare(), + PerLengthDCLineParameter::declare(), + PetersenCoil::declare(), + PhaseTapChanger::declare(), + PhaseTapChangerAsymmetrical::declare(), + PhaseTapChangerLinear::declare(), + PhaseTapChangerNonLinear::declare(), + PhaseTapChangerSymmetrical::declare(), + PhaseTapChangerTable::declare(), + PhaseTapChangerTablePoint::declare(), + PhaseTapChangerTabular::declare(), + PositionPoint::declare(), + PowerSystemResource::declare(), + PowerSystemStabilizerDynamics::declare(), + PowerSystemStabilizerUserDefined::declare(), + PowerTransformer::declare(), + PowerTransformerEnd::declare(), + ProprietaryParameterDynamics::declare(), + ProtectedSwitch::declare(), + Pss1::declare(), + Pss1A::declare(), + Pss2B::declare(), + Pss2ST::declare(), + Pss5::declare(), + PssELIN2::declare(), + PssIEEE1A::declare(), + PssIEEE2B::declare(), + PssIEEE3B::declare(), + PssIEEE4B::declare(), + PssPTIST1::declare(), + PssPTIST3::declare(), + PssSB4::declare(), + PssSH::declare(), + PssSK::declare(), + PssWECC::declare(), + Quality61850::declare(), + RaiseLowerCommand::declare(), + RatioTapChanger::declare(), + RatioTapChangerTable::declare(), + RatioTapChangerTablePoint::declare(), + ReactiveCapabilityCurve::declare(), + RegularIntervalSchedule::declare(), + RegularTimePoint::declare(), + RegulatingCondEq::declare(), + RegulatingControl::declare(), + RegulationSchedule::declare(), + RemoteInputSignal::declare(), + ReportingGroup::declare(), + RotatingMachine::declare(), + RotatingMachineDynamics::declare(), + Season::declare(), + SeasonDayTypeSchedule::declare(), + SeriesCompensator::declare(), + SetPoint::declare(), + ShuntCompensator::declare(), + SolarGeneratingUnit::declare(), + StateVariablesVersion::declare(), + StaticVarCompensator::declare(), + StationSupply::declare(), + SteadyStateHypothesisVersion::declare(), + StringMeasurement::declare(), + StringMeasurementValue::declare(), + SubGeographicalRegion::declare(), + SubLoadArea::declare(), + Substation::declare(), + SvInjection::declare(), + SvPowerFlow::declare(), + SvShuntCompensatorSections::declare(), + SvStatus::declare(), + SvTapStep::declare(), + SvVoltage::declare(), + Switch::declare(), + SwitchSchedule::declare(), + SynchronousMachine::declare(), + SynchronousMachineDetailed::declare(), + SynchronousMachineDynamics::declare(), + SynchronousMachineEquivalentCircuit::declare(), + SynchronousMachineSimplified::declare(), + SynchronousMachineTimeConstantReactance::declare(), + SynchronousMachineUserDefined::declare(), + TapChanger::declare(), + TapChangerControl::declare(), + TapChangerTablePoint::declare(), + TapSchedule::declare(), + Terminal::declare(), + TextDiagramObject::declare(), + ThermalGeneratingUnit::declare(), + TieFlow::declare(), + TopologicalIsland::declare(), + TopologicalNode::declare(), + TopologyBoundaryVersion::declare(), + TopologyVersion::declare(), + TransformerEnd::declare(), + TurbLCFB1::declare(), + TurbineGovernorDynamics::declare(), + TurbineGovernorUserDefined::declare(), + TurbineLoadControllerDynamics::declare(), + TurbineLoadControllerUserDefined::declare(), + UnderexcLim2Simplified::declare(), + UnderexcLimIEEE1::declare(), + UnderexcLimIEEE2::declare(), + UnderexcLimX1::declare(), + UnderexcLimX2::declare(), + UnderexcitationLimiterDynamics::declare(), + UnderexcitationLimiterUserDefined::declare(), + VAdjIEEE::declare(), + VCompIEEEType1::declare(), + VCompIEEEType2::declare(), + ValueAliasSet::declare(), + ValueToAlias::declare(), + VisibilityLayer::declare(), + VoltageAdjusterDynamics::declare(), + VoltageAdjusterUserDefined::declare(), + VoltageCompensatorDynamics::declare(), + VoltageCompensatorUserDefined::declare(), + VoltageLevel::declare(), + VoltageLimit::declare(), + VsCapabilityCurve::declare(), + VsConverter::declare(), + WindAeroConstIEC::declare(), + WindAeroLinearIEC::declare(), + WindContCurrLimIEC::declare(), + WindContPType3IEC::declare(), + WindContPType4aIEC::declare(), + WindContPType4bIEC::declare(), + WindContPitchAngleIEC::declare(), + WindContQIEC::declare(), + WindContRotorRIEC::declare(), + WindDynamicsLookupTable::declare(), + WindGenTurbineType1IEC::declare(), + WindGenTurbineType2IEC::declare(), + WindGenTurbineType3IEC::declare(), + WindGenTurbineType3aIEC::declare(), + WindGenTurbineType3bIEC::declare(), + WindGenType4IEC::declare(), + WindGeneratingUnit::declare(), + WindMechIEC::declare(), + WindPitchContEmulIEC::declare(), + WindPlantDynamics::declare(), + WindPlantFreqPcontrolIEC::declare(), + WindPlantIEC::declare(), + WindPlantReactiveControlIEC::declare(), + WindPlantUserDefined::declare(), + WindProtectionIEC::declare(), + WindTurbineType1or2Dynamics::declare(), + WindTurbineType1or2IEC::declare(), + WindTurbineType3or4Dynamics::declare(), + WindTurbineType3or4IEC::declare(), + WindTurbineType4aIEC::declare(), + WindTurbineType4bIEC::declare(), + WindType1or2UserDefined::declare(), + WindType3or4UserDefined::declare(), + UnknownType::declare(), +}; #endif // CIMCLASSLIST_H diff --git a/CGMES_2.4.15_16FEB2016/Capacitance.cpp b/CGMES_2.4.15_16FEB2016/Capacitance.cpp index f3f7f180f..79261bc63 100644 --- a/CGMES_2.4.15_16FEB2016/Capacitance.cpp +++ b/CGMES_2.4.15_16FEB2016/Capacitance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Capacitance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Capacitance::Capacitance() {} -Capacitance::~Capacitance(){} +#include -Capacitance::Capacitance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Capacitance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Capacitance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Capacitance& Capacitance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Capacitance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Capacitance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Capacitance::debugName[] = "Capacitance"; -const char* Capacitance::debugString() { +const char* Capacitance::debugString() const +{ return Capacitance::debugName; } - -const BaseClassDefiner Capacitance::declare() { - return BaseClassDefiner(Capacitance::addConstructToMap, Capacitance::addPrimitiveAssignFnsToMap, Capacitance::addClassAssignFnsToMap, Capacitance::debugName); +Capacitance& Capacitance::operator+=(const Capacitance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Capacitance& Capacitance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Capacitance& Capacitance::operator-=(const Capacitance& rhs) { - value -= rhs.value; - return *this; - } - - Capacitance& Capacitance::operator*=(const Capacitance& rhs) { - value *= rhs.value; - return *this; - } - - Capacitance& Capacitance::operator/=(const Capacitance& rhs) { - value /= rhs.value; - return *this; - } +Capacitance& Capacitance::operator-=(const Capacitance& rhs) +{ + value -= rhs.value; + return *this; +} - Capacitance& Capacitance::operator+=(const Capacitance& rhs) { - value += rhs.value; - return *this; - } +Capacitance& Capacitance::operator*=(const Capacitance& rhs) +{ + value *= rhs.value; + return *this; +} - Capacitance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Capacitance& Capacitance::operator/=(const Capacitance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Capacitance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Capacitance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Capacitance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Capacitance.hpp b/CGMES_2.4.15_16FEB2016/Capacitance.hpp index 0c3f2a9bd..0f2f8bad2 100644 --- a/CGMES_2.4.15_16FEB2016/Capacitance.hpp +++ b/CGMES_2.4.15_16FEB2016/Capacitance.hpp @@ -1,38 +1,39 @@ #ifndef Capacitance_H #define Capacitance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Capacitance : public BaseClass + /* + Capacitive part of reactance (imaginary part of impedance), at rated frequency. + */ + class Capacitance { - public: - Capacitance(); - virtual ~Capacitance(); - Capacitance(long double value); - static const BaseClassDefiner declare(); - Capacitance& operator=(long double &rop); + Capacitance() : value(0.0), initialized(false) {} + Capacitance(long double value) : value(value), initialized(true) {} + + Capacitance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Capacitance& operator+=(const Capacitance& rhs); Capacitance& operator-=(const Capacitance& rhs); Capacitance& operator*=(const Capacitance& rhs); Capacitance& operator/=(const Capacitance& rhs); + friend std::istream& operator>>(std::istream& lop, Capacitance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Capacitance& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/CapacitancePerLength.cpp b/CGMES_2.4.15_16FEB2016/CapacitancePerLength.cpp index b1456470a..213af0ce1 100644 --- a/CGMES_2.4.15_16FEB2016/CapacitancePerLength.cpp +++ b/CGMES_2.4.15_16FEB2016/CapacitancePerLength.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CapacitancePerLength.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -CapacitancePerLength::CapacitancePerLength(): value(nullptr) {}; - -CapacitancePerLength::~CapacitancePerLength() {}; - - -bool assign_CapacitancePerLength_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_CapacitancePerLength_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CapacitancePerLength_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_CapacitancePerLength_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_CapacitancePerLength_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +CapacitancePerLength& CapacitancePerLength::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* CapacitancePerLength_factory() { - return new CapacitancePerLength; +CapacitancePerLength::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void CapacitancePerLength::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:CapacitancePerLength"), &CapacitancePerLength_factory)); +const char CapacitancePerLength::debugName[] = "CapacitancePerLength"; +const char* CapacitancePerLength::debugString() const +{ + return CapacitancePerLength::debugName; } -void CapacitancePerLength::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.unit"), &assign_CapacitancePerLength_unit)); - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.multiplier"), &assign_CapacitancePerLength_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.denominatorUnit"), &assign_CapacitancePerLength_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.denominatorMultiplier"), &assign_CapacitancePerLength_denominatorMultiplier)); +CapacitancePerLength& CapacitancePerLength::operator+=(const CapacitancePerLength& rhs) +{ + value += rhs.value; + return *this; } -void CapacitancePerLength::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.value"), &assign_CapacitancePerLength_value)); - } +CapacitancePerLength& CapacitancePerLength::operator-=(const CapacitancePerLength& rhs) +{ + value -= rhs.value; + return *this; +} -const char CapacitancePerLength::debugName[] = "CapacitancePerLength"; -const char* CapacitancePerLength::debugString() +CapacitancePerLength& CapacitancePerLength::operator*=(const CapacitancePerLength& rhs) { - return CapacitancePerLength::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner CapacitancePerLength::declare() +CapacitancePerLength& CapacitancePerLength::operator/=(const CapacitancePerLength& rhs) { - return BaseClassDefiner(CapacitancePerLength::addConstructToMap, CapacitancePerLength::addPrimitiveAssignFnsToMap, CapacitancePerLength::addClassAssignFnsToMap, CapacitancePerLength::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CapacitancePerLength& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const CapacitancePerLength& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CapacitancePerLength.hpp b/CGMES_2.4.15_16FEB2016/CapacitancePerLength.hpp index efdfe0dbb..b38d961b2 100644 --- a/CGMES_2.4.15_16FEB2016/CapacitancePerLength.hpp +++ b/CGMES_2.4.15_16FEB2016/CapacitancePerLength.hpp @@ -1,46 +1,39 @@ #ifndef CapacitancePerLength_H #define CapacitancePerLength_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Capacitance per unit of length. */ - class CapacitancePerLength: public BaseClass + class CapacitancePerLength { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + CapacitancePerLength() : value(0.0), initialized(false) {} + CapacitancePerLength(long double value) : value(value), initialized(true) {} + + CapacitancePerLength& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - CapacitancePerLength(); - virtual ~CapacitancePerLength(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + CapacitancePerLength& operator+=(const CapacitancePerLength& rhs); + CapacitancePerLength& operator-=(const CapacitancePerLength& rhs); + CapacitancePerLength& operator*=(const CapacitancePerLength& rhs); + CapacitancePerLength& operator/=(const CapacitancePerLength& rhs); - BaseClass* CapacitancePerLength_factory(); + friend std::istream& operator>>(std::istream& lop, CapacitancePerLength& rop); + friend std::ostream& operator<<(std::ostream& os, const CapacitancePerLength& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/Command.cpp b/CGMES_2.4.15_16FEB2016/Command.cpp index 15de14f4a..3c4de5e5f 100644 --- a/CGMES_2.4.15_16FEB2016/Command.cpp +++ b/CGMES_2.4.15_16FEB2016/Command.cpp @@ -1,92 +1,108 @@ -#include -#include "Control.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Command.hpp" -#include "Integer.hpp" -#include "Integer.hpp" +#include +#include + #include "DiscreteValue.hpp" #include "ValueAliasSet.hpp" +#include "Integer.hpp" +#include "Integer.hpp" using namespace CIMPP; -Command::Command(): DiscreteValue(nullptr), ValueAliasSet(nullptr) {}; - +Command::Command() : DiscreteValue(nullptr), ValueAliasSet(nullptr) {}; Command::~Command() {}; -bool assign_DiscreteValue_Command(BaseClass*, BaseClass*); -bool assign_Command_DiscreteValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscreteValue = dynamic_cast(BaseClass_ptr2); - if(element->DiscreteValue != nullptr) - return assign_DiscreteValue_Command(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Command_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Command* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ValueAliasSet_Commands(BaseClass*, BaseClass*); -bool assign_Command_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_Commands(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Command_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Command* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Command_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiscreteValue_Command(BaseClass*, BaseClass*); +bool assign_Command_DiscreteValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Command* element = dynamic_cast(BaseClass_ptr1); + DiscreteValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscreteValue != element2) + { + element->DiscreteValue = element2; + return assign_DiscreteValue_Command(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Command_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ValueAliasSet_Commands(BaseClass*, BaseClass*); +bool assign_Command_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Command* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_Commands(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* Command_factory() { - return new Command; - } +const char Command::debugName[] = "Command"; +const char* Command::debugString() const +{ + return Command::debugName; } -void Command::addConstructToMap(std::unordered_map& factory_map) { +void Command::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Command"), &Command_factory)); } -void Command::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Command::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Command.normalValue"), &assign_Command_normalValue)); assign_map.insert(std::make_pair(std::string("cim:Command.value"), &assign_Command_value)); - } - -void Command::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Command.DiscreteValue"), &assign_Command_DiscreteValue)); - assign_map.insert(std::make_pair(std::string("cim:Command.ValueAliasSet"), &assign_Command_ValueAliasSet)); } -const char Command::debugName[] = "Command"; -const char* Command::debugString() +void Command::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Command::debugName; + assign_map.insert(std::make_pair(std::string("cim:Command.DiscreteValue"), &assign_Command_DiscreteValue)); + assign_map.insert(std::make_pair(std::string("cim:Command.ValueAliasSet"), &assign_Command_ValueAliasSet)); } const BaseClassDefiner Command::declare() @@ -94,4 +110,10 @@ const BaseClassDefiner Command::declare() return BaseClassDefiner(Command::addConstructToMap, Command::addPrimitiveAssignFnsToMap, Command::addClassAssignFnsToMap, Command::debugName); } - +namespace CIMPP +{ + BaseClass* Command_factory() + { + return new Command; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Command.hpp b/CGMES_2.4.15_16FEB2016/Command.hpp index 31d352bee..5131e4978 100644 --- a/CGMES_2.4.15_16FEB2016/Command.hpp +++ b/CGMES_2.4.15_16FEB2016/Command.hpp @@ -1,43 +1,44 @@ #ifndef Command_H #define Command_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Control.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Control.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiscreteValue; + class ValueAliasSet; - -class DiscreteValue; -class ValueAliasSet; /* A Command is a discrete control used for supervisory control. */ - class Command: public Control + class Command : public Control { - public: - CIMPP::Integer normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: 0 */ - CIMPP::Integer value; /* The value representing the actuator output. Default: 0 */ - CIMPP::DiscreteValue* DiscreteValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Command(); - virtual ~Command(); - + ~Command() override; + + CIMPP::DiscreteValue* DiscreteValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ + CIMPP::Integer normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: 0 */ + CIMPP::Integer value; /* The value representing the actuator output. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Command_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Conductance.cpp b/CGMES_2.4.15_16FEB2016/Conductance.cpp index c21f4ceed..a9bb89d1f 100644 --- a/CGMES_2.4.15_16FEB2016/Conductance.cpp +++ b/CGMES_2.4.15_16FEB2016/Conductance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Conductance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Conductance::Conductance() {} -Conductance::~Conductance(){} +#include -Conductance::Conductance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Conductance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Conductance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Conductance& Conductance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Conductance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Conductance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Conductance::debugName[] = "Conductance"; -const char* Conductance::debugString() { +const char* Conductance::debugString() const +{ return Conductance::debugName; } - -const BaseClassDefiner Conductance::declare() { - return BaseClassDefiner(Conductance::addConstructToMap, Conductance::addPrimitiveAssignFnsToMap, Conductance::addClassAssignFnsToMap, Conductance::debugName); +Conductance& Conductance::operator+=(const Conductance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Conductance& Conductance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Conductance& Conductance::operator-=(const Conductance& rhs) { - value -= rhs.value; - return *this; - } - - Conductance& Conductance::operator*=(const Conductance& rhs) { - value *= rhs.value; - return *this; - } - - Conductance& Conductance::operator/=(const Conductance& rhs) { - value /= rhs.value; - return *this; - } +Conductance& Conductance::operator-=(const Conductance& rhs) +{ + value -= rhs.value; + return *this; +} - Conductance& Conductance::operator+=(const Conductance& rhs) { - value += rhs.value; - return *this; - } +Conductance& Conductance::operator*=(const Conductance& rhs) +{ + value *= rhs.value; + return *this; +} - Conductance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Conductance& Conductance::operator/=(const Conductance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Conductance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Conductance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Conductance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Conductance.hpp b/CGMES_2.4.15_16FEB2016/Conductance.hpp index 98d5ad4dc..6a99df04e 100644 --- a/CGMES_2.4.15_16FEB2016/Conductance.hpp +++ b/CGMES_2.4.15_16FEB2016/Conductance.hpp @@ -1,38 +1,39 @@ #ifndef Conductance_H #define Conductance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Conductance : public BaseClass + /* + Factor by which voltage must be multiplied to give corresponding power lost from a circuit. Real part of admittance. + */ + class Conductance { - public: - Conductance(); - virtual ~Conductance(); - Conductance(long double value); - static const BaseClassDefiner declare(); - Conductance& operator=(long double &rop); + Conductance() : value(0.0), initialized(false) {} + Conductance(long double value) : value(value), initialized(true) {} + + Conductance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Conductance& operator+=(const Conductance& rhs); Conductance& operator-=(const Conductance& rhs); Conductance& operator*=(const Conductance& rhs); Conductance& operator/=(const Conductance& rhs); + friend std::istream& operator>>(std::istream& lop, Conductance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Conductance& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ConductingEquipment.cpp b/CGMES_2.4.15_16FEB2016/ConductingEquipment.cpp index 35c499329..75fda89e3 100644 --- a/CGMES_2.4.15_16FEB2016/ConductingEquipment.cpp +++ b/CGMES_2.4.15_16FEB2016/ConductingEquipment.cpp @@ -1,74 +1,96 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConductingEquipment.hpp" -#include "Terminal.hpp" +#include +#include + #include "BaseVoltage.hpp" #include "SvStatus.hpp" +#include "Terminal.hpp" using namespace CIMPP; -ConductingEquipment::ConductingEquipment(): BaseVoltage(nullptr), SvStatus(nullptr) {}; - +ConductingEquipment::ConductingEquipment() : BaseVoltage(nullptr), SvStatus(nullptr) {}; ConductingEquipment::~ConductingEquipment() {}; -bool assign_ConductingEquipment_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_BaseVoltage_ConductingEquipment(BaseClass*, BaseClass*); +bool assign_ConductingEquipment_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_BaseVoltage_ConductingEquipment(BaseClass*, BaseClass*); -bool assign_ConductingEquipment_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvStatus_ConductingEquipment(BaseClass*, BaseClass*); +bool assign_ConductingEquipment_SvStatus(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + SvStatus* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvStatus != element2) + { + element->SvStatus = element2; + return assign_SvStatus_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ConductingEquipment_SvStatus(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - element->SvStatus = dynamic_cast(BaseClass_ptr2); - if(element->SvStatus != nullptr) - return true; - } - return false; +bool assign_Terminal_ConductingEquipment(BaseClass*, BaseClass*); +bool assign_ConductingEquipment_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminals.begin(), element->Terminals.end(), element2) == element->Terminals.end()) + { + element->Terminals.push_back(element2); + return assign_Terminal_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* ConductingEquipment_factory() { - return new ConductingEquipment; - } +const char ConductingEquipment::debugName[] = "ConductingEquipment"; +const char* ConductingEquipment::debugString() const +{ + return ConductingEquipment::debugName; } -void ConductingEquipment::addConstructToMap(std::unordered_map& factory_map) { +void ConductingEquipment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConductingEquipment"), &ConductingEquipment_factory)); } -void ConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.Terminals"), &assign_ConductingEquipment_Terminals)); - assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.BaseVoltage"), &assign_ConductingEquipment_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.SvStatus"), &assign_ConductingEquipment_SvStatus)); +void ConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConductingEquipment::debugName[] = "ConductingEquipment"; -const char* ConductingEquipment::debugString() +void ConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConductingEquipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.BaseVoltage"), &assign_ConductingEquipment_BaseVoltage)); + assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.SvStatus"), &assign_ConductingEquipment_SvStatus)); + assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.Terminals"), &assign_ConductingEquipment_Terminals)); } const BaseClassDefiner ConductingEquipment::declare() @@ -76,4 +98,10 @@ const BaseClassDefiner ConductingEquipment::declare() return BaseClassDefiner(ConductingEquipment::addConstructToMap, ConductingEquipment::addPrimitiveAssignFnsToMap, ConductingEquipment::addClassAssignFnsToMap, ConductingEquipment::debugName); } - +namespace CIMPP +{ + BaseClass* ConductingEquipment_factory() + { + return new ConductingEquipment; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ConductingEquipment.hpp b/CGMES_2.4.15_16FEB2016/ConductingEquipment.hpp index f77611da4..5454b4a05 100644 --- a/CGMES_2.4.15_16FEB2016/ConductingEquipment.hpp +++ b/CGMES_2.4.15_16FEB2016/ConductingEquipment.hpp @@ -1,42 +1,43 @@ #ifndef ConductingEquipment_H #define ConductingEquipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class BaseVoltage; + class SvStatus; + class Terminal; -class Terminal; -class BaseVoltage; -class SvStatus; /* The parts of the AC power system that are designed to carry current or that are conductively connected through terminals. */ - class ConductingEquipment: public Equipment + class ConductingEquipment : public Equipment { - public: - std::list Terminals; /* Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ - CIMPP::BaseVoltage* BaseVoltage; /* All conducting equipment with this base voltage. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ - CIMPP::SvStatus* SvStatus; /* The status state variable associated with this conducting equipment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConductingEquipment(); - virtual ~ConductingEquipment(); - + ~ConductingEquipment() override; + + CIMPP::BaseVoltage* BaseVoltage; /* All conducting equipment with this base voltage. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ + CIMPP::SvStatus* SvStatus; /* The status state variable associated with this conducting equipment. Default: 0 */ + std::list Terminals; /* Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConductingEquipment_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Conductor.cpp b/CGMES_2.4.15_16FEB2016/Conductor.cpp index 1a0d8eaec..f91f1c615 100644 --- a/CGMES_2.4.15_16FEB2016/Conductor.cpp +++ b/CGMES_2.4.15_16FEB2016/Conductor.cpp @@ -1,51 +1,52 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Conductor.hpp" +#include +#include + #include "Length.hpp" using namespace CIMPP; Conductor::Conductor() {}; - Conductor::~Conductor() {}; +bool assign_Conductor_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Conductor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->length; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Conductor_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Conductor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->length; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Conductor_factory() { - return new Conductor; - } +const char Conductor::debugName[] = "Conductor"; +const char* Conductor::debugString() const +{ + return Conductor::debugName; } -void Conductor::addConstructToMap(std::unordered_map& factory_map) { +void Conductor::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Conductor"), &Conductor_factory)); } -void Conductor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Conductor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Conductor.length"), &assign_Conductor_length)); } -void Conductor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Conductor::debugName[] = "Conductor"; -const char* Conductor::debugString() +void Conductor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Conductor::debugName; } const BaseClassDefiner Conductor::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner Conductor::declare() return BaseClassDefiner(Conductor::addConstructToMap, Conductor::addPrimitiveAssignFnsToMap, Conductor::addClassAssignFnsToMap, Conductor::debugName); } - +namespace CIMPP +{ + BaseClass* Conductor_factory() + { + return new Conductor; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Conductor.hpp b/CGMES_2.4.15_16FEB2016/Conductor.hpp index 12e8cba7c..f94265788 100644 --- a/CGMES_2.4.15_16FEB2016/Conductor.hpp +++ b/CGMES_2.4.15_16FEB2016/Conductor.hpp @@ -1,38 +1,39 @@ #ifndef Conductor_H #define Conductor_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Length.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Combination of conducting material with consistent electrical characteristics, building a single electrical system, used to carry current between points in the power system. */ - class Conductor: public ConductingEquipment + class Conductor : public ConductingEquipment { - public: - CIMPP::Length length; /* Segment length for calculating line section capabilities Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Conductor(); - virtual ~Conductor(); - + ~Conductor() override; + + CIMPP::Length length; /* Segment length for calculating line section capabilities Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Conductor_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ConformLoad.cpp b/CGMES_2.4.15_16FEB2016/ConformLoad.cpp index 5f030ae04..068ca38a5 100644 --- a/CGMES_2.4.15_16FEB2016/ConformLoad.cpp +++ b/CGMES_2.4.15_16FEB2016/ConformLoad.cpp @@ -1,49 +1,56 @@ -#include -#include "EnergyConsumer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConformLoad.hpp" +#include +#include + #include "ConformLoadGroup.hpp" using namespace CIMPP; -ConformLoad::ConformLoad(): LoadGroup(nullptr) {}; - +ConformLoad::ConformLoad() : LoadGroup(nullptr) {}; ConformLoad::~ConformLoad() {}; -bool assign_ConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); -bool assign_ConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoad* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->LoadGroup != nullptr) - return assign_ConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* ConformLoad_factory() { - return new ConformLoad; +bool assign_ConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); +bool assign_ConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoad* element = dynamic_cast(BaseClass_ptr1); + ConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadGroup != element2) + { + element->LoadGroup = element2; + return assign_ConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ConformLoad::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ConformLoad"), &ConformLoad_factory)); +const char ConformLoad::debugName[] = "ConformLoad"; +const char* ConformLoad::debugString() const +{ + return ConformLoad::debugName; } -void ConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ConformLoad::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ConformLoad"), &ConformLoad_factory)); +} -void ConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConformLoad.LoadGroup"), &assign_ConformLoad_LoadGroup)); +void ConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConformLoad::debugName[] = "ConformLoad"; -const char* ConformLoad::debugString() +void ConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConformLoad::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConformLoad.LoadGroup"), &assign_ConformLoad_LoadGroup)); } const BaseClassDefiner ConformLoad::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner ConformLoad::declare() return BaseClassDefiner(ConformLoad::addConstructToMap, ConformLoad::addPrimitiveAssignFnsToMap, ConformLoad::addClassAssignFnsToMap, ConformLoad::debugName); } - +namespace CIMPP +{ + BaseClass* ConformLoad_factory() + { + return new ConformLoad; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ConformLoad.hpp b/CGMES_2.4.15_16FEB2016/ConformLoad.hpp index 6c10592b3..d124b28eb 100644 --- a/CGMES_2.4.15_16FEB2016/ConformLoad.hpp +++ b/CGMES_2.4.15_16FEB2016/ConformLoad.hpp @@ -1,38 +1,39 @@ #ifndef ConformLoad_H #define ConformLoad_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyConsumer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyConsumer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConformLoadGroup; -class ConformLoadGroup; /* ConformLoad represent loads that follow a daily load change pattern where the pattern can be used to scale the load with a system load. */ - class ConformLoad: public EnergyConsumer + class ConformLoad : public EnergyConsumer { - public: - CIMPP::ConformLoadGroup* LoadGroup; /* Group of this ConformLoad. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConformLoad(); - virtual ~ConformLoad(); - + ~ConformLoad() override; + + CIMPP::ConformLoadGroup* LoadGroup; /* Group of this ConformLoad. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConformLoad_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ConformLoadGroup.cpp b/CGMES_2.4.15_16FEB2016/ConformLoadGroup.cpp index 58f726f62..de8dedb23 100644 --- a/CGMES_2.4.15_16FEB2016/ConformLoadGroup.cpp +++ b/CGMES_2.4.15_16FEB2016/ConformLoadGroup.cpp @@ -1,62 +1,76 @@ -#include -#include "LoadGroup.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConformLoadGroup.hpp" -#include "ConformLoad.hpp" +#include +#include + #include "ConformLoadSchedule.hpp" +#include "ConformLoad.hpp" using namespace CIMPP; ConformLoadGroup::ConformLoadGroup() {}; - ConformLoadGroup::~ConformLoadGroup() {}; -bool assign_ConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumers.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_ConformLoadSchedule_ConformLoadGroup(BaseClass*, BaseClass*); +bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + ConformLoadSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConformLoadSchedules.begin(), element->ConformLoadSchedules.end(), element2) == element->ConformLoadSchedules.end()) + { + element->ConformLoadSchedules.push_back(element2); + return assign_ConformLoadSchedule_ConformLoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConformLoadSchedules.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_ConformLoad_LoadGroup(BaseClass*, BaseClass*); +bool assign_ConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + ConformLoad* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumers.begin(), element->EnergyConsumers.end(), element2) == element->EnergyConsumers.end()) + { + element->EnergyConsumers.push_back(element2); + return assign_ConformLoad_LoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ConformLoadGroup_factory() { - return new ConformLoadGroup; - } +const char ConformLoadGroup::debugName[] = "ConformLoadGroup"; +const char* ConformLoadGroup::debugString() const +{ + return ConformLoadGroup::debugName; } -void ConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) { +void ConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConformLoadGroup"), &ConformLoadGroup_factory)); } -void ConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.EnergyConsumers"), &assign_ConformLoadGroup_EnergyConsumers)); - assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.ConformLoadSchedules"), &assign_ConformLoadGroup_ConformLoadSchedules)); +void ConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConformLoadGroup::debugName[] = "ConformLoadGroup"; -const char* ConformLoadGroup::debugString() +void ConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConformLoadGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.ConformLoadSchedules"), &assign_ConformLoadGroup_ConformLoadSchedules)); + assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.EnergyConsumers"), &assign_ConformLoadGroup_EnergyConsumers)); } const BaseClassDefiner ConformLoadGroup::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ConformLoadGroup::declare() return BaseClassDefiner(ConformLoadGroup::addConstructToMap, ConformLoadGroup::addPrimitiveAssignFnsToMap, ConformLoadGroup::addClassAssignFnsToMap, ConformLoadGroup::debugName); } - +namespace CIMPP +{ + BaseClass* ConformLoadGroup_factory() + { + return new ConformLoadGroup; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ConformLoadGroup.hpp b/CGMES_2.4.15_16FEB2016/ConformLoadGroup.hpp index 01cc3c0cd..0ea15d628 100644 --- a/CGMES_2.4.15_16FEB2016/ConformLoadGroup.hpp +++ b/CGMES_2.4.15_16FEB2016/ConformLoadGroup.hpp @@ -1,40 +1,41 @@ #ifndef ConformLoadGroup_H #define ConformLoadGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadGroup.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LoadGroup.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConformLoad; + class ConformLoadSchedule; -class ConformLoad; -class ConformLoadSchedule; /* A group of loads conforming to an allocation pattern. */ - class ConformLoadGroup: public LoadGroup + class ConformLoadGroup : public LoadGroup { - public: - std::list EnergyConsumers; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ - std::list ConformLoadSchedules; /* The ConformLoadSchedules in the ConformLoadGroup. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConformLoadGroup(); - virtual ~ConformLoadGroup(); - + ~ConformLoadGroup() override; + + std::list ConformLoadSchedules; /* The ConformLoadSchedules in the ConformLoadGroup. Default: 0 */ + std::list EnergyConsumers; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConformLoadGroup_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.cpp b/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.cpp index bcf5a576d..e3f173e5e 100644 --- a/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConformLoadSchedule.hpp" +#include +#include + #include "ConformLoadGroup.hpp" using namespace CIMPP; -ConformLoadSchedule::ConformLoadSchedule(): ConformLoadGroup(nullptr) {}; - +ConformLoadSchedule::ConformLoadSchedule() : ConformLoadGroup(nullptr) {}; ConformLoadSchedule::~ConformLoadSchedule() {}; -bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass*, BaseClass*); -bool assign_ConformLoadSchedule_ConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->ConformLoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->ConformLoadGroup != nullptr) - return assign_ConformLoadGroup_ConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* ConformLoadSchedule_factory() { - return new ConformLoadSchedule; +bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass*, BaseClass*); +bool assign_ConformLoadSchedule_ConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1); + ConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConformLoadGroup != element2) + { + element->ConformLoadGroup = element2; + return assign_ConformLoadGroup_ConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule"), &ConformLoadSchedule_factory)); +const char ConformLoadSchedule::debugName[] = "ConformLoadSchedule"; +const char* ConformLoadSchedule::debugString() const +{ + return ConformLoadSchedule::debugName; } -void ConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule"), &ConformLoadSchedule_factory)); +} -void ConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule.ConformLoadGroup"), &assign_ConformLoadSchedule_ConformLoadGroup)); +void ConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConformLoadSchedule::debugName[] = "ConformLoadSchedule"; -const char* ConformLoadSchedule::debugString() +void ConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConformLoadSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule.ConformLoadGroup"), &assign_ConformLoadSchedule_ConformLoadGroup)); } const BaseClassDefiner ConformLoadSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner ConformLoadSchedule::declare() return BaseClassDefiner(ConformLoadSchedule::addConstructToMap, ConformLoadSchedule::addPrimitiveAssignFnsToMap, ConformLoadSchedule::addClassAssignFnsToMap, ConformLoadSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* ConformLoadSchedule_factory() + { + return new ConformLoadSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.hpp b/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.hpp index bfc522ac8..6d7a42782 100644 --- a/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/ConformLoadSchedule.hpp @@ -1,38 +1,39 @@ #ifndef ConformLoadSchedule_H #define ConformLoadSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConformLoadGroup; -class ConformLoadGroup; /* A curve of load versus time (X-axis) showing the active power values (Y1-axis) and reactive power (Y2-axis) for each unit of the period covered. This curve represents a typical pattern of load over the time period for a given day type and season. */ - class ConformLoadSchedule: public SeasonDayTypeSchedule + class ConformLoadSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::ConformLoadGroup* ConformLoadGroup; /* The ConformLoadGroup where the ConformLoadSchedule belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConformLoadSchedule(); - virtual ~ConformLoadSchedule(); - + ~ConformLoadSchedule() override; + + CIMPP::ConformLoadGroup* ConformLoadGroup; /* The ConformLoadGroup where the ConformLoadSchedule belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConformLoadSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ConnectivityNode.cpp b/CGMES_2.4.15_16FEB2016/ConnectivityNode.cpp index 61062496c..b0282bde9 100644 --- a/CGMES_2.4.15_16FEB2016/ConnectivityNode.cpp +++ b/CGMES_2.4.15_16FEB2016/ConnectivityNode.cpp @@ -1,9 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConnectivityNode.hpp" -#include "Terminal.hpp" +#include +#include + #include "ConnectivityNodeContainer.hpp" +#include "Terminal.hpp" #include "TopologicalNode.hpp" #include "Boolean.hpp" #include "String.hpp" @@ -15,68 +19,32 @@ using namespace CIMPP; -ConnectivityNode::ConnectivityNode(): ConnectivityNodeContainer(nullptr), TopologicalNode(nullptr) {}; - +ConnectivityNode::ConnectivityNode() : ConnectivityNodeContainer(nullptr), TopologicalNode(nullptr) {}; ConnectivityNode::~ConnectivityNode() {}; -bool assign_ConnectivityNode_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; - } - } - return false; -} - -bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass*, BaseClass*); -bool assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - element->ConnectivityNodeContainer = dynamic_cast(BaseClass_ptr2); - if(element->ConnectivityNodeContainer != nullptr) - return assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TopologicalNode_ConnectivityNodes(BaseClass*, BaseClass*); -bool assign_ConnectivityNode_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - - - - - - - -bool assign_ConnectivityNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->boundaryPoint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ConnectivityNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->boundaryPoint; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ConnectivityNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +52,12 @@ bool assign_ConnectivityNode_fromEndIsoCode(std::stringstream &buffer, BaseClass return false; } -bool assign_ConnectivityNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +65,12 @@ bool assign_ConnectivityNode_fromEndName(std::stringstream &buffer, BaseClass* B return false; } -bool assign_ConnectivityNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +78,12 @@ bool assign_ConnectivityNode_fromEndNameTso(std::stringstream &buffer, BaseClass return false; } -bool assign_ConnectivityNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +91,12 @@ bool assign_ConnectivityNode_toEndIsoCode(std::stringstream &buffer, BaseClass* return false; } -bool assign_ConnectivityNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +104,12 @@ bool assign_ConnectivityNode_toEndName(std::stringstream &buffer, BaseClass* Bas return false; } -bool assign_ConnectivityNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,18 +117,79 @@ bool assign_ConnectivityNode_toEndNameTso(std::stringstream &buffer, BaseClass* return false; } -namespace CIMPP { - BaseClass* ConnectivityNode_factory() { - return new ConnectivityNode; + +bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass*, BaseClass*); +bool assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNode* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNodeContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConnectivityNodeContainer != element2) + { + element->ConnectivityNodeContainer = element2; + return assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ConnectivityNode::addConstructToMap(std::unordered_map& factory_map) { +bool assign_Terminal_ConnectivityNode(BaseClass*, BaseClass*); +bool assign_ConnectivityNode_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNode* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminals.begin(), element->Terminals.end(), element2) == element->Terminals.end()) + { + element->Terminals.push_back(element2); + return assign_Terminal_ConnectivityNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TopologicalNode_ConnectivityNodes(BaseClass*, BaseClass*); +bool assign_ConnectivityNode_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNode* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + + + +const char ConnectivityNode::debugName[] = "ConnectivityNode"; +const char* ConnectivityNode::debugString() const +{ + return ConnectivityNode::debugName; +} + +void ConnectivityNode::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConnectivityNode"), &ConnectivityNode_factory)); } -void ConnectivityNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.boundaryPoint"), &assign_ConnectivityNode_boundaryPoint)); +void ConnectivityNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.boundaryPoint"), &assign_ConnectivityNode_boundaryPoint)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.fromEndIsoCode"), &assign_ConnectivityNode_fromEndIsoCode)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.fromEndName"), &assign_ConnectivityNode_fromEndName)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.fromEndNameTso"), &assign_ConnectivityNode_fromEndNameTso)); @@ -159,16 +198,11 @@ void ConnectivityNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.Terminals"), &assign_ConnectivityNode_Terminals)); +void ConnectivityNode::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.ConnectivityNodeContainer"), &assign_ConnectivityNode_ConnectivityNodeContainer)); + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.Terminals"), &assign_ConnectivityNode_Terminals)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.TopologicalNode"), &assign_ConnectivityNode_TopologicalNode)); - } - -const char ConnectivityNode::debugName[] = "ConnectivityNode"; -const char* ConnectivityNode::debugString() -{ - return ConnectivityNode::debugName; } const BaseClassDefiner ConnectivityNode::declare() @@ -176,4 +210,10 @@ const BaseClassDefiner ConnectivityNode::declare() return BaseClassDefiner(ConnectivityNode::addConstructToMap, ConnectivityNode::addPrimitiveAssignFnsToMap, ConnectivityNode::addClassAssignFnsToMap, ConnectivityNode::debugName); } - +namespace CIMPP +{ + BaseClass* ConnectivityNode_factory() + { + return new ConnectivityNode; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ConnectivityNode.hpp b/CGMES_2.4.15_16FEB2016/ConnectivityNode.hpp index a5a97fdd8..cf94752de 100644 --- a/CGMES_2.4.15_16FEB2016/ConnectivityNode.hpp +++ b/CGMES_2.4.15_16FEB2016/ConnectivityNode.hpp @@ -1,51 +1,52 @@ #ifndef ConnectivityNode_H #define ConnectivityNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "String.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ConnectivityNodeContainer; + class Terminal; + class TopologicalNode; -class Terminal; -class ConnectivityNodeContainer; -class TopologicalNode; /* Connectivity nodes are points where terminals of AC conducting equipment are connected together with zero impedance. */ - class ConnectivityNode: public IdentifiedObject + class ConnectivityNode : public IdentifiedObject { - public: - std::list Terminals; /* The connectivity node to which this terminal connects with zero impedance. Default: 0 */ - CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* Container of this connectivity node. Default: 0 */ - CIMPP::TopologicalNode* TopologicalNode; /* The topological node to which this connectivity node is assigned. May depend on the current state of switches in the network. Default: 0 */ - CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ - CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConnectivityNode(); - virtual ~ConnectivityNode(); - + ~ConnectivityNode() override; + + CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* Container of this connectivity node. Default: 0 */ + std::list Terminals; /* The connectivity node to which this terminal connects with zero impedance. Default: 0 */ + CIMPP::TopologicalNode* TopologicalNode; /* The topological node to which this connectivity node is assigned. May depend on the current state of switches in the network. Default: 0 */ + CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ + CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConnectivityNode_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.cpp b/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.cpp index f9b396575..a5ed6251f 100644 --- a/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.cpp +++ b/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.cpp @@ -1,62 +1,76 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConnectivityNodeContainer.hpp" +#include +#include + #include "ConnectivityNode.hpp" #include "TopologicalNode.hpp" using namespace CIMPP; ConnectivityNodeContainer::ConnectivityNodeContainer() {}; - ConnectivityNodeContainer::~ConnectivityNodeContainer() {}; -bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConnectivityNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass*, BaseClass*); +bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConnectivityNodes.begin(), element->ConnectivityNodes.end(), element2) == element->ConnectivityNodes.end()) + { + element->ConnectivityNodes.push_back(element2); + return assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass*, BaseClass*); +bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNode.begin(), element->TopologicalNode.end(), element2) == element->TopologicalNode.end()) + { + element->TopologicalNode.push_back(element2); + return assign_TopologicalNode_ConnectivityNodeContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ConnectivityNodeContainer_factory() { - return new ConnectivityNodeContainer; - } +const char ConnectivityNodeContainer::debugName[] = "ConnectivityNodeContainer"; +const char* ConnectivityNodeContainer::debugString() const +{ + return ConnectivityNodeContainer::debugName; } -void ConnectivityNodeContainer::addConstructToMap(std::unordered_map& factory_map) { +void ConnectivityNodeContainer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer"), &ConnectivityNodeContainer_factory)); } -void ConnectivityNodeContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ConnectivityNodeContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.ConnectivityNodes"), &assign_ConnectivityNodeContainer_ConnectivityNodes)); - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.TopologicalNode"), &assign_ConnectivityNodeContainer_TopologicalNode)); +void ConnectivityNodeContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConnectivityNodeContainer::debugName[] = "ConnectivityNodeContainer"; -const char* ConnectivityNodeContainer::debugString() +void ConnectivityNodeContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConnectivityNodeContainer::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.ConnectivityNodes"), &assign_ConnectivityNodeContainer_ConnectivityNodes)); + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.TopologicalNode"), &assign_ConnectivityNodeContainer_TopologicalNode)); } const BaseClassDefiner ConnectivityNodeContainer::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ConnectivityNodeContainer::declare() return BaseClassDefiner(ConnectivityNodeContainer::addConstructToMap, ConnectivityNodeContainer::addPrimitiveAssignFnsToMap, ConnectivityNodeContainer::addClassAssignFnsToMap, ConnectivityNodeContainer::debugName); } - +namespace CIMPP +{ + BaseClass* ConnectivityNodeContainer_factory() + { + return new ConnectivityNodeContainer; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.hpp b/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.hpp index dc14dea02..0b188b41b 100644 --- a/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.hpp +++ b/CGMES_2.4.15_16FEB2016/ConnectivityNodeContainer.hpp @@ -1,40 +1,41 @@ #ifndef ConnectivityNodeContainer_H #define ConnectivityNodeContainer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConnectivityNode; + class TopologicalNode; -class ConnectivityNode; -class TopologicalNode; /* A base class for all objects that may contain connectivity nodes or topological nodes. */ - class ConnectivityNodeContainer: public PowerSystemResource + class ConnectivityNodeContainer : public PowerSystemResource { - public: - std::list ConnectivityNodes; /* Connectivity nodes which belong to this connectivity node container. Default: 0 */ - std::list TopologicalNode; /* The topological nodes which belong to this connectivity node container. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConnectivityNodeContainer(); - virtual ~ConnectivityNodeContainer(); - + ~ConnectivityNodeContainer() override; + + std::list ConnectivityNodes; /* Connectivity nodes which belong to this connectivity node container. Default: 0 */ + std::list TopologicalNode; /* The topological nodes which belong to this connectivity node container. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConnectivityNodeContainer_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Connector.cpp b/CGMES_2.4.15_16FEB2016/Connector.cpp index e4754630f..55025d4c6 100644 --- a/CGMES_2.4.15_16FEB2016/Connector.cpp +++ b/CGMES_2.4.15_16FEB2016/Connector.cpp @@ -1,36 +1,36 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Connector.hpp" +#include +#include + using namespace CIMPP; Connector::Connector() {}; - Connector::~Connector() {}; -namespace CIMPP { - BaseClass* Connector_factory() { - return new Connector; - } +const char Connector::debugName[] = "Connector"; +const char* Connector::debugString() const +{ + return Connector::debugName; } -void Connector::addConstructToMap(std::unordered_map& factory_map) { +void Connector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Connector"), &Connector_factory)); } -void Connector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Connector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Connector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Connector::debugName[] = "Connector"; -const char* Connector::debugString() +void Connector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Connector::debugName; } const BaseClassDefiner Connector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Connector::declare() return BaseClassDefiner(Connector::addConstructToMap, Connector::addPrimitiveAssignFnsToMap, Connector::addClassAssignFnsToMap, Connector::debugName); } - +namespace CIMPP +{ + BaseClass* Connector_factory() + { + return new Connector; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Connector.hpp b/CGMES_2.4.15_16FEB2016/Connector.hpp index 6322a9360..9c7e0b2a4 100644 --- a/CGMES_2.4.15_16FEB2016/Connector.hpp +++ b/CGMES_2.4.15_16FEB2016/Connector.hpp @@ -1,36 +1,37 @@ #ifndef Connector_H #define Connector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation and are modelled with a single logical terminal. */ - class Connector: public ConductingEquipment + class Connector : public ConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Connector(); - virtual ~Connector(); - + ~Connector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Connector_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Control.cpp b/CGMES_2.4.15_16FEB2016/Control.cpp index 75af44fa1..9aba93e37 100644 --- a/CGMES_2.4.15_16FEB2016/Control.cpp +++ b/CGMES_2.4.15_16FEB2016/Control.cpp @@ -1,49 +1,70 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Control.hpp" +#include +#include + +#include "PowerSystemResource.hpp" #include "String.hpp" #include "Boolean.hpp" #include "DateTime.hpp" #include "UnitMultiplier.hpp" #include "UnitSymbol.hpp" -#include "PowerSystemResource.hpp" using namespace CIMPP; -Control::Control(): timeStamp(nullptr), PowerSystemResource(nullptr) {}; - +Control::Control() : PowerSystemResource(nullptr) {}; Control::~Control() {}; - -bool assign_Control_timeStamp(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - element->timeStamp = dynamic_cast(BaseClass_ptr2); - if(element->timeStamp != nullptr) - return true; - } - return false; +bool assign_Control_controlType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + element->controlType = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } - - -bool assign_PowerSystemResource_Controls(BaseClass*, BaseClass*); -bool assign_Control_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemResource = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemResource != nullptr) - return assign_PowerSystemResource_Controls(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Control_operationInProgress(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operationInProgress; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_Control_timeStamp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + element->timeStamp = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Control_controlType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - element->controlType = buffer.str(); - if(buffer.fail()) +bool assign_Control_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitMultiplier; + if (buffer.fail()) return false; else return true; @@ -51,70 +72,65 @@ bool assign_Control_controlType(std::stringstream &buffer, BaseClass* BaseClass_ return false; } -bool assign_Control_operationInProgress(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operationInProgress; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Control_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitSymbol; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Control_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PowerSystemResource_Controls(BaseClass*, BaseClass*); +bool assign_Control_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Control* element = dynamic_cast(BaseClass_ptr1); + PowerSystemResource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemResource != element2) + { + element->PowerSystemResource = element2; + return assign_PowerSystemResource_Controls(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Control_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitSymbol; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Control_factory() { - return new Control; - } + + + +const char Control::debugName[] = "Control"; +const char* Control::debugString() const +{ + return Control::debugName; } -void Control::addConstructToMap(std::unordered_map& factory_map) { +void Control::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Control"), &Control_factory)); } -void Control::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Control::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Control.controlType"), &assign_Control_controlType)); assign_map.insert(std::make_pair(std::string("cim:Control.operationInProgress"), &assign_Control_operationInProgress)); - assign_map.insert(std::make_pair(std::string("cim:Control.unitMultiplier"), &assign_Control_unitMultiplier)); + assign_map.insert(std::make_pair(std::string("cim:Control.timeStamp"), &assign_Control_timeStamp)); + assign_map.insert(std::make_pair(std::string("cim:Control.unitMultiplier"), &assign_Control_unitMultiplier)); assign_map.insert(std::make_pair(std::string("cim:Control.unitSymbol"), &assign_Control_unitSymbol)); - } - -void Control::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Control.timeStamp"), &assign_Control_timeStamp)); - assign_map.insert(std::make_pair(std::string("cim:Control.PowerSystemResource"), &assign_Control_PowerSystemResource)); } -const char Control::debugName[] = "Control"; -const char* Control::debugString() +void Control::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Control::debugName; + assign_map.insert(std::make_pair(std::string("cim:Control.PowerSystemResource"), &assign_Control_PowerSystemResource)); } const BaseClassDefiner Control::declare() @@ -122,4 +138,10 @@ const BaseClassDefiner Control::declare() return BaseClassDefiner(Control::addConstructToMap, Control::addPrimitiveAssignFnsToMap, Control::addClassAssignFnsToMap, Control::debugName); } - +namespace CIMPP +{ + BaseClass* Control_factory() + { + return new Control; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Control.hpp b/CGMES_2.4.15_16FEB2016/Control.hpp index 0eda4c1bb..8d2c55032 100644 --- a/CGMES_2.4.15_16FEB2016/Control.hpp +++ b/CGMES_2.4.15_16FEB2016/Control.hpp @@ -1,48 +1,49 @@ #ifndef Control_H #define Control_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "String.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "DateTime.hpp" +#include "String.hpp" #include "UnitMultiplier.hpp" #include "UnitSymbol.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PowerSystemResource; -class DateTime; -class PowerSystemResource; /* Control is used for supervisory/device control. It represents control outputs that are used to change the state in a process, e.g. close or open breaker, a set point value or a raise lower command. */ - class Control: public IdentifiedObject + class Control : public IdentifiedObject { - public: - CIMPP::String controlType; /* Specifies the type of Control, e.g. BreakerOn/Off, GeneratorVoltageSetPoint, TieLineFlow etc. The ControlType.name shall be unique among all specified types and describe the type. Default: '' */ - CIMPP::Boolean operationInProgress; /* Indicates that a client is currently sending control commands that has not completed. Default: false */ - CIMPP::DateTime* timeStamp; /* The last time a control output was sent. Default: '' */ - CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the controlled quantity. Default: 0 */ - CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the controlled quantity. Default: 0 */ - CIMPP::PowerSystemResource* PowerSystemResource; /* The controller outputs used to actually govern a regulating device, e.g. the magnetization of a synchronous machine or capacitor bank breaker actuator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Control(); - virtual ~Control(); - + ~Control() override; + + CIMPP::PowerSystemResource* PowerSystemResource; /* The controller outputs used to actually govern a regulating device, e.g. the magnetization of a synchronous machine or capacitor bank breaker actuator. Default: 0 */ + CIMPP::String controlType; /* Specifies the type of Control, e.g. BreakerOn/Off, GeneratorVoltageSetPoint, TieLineFlow etc. The ControlType.name shall be unique among all specified types and describe the type. Default: '' */ + CIMPP::Boolean operationInProgress; /* Indicates that a client is currently sending control commands that has not completed. Default: false */ + CIMPP::DateTime timeStamp; /* The last time a control output was sent. Default: '' */ + CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the controlled quantity. Default: 0 */ + CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the controlled quantity. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Control_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ControlArea.cpp b/CGMES_2.4.15_16FEB2016/ControlArea.cpp index c9fbf14fa..81143d238 100644 --- a/CGMES_2.4.15_16FEB2016/ControlArea.cpp +++ b/CGMES_2.4.15_16FEB2016/ControlArea.cpp @@ -1,120 +1,144 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ControlArea.hpp" +#include +#include + +#include "ControlAreaGeneratingUnit.hpp" #include "EnergyArea.hpp" -#include "ControlAreaTypeKind.hpp" #include "TieFlow.hpp" -#include "ControlAreaGeneratingUnit.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" +#include "ControlAreaTypeKind.hpp" using namespace CIMPP; -ControlArea::ControlArea(): EnergyArea(nullptr) {}; - +ControlArea::ControlArea() : EnergyArea(nullptr) {}; ControlArea::~ControlArea() {}; -bool assign_EnergyArea_ControlArea(BaseClass*, BaseClass*); -bool assign_ControlArea_EnergyArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - element->EnergyArea = dynamic_cast(BaseClass_ptr2); - if(element->EnergyArea != nullptr) - return assign_EnergyArea_ControlArea(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_ControlArea_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TieFlow.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_ControlArea_netInterchange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ControlArea* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->netInterchange; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ControlAreaGeneratingUnit.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ControlArea_pTolerance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ControlArea* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pTolerance; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_ControlArea_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ControlArea* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ControlAreaGeneratingUnit_ControlArea(BaseClass*, BaseClass*); +bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlArea* element = dynamic_cast(BaseClass_ptr1); + ControlAreaGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ControlAreaGeneratingUnit.begin(), element->ControlAreaGeneratingUnit.end(), element2) == element->ControlAreaGeneratingUnit.end()) + { + element->ControlAreaGeneratingUnit.push_back(element2); + return assign_ControlAreaGeneratingUnit_ControlArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} - -bool assign_ControlArea_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_EnergyArea_ControlArea(BaseClass*, BaseClass*); +bool assign_ControlArea_EnergyArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlArea* element = dynamic_cast(BaseClass_ptr1); + EnergyArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EnergyArea != element2) + { + element->EnergyArea = element2; + return assign_EnergyArea_ControlArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_TieFlow_ControlArea(BaseClass*, BaseClass*); +bool assign_ControlArea_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlArea* element = dynamic_cast(BaseClass_ptr1); + TieFlow* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TieFlow.begin(), element->TieFlow.end(), element2) == element->TieFlow.end()) + { + element->TieFlow.push_back(element2); + return assign_TieFlow_ControlArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_ControlArea_netInterchange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->netInterchange; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ControlArea_pTolerance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pTolerance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ControlArea_factory() { - return new ControlArea; - } +const char ControlArea::debugName[] = "ControlArea"; +const char* ControlArea::debugString() const +{ + return ControlArea::debugName; } -void ControlArea::addConstructToMap(std::unordered_map& factory_map) { +void ControlArea::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ControlArea"), &ControlArea_factory)); } -void ControlArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ControlArea.type"), &assign_ControlArea_type)); - assign_map.insert(std::make_pair(std::string("cim:ControlArea.netInterchange"), &assign_ControlArea_netInterchange)); +void ControlArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ControlArea.netInterchange"), &assign_ControlArea_netInterchange)); assign_map.insert(std::make_pair(std::string("cim:ControlArea.pTolerance"), &assign_ControlArea_pTolerance)); + assign_map.insert(std::make_pair(std::string("cim:ControlArea.type"), &assign_ControlArea_type)); } -void ControlArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ControlArea.EnergyArea"), &assign_ControlArea_EnergyArea)); - assign_map.insert(std::make_pair(std::string("cim:ControlArea.TieFlow"), &assign_ControlArea_TieFlow)); - assign_map.insert(std::make_pair(std::string("cim:ControlArea.ControlAreaGeneratingUnit"), &assign_ControlArea_ControlAreaGeneratingUnit)); - } - -const char ControlArea::debugName[] = "ControlArea"; -const char* ControlArea::debugString() +void ControlArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ControlArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:ControlArea.ControlAreaGeneratingUnit"), &assign_ControlArea_ControlAreaGeneratingUnit)); + assign_map.insert(std::make_pair(std::string("cim:ControlArea.EnergyArea"), &assign_ControlArea_EnergyArea)); + assign_map.insert(std::make_pair(std::string("cim:ControlArea.TieFlow"), &assign_ControlArea_TieFlow)); } const BaseClassDefiner ControlArea::declare() @@ -122,4 +146,10 @@ const BaseClassDefiner ControlArea::declare() return BaseClassDefiner(ControlArea::addConstructToMap, ControlArea::addPrimitiveAssignFnsToMap, ControlArea::addClassAssignFnsToMap, ControlArea::debugName); } - +namespace CIMPP +{ + BaseClass* ControlArea_factory() + { + return new ControlArea; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ControlArea.hpp b/CGMES_2.4.15_16FEB2016/ControlArea.hpp index 1feaec7a0..69d562f82 100644 --- a/CGMES_2.4.15_16FEB2016/ControlArea.hpp +++ b/CGMES_2.4.15_16FEB2016/ControlArea.hpp @@ -1,47 +1,48 @@ #ifndef ControlArea_H #define ControlArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "ControlAreaTypeKind.hpp" +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "ControlAreaTypeKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ControlAreaGeneratingUnit; + class EnergyArea; + class TieFlow; -class EnergyArea; -class TieFlow; -class ControlAreaGeneratingUnit; /* A control areais a grouping of generating units and/or loads and a cutset of tie lines (as terminals) which may be used for a variety of purposes including automatic generation control, powerflow solution area interchange control specification, and input to load forecasting. Note that any number of overlapping control area specifications can be superimposed on the physical model. */ - class ControlArea: public PowerSystemResource + class ControlArea : public PowerSystemResource { - public: - CIMPP::EnergyArea* EnergyArea; /* The energy area that is forecast from this control area specification. Default: 0 */ - CIMPP::ControlAreaTypeKind type; /* The primary type of control area definition used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. A control area specified with primary type of automatic generation control could still be forecast and used as an interchange area in power flow analysis. Default: 0 */ - std::list TieFlow; /* The tie flows associated with the control area. Default: 0 */ - std::list ControlAreaGeneratingUnit; /* The generating unit specificaitons for the control area. Default: 0 */ - CIMPP::ActivePower netInterchange; /* The specified positive net interchange into the control area, i.e. positive sign means flow in to the area. Default: nullptr */ - CIMPP::ActivePower pTolerance; /* Active power net interchange tolerance Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ControlArea(); - virtual ~ControlArea(); - + ~ControlArea() override; + + std::list ControlAreaGeneratingUnit; /* The generating unit specificaitons for the control area. Default: 0 */ + CIMPP::EnergyArea* EnergyArea; /* The energy area that is forecast from this control area specification. Default: 0 */ + std::list TieFlow; /* The tie flows associated with the control area. Default: 0 */ + CIMPP::ActivePower netInterchange; /* The specified positive net interchange into the control area, i.e. positive sign means flow in to the area. Default: nullptr */ + CIMPP::ActivePower pTolerance; /* Active power net interchange tolerance Default: nullptr */ + CIMPP::ControlAreaTypeKind type; /* The primary type of control area definition used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. A control area specified with primary type of automatic generation control could still be forecast and used as an interchange area in power flow analysis. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ControlArea_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.cpp index a9f06554d..40ad5b42f 100644 --- a/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ControlAreaGeneratingUnit.hpp" -#include "GeneratingUnit.hpp" +#include +#include + #include "ControlArea.hpp" +#include "GeneratingUnit.hpp" using namespace CIMPP; -ControlAreaGeneratingUnit::ControlAreaGeneratingUnit(): GeneratingUnit(nullptr), ControlArea(nullptr) {}; - +ControlAreaGeneratingUnit::ControlAreaGeneratingUnit() : ControlArea(nullptr), GeneratingUnit(nullptr) {}; ControlAreaGeneratingUnit::~ControlAreaGeneratingUnit() {}; -bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); -bool assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->GeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->GeneratingUnit != nullptr) - return assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); -bool assign_ControlAreaGeneratingUnit_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->ControlArea = dynamic_cast(BaseClass_ptr2); - if(element->ControlArea != nullptr) - return assign_ControlArea_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); +bool assign_ControlAreaGeneratingUnit_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + ControlArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ControlArea != element2) + { + element->ControlArea = element2; + return assign_ControlArea_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* ControlAreaGeneratingUnit_factory() { - return new ControlAreaGeneratingUnit; +bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); +bool assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + GeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->GeneratingUnit != element2) + { + element->GeneratingUnit = element2; + return assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ControlAreaGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit"), &ControlAreaGeneratingUnit_factory)); +const char ControlAreaGeneratingUnit::debugName[] = "ControlAreaGeneratingUnit"; +const char* ControlAreaGeneratingUnit::debugString() const +{ + return ControlAreaGeneratingUnit::debugName; } -void ControlAreaGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ControlAreaGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit"), &ControlAreaGeneratingUnit_factory)); +} -void ControlAreaGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.GeneratingUnit"), &assign_ControlAreaGeneratingUnit_GeneratingUnit)); - assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.ControlArea"), &assign_ControlAreaGeneratingUnit_ControlArea)); +void ControlAreaGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ControlAreaGeneratingUnit::debugName[] = "ControlAreaGeneratingUnit"; -const char* ControlAreaGeneratingUnit::debugString() +void ControlAreaGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ControlAreaGeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.ControlArea"), &assign_ControlAreaGeneratingUnit_ControlArea)); + assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.GeneratingUnit"), &assign_ControlAreaGeneratingUnit_GeneratingUnit)); } const BaseClassDefiner ControlAreaGeneratingUnit::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ControlAreaGeneratingUnit::declare() return BaseClassDefiner(ControlAreaGeneratingUnit::addConstructToMap, ControlAreaGeneratingUnit::addPrimitiveAssignFnsToMap, ControlAreaGeneratingUnit::addClassAssignFnsToMap, ControlAreaGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* ControlAreaGeneratingUnit_factory() + { + return new ControlAreaGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.hpp index 80d838c5f..96eb060c9 100644 --- a/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/ControlAreaGeneratingUnit.hpp @@ -1,40 +1,41 @@ #ifndef ControlAreaGeneratingUnit_H #define ControlAreaGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ControlArea; + class GeneratingUnit; -class GeneratingUnit; -class ControlArea; /* A control area generating unit. This class is needed so that alternate control area definitions may include the same generating unit. Note only one instance within a control area should reference a specific generating unit. */ - class ControlAreaGeneratingUnit: public IdentifiedObject + class ControlAreaGeneratingUnit : public IdentifiedObject { - public: - CIMPP::GeneratingUnit* GeneratingUnit; /* The generating unit specified for this control area. Note that a control area should include a GeneratingUnit only once. Default: 0 */ - CIMPP::ControlArea* ControlArea; /* The parent control area for the generating unit specifications. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ControlAreaGeneratingUnit(); - virtual ~ControlAreaGeneratingUnit(); - + ~ControlAreaGeneratingUnit() override; + + CIMPP::ControlArea* ControlArea; /* The parent control area for the generating unit specifications. Default: 0 */ + CIMPP::GeneratingUnit* GeneratingUnit; /* The generating unit specified for this control area. Note that a control area should include a GeneratingUnit only once. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ControlAreaGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.cpp b/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.cpp index 46a651a3f..48f6c0cb5 100644 --- a/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ControlAreaTypeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ControlAreaTypeKind& rop) +ControlAreaTypeKind& ControlAreaTypeKind::operator=(ControlAreaTypeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ControlAreaTypeKind::operator ControlAreaTypeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ControlAreaTypeKind::debugName[] = "ControlAreaTypeKind"; +const char* ControlAreaTypeKind::debugString() const +{ + return ControlAreaTypeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ControlAreaTypeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ControlAreaTypeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ControlAreaTypeKind::AGC) + { + EnumSymbol = "AGC"; + } + if (obj.value == ControlAreaTypeKind::Forecast) + { + EnumSymbol = "Forecast"; + } + if (obj.value == ControlAreaTypeKind::Interchange) + { + EnumSymbol = "Interchange"; + } + + if (!EnumSymbol.empty()) + { + os << "ControlAreaTypeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.hpp b/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.hpp index d111ce9ae..025df1d5c 100644 --- a/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ControlAreaTypeKind.hpp @@ -1,25 +1,50 @@ #ifndef ControlAreaTypeKind_H #define ControlAreaTypeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The type of control area. */ - enum class ControlAreaTypeKind + class ControlAreaTypeKind { - /** - * Used for automatic generation control. - */ - AGC, - /** - * Used for load forecast. - */ - Forecast, - /** - * Used for interchange specification or control. - */ - Interchange, + public: + enum ControlAreaTypeKind_ENUM + { + /** + * Used for automatic generation control. + */ + AGC, + /** + * Used for load forecast. + */ + Forecast, + /** + * Used for interchange specification or control. + */ + Interchange, + }; + + ControlAreaTypeKind() : value(), initialized(false) {} + ControlAreaTypeKind(ControlAreaTypeKind_ENUM value) : value(value), initialized(true) {} + + ControlAreaTypeKind& operator=(ControlAreaTypeKind_ENUM rop); + operator ControlAreaTypeKind_ENUM() const; + + ControlAreaTypeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ControlAreaTypeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ControlAreaTypeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ControlAreaTypeKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/CoordinateSystem.cpp b/CGMES_2.4.15_16FEB2016/CoordinateSystem.cpp index e37246668..c4d4dd7f2 100644 --- a/CGMES_2.4.15_16FEB2016/CoordinateSystem.cpp +++ b/CGMES_2.4.15_16FEB2016/CoordinateSystem.cpp @@ -1,63 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CoordinateSystem.hpp" -#include "String.hpp" +#include +#include + #include "Location.hpp" +#include "String.hpp" using namespace CIMPP; CoordinateSystem::CoordinateSystem() {}; - CoordinateSystem::~CoordinateSystem() {}; -bool assign_CoordinateSystem_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(CoordinateSystem* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Location.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_CoordinateSystem_crsUrn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CoordinateSystem* element = dynamic_cast(BaseClass_ptr1)) + { + element->crsUrn = buffer.str(); + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_CoordinateSystem_crsUrn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CoordinateSystem* element = dynamic_cast(BaseClass_ptr1)) { - element->crsUrn = buffer.str(); - if(buffer.fail()) - return false; - else - return true; +bool assign_Location_CoordinateSystem(BaseClass*, BaseClass*); +bool assign_CoordinateSystem_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + CoordinateSystem* element = dynamic_cast(BaseClass_ptr1); + Location* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Location.begin(), element->Location.end(), element2) == element->Location.end()) + { + element->Location.push_back(element2); + return assign_Location_CoordinateSystem(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } return false; } -namespace CIMPP { - BaseClass* CoordinateSystem_factory() { - return new CoordinateSystem; - } +const char CoordinateSystem::debugName[] = "CoordinateSystem"; +const char* CoordinateSystem::debugString() const +{ + return CoordinateSystem::debugName; } -void CoordinateSystem::addConstructToMap(std::unordered_map& factory_map) { +void CoordinateSystem::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CoordinateSystem"), &CoordinateSystem_factory)); } -void CoordinateSystem::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CoordinateSystem::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:CoordinateSystem.crsUrn"), &assign_CoordinateSystem_crsUrn)); - } - -void CoordinateSystem::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CoordinateSystem.Location"), &assign_CoordinateSystem_Location)); } -const char CoordinateSystem::debugName[] = "CoordinateSystem"; -const char* CoordinateSystem::debugString() +void CoordinateSystem::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CoordinateSystem::debugName; + assign_map.insert(std::make_pair(std::string("cim:CoordinateSystem.Location"), &assign_CoordinateSystem_Location)); } const BaseClassDefiner CoordinateSystem::declare() @@ -65,4 +74,10 @@ const BaseClassDefiner CoordinateSystem::declare() return BaseClassDefiner(CoordinateSystem::addConstructToMap, CoordinateSystem::addPrimitiveAssignFnsToMap, CoordinateSystem::addClassAssignFnsToMap, CoordinateSystem::debugName); } - +namespace CIMPP +{ + BaseClass* CoordinateSystem_factory() + { + return new CoordinateSystem; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CoordinateSystem.hpp b/CGMES_2.4.15_16FEB2016/CoordinateSystem.hpp index 5202e0375..e3b72d8ce 100644 --- a/CGMES_2.4.15_16FEB2016/CoordinateSystem.hpp +++ b/CGMES_2.4.15_16FEB2016/CoordinateSystem.hpp @@ -1,40 +1,41 @@ #ifndef CoordinateSystem_H #define CoordinateSystem_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Location; - -class Location; /* Coordinate reference system. */ - class CoordinateSystem: public IdentifiedObject + class CoordinateSystem : public IdentifiedObject { - public: - CIMPP::String crsUrn; /* A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define `Location.PositionPoints`. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc:def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry web site http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. Default: '' */ - std::list Location; /* All locations described with position points in this coordinate system. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CoordinateSystem(); - virtual ~CoordinateSystem(); - + ~CoordinateSystem() override; + + std::list Location; /* All locations described with position points in this coordinate system. Default: 0 */ + CIMPP::String crsUrn; /* A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define `Location.PositionPoints`. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc:def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry web site http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CoordinateSystem_factory(); diff --git a/CGMES_2.4.15_16FEB2016/CsConverter.cpp b/CGMES_2.4.15_16FEB2016/CsConverter.cpp index 7670812af..3998e98e5 100644 --- a/CGMES_2.4.15_16FEB2016/CsConverter.cpp +++ b/CGMES_2.4.15_16FEB2016/CsConverter.cpp @@ -1,18 +1,22 @@ -#include -#include "ACDCConverter.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CsConverter.hpp" +#include +#include + #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" -#include "CurrentFlow.hpp" #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" #include "CurrentFlow.hpp" -#include "CurrentFlow.hpp" #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" +#include "CurrentFlow.hpp" #include "CsOperatingModeKind.hpp" #include "CsPpccControlKind.hpp" +#include "CurrentFlow.hpp" #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" #include "CurrentFlow.hpp" @@ -20,227 +24,237 @@ using namespace CIMPP; CsConverter::CsConverter() {}; - CsConverter::~CsConverter() {}; +bool assign_CsConverter_alpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->alpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_gamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_maxAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxAlpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_maxGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxGamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_maxIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_minAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minAlpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_minGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minGamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_minIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operatingMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pPccControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_ratedIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_targetAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetAlpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_targetGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetGamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_targetIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_CsConverter_maxAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxAlpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_maxGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxGamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_maxIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_minAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minAlpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_minGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minGamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_minIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_ratedIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_alpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->alpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_gamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operatingMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pPccControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_targetAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetAlpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_targetGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetGamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_targetIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* CsConverter_factory() { - return new CsConverter; - } + + + + + + + + + + +const char CsConverter::debugName[] = "CsConverter"; +const char* CsConverter::debugString() const +{ + return CsConverter::debugName; } -void CsConverter::addConstructToMap(std::unordered_map& factory_map) { +void CsConverter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CsConverter"), &CsConverter_factory)); } -void CsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:CsConverter.alpha"), &assign_CsConverter_alpha)); + assign_map.insert(std::make_pair(std::string("cim:CsConverter.gamma"), &assign_CsConverter_gamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.maxAlpha"), &assign_CsConverter_maxAlpha)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.maxGamma"), &assign_CsConverter_maxGamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.maxIdc"), &assign_CsConverter_maxIdc)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.minAlpha"), &assign_CsConverter_minAlpha)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.minGamma"), &assign_CsConverter_minGamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.minIdc"), &assign_CsConverter_minIdc)); - assign_map.insert(std::make_pair(std::string("cim:CsConverter.ratedIdc"), &assign_CsConverter_ratedIdc)); - assign_map.insert(std::make_pair(std::string("cim:CsConverter.alpha"), &assign_CsConverter_alpha)); - assign_map.insert(std::make_pair(std::string("cim:CsConverter.gamma"), &assign_CsConverter_gamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.operatingMode"), &assign_CsConverter_operatingMode)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.pPccControl"), &assign_CsConverter_pPccControl)); + assign_map.insert(std::make_pair(std::string("cim:CsConverter.ratedIdc"), &assign_CsConverter_ratedIdc)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.targetAlpha"), &assign_CsConverter_targetAlpha)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.targetGamma"), &assign_CsConverter_targetGamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.targetIdc"), &assign_CsConverter_targetIdc)); } -void CsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char CsConverter::debugName[] = "CsConverter"; -const char* CsConverter::debugString() +void CsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CsConverter::debugName; } const BaseClassDefiner CsConverter::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner CsConverter::declare() return BaseClassDefiner(CsConverter::addConstructToMap, CsConverter::addPrimitiveAssignFnsToMap, CsConverter::addClassAssignFnsToMap, CsConverter::debugName); } - +namespace CIMPP +{ + BaseClass* CsConverter_factory() + { + return new CsConverter; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CsConverter.hpp b/CGMES_2.4.15_16FEB2016/CsConverter.hpp index 5905eb58a..b17bc6252 100644 --- a/CGMES_2.4.15_16FEB2016/CsConverter.hpp +++ b/CGMES_2.4.15_16FEB2016/CsConverter.hpp @@ -1,54 +1,55 @@ #ifndef CsConverter_H #define CsConverter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCConverter.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ACDCConverter.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -#include "CurrentFlow.hpp" #include "CsOperatingModeKind.hpp" #include "CsPpccControlKind.hpp" +#include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* DC side of the current source converter (CSC). */ - class CsConverter: public ACDCConverter + class CsConverter : public ACDCConverter { - public: - CIMPP::AngleDegrees maxAlpha; /* Maximum firing angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::AngleDegrees maxGamma; /* Maximum extinction angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow maxIdc; /* The maximum direct current (Id) on the DC side at which the converter should operate. Converter configuration data use in power flow. Default: nullptr */ - CIMPP::AngleDegrees minAlpha; /* Minimum firing angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::AngleDegrees minGamma; /* Minimum extinction angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow minIdc; /* The minimum direct current (Id) on the DC side at which the converter should operate. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow ratedIdc; /* Rated converter DC current, also called IdN. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::AngleDegrees alpha; /* Firing angle, typical value between 10 and 18 degrees for a rectifier. CSC state variable, result from power flow. Default: nullptr */ - CIMPP::AngleDegrees gamma; /* Extinction angle. CSC state variable, result from power flow. Default: nullptr */ - CIMPP::CsOperatingModeKind operatingMode; /* Indicates whether the DC pole is operating as an inverter or as a rectifier. CSC control variable used in power flow. Default: 0 */ - CIMPP::CsPpccControlKind pPccControl; /* Default: 0 */ - CIMPP::AngleDegrees targetAlpha; /* Target firing angle. CSC control variable used in power flow. Default: nullptr */ - CIMPP::AngleDegrees targetGamma; /* Target extinction angle. CSC control variable used in power flow. Default: nullptr */ - CIMPP::CurrentFlow targetIdc; /* DC current target value. CSC control variable used in power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CsConverter(); - virtual ~CsConverter(); - + ~CsConverter() override; + + CIMPP::AngleDegrees alpha; /* Firing angle, typical value between 10 and 18 degrees for a rectifier. CSC state variable, result from power flow. Default: nullptr */ + CIMPP::AngleDegrees gamma; /* Extinction angle. CSC state variable, result from power flow. Default: nullptr */ + CIMPP::AngleDegrees maxAlpha; /* Maximum firing angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::AngleDegrees maxGamma; /* Maximum extinction angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::CurrentFlow maxIdc; /* The maximum direct current (Id) on the DC side at which the converter should operate. Converter configuration data use in power flow. Default: nullptr */ + CIMPP::AngleDegrees minAlpha; /* Minimum firing angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::AngleDegrees minGamma; /* Minimum extinction angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::CurrentFlow minIdc; /* The minimum direct current (Id) on the DC side at which the converter should operate. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::CsOperatingModeKind operatingMode; /* Indicates whether the DC pole is operating as an inverter or as a rectifier. CSC control variable used in power flow. Default: 0 */ + CIMPP::CsPpccControlKind pPccControl; /* Default: 0 */ + CIMPP::CurrentFlow ratedIdc; /* Rated converter DC current, also called IdN. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::AngleDegrees targetAlpha; /* Target firing angle. CSC control variable used in power flow. Default: nullptr */ + CIMPP::AngleDegrees targetGamma; /* Target extinction angle. CSC control variable used in power flow. Default: nullptr */ + CIMPP::CurrentFlow targetIdc; /* DC current target value. CSC control variable used in power flow. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CsConverter_factory(); diff --git a/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.cpp b/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.cpp index a5c91bcad..61074c399 100644 --- a/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.cpp +++ b/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CsOperatingModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::CsOperatingModeKind& rop) +CsOperatingModeKind& CsOperatingModeKind::operator=(CsOperatingModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +CsOperatingModeKind::operator CsOperatingModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char CsOperatingModeKind::debugName[] = "CsOperatingModeKind"; +const char* CsOperatingModeKind::debugString() const +{ + return CsOperatingModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CsOperatingModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const CsOperatingModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == CsOperatingModeKind::inverter) + { + EnumSymbol = "inverter"; + } + if (obj.value == CsOperatingModeKind::rectifier) + { + EnumSymbol = "rectifier"; + } + + if (!EnumSymbol.empty()) + { + os << "CsOperatingModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.hpp b/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.hpp index bd6a1f51d..eb2af30bf 100644 --- a/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.hpp +++ b/CGMES_2.4.15_16FEB2016/CsOperatingModeKind.hpp @@ -1,21 +1,46 @@ #ifndef CsOperatingModeKind_H #define CsOperatingModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Operating mode for HVDC line operating as Current Source Converter. */ - enum class CsOperatingModeKind + class CsOperatingModeKind { - /** - * Operating as inverter - */ - inverter, - /** - * Operating as rectifier. - */ - rectifier, + public: + enum CsOperatingModeKind_ENUM + { + /** + * Operating as inverter + */ + inverter, + /** + * Operating as rectifier. + */ + rectifier, + }; + + CsOperatingModeKind() : value(), initialized(false) {} + CsOperatingModeKind(CsOperatingModeKind_ENUM value) : value(value), initialized(true) {} + + CsOperatingModeKind& operator=(CsOperatingModeKind_ENUM rop); + operator CsOperatingModeKind_ENUM() const; + + CsOperatingModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, CsOperatingModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const CsOperatingModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::CsOperatingModeKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/CsPpccControlKind.cpp b/CGMES_2.4.15_16FEB2016/CsPpccControlKind.cpp index 7dab2997c..e4e9aa9b2 100644 --- a/CGMES_2.4.15_16FEB2016/CsPpccControlKind.cpp +++ b/CGMES_2.4.15_16FEB2016/CsPpccControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CsPpccControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::CsPpccControlKind& rop) +CsPpccControlKind& CsPpccControlKind::operator=(CsPpccControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +CsPpccControlKind::operator CsPpccControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char CsPpccControlKind::debugName[] = "CsPpccControlKind"; +const char* CsPpccControlKind::debugString() const +{ + return CsPpccControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CsPpccControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const CsPpccControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == CsPpccControlKind::activePower) + { + EnumSymbol = "activePower"; + } + if (obj.value == CsPpccControlKind::dcVoltage) + { + EnumSymbol = "dcVoltage"; + } + if (obj.value == CsPpccControlKind::dcCurrent) + { + EnumSymbol = "dcCurrent"; + } + + if (!EnumSymbol.empty()) + { + os << "CsPpccControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CsPpccControlKind.hpp b/CGMES_2.4.15_16FEB2016/CsPpccControlKind.hpp index 049a5127f..3c17709fb 100644 --- a/CGMES_2.4.15_16FEB2016/CsPpccControlKind.hpp +++ b/CGMES_2.4.15_16FEB2016/CsPpccControlKind.hpp @@ -1,25 +1,50 @@ #ifndef CsPpccControlKind_H #define CsPpccControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Active power control modes for HVDC line operating as Current Source Converter. */ - enum class CsPpccControlKind + class CsPpccControlKind { - /** - * Active power control at AC side. - */ - activePower, - /** - * DC voltage control. - */ - dcVoltage, - /** - * DC current control - */ - dcCurrent, + public: + enum CsPpccControlKind_ENUM + { + /** + * Active power control at AC side. + */ + activePower, + /** + * DC voltage control. + */ + dcVoltage, + /** + * DC current control + */ + dcCurrent, + }; + + CsPpccControlKind() : value(), initialized(false) {} + CsPpccControlKind(CsPpccControlKind_ENUM value) : value(value), initialized(true) {} + + CsPpccControlKind& operator=(CsPpccControlKind_ENUM rop); + operator CsPpccControlKind_ENUM() const; + + CsPpccControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, CsPpccControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const CsPpccControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::CsPpccControlKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/Currency.cpp b/CGMES_2.4.15_16FEB2016/Currency.cpp index 360e9e694..0a4518071 100644 --- a/CGMES_2.4.15_16FEB2016/Currency.cpp +++ b/CGMES_2.4.15_16FEB2016/Currency.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Currency.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::Currency& rop) +Currency& Currency::operator=(Currency_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +Currency::operator Currency_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Currency::debugName[] = "Currency"; +const char* Currency::debugString() const +{ + return Currency::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Currency& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -93,5 +124,75 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const Currency& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == Currency::USD) + { + EnumSymbol = "USD"; + } + if (obj.value == Currency::EUR) + { + EnumSymbol = "EUR"; + } + if (obj.value == Currency::AUD) + { + EnumSymbol = "AUD"; + } + if (obj.value == Currency::CAD) + { + EnumSymbol = "CAD"; + } + if (obj.value == Currency::CHF) + { + EnumSymbol = "CHF"; + } + if (obj.value == Currency::CNY) + { + EnumSymbol = "CNY"; + } + if (obj.value == Currency::DKK) + { + EnumSymbol = "DKK"; + } + if (obj.value == Currency::GBP) + { + EnumSymbol = "GBP"; + } + if (obj.value == Currency::JPY) + { + EnumSymbol = "JPY"; + } + if (obj.value == Currency::NOK) + { + EnumSymbol = "NOK"; + } + if (obj.value == Currency::RUR) + { + EnumSymbol = "RUR"; + } + if (obj.value == Currency::SEK) + { + EnumSymbol = "SEK"; + } + if (obj.value == Currency::INR) + { + EnumSymbol = "INR"; + } + if (obj.value == Currency::other) + { + EnumSymbol = "other"; + } + + if (!EnumSymbol.empty()) + { + os << "Currency." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Currency.hpp b/CGMES_2.4.15_16FEB2016/Currency.hpp index 552514a04..f4de85751 100644 --- a/CGMES_2.4.15_16FEB2016/Currency.hpp +++ b/CGMES_2.4.15_16FEB2016/Currency.hpp @@ -1,69 +1,94 @@ #ifndef Currency_H #define Currency_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Monetary currencies. Apologies for this list not being exhaustive. */ - enum class Currency + class Currency { - /** - * US dollar - */ - USD, - /** - * European euro - */ - EUR, - /** - * Australian dollar - */ - AUD, - /** - * Canadian dollar - */ - CAD, - /** - * Swiss francs - */ - CHF, - /** - * Chinese yuan renminbi - */ - CNY, - /** - * Danish crown - */ - DKK, - /** - * British pound - */ - GBP, - /** - * Japanese yen - */ - JPY, - /** - * Norwegian crown - */ - NOK, - /** - * Russian ruble - */ - RUR, - /** - * Swedish crown - */ - SEK, - /** - * India rupees - */ - INR, - /** - * Another type of currency. - */ - other, + public: + enum Currency_ENUM + { + /** + * US dollar + */ + USD, + /** + * European euro + */ + EUR, + /** + * Australian dollar + */ + AUD, + /** + * Canadian dollar + */ + CAD, + /** + * Swiss francs + */ + CHF, + /** + * Chinese yuan renminbi + */ + CNY, + /** + * Danish crown + */ + DKK, + /** + * British pound + */ + GBP, + /** + * Japanese yen + */ + JPY, + /** + * Norwegian crown + */ + NOK, + /** + * Russian ruble + */ + RUR, + /** + * Swedish crown + */ + SEK, + /** + * India rupees + */ + INR, + /** + * Another type of currency. + */ + other, + }; + + Currency() : value(), initialized(false) {} + Currency(Currency_ENUM value) : value(value), initialized(true) {} + + Currency& operator=(Currency_ENUM rop); + operator Currency_ENUM() const; + + Currency_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Currency& rop); + friend std::ostream& operator<<(std::ostream& os, const Currency& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::Currency& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/CurrentFlow.cpp b/CGMES_2.4.15_16FEB2016/CurrentFlow.cpp index 9a05de0c9..56f73af6e 100644 --- a/CGMES_2.4.15_16FEB2016/CurrentFlow.cpp +++ b/CGMES_2.4.15_16FEB2016/CurrentFlow.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurrentFlow.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -CurrentFlow::CurrentFlow() {} -CurrentFlow::~CurrentFlow(){} +#include -CurrentFlow::CurrentFlow(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void CurrentFlow::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void CurrentFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +CurrentFlow& CurrentFlow::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void CurrentFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +CurrentFlow::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char CurrentFlow::debugName[] = "CurrentFlow"; -const char* CurrentFlow::debugString() { +const char* CurrentFlow::debugString() const +{ return CurrentFlow::debugName; } - -const BaseClassDefiner CurrentFlow::declare() { - return BaseClassDefiner(CurrentFlow::addConstructToMap, CurrentFlow::addPrimitiveAssignFnsToMap, CurrentFlow::addClassAssignFnsToMap, CurrentFlow::debugName); +CurrentFlow& CurrentFlow::operator+=(const CurrentFlow& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - CurrentFlow& CurrentFlow::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - CurrentFlow& CurrentFlow::operator-=(const CurrentFlow& rhs) { - value -= rhs.value; - return *this; - } - - CurrentFlow& CurrentFlow::operator*=(const CurrentFlow& rhs) { - value *= rhs.value; - return *this; - } - - CurrentFlow& CurrentFlow::operator/=(const CurrentFlow& rhs) { - value /= rhs.value; - return *this; - } +CurrentFlow& CurrentFlow::operator-=(const CurrentFlow& rhs) +{ + value -= rhs.value; + return *this; +} - CurrentFlow& CurrentFlow::operator+=(const CurrentFlow& rhs) { - value += rhs.value; - return *this; - } +CurrentFlow& CurrentFlow::operator*=(const CurrentFlow& rhs) +{ + value *= rhs.value; + return *this; +} - CurrentFlow::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +CurrentFlow& CurrentFlow::operator/=(const CurrentFlow& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, CurrentFlow& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CurrentFlow& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const CurrentFlow& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/CurrentFlow.hpp b/CGMES_2.4.15_16FEB2016/CurrentFlow.hpp index 72b277753..0f38f0f07 100644 --- a/CGMES_2.4.15_16FEB2016/CurrentFlow.hpp +++ b/CGMES_2.4.15_16FEB2016/CurrentFlow.hpp @@ -1,38 +1,39 @@ #ifndef CurrentFlow_H #define CurrentFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class CurrentFlow : public BaseClass + /* + Electrical current with sign convention: positive flow is out of the conducting equipment into the connectivity node. Can be both AC and DC. + */ + class CurrentFlow { - public: - CurrentFlow(); - virtual ~CurrentFlow(); - CurrentFlow(long double value); - static const BaseClassDefiner declare(); - CurrentFlow& operator=(long double &rop); + CurrentFlow() : value(0.0), initialized(false) {} + CurrentFlow(long double value) : value(value), initialized(true) {} + + CurrentFlow& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + CurrentFlow& operator+=(const CurrentFlow& rhs); CurrentFlow& operator-=(const CurrentFlow& rhs); CurrentFlow& operator*=(const CurrentFlow& rhs); CurrentFlow& operator/=(const CurrentFlow& rhs); + friend std::istream& operator>>(std::istream& lop, CurrentFlow& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const CurrentFlow& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/CurrentLimit.cpp b/CGMES_2.4.15_16FEB2016/CurrentLimit.cpp index 684b7a490..5572e0f4c 100644 --- a/CGMES_2.4.15_16FEB2016/CurrentLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/CurrentLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurrentLimit.hpp" +#include +#include + #include "CurrentFlow.hpp" using namespace CIMPP; CurrentLimit::CurrentLimit() {}; - CurrentLimit::~CurrentLimit() {}; +bool assign_CurrentLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurrentLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_CurrentLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurrentLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* CurrentLimit_factory() { - return new CurrentLimit; - } +const char CurrentLimit::debugName[] = "CurrentLimit"; +const char* CurrentLimit::debugString() const +{ + return CurrentLimit::debugName; } -void CurrentLimit::addConstructToMap(std::unordered_map& factory_map) { +void CurrentLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CurrentLimit"), &CurrentLimit_factory)); } -void CurrentLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CurrentLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:CurrentLimit.value"), &assign_CurrentLimit_value)); } -void CurrentLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char CurrentLimit::debugName[] = "CurrentLimit"; -const char* CurrentLimit::debugString() +void CurrentLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CurrentLimit::debugName; } const BaseClassDefiner CurrentLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner CurrentLimit::declare() return BaseClassDefiner(CurrentLimit::addConstructToMap, CurrentLimit::addPrimitiveAssignFnsToMap, CurrentLimit::addClassAssignFnsToMap, CurrentLimit::debugName); } - +namespace CIMPP +{ + BaseClass* CurrentLimit_factory() + { + return new CurrentLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CurrentLimit.hpp b/CGMES_2.4.15_16FEB2016/CurrentLimit.hpp index a6b1f55e0..2b608fa40 100644 --- a/CGMES_2.4.15_16FEB2016/CurrentLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/CurrentLimit.hpp @@ -1,38 +1,39 @@ #ifndef CurrentLimit_H #define CurrentLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Operational limit on current. */ - class CurrentLimit: public OperationalLimit + class CurrentLimit : public OperationalLimit { - public: - CIMPP::CurrentFlow value; /* Limit on current flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CurrentLimit(); - virtual ~CurrentLimit(); - + ~CurrentLimit() override; + + CIMPP::CurrentFlow value; /* Limit on current flow. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CurrentLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Curve.cpp b/CGMES_2.4.15_16FEB2016/Curve.cpp index d5f3fdc24..e25ece428 100644 --- a/CGMES_2.4.15_16FEB2016/Curve.cpp +++ b/CGMES_2.4.15_16FEB2016/Curve.cpp @@ -1,109 +1,120 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Curve.hpp" +#include +#include + +#include "CurveData.hpp" #include "CurveStyle.hpp" #include "UnitSymbol.hpp" #include "UnitSymbol.hpp" #include "UnitSymbol.hpp" -#include "CurveData.hpp" using namespace CIMPP; Curve::Curve() {}; - Curve::~Curve() {}; +bool assign_Curve_curveStyle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->curveStyle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Curve_xUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xUnit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Curve_y1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y1Unit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Curve_CurveDatas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->CurveDatas.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Curve_y2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y2Unit; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Curve_curveStyle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->curveStyle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_CurveData_Curve(BaseClass*, BaseClass*); +bool assign_Curve_CurveDatas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Curve* element = dynamic_cast(BaseClass_ptr1); + CurveData* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->CurveDatas.begin(), element->CurveDatas.end(), element2) == element->CurveDatas.end()) + { + element->CurveDatas.push_back(element2); + return assign_CurveData_Curve(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Curve_xUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Curve_y1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y1Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Curve_y2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y2Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Curve_factory() { - return new Curve; - } +const char Curve::debugName[] = "Curve"; +const char* Curve::debugString() const +{ + return Curve::debugName; } -void Curve::addConstructToMap(std::unordered_map& factory_map) { +void Curve::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Curve"), &Curve_factory)); } -void Curve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Curve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Curve.curveStyle"), &assign_Curve_curveStyle)); assign_map.insert(std::make_pair(std::string("cim:Curve.xUnit"), &assign_Curve_xUnit)); assign_map.insert(std::make_pair(std::string("cim:Curve.y1Unit"), &assign_Curve_y1Unit)); assign_map.insert(std::make_pair(std::string("cim:Curve.y2Unit"), &assign_Curve_y2Unit)); - } - -void Curve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Curve.CurveDatas"), &assign_Curve_CurveDatas)); } -const char Curve::debugName[] = "Curve"; -const char* Curve::debugString() +void Curve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Curve::debugName; + assign_map.insert(std::make_pair(std::string("cim:Curve.CurveDatas"), &assign_Curve_CurveDatas)); } const BaseClassDefiner Curve::declare() @@ -111,4 +122,10 @@ const BaseClassDefiner Curve::declare() return BaseClassDefiner(Curve::addConstructToMap, Curve::addPrimitiveAssignFnsToMap, Curve::addClassAssignFnsToMap, Curve::debugName); } - +namespace CIMPP +{ + BaseClass* Curve_factory() + { + return new Curve; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Curve.hpp b/CGMES_2.4.15_16FEB2016/Curve.hpp index b305bb602..5a634c3df 100644 --- a/CGMES_2.4.15_16FEB2016/Curve.hpp +++ b/CGMES_2.4.15_16FEB2016/Curve.hpp @@ -1,44 +1,45 @@ #ifndef Curve_H #define Curve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "CurveStyle.hpp" #include "UnitSymbol.hpp" -namespace CIMPP { +namespace CIMPP +{ + class CurveData; - -class CurveData; /* A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables. */ - class Curve: public IdentifiedObject + class Curve : public IdentifiedObject { - public: - CIMPP::CurveStyle curveStyle; /* The style or shape of the curve. Default: 0 */ - CIMPP::UnitSymbol xUnit; /* The X-axis units of measure. Default: 0 */ - CIMPP::UnitSymbol y1Unit; /* The Y1-axis units of measure. Default: 0 */ - CIMPP::UnitSymbol y2Unit; /* The Y2-axis units of measure. Default: 0 */ - std::list CurveDatas; /* The curve of this curve data point. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Curve(); - virtual ~Curve(); - + ~Curve() override; + + std::list CurveDatas; /* The curve of this curve data point. Default: 0 */ + CIMPP::CurveStyle curveStyle; /* The style or shape of the curve. Default: 0 */ + CIMPP::UnitSymbol xUnit; /* The X-axis units of measure. Default: 0 */ + CIMPP::UnitSymbol y1Unit; /* The Y1-axis units of measure. Default: 0 */ + CIMPP::UnitSymbol y2Unit; /* The Y2-axis units of measure. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Curve_factory(); diff --git a/CGMES_2.4.15_16FEB2016/CurveData.cpp b/CGMES_2.4.15_16FEB2016/CurveData.cpp index a93217d04..85447066e 100644 --- a/CGMES_2.4.15_16FEB2016/CurveData.cpp +++ b/CGMES_2.4.15_16FEB2016/CurveData.cpp @@ -1,94 +1,104 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurveData.hpp" +#include +#include + +#include "Curve.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Curve.hpp" using namespace CIMPP; -CurveData::CurveData(): Curve(nullptr) {}; - +CurveData::CurveData() : Curve(nullptr) {}; CurveData::~CurveData() {}; +bool assign_CurveData_xvalue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurveData* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xvalue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CurveData_y1value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurveData* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y1value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Curve_CurveDatas(BaseClass*, BaseClass*); -bool assign_CurveData_Curve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - element->Curve = dynamic_cast(BaseClass_ptr2); - if(element->Curve != nullptr) - return assign_Curve_CurveDatas(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_CurveData_y2value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurveData* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y2value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_CurveData_xvalue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xvalue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Curve_CurveDatas(BaseClass*, BaseClass*); +bool assign_CurveData_Curve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + CurveData* element = dynamic_cast(BaseClass_ptr1); + Curve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Curve != element2) + { + element->Curve = element2; + return assign_Curve_CurveDatas(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_CurveData_y1value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y1value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CurveData_y2value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y2value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* CurveData_factory() { - return new CurveData; - } +const char CurveData::debugName[] = "CurveData"; +const char* CurveData::debugString() const +{ + return CurveData::debugName; } -void CurveData::addConstructToMap(std::unordered_map& factory_map) { +void CurveData::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CurveData"), &CurveData_factory)); } -void CurveData::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CurveData::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:CurveData.xvalue"), &assign_CurveData_xvalue)); assign_map.insert(std::make_pair(std::string("cim:CurveData.y1value"), &assign_CurveData_y1value)); assign_map.insert(std::make_pair(std::string("cim:CurveData.y2value"), &assign_CurveData_y2value)); - } - -void CurveData::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CurveData.Curve"), &assign_CurveData_Curve)); } -const char CurveData::debugName[] = "CurveData"; -const char* CurveData::debugString() +void CurveData::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CurveData::debugName; + assign_map.insert(std::make_pair(std::string("cim:CurveData.Curve"), &assign_CurveData_Curve)); } const BaseClassDefiner CurveData::declare() @@ -96,4 +106,10 @@ const BaseClassDefiner CurveData::declare() return BaseClassDefiner(CurveData::addConstructToMap, CurveData::addPrimitiveAssignFnsToMap, CurveData::addClassAssignFnsToMap, CurveData::debugName); } - +namespace CIMPP +{ + BaseClass* CurveData_factory() + { + return new CurveData; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CurveData.hpp b/CGMES_2.4.15_16FEB2016/CurveData.hpp index d98d46d34..d728a8062 100644 --- a/CGMES_2.4.15_16FEB2016/CurveData.hpp +++ b/CGMES_2.4.15_16FEB2016/CurveData.hpp @@ -1,42 +1,43 @@ #ifndef CurveData_H #define CurveData_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Curve; - -class Curve; /* Multi-purpose data points for defining a curve. The use of this generic class is discouraged if a more specific class can be used to specify the x and y axis values along with their specific data types. */ - class CurveData: public BaseClass + class CurveData : public BaseClass { - public: - CIMPP::Simple_Float xvalue; /* The data value of the X-axis variable, depending on the X-axis units. Default: nullptr */ - CIMPP::Simple_Float y1value; /* The data value of the first Y-axis variable, depending on the Y-axis units. Default: nullptr */ - CIMPP::Simple_Float y2value; /* The data value of the second Y-axis variable (if present), depending on the Y-axis units. Default: nullptr */ - CIMPP::Curve* Curve; /* The point data values that define this curve. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CurveData(); - virtual ~CurveData(); - + ~CurveData() override; + + CIMPP::Curve* Curve; /* The point data values that define this curve. Default: 0 */ + CIMPP::Simple_Float xvalue; /* The data value of the X-axis variable, depending on the X-axis units. Default: nullptr */ + CIMPP::Simple_Float y1value; /* The data value of the first Y-axis variable, depending on the Y-axis units. Default: nullptr */ + CIMPP::Simple_Float y2value; /* The data value of the second Y-axis variable (if present), depending on the Y-axis units. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CurveData_factory(); diff --git a/CGMES_2.4.15_16FEB2016/CurveStyle.cpp b/CGMES_2.4.15_16FEB2016/CurveStyle.cpp index b53fe27a8..d28696151 100644 --- a/CGMES_2.4.15_16FEB2016/CurveStyle.cpp +++ b/CGMES_2.4.15_16FEB2016/CurveStyle.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurveStyle.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::CurveStyle& rop) +CurveStyle& CurveStyle::operator=(CurveStyle_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +CurveStyle::operator CurveStyle_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char CurveStyle::debugName[] = "CurveStyle"; +const char* CurveStyle::debugString() const +{ + return CurveStyle::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CurveStyle& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const CurveStyle& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == CurveStyle::constantYValue) + { + EnumSymbol = "constantYValue"; + } + if (obj.value == CurveStyle::straightLineYValues) + { + EnumSymbol = "straightLineYValues"; + } + + if (!EnumSymbol.empty()) + { + os << "CurveStyle." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/CurveStyle.hpp b/CGMES_2.4.15_16FEB2016/CurveStyle.hpp index 81789d1d0..72f95568c 100644 --- a/CGMES_2.4.15_16FEB2016/CurveStyle.hpp +++ b/CGMES_2.4.15_16FEB2016/CurveStyle.hpp @@ -1,21 +1,46 @@ #ifndef CurveStyle_H #define CurveStyle_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Style or shape of curve. */ - enum class CurveStyle + class CurveStyle { - /** - * The Y-axis values are assumed constant until the next curve point and prior to the first curve point. - */ - constantYValue, - /** - * The Y-axis values are assumed to be a straight line between values. Also known as linear interpolation. - */ - straightLineYValues, + public: + enum CurveStyle_ENUM + { + /** + * The Y-axis values are assumed constant until the next curve point and prior to the first curve point. + */ + constantYValue, + /** + * The Y-axis values are assumed to be a straight line between values. Also known as linear interpolation. + */ + straightLineYValues, + }; + + CurveStyle() : value(), initialized(false) {} + CurveStyle(CurveStyle_ENUM value) : value(value), initialized(true) {} + + CurveStyle& operator=(CurveStyle_ENUM rop); + operator CurveStyle_ENUM() const; + + CurveStyle_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, CurveStyle& rop); + friend std::ostream& operator<<(std::ostream& os, const CurveStyle& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::CurveStyle& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/DCBaseTerminal.cpp b/CGMES_2.4.15_16FEB2016/DCBaseTerminal.cpp index 5869dcb56..9f9ea9862 100644 --- a/CGMES_2.4.15_16FEB2016/DCBaseTerminal.cpp +++ b/CGMES_2.4.15_16FEB2016/DCBaseTerminal.cpp @@ -1,62 +1,76 @@ -#include -#include "ACDCTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCBaseTerminal.hpp" +#include +#include + #include "DCNode.hpp" #include "DCTopologicalNode.hpp" using namespace CIMPP; -DCBaseTerminal::DCBaseTerminal(): DCNode(nullptr), DCTopologicalNode(nullptr) {}; - +DCBaseTerminal::DCBaseTerminal() : DCNode(nullptr), DCTopologicalNode(nullptr) {}; DCBaseTerminal::~DCBaseTerminal() {}; + + + bool assign_DCNode_DCTerminals(BaseClass*, BaseClass*); -bool assign_DCBaseTerminal_DCNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCNode = dynamic_cast(BaseClass_ptr2); - if(element->DCNode != nullptr) - return assign_DCNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCBaseTerminal_DCNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1); + DCNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCNode != element2) + { + element->DCNode = element2; + return assign_DCNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_DCTopologicalNode_DCTerminals(BaseClass*, BaseClass*); -bool assign_DCBaseTerminal_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCTopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->DCTopologicalNode != nullptr) - return assign_DCTopologicalNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCBaseTerminal_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCTopologicalNode != element2) + { + element->DCTopologicalNode = element2; + return assign_DCTopologicalNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* DCBaseTerminal_factory() { - return new DCBaseTerminal; - } +const char DCBaseTerminal::debugName[] = "DCBaseTerminal"; +const char* DCBaseTerminal::debugString() const +{ + return DCBaseTerminal::debugName; } -void DCBaseTerminal::addConstructToMap(std::unordered_map& factory_map) { +void DCBaseTerminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCBaseTerminal"), &DCBaseTerminal_factory)); } -void DCBaseTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCBaseTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCNode"), &assign_DCBaseTerminal_DCNode)); - assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCTopologicalNode"), &assign_DCBaseTerminal_DCTopologicalNode)); +void DCBaseTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCBaseTerminal::debugName[] = "DCBaseTerminal"; -const char* DCBaseTerminal::debugString() +void DCBaseTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCBaseTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCNode"), &assign_DCBaseTerminal_DCNode)); + assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCTopologicalNode"), &assign_DCBaseTerminal_DCTopologicalNode)); } const BaseClassDefiner DCBaseTerminal::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner DCBaseTerminal::declare() return BaseClassDefiner(DCBaseTerminal::addConstructToMap, DCBaseTerminal::addPrimitiveAssignFnsToMap, DCBaseTerminal::addClassAssignFnsToMap, DCBaseTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* DCBaseTerminal_factory() + { + return new DCBaseTerminal; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCBaseTerminal.hpp b/CGMES_2.4.15_16FEB2016/DCBaseTerminal.hpp index f5592438c..b46fc2e82 100644 --- a/CGMES_2.4.15_16FEB2016/DCBaseTerminal.hpp +++ b/CGMES_2.4.15_16FEB2016/DCBaseTerminal.hpp @@ -1,40 +1,41 @@ #ifndef DCBaseTerminal_H #define DCBaseTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ACDCTerminal.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCNode; + class DCTopologicalNode; -class DCNode; -class DCTopologicalNode; /* An electrical connection point at a piece of DC conducting equipment. DC terminals are connected at one physical DC node that may have multiple DC terminals connected. A DC node is similar to an AC connectivity node. The model enforces that DC connections are distinct from AC connections. */ - class DCBaseTerminal: public ACDCTerminal + class DCBaseTerminal : public ACDCTerminal { - public: - CIMPP::DCNode* DCNode; /* Default: 0 */ - CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.Terminal. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCBaseTerminal(); - virtual ~DCBaseTerminal(); - + ~DCBaseTerminal() override; + + CIMPP::DCNode* DCNode; /* Default: 0 */ + CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.Terminal. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCBaseTerminal_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCBreaker.cpp b/CGMES_2.4.15_16FEB2016/DCBreaker.cpp index 67c2f58d0..c862f40e9 100644 --- a/CGMES_2.4.15_16FEB2016/DCBreaker.cpp +++ b/CGMES_2.4.15_16FEB2016/DCBreaker.cpp @@ -1,36 +1,36 @@ -#include -#include "DCSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCBreaker.hpp" +#include +#include + using namespace CIMPP; DCBreaker::DCBreaker() {}; - DCBreaker::~DCBreaker() {}; -namespace CIMPP { - BaseClass* DCBreaker_factory() { - return new DCBreaker; - } +const char DCBreaker::debugName[] = "DCBreaker"; +const char* DCBreaker::debugString() const +{ + return DCBreaker::debugName; } -void DCBreaker::addConstructToMap(std::unordered_map& factory_map) { +void DCBreaker::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCBreaker"), &DCBreaker_factory)); } -void DCBreaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCBreaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCBreaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCBreaker::debugName[] = "DCBreaker"; -const char* DCBreaker::debugString() +void DCBreaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCBreaker::debugName; } const BaseClassDefiner DCBreaker::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCBreaker::declare() return BaseClassDefiner(DCBreaker::addConstructToMap, DCBreaker::addPrimitiveAssignFnsToMap, DCBreaker::addClassAssignFnsToMap, DCBreaker::debugName); } - +namespace CIMPP +{ + BaseClass* DCBreaker_factory() + { + return new DCBreaker; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCBreaker.hpp b/CGMES_2.4.15_16FEB2016/DCBreaker.hpp index 9881bced3..a360a1425 100644 --- a/CGMES_2.4.15_16FEB2016/DCBreaker.hpp +++ b/CGMES_2.4.15_16FEB2016/DCBreaker.hpp @@ -1,36 +1,37 @@ #ifndef DCBreaker_H #define DCBreaker_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A breaker within a DC system. */ - class DCBreaker: public DCSwitch + class DCBreaker : public DCSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCBreaker(); - virtual ~DCBreaker(); - + ~DCBreaker() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCBreaker_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCBusbar.cpp b/CGMES_2.4.15_16FEB2016/DCBusbar.cpp index 86b7bec9e..587b722fb 100644 --- a/CGMES_2.4.15_16FEB2016/DCBusbar.cpp +++ b/CGMES_2.4.15_16FEB2016/DCBusbar.cpp @@ -1,36 +1,36 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCBusbar.hpp" +#include +#include + using namespace CIMPP; DCBusbar::DCBusbar() {}; - DCBusbar::~DCBusbar() {}; -namespace CIMPP { - BaseClass* DCBusbar_factory() { - return new DCBusbar; - } +const char DCBusbar::debugName[] = "DCBusbar"; +const char* DCBusbar::debugString() const +{ + return DCBusbar::debugName; } -void DCBusbar::addConstructToMap(std::unordered_map& factory_map) { +void DCBusbar::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCBusbar"), &DCBusbar_factory)); } -void DCBusbar::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCBusbar::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCBusbar::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCBusbar::debugName[] = "DCBusbar"; -const char* DCBusbar::debugString() +void DCBusbar::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCBusbar::debugName; } const BaseClassDefiner DCBusbar::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCBusbar::declare() return BaseClassDefiner(DCBusbar::addConstructToMap, DCBusbar::addPrimitiveAssignFnsToMap, DCBusbar::addClassAssignFnsToMap, DCBusbar::debugName); } - +namespace CIMPP +{ + BaseClass* DCBusbar_factory() + { + return new DCBusbar; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCBusbar.hpp b/CGMES_2.4.15_16FEB2016/DCBusbar.hpp index ed35a82ca..4e9f6c039 100644 --- a/CGMES_2.4.15_16FEB2016/DCBusbar.hpp +++ b/CGMES_2.4.15_16FEB2016/DCBusbar.hpp @@ -1,36 +1,37 @@ #ifndef DCBusbar_H #define DCBusbar_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A busbar within a DC system. */ - class DCBusbar: public DCConductingEquipment + class DCBusbar : public DCConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCBusbar(); - virtual ~DCBusbar(); - + ~DCBusbar() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCBusbar_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCChopper.cpp b/CGMES_2.4.15_16FEB2016/DCChopper.cpp index 1dd84a7f0..f196636fd 100644 --- a/CGMES_2.4.15_16FEB2016/DCChopper.cpp +++ b/CGMES_2.4.15_16FEB2016/DCChopper.cpp @@ -1,36 +1,36 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCChopper.hpp" +#include +#include + using namespace CIMPP; DCChopper::DCChopper() {}; - DCChopper::~DCChopper() {}; -namespace CIMPP { - BaseClass* DCChopper_factory() { - return new DCChopper; - } +const char DCChopper::debugName[] = "DCChopper"; +const char* DCChopper::debugString() const +{ + return DCChopper::debugName; } -void DCChopper::addConstructToMap(std::unordered_map& factory_map) { +void DCChopper::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCChopper"), &DCChopper_factory)); } -void DCChopper::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCChopper::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCChopper::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCChopper::debugName[] = "DCChopper"; -const char* DCChopper::debugString() +void DCChopper::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCChopper::debugName; } const BaseClassDefiner DCChopper::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCChopper::declare() return BaseClassDefiner(DCChopper::addConstructToMap, DCChopper::addPrimitiveAssignFnsToMap, DCChopper::addClassAssignFnsToMap, DCChopper::debugName); } - +namespace CIMPP +{ + BaseClass* DCChopper_factory() + { + return new DCChopper; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCChopper.hpp b/CGMES_2.4.15_16FEB2016/DCChopper.hpp index 4d0e8b710..674d2c2db 100644 --- a/CGMES_2.4.15_16FEB2016/DCChopper.hpp +++ b/CGMES_2.4.15_16FEB2016/DCChopper.hpp @@ -1,36 +1,37 @@ #ifndef DCChopper_H #define DCChopper_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Low resistance equipment used in the internal DC circuit to balance voltages. It has typically positive and negative pole terminals and a ground. */ - class DCChopper: public DCConductingEquipment + class DCChopper : public DCConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCChopper(); - virtual ~DCChopper(); - + ~DCChopper() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCChopper_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCConductingEquipment.cpp b/CGMES_2.4.15_16FEB2016/DCConductingEquipment.cpp index 81adcb3a5..30cbbdd8e 100644 --- a/CGMES_2.4.15_16FEB2016/DCConductingEquipment.cpp +++ b/CGMES_2.4.15_16FEB2016/DCConductingEquipment.cpp @@ -1,49 +1,56 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCConductingEquipment.hpp" +#include +#include + #include "DCTerminal.hpp" using namespace CIMPP; DCConductingEquipment::DCConductingEquipment() {}; - DCConductingEquipment::~DCConductingEquipment() {}; -bool assign_DCConductingEquipment_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_DCTerminal_DCConductingEquipment(BaseClass*, BaseClass*); +bool assign_DCConductingEquipment_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + DCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_DCTerminal_DCConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DCConductingEquipment_factory() { - return new DCConductingEquipment; - } +const char DCConductingEquipment::debugName[] = "DCConductingEquipment"; +const char* DCConductingEquipment::debugString() const +{ + return DCConductingEquipment::debugName; } -void DCConductingEquipment::addConstructToMap(std::unordered_map& factory_map) { +void DCConductingEquipment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCConductingEquipment"), &DCConductingEquipment_factory)); } -void DCConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCConductingEquipment.DCTerminals"), &assign_DCConductingEquipment_DCTerminals)); +void DCConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCConductingEquipment::debugName[] = "DCConductingEquipment"; -const char* DCConductingEquipment::debugString() +void DCConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCConductingEquipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCConductingEquipment.DCTerminals"), &assign_DCConductingEquipment_DCTerminals)); } const BaseClassDefiner DCConductingEquipment::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCConductingEquipment::declare() return BaseClassDefiner(DCConductingEquipment::addConstructToMap, DCConductingEquipment::addPrimitiveAssignFnsToMap, DCConductingEquipment::addClassAssignFnsToMap, DCConductingEquipment::debugName); } - +namespace CIMPP +{ + BaseClass* DCConductingEquipment_factory() + { + return new DCConductingEquipment; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCConductingEquipment.hpp b/CGMES_2.4.15_16FEB2016/DCConductingEquipment.hpp index 0d7485a42..e9c204a64 100644 --- a/CGMES_2.4.15_16FEB2016/DCConductingEquipment.hpp +++ b/CGMES_2.4.15_16FEB2016/DCConductingEquipment.hpp @@ -1,38 +1,39 @@ #ifndef DCConductingEquipment_H #define DCConductingEquipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCTerminal; -class DCTerminal; /* The parts of the DC power system that are designed to carry current or that are conductively connected through DC terminals. */ - class DCConductingEquipment: public Equipment + class DCConductingEquipment : public Equipment { - public: - std::list DCTerminals; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCConductingEquipment(); - virtual ~DCConductingEquipment(); - + ~DCConductingEquipment() override; + + std::list DCTerminals; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCConductingEquipment_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.cpp b/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.cpp index 65190ceed..723e4594e 100644 --- a/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.cpp +++ b/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCConverterOperatingModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::DCConverterOperatingModeKind& rop) +DCConverterOperatingModeKind& DCConverterOperatingModeKind::operator=(DCConverterOperatingModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +DCConverterOperatingModeKind::operator DCConverterOperatingModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char DCConverterOperatingModeKind::debugName[] = "DCConverterOperatingModeKind"; +const char* DCConverterOperatingModeKind::debugString() const +{ + return DCConverterOperatingModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, DCConverterOperatingModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const DCConverterOperatingModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == DCConverterOperatingModeKind::bipolar) + { + EnumSymbol = "bipolar"; + } + if (obj.value == DCConverterOperatingModeKind::monopolarMetallicReturn) + { + EnumSymbol = "monopolarMetallicReturn"; + } + if (obj.value == DCConverterOperatingModeKind::monopolarGroundReturn) + { + EnumSymbol = "monopolarGroundReturn"; + } + + if (!EnumSymbol.empty()) + { + os << "DCConverterOperatingModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.hpp b/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.hpp index 310b5f1a1..eb7c9c456 100644 --- a/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.hpp +++ b/CGMES_2.4.15_16FEB2016/DCConverterOperatingModeKind.hpp @@ -1,25 +1,50 @@ #ifndef DCConverterOperatingModeKind_H #define DCConverterOperatingModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The operating mode of an HVDC bipole. */ - enum class DCConverterOperatingModeKind + class DCConverterOperatingModeKind { - /** - * Bipolar operation. - */ - bipolar, - /** - * Monopolar operation with metallic return - */ - monopolarMetallicReturn, - /** - * Monopolar operation with ground return - */ - monopolarGroundReturn, + public: + enum DCConverterOperatingModeKind_ENUM + { + /** + * Bipolar operation. + */ + bipolar, + /** + * Monopolar operation with metallic return + */ + monopolarMetallicReturn, + /** + * Monopolar operation with ground return + */ + monopolarGroundReturn, + }; + + DCConverterOperatingModeKind() : value(), initialized(false) {} + DCConverterOperatingModeKind(DCConverterOperatingModeKind_ENUM value) : value(value), initialized(true) {} + + DCConverterOperatingModeKind& operator=(DCConverterOperatingModeKind_ENUM rop); + operator DCConverterOperatingModeKind_ENUM() const; + + DCConverterOperatingModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, DCConverterOperatingModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const DCConverterOperatingModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::DCConverterOperatingModeKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/DCConverterUnit.cpp b/CGMES_2.4.15_16FEB2016/DCConverterUnit.cpp index 96b619c55..737004e53 100644 --- a/CGMES_2.4.15_16FEB2016/DCConverterUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/DCConverterUnit.cpp @@ -1,64 +1,72 @@ -#include -#include "DCEquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCConverterUnit.hpp" -#include "DCConverterOperatingModeKind.hpp" +#include +#include + #include "Substation.hpp" +#include "DCConverterOperatingModeKind.hpp" using namespace CIMPP; -DCConverterUnit::DCConverterUnit(): Substation(nullptr) {}; - +DCConverterUnit::DCConverterUnit() : Substation(nullptr) {}; DCConverterUnit::~DCConverterUnit() {}; -bool assign_Substation_DCConverterUnit(BaseClass*, BaseClass*); -bool assign_DCConverterUnit_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCConverterUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->Substation = dynamic_cast(BaseClass_ptr2); - if(element->Substation != nullptr) - return assign_Substation_DCConverterUnit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCConverterUnit_operationMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCConverterUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operationMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_DCConverterUnit_operationMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCConverterUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operationMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Substation_DCConverterUnit(BaseClass*, BaseClass*); +bool assign_DCConverterUnit_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCConverterUnit* element = dynamic_cast(BaseClass_ptr1); + Substation* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Substation != element2) + { + element->Substation = element2; + return assign_Substation_DCConverterUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* DCConverterUnit_factory() { - return new DCConverterUnit; - } +const char DCConverterUnit::debugName[] = "DCConverterUnit"; +const char* DCConverterUnit::debugString() const +{ + return DCConverterUnit::debugName; } -void DCConverterUnit::addConstructToMap(std::unordered_map& factory_map) { +void DCConverterUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCConverterUnit"), &DCConverterUnit_factory)); } -void DCConverterUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCConverterUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCConverterUnit.operationMode"), &assign_DCConverterUnit_operationMode)); - } - -void DCConverterUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCConverterUnit.Substation"), &assign_DCConverterUnit_Substation)); } -const char DCConverterUnit::debugName[] = "DCConverterUnit"; -const char* DCConverterUnit::debugString() +void DCConverterUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCConverterUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCConverterUnit.Substation"), &assign_DCConverterUnit_Substation)); } const BaseClassDefiner DCConverterUnit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner DCConverterUnit::declare() return BaseClassDefiner(DCConverterUnit::addConstructToMap, DCConverterUnit::addPrimitiveAssignFnsToMap, DCConverterUnit::addClassAssignFnsToMap, DCConverterUnit::debugName); } - +namespace CIMPP +{ + BaseClass* DCConverterUnit_factory() + { + return new DCConverterUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCConverterUnit.hpp b/CGMES_2.4.15_16FEB2016/DCConverterUnit.hpp index 721c00ebf..642a2abbd 100644 --- a/CGMES_2.4.15_16FEB2016/DCConverterUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/DCConverterUnit.hpp @@ -1,40 +1,41 @@ #ifndef DCConverterUnit_H #define DCConverterUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCEquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCEquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" #include "DCConverterOperatingModeKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Substation; - -class Substation; /* Indivisible operative unit comprising all equipment between the point of common coupling on the AC side and the point of common coupling - DC side, essentially one or more converters, together with one or more converter transformers, converter control equipment, essential protective and switching devices and auxiliaries, if any, used for conversion. */ - class DCConverterUnit: public DCEquipmentContainer + class DCConverterUnit : public DCEquipmentContainer { - public: - CIMPP::DCConverterOperatingModeKind operationMode; /* Default: 0 */ - CIMPP::Substation* Substation; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCConverterUnit(); - virtual ~DCConverterUnit(); - + ~DCConverterUnit() override; + + CIMPP::Substation* Substation; /* Default: 0 */ + CIMPP::DCConverterOperatingModeKind operationMode; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCConverterUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCDisconnector.cpp b/CGMES_2.4.15_16FEB2016/DCDisconnector.cpp index 30f8ab4a5..9386681a3 100644 --- a/CGMES_2.4.15_16FEB2016/DCDisconnector.cpp +++ b/CGMES_2.4.15_16FEB2016/DCDisconnector.cpp @@ -1,36 +1,36 @@ -#include -#include "DCSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCDisconnector.hpp" +#include +#include + using namespace CIMPP; DCDisconnector::DCDisconnector() {}; - DCDisconnector::~DCDisconnector() {}; -namespace CIMPP { - BaseClass* DCDisconnector_factory() { - return new DCDisconnector; - } +const char DCDisconnector::debugName[] = "DCDisconnector"; +const char* DCDisconnector::debugString() const +{ + return DCDisconnector::debugName; } -void DCDisconnector::addConstructToMap(std::unordered_map& factory_map) { +void DCDisconnector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCDisconnector"), &DCDisconnector_factory)); } -void DCDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCDisconnector::debugName[] = "DCDisconnector"; -const char* DCDisconnector::debugString() +void DCDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCDisconnector::debugName; } const BaseClassDefiner DCDisconnector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCDisconnector::declare() return BaseClassDefiner(DCDisconnector::addConstructToMap, DCDisconnector::addPrimitiveAssignFnsToMap, DCDisconnector::addClassAssignFnsToMap, DCDisconnector::debugName); } - +namespace CIMPP +{ + BaseClass* DCDisconnector_factory() + { + return new DCDisconnector; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCDisconnector.hpp b/CGMES_2.4.15_16FEB2016/DCDisconnector.hpp index e713ad0b4..11f5da74c 100644 --- a/CGMES_2.4.15_16FEB2016/DCDisconnector.hpp +++ b/CGMES_2.4.15_16FEB2016/DCDisconnector.hpp @@ -1,36 +1,37 @@ #ifndef DCDisconnector_H #define DCDisconnector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A disconnector within a DC system. */ - class DCDisconnector: public DCSwitch + class DCDisconnector : public DCSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCDisconnector(); - virtual ~DCDisconnector(); - + ~DCDisconnector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCDisconnector_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.cpp b/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.cpp index 767ceaa5c..6fbe46186 100644 --- a/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.cpp +++ b/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.cpp @@ -1,62 +1,76 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCEquipmentContainer.hpp" +#include +#include + #include "DCNode.hpp" #include "DCTopologicalNode.hpp" using namespace CIMPP; DCEquipmentContainer::DCEquipmentContainer() {}; - DCEquipmentContainer::~DCEquipmentContainer() {}; -bool assign_DCEquipmentContainer_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_DCNode_DCEquipmentContainer(BaseClass*, BaseClass*); +bool assign_DCEquipmentContainer_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1); + DCNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCNodes.begin(), element->DCNodes.end(), element2) == element->DCNodes.end()) + { + element->DCNodes.push_back(element2); + return assign_DCNode_DCEquipmentContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_DCTopologicalNode_DCEquipmentContainer(BaseClass*, BaseClass*); +bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTopologicalNode.begin(), element->DCTopologicalNode.end(), element2) == element->DCTopologicalNode.end()) + { + element->DCTopologicalNode.push_back(element2); + return assign_DCTopologicalNode_DCEquipmentContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* DCEquipmentContainer_factory() { - return new DCEquipmentContainer; - } +const char DCEquipmentContainer::debugName[] = "DCEquipmentContainer"; +const char* DCEquipmentContainer::debugString() const +{ + return DCEquipmentContainer::debugName; } -void DCEquipmentContainer::addConstructToMap(std::unordered_map& factory_map) { +void DCEquipmentContainer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer"), &DCEquipmentContainer_factory)); } -void DCEquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCEquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCNodes"), &assign_DCEquipmentContainer_DCNodes)); - assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCTopologicalNode"), &assign_DCEquipmentContainer_DCTopologicalNode)); +void DCEquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCEquipmentContainer::debugName[] = "DCEquipmentContainer"; -const char* DCEquipmentContainer::debugString() +void DCEquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCEquipmentContainer::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCNodes"), &assign_DCEquipmentContainer_DCNodes)); + assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCTopologicalNode"), &assign_DCEquipmentContainer_DCTopologicalNode)); } const BaseClassDefiner DCEquipmentContainer::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner DCEquipmentContainer::declare() return BaseClassDefiner(DCEquipmentContainer::addConstructToMap, DCEquipmentContainer::addPrimitiveAssignFnsToMap, DCEquipmentContainer::addClassAssignFnsToMap, DCEquipmentContainer::debugName); } - +namespace CIMPP +{ + BaseClass* DCEquipmentContainer_factory() + { + return new DCEquipmentContainer; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.hpp b/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.hpp index ac3cf9339..2f5ac385e 100644 --- a/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.hpp +++ b/CGMES_2.4.15_16FEB2016/DCEquipmentContainer.hpp @@ -1,40 +1,41 @@ #ifndef DCEquipmentContainer_H #define DCEquipmentContainer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCNode; + class DCTopologicalNode; -class DCNode; -class DCTopologicalNode; /* A modeling construct to provide a root class for containment of DC as well as AC equipment. The class differ from the EquipmentContaner for AC in that it may also contain DCNodes. Hence it can contain both AC and DC equipment. */ - class DCEquipmentContainer: public EquipmentContainer + class DCEquipmentContainer : public EquipmentContainer { - public: - std::list DCNodes; /* Default: 0 */ - std::list DCTopologicalNode; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCEquipmentContainer(); - virtual ~DCEquipmentContainer(); - + ~DCEquipmentContainer() override; + + std::list DCNodes; /* Default: 0 */ + std::list DCTopologicalNode; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCEquipmentContainer_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCGround.cpp b/CGMES_2.4.15_16FEB2016/DCGround.cpp index 056f90ccd..713715e26 100644 --- a/CGMES_2.4.15_16FEB2016/DCGround.cpp +++ b/CGMES_2.4.15_16FEB2016/DCGround.cpp @@ -1,66 +1,68 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCGround.hpp" +#include +#include + #include "Inductance.hpp" #include "Resistance.hpp" using namespace CIMPP; DCGround::DCGround() {}; - DCGround::~DCGround() {}; +bool assign_DCGround_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCGround* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCGround_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCGround* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DCGround_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCGround* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCGround_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCGround* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCGround_factory() { - return new DCGround; - } +const char DCGround::debugName[] = "DCGround"; +const char* DCGround::debugString() const +{ + return DCGround::debugName; } -void DCGround::addConstructToMap(std::unordered_map& factory_map) { +void DCGround::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCGround"), &DCGround_factory)); } -void DCGround::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCGround::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCGround.inductance"), &assign_DCGround_inductance)); assign_map.insert(std::make_pair(std::string("cim:DCGround.r"), &assign_DCGround_r)); } -void DCGround::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DCGround::debugName[] = "DCGround"; -const char* DCGround::debugString() +void DCGround::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCGround::debugName; } const BaseClassDefiner DCGround::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner DCGround::declare() return BaseClassDefiner(DCGround::addConstructToMap, DCGround::addPrimitiveAssignFnsToMap, DCGround::addClassAssignFnsToMap, DCGround::debugName); } - +namespace CIMPP +{ + BaseClass* DCGround_factory() + { + return new DCGround; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCGround.hpp b/CGMES_2.4.15_16FEB2016/DCGround.hpp index 172a4d182..9da13df9f 100644 --- a/CGMES_2.4.15_16FEB2016/DCGround.hpp +++ b/CGMES_2.4.15_16FEB2016/DCGround.hpp @@ -1,40 +1,41 @@ #ifndef DCGround_H #define DCGround_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Inductance.hpp" #include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A ground within a DC system. */ - class DCGround: public DCConductingEquipment + class DCGround : public DCConductingEquipment { - public: - CIMPP::Inductance inductance; /* Inductance to ground. Default: nullptr */ - CIMPP::Resistance r; /* Resistance to ground. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCGround(); - virtual ~DCGround(); - + ~DCGround() override; + + CIMPP::Inductance inductance; /* Inductance to ground. Default: nullptr */ + CIMPP::Resistance r; /* Resistance to ground. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCGround_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCLine.cpp b/CGMES_2.4.15_16FEB2016/DCLine.cpp index 42ef2be2c..98bc5d517 100644 --- a/CGMES_2.4.15_16FEB2016/DCLine.cpp +++ b/CGMES_2.4.15_16FEB2016/DCLine.cpp @@ -1,49 +1,56 @@ -#include -#include "DCEquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCLine.hpp" +#include +#include + #include "SubGeographicalRegion.hpp" using namespace CIMPP; -DCLine::DCLine(): Region(nullptr) {}; - +DCLine::DCLine() : Region(nullptr) {}; DCLine::~DCLine() {}; -bool assign_SubGeographicalRegion_DCLines(BaseClass*, BaseClass*); -bool assign_DCLine_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCLine* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_SubGeographicalRegion_DCLines(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* DCLine_factory() { - return new DCLine; +bool assign_SubGeographicalRegion_DCLines(BaseClass*, BaseClass*); +bool assign_DCLine_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCLine* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_SubGeographicalRegion_DCLines(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DCLine::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DCLine"), &DCLine_factory)); +const char DCLine::debugName[] = "DCLine"; +const char* DCLine::debugString() const +{ + return DCLine::debugName; } -void DCLine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DCLine::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DCLine"), &DCLine_factory)); +} -void DCLine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCLine.Region"), &assign_DCLine_Region)); +void DCLine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCLine::debugName[] = "DCLine"; -const char* DCLine::debugString() +void DCLine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCLine::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCLine.Region"), &assign_DCLine_Region)); } const BaseClassDefiner DCLine::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCLine::declare() return BaseClassDefiner(DCLine::addConstructToMap, DCLine::addPrimitiveAssignFnsToMap, DCLine::addClassAssignFnsToMap, DCLine::debugName); } - +namespace CIMPP +{ + BaseClass* DCLine_factory() + { + return new DCLine; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCLine.hpp b/CGMES_2.4.15_16FEB2016/DCLine.hpp index 488ceeab8..24bd47128 100644 --- a/CGMES_2.4.15_16FEB2016/DCLine.hpp +++ b/CGMES_2.4.15_16FEB2016/DCLine.hpp @@ -1,38 +1,39 @@ #ifndef DCLine_H #define DCLine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCEquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCEquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubGeographicalRegion; -class SubGeographicalRegion; /* Overhead lines and/or cables connecting two or more HVDC substations. */ - class DCLine: public DCEquipmentContainer + class DCLine : public DCEquipmentContainer { - public: - CIMPP::SubGeographicalRegion* Region; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCLine(); - virtual ~DCLine(); - + ~DCLine() override; + + CIMPP::SubGeographicalRegion* Region; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCLine_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCLineSegment.cpp b/CGMES_2.4.15_16FEB2016/DCLineSegment.cpp index 754295ba8..394d99e04 100644 --- a/CGMES_2.4.15_16FEB2016/DCLineSegment.cpp +++ b/CGMES_2.4.15_16FEB2016/DCLineSegment.cpp @@ -1,109 +1,120 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCLineSegment.hpp" +#include +#include + +#include "PerLengthDCLineParameter.hpp" #include "Capacitance.hpp" #include "Inductance.hpp" -#include "Resistance.hpp" #include "Length.hpp" -#include "PerLengthDCLineParameter.hpp" +#include "Resistance.hpp" using namespace CIMPP; -DCLineSegment::DCLineSegment(): PerLengthParameter(nullptr) {}; - +DCLineSegment::DCLineSegment() : PerLengthParameter(nullptr) {}; DCLineSegment::~DCLineSegment() {}; +bool assign_DCLineSegment_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCLineSegment_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCLineSegment_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->length; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass*, BaseClass*); -bool assign_DCLineSegment_PerLengthParameter(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - element->PerLengthParameter = dynamic_cast(BaseClass_ptr2); - if(element->PerLengthParameter != nullptr) - return assign_PerLengthDCLineParameter_DCLineSegments(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCLineSegment_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_DCLineSegment_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->capacitance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass*, BaseClass*); +bool assign_DCLineSegment_PerLengthParameter(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCLineSegment* element = dynamic_cast(BaseClass_ptr1); + PerLengthDCLineParameter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PerLengthParameter != element2) + { + element->PerLengthParameter = element2; + return assign_PerLengthDCLineParameter_DCLineSegments(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DCLineSegment_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCLineSegment_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCLineSegment_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->length; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCLineSegment_factory() { - return new DCLineSegment; - } +const char DCLineSegment::debugName[] = "DCLineSegment"; +const char* DCLineSegment::debugString() const +{ + return DCLineSegment::debugName; } -void DCLineSegment::addConstructToMap(std::unordered_map& factory_map) { +void DCLineSegment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCLineSegment"), &DCLineSegment_factory)); } -void DCLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.capacitance"), &assign_DCLineSegment_capacitance)); assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.inductance"), &assign_DCLineSegment_inductance)); - assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.resistance"), &assign_DCLineSegment_resistance)); assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.length"), &assign_DCLineSegment_length)); - } - -void DCLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.PerLengthParameter"), &assign_DCLineSegment_PerLengthParameter)); + assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.resistance"), &assign_DCLineSegment_resistance)); } -const char DCLineSegment::debugName[] = "DCLineSegment"; -const char* DCLineSegment::debugString() +void DCLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCLineSegment::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.PerLengthParameter"), &assign_DCLineSegment_PerLengthParameter)); } const BaseClassDefiner DCLineSegment::declare() @@ -111,4 +122,10 @@ const BaseClassDefiner DCLineSegment::declare() return BaseClassDefiner(DCLineSegment::addConstructToMap, DCLineSegment::addPrimitiveAssignFnsToMap, DCLineSegment::addClassAssignFnsToMap, DCLineSegment::debugName); } - +namespace CIMPP +{ + BaseClass* DCLineSegment_factory() + { + return new DCLineSegment; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCLineSegment.hpp b/CGMES_2.4.15_16FEB2016/DCLineSegment.hpp index 84efef3ee..784cb35e4 100644 --- a/CGMES_2.4.15_16FEB2016/DCLineSegment.hpp +++ b/CGMES_2.4.15_16FEB2016/DCLineSegment.hpp @@ -1,46 +1,47 @@ #ifndef DCLineSegment_H #define DCLineSegment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Capacitance.hpp" #include "Inductance.hpp" -#include "Resistance.hpp" #include "Length.hpp" +#include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PerLengthDCLineParameter; -class PerLengthDCLineParameter; /* A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. */ - class DCLineSegment: public DCConductingEquipment + class DCLineSegment : public DCConductingEquipment { - public: - CIMPP::Capacitance capacitance; /* Capacitance of the DC line segment. Significant for cables only. Default: nullptr */ - CIMPP::Inductance inductance; /* Inductance of the DC line segment. Neglectable compared with DCSeriesDevice used for smoothing. Default: nullptr */ - CIMPP::Resistance resistance; /* Resistance of the DC line segment. Default: nullptr */ - CIMPP::Length length; /* Segment length for calculating line section capabilities. Default: nullptr */ - CIMPP::PerLengthDCLineParameter* PerLengthParameter; /* Set of per-length parameters for this line segment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCLineSegment(); - virtual ~DCLineSegment(); - + ~DCLineSegment() override; + + CIMPP::PerLengthDCLineParameter* PerLengthParameter; /* Set of per-length parameters for this line segment. Default: 0 */ + CIMPP::Capacitance capacitance; /* Capacitance of the DC line segment. Significant for cables only. Default: nullptr */ + CIMPP::Inductance inductance; /* Inductance of the DC line segment. Neglectable compared with DCSeriesDevice used for smoothing. Default: nullptr */ + CIMPP::Length length; /* Segment length for calculating line section capabilities. Default: nullptr */ + CIMPP::Resistance resistance; /* Resistance of the DC line segment. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCLineSegment_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCNode.cpp b/CGMES_2.4.15_16FEB2016/DCNode.cpp index b0d6cb77e..d47580458 100644 --- a/CGMES_2.4.15_16FEB2016/DCNode.cpp +++ b/CGMES_2.4.15_16FEB2016/DCNode.cpp @@ -1,75 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCNode.hpp" -#include "DCBaseTerminal.hpp" +#include +#include + #include "DCEquipmentContainer.hpp" +#include "DCBaseTerminal.hpp" #include "DCTopologicalNode.hpp" using namespace CIMPP; -DCNode::DCNode(): DCEquipmentContainer(nullptr), DCTopologicalNode(nullptr) {}; - +DCNode::DCNode() : DCEquipmentContainer(nullptr), DCTopologicalNode(nullptr) {}; DCNode::~DCNode() {}; -bool assign_DCNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_DCEquipmentContainer_DCNodes(BaseClass*, BaseClass*); +bool assign_DCNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCNode* element = dynamic_cast(BaseClass_ptr1); + DCEquipmentContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCEquipmentContainer != element2) + { + element->DCEquipmentContainer = element2; + return assign_DCEquipmentContainer_DCNodes(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_DCEquipmentContainer_DCNodes(BaseClass*, BaseClass*); -bool assign_DCNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCEquipmentContainer = dynamic_cast(BaseClass_ptr2); - if(element->DCEquipmentContainer != nullptr) - return assign_DCEquipmentContainer_DCNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCBaseTerminal_DCNode(BaseClass*, BaseClass*); +bool assign_DCNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCNode* element = dynamic_cast(BaseClass_ptr1); + DCBaseTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_DCBaseTerminal_DCNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_DCTopologicalNode_DCNodes(BaseClass*, BaseClass*); -bool assign_DCNode_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCTopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->DCTopologicalNode != nullptr) - return assign_DCTopologicalNode_DCNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCNode_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCNode* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCTopologicalNode != element2) + { + element->DCTopologicalNode = element2; + return assign_DCTopologicalNode_DCNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* DCNode_factory() { - return new DCNode; - } +const char DCNode::debugName[] = "DCNode"; +const char* DCNode::debugString() const +{ + return DCNode::debugName; } -void DCNode::addConstructToMap(std::unordered_map& factory_map) { +void DCNode::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCNode"), &DCNode_factory)); } -void DCNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTerminals"), &assign_DCNode_DCTerminals)); - assign_map.insert(std::make_pair(std::string("cim:DCNode.DCEquipmentContainer"), &assign_DCNode_DCEquipmentContainer)); - assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTopologicalNode"), &assign_DCNode_DCTopologicalNode)); +void DCNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCNode::debugName[] = "DCNode"; -const char* DCNode::debugString() +void DCNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCNode::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCNode.DCEquipmentContainer"), &assign_DCNode_DCEquipmentContainer)); + assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTerminals"), &assign_DCNode_DCTerminals)); + assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTopologicalNode"), &assign_DCNode_DCTopologicalNode)); } const BaseClassDefiner DCNode::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner DCNode::declare() return BaseClassDefiner(DCNode::addConstructToMap, DCNode::addPrimitiveAssignFnsToMap, DCNode::addClassAssignFnsToMap, DCNode::debugName); } - +namespace CIMPP +{ + BaseClass* DCNode_factory() + { + return new DCNode; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCNode.hpp b/CGMES_2.4.15_16FEB2016/DCNode.hpp index 0b3ef9a96..14ceecae1 100644 --- a/CGMES_2.4.15_16FEB2016/DCNode.hpp +++ b/CGMES_2.4.15_16FEB2016/DCNode.hpp @@ -1,42 +1,43 @@ #ifndef DCNode_H #define DCNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCBaseTerminal; + class DCEquipmentContainer; + class DCTopologicalNode; -class DCBaseTerminal; -class DCEquipmentContainer; -class DCTopologicalNode; /* DC nodes are points where terminals of DC conducting equipment are connected together with zero impedance. */ - class DCNode: public IdentifiedObject + class DCNode : public IdentifiedObject { - public: - std::list DCTerminals; /* Default: 0 */ - CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ - CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.ConnectivityNodes. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCNode(); - virtual ~DCNode(); - + ~DCNode() override; + + CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ + std::list DCTerminals; /* Default: 0 */ + CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.ConnectivityNodes. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCNode_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCPolarityKind.cpp b/CGMES_2.4.15_16FEB2016/DCPolarityKind.cpp index 774aff923..a1a646248 100644 --- a/CGMES_2.4.15_16FEB2016/DCPolarityKind.cpp +++ b/CGMES_2.4.15_16FEB2016/DCPolarityKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCPolarityKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::DCPolarityKind& rop) +DCPolarityKind& DCPolarityKind::operator=(DCPolarityKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +DCPolarityKind::operator DCPolarityKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char DCPolarityKind::debugName[] = "DCPolarityKind"; +const char* DCPolarityKind::debugString() const +{ + return DCPolarityKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, DCPolarityKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const DCPolarityKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == DCPolarityKind::positive) + { + EnumSymbol = "positive"; + } + if (obj.value == DCPolarityKind::middle) + { + EnumSymbol = "middle"; + } + if (obj.value == DCPolarityKind::negative) + { + EnumSymbol = "negative"; + } + + if (!EnumSymbol.empty()) + { + os << "DCPolarityKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCPolarityKind.hpp b/CGMES_2.4.15_16FEB2016/DCPolarityKind.hpp index 1004c1183..8b3bd24e9 100644 --- a/CGMES_2.4.15_16FEB2016/DCPolarityKind.hpp +++ b/CGMES_2.4.15_16FEB2016/DCPolarityKind.hpp @@ -1,25 +1,50 @@ #ifndef DCPolarityKind_H #define DCPolarityKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Polarity for DC circuits. */ - enum class DCPolarityKind + class DCPolarityKind { - /** - * Positive pole. - */ - positive, - /** - * Middle pole, potentially grounded. - */ - middle, - /** - * Negative pole. - */ - negative, + public: + enum DCPolarityKind_ENUM + { + /** + * Positive pole. + */ + positive, + /** + * Middle pole, potentially grounded. + */ + middle, + /** + * Negative pole. + */ + negative, + }; + + DCPolarityKind() : value(), initialized(false) {} + DCPolarityKind(DCPolarityKind_ENUM value) : value(value), initialized(true) {} + + DCPolarityKind& operator=(DCPolarityKind_ENUM rop); + operator DCPolarityKind_ENUM() const; + + DCPolarityKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, DCPolarityKind& rop); + friend std::ostream& operator<<(std::ostream& os, const DCPolarityKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::DCPolarityKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/DCSeriesDevice.cpp b/CGMES_2.4.15_16FEB2016/DCSeriesDevice.cpp index 2d2ac6fa7..6cc87ef0e 100644 --- a/CGMES_2.4.15_16FEB2016/DCSeriesDevice.cpp +++ b/CGMES_2.4.15_16FEB2016/DCSeriesDevice.cpp @@ -1,81 +1,84 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCSeriesDevice.hpp" +#include +#include + #include "Inductance.hpp" -#include "Resistance.hpp" #include "Voltage.hpp" +#include "Resistance.hpp" using namespace CIMPP; DCSeriesDevice::DCSeriesDevice() {}; - DCSeriesDevice::~DCSeriesDevice() {}; +bool assign_DCSeriesDevice_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCSeriesDevice_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCSeriesDevice_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DCSeriesDevice_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCSeriesDevice_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCSeriesDevice_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCSeriesDevice_factory() { - return new DCSeriesDevice; - } +const char DCSeriesDevice::debugName[] = "DCSeriesDevice"; +const char* DCSeriesDevice::debugString() const +{ + return DCSeriesDevice::debugName; } -void DCSeriesDevice::addConstructToMap(std::unordered_map& factory_map) { +void DCSeriesDevice::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCSeriesDevice"), &DCSeriesDevice_factory)); } -void DCSeriesDevice::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCSeriesDevice::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.inductance"), &assign_DCSeriesDevice_inductance)); - assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.resistance"), &assign_DCSeriesDevice_resistance)); assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.ratedUdc"), &assign_DCSeriesDevice_ratedUdc)); + assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.resistance"), &assign_DCSeriesDevice_resistance)); } -void DCSeriesDevice::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DCSeriesDevice::debugName[] = "DCSeriesDevice"; -const char* DCSeriesDevice::debugString() +void DCSeriesDevice::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCSeriesDevice::debugName; } const BaseClassDefiner DCSeriesDevice::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner DCSeriesDevice::declare() return BaseClassDefiner(DCSeriesDevice::addConstructToMap, DCSeriesDevice::addPrimitiveAssignFnsToMap, DCSeriesDevice::addClassAssignFnsToMap, DCSeriesDevice::debugName); } - +namespace CIMPP +{ + BaseClass* DCSeriesDevice_factory() + { + return new DCSeriesDevice; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCSeriesDevice.hpp b/CGMES_2.4.15_16FEB2016/DCSeriesDevice.hpp index ffee38162..e8ac734b6 100644 --- a/CGMES_2.4.15_16FEB2016/DCSeriesDevice.hpp +++ b/CGMES_2.4.15_16FEB2016/DCSeriesDevice.hpp @@ -1,42 +1,43 @@ #ifndef DCSeriesDevice_H #define DCSeriesDevice_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Inductance.hpp" #include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A series device within the DC system, typically a reactor used for filtering or smoothing. Needed for transient and short circuit studies. */ - class DCSeriesDevice: public DCConductingEquipment + class DCSeriesDevice : public DCConductingEquipment { - public: - CIMPP::Inductance inductance; /* Inductance of the device. Default: nullptr */ - CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ - CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCSeriesDevice(); - virtual ~DCSeriesDevice(); - + ~DCSeriesDevice() override; + + CIMPP::Inductance inductance; /* Inductance of the device. Default: nullptr */ + CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCSeriesDevice_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCShunt.cpp b/CGMES_2.4.15_16FEB2016/DCShunt.cpp index 8848b26e6..b99cbcb41 100644 --- a/CGMES_2.4.15_16FEB2016/DCShunt.cpp +++ b/CGMES_2.4.15_16FEB2016/DCShunt.cpp @@ -1,81 +1,84 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCShunt.hpp" +#include +#include + #include "Capacitance.hpp" -#include "Resistance.hpp" #include "Voltage.hpp" +#include "Resistance.hpp" using namespace CIMPP; DCShunt::DCShunt() {}; - DCShunt::~DCShunt() {}; +bool assign_DCShunt_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCShunt_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCShunt_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DCShunt_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->capacitance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCShunt_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCShunt_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCShunt_factory() { - return new DCShunt; - } +const char DCShunt::debugName[] = "DCShunt"; +const char* DCShunt::debugString() const +{ + return DCShunt::debugName; } -void DCShunt::addConstructToMap(std::unordered_map& factory_map) { +void DCShunt::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCShunt"), &DCShunt_factory)); } -void DCShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCShunt.capacitance"), &assign_DCShunt_capacitance)); - assign_map.insert(std::make_pair(std::string("cim:DCShunt.resistance"), &assign_DCShunt_resistance)); assign_map.insert(std::make_pair(std::string("cim:DCShunt.ratedUdc"), &assign_DCShunt_ratedUdc)); + assign_map.insert(std::make_pair(std::string("cim:DCShunt.resistance"), &assign_DCShunt_resistance)); } -void DCShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DCShunt::debugName[] = "DCShunt"; -const char* DCShunt::debugString() +void DCShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCShunt::debugName; } const BaseClassDefiner DCShunt::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner DCShunt::declare() return BaseClassDefiner(DCShunt::addConstructToMap, DCShunt::addPrimitiveAssignFnsToMap, DCShunt::addClassAssignFnsToMap, DCShunt::debugName); } - +namespace CIMPP +{ + BaseClass* DCShunt_factory() + { + return new DCShunt; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCShunt.hpp b/CGMES_2.4.15_16FEB2016/DCShunt.hpp index c59ae93b2..bc316c530 100644 --- a/CGMES_2.4.15_16FEB2016/DCShunt.hpp +++ b/CGMES_2.4.15_16FEB2016/DCShunt.hpp @@ -1,42 +1,43 @@ #ifndef DCShunt_H #define DCShunt_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Capacitance.hpp" #include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A shunt device within the DC system, typically used for filtering. Needed for transient and short circuit studies. */ - class DCShunt: public DCConductingEquipment + class DCShunt : public DCConductingEquipment { - public: - CIMPP::Capacitance capacitance; /* Capacitance of the DC shunt. Default: nullptr */ - CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ - CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCShunt(); - virtual ~DCShunt(); - + ~DCShunt() override; + + CIMPP::Capacitance capacitance; /* Capacitance of the DC shunt. Default: nullptr */ + CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCShunt_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCSwitch.cpp b/CGMES_2.4.15_16FEB2016/DCSwitch.cpp index 91d94c952..6ad07472d 100644 --- a/CGMES_2.4.15_16FEB2016/DCSwitch.cpp +++ b/CGMES_2.4.15_16FEB2016/DCSwitch.cpp @@ -1,36 +1,36 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCSwitch.hpp" +#include +#include + using namespace CIMPP; DCSwitch::DCSwitch() {}; - DCSwitch::~DCSwitch() {}; -namespace CIMPP { - BaseClass* DCSwitch_factory() { - return new DCSwitch; - } +const char DCSwitch::debugName[] = "DCSwitch"; +const char* DCSwitch::debugString() const +{ + return DCSwitch::debugName; } -void DCSwitch::addConstructToMap(std::unordered_map& factory_map) { +void DCSwitch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCSwitch"), &DCSwitch_factory)); } -void DCSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCSwitch::debugName[] = "DCSwitch"; -const char* DCSwitch::debugString() +void DCSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCSwitch::debugName; } const BaseClassDefiner DCSwitch::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCSwitch::declare() return BaseClassDefiner(DCSwitch::addConstructToMap, DCSwitch::addPrimitiveAssignFnsToMap, DCSwitch::addClassAssignFnsToMap, DCSwitch::debugName); } - +namespace CIMPP +{ + BaseClass* DCSwitch_factory() + { + return new DCSwitch; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCSwitch.hpp b/CGMES_2.4.15_16FEB2016/DCSwitch.hpp index cd3de7e0e..76e968ca7 100644 --- a/CGMES_2.4.15_16FEB2016/DCSwitch.hpp +++ b/CGMES_2.4.15_16FEB2016/DCSwitch.hpp @@ -1,36 +1,37 @@ #ifndef DCSwitch_H #define DCSwitch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A switch within the DC system. */ - class DCSwitch: public DCConductingEquipment + class DCSwitch : public DCConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCSwitch(); - virtual ~DCSwitch(); - + ~DCSwitch() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCSwitch_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCTerminal.cpp b/CGMES_2.4.15_16FEB2016/DCTerminal.cpp index b9715feb9..b9b3832c1 100644 --- a/CGMES_2.4.15_16FEB2016/DCTerminal.cpp +++ b/CGMES_2.4.15_16FEB2016/DCTerminal.cpp @@ -1,49 +1,56 @@ -#include -#include "DCBaseTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCTerminal.hpp" +#include +#include + #include "DCConductingEquipment.hpp" using namespace CIMPP; -DCTerminal::DCTerminal(): DCConductingEquipment(nullptr) {}; - +DCTerminal::DCTerminal() : DCConductingEquipment(nullptr) {}; DCTerminal::~DCTerminal() {}; -bool assign_DCConductingEquipment_DCTerminals(BaseClass*, BaseClass*); -bool assign_DCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->DCConductingEquipment != nullptr) - return assign_DCConductingEquipment_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* DCTerminal_factory() { - return new DCTerminal; +bool assign_DCConductingEquipment_DCTerminals(BaseClass*, BaseClass*); +bool assign_DCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTerminal* element = dynamic_cast(BaseClass_ptr1); + DCConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCConductingEquipment != element2) + { + element->DCConductingEquipment = element2; + return assign_DCConductingEquipment_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DCTerminal::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DCTerminal"), &DCTerminal_factory)); +const char DCTerminal::debugName[] = "DCTerminal"; +const char* DCTerminal::debugString() const +{ + return DCTerminal::debugName; } -void DCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DCTerminal::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DCTerminal"), &DCTerminal_factory)); +} -void DCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCTerminal.DCConductingEquipment"), &assign_DCTerminal_DCConductingEquipment)); +void DCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCTerminal::debugName[] = "DCTerminal"; -const char* DCTerminal::debugString() +void DCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCTerminal.DCConductingEquipment"), &assign_DCTerminal_DCConductingEquipment)); } const BaseClassDefiner DCTerminal::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCTerminal::declare() return BaseClassDefiner(DCTerminal::addConstructToMap, DCTerminal::addPrimitiveAssignFnsToMap, DCTerminal::addClassAssignFnsToMap, DCTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* DCTerminal_factory() + { + return new DCTerminal; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCTerminal.hpp b/CGMES_2.4.15_16FEB2016/DCTerminal.hpp index f5c1daab8..39dc6c3d3 100644 --- a/CGMES_2.4.15_16FEB2016/DCTerminal.hpp +++ b/CGMES_2.4.15_16FEB2016/DCTerminal.hpp @@ -1,38 +1,39 @@ #ifndef DCTerminal_H #define DCTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCBaseTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCBaseTerminal.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCConductingEquipment; -class DCConductingEquipment; /* An electrical connection point to generic DC conducting equipment. */ - class DCTerminal: public DCBaseTerminal + class DCTerminal : public DCBaseTerminal { - public: - CIMPP::DCConductingEquipment* DCConductingEquipment; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCTerminal(); - virtual ~DCTerminal(); - + ~DCTerminal() override; + + CIMPP::DCConductingEquipment* DCConductingEquipment; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCTerminal_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.cpp b/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.cpp index 285cbcf1b..a764d3e3e 100644 --- a/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.cpp +++ b/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCTopologicalIsland.hpp" +#include +#include + #include "DCTopologicalNode.hpp" using namespace CIMPP; DCTopologicalIsland::DCTopologicalIsland() {}; - DCTopologicalIsland::~DCTopologicalIsland() {}; -bool assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalIsland* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTopologicalNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_DCTopologicalNode_DCTopologicalIsland(BaseClass*, BaseClass*); +bool assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalIsland* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTopologicalNodes.begin(), element->DCTopologicalNodes.end(), element2) == element->DCTopologicalNodes.end()) + { + element->DCTopologicalNodes.push_back(element2); + return assign_DCTopologicalNode_DCTopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DCTopologicalIsland_factory() { - return new DCTopologicalIsland; - } +const char DCTopologicalIsland::debugName[] = "DCTopologicalIsland"; +const char* DCTopologicalIsland::debugString() const +{ + return DCTopologicalIsland::debugName; } -void DCTopologicalIsland::addConstructToMap(std::unordered_map& factory_map) { +void DCTopologicalIsland::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCTopologicalIsland"), &DCTopologicalIsland_factory)); } -void DCTopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCTopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalIsland.DCTopologicalNodes"), &assign_DCTopologicalIsland_DCTopologicalNodes)); +void DCTopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCTopologicalIsland::debugName[] = "DCTopologicalIsland"; -const char* DCTopologicalIsland::debugString() +void DCTopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCTopologicalIsland::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalIsland.DCTopologicalNodes"), &assign_DCTopologicalIsland_DCTopologicalNodes)); } const BaseClassDefiner DCTopologicalIsland::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCTopologicalIsland::declare() return BaseClassDefiner(DCTopologicalIsland::addConstructToMap, DCTopologicalIsland::addPrimitiveAssignFnsToMap, DCTopologicalIsland::addClassAssignFnsToMap, DCTopologicalIsland::debugName); } - +namespace CIMPP +{ + BaseClass* DCTopologicalIsland_factory() + { + return new DCTopologicalIsland; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.hpp b/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.hpp index aeb6cd1f4..7a2e853f2 100644 --- a/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.hpp +++ b/CGMES_2.4.15_16FEB2016/DCTopologicalIsland.hpp @@ -1,38 +1,39 @@ #ifndef DCTopologicalIsland_H #define DCTopologicalIsland_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCTopologicalNode; -class DCTopologicalNode; /* An electrically connected subset of the network. DC topological islands can change as the current network state changes: e.g. due to - disconnect switches or breakers change state in a SCADA/EMS - manual creation, change or deletion of topological nodes in a planning tool. */ - class DCTopologicalIsland: public IdentifiedObject + class DCTopologicalIsland : public IdentifiedObject { - public: - std::list DCTopologicalNodes; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCTopologicalIsland(); - virtual ~DCTopologicalIsland(); - + ~DCTopologicalIsland() override; + + std::list DCTopologicalNodes; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCTopologicalIsland_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DCTopologicalNode.cpp b/CGMES_2.4.15_16FEB2016/DCTopologicalNode.cpp index d64589024..5a31638d6 100644 --- a/CGMES_2.4.15_16FEB2016/DCTopologicalNode.cpp +++ b/CGMES_2.4.15_16FEB2016/DCTopologicalNode.cpp @@ -1,87 +1,116 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCTopologicalNode.hpp" -#include "DCTopologicalIsland.hpp" -#include "DCBaseTerminal.hpp" +#include +#include + #include "DCEquipmentContainer.hpp" #include "DCNode.hpp" +#include "DCBaseTerminal.hpp" +#include "DCTopologicalIsland.hpp" using namespace CIMPP; -DCTopologicalNode::DCTopologicalNode(): DCTopologicalIsland(nullptr), DCEquipmentContainer(nullptr) {}; - +DCTopologicalNode::DCTopologicalNode() : DCEquipmentContainer(nullptr), DCTopologicalIsland(nullptr) {}; DCTopologicalNode::~DCTopologicalNode() {}; -bool assign_DCTopologicalNode_DCTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCTopologicalIsland = dynamic_cast(BaseClass_ptr2); - if(element->DCTopologicalIsland != nullptr) - return true; - } - return false; -} -bool assign_DCTopologicalNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCEquipmentContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCEquipmentContainer != element2) + { + element->DCEquipmentContainer = element2; + return assign_DCEquipmentContainer_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass*, BaseClass*); -bool assign_DCTopologicalNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCEquipmentContainer = dynamic_cast(BaseClass_ptr2); - if(element->DCEquipmentContainer != nullptr) - return assign_DCEquipmentContainer_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCNode_DCTopologicalNode(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCNodes.begin(), element->DCNodes.end(), element2) == element->DCNodes.end()) + { + element->DCNodes.push_back(element2); + return assign_DCNode_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DCTopologicalNode_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_DCBaseTerminal_DCTopologicalNode(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCBaseTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_DCBaseTerminal_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - -namespace CIMPP { - BaseClass* DCTopologicalNode_factory() { - return new DCTopologicalNode; +bool assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalIsland* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCTopologicalIsland != element2) + { + element->DCTopologicalIsland = element2; + return assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DCTopologicalNode::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DCTopologicalNode"), &DCTopologicalNode_factory)); +const char DCTopologicalNode::debugName[] = "DCTopologicalNode"; +const char* DCTopologicalNode::debugString() const +{ + return DCTopologicalNode::debugName; } -void DCTopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DCTopologicalNode::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DCTopologicalNode"), &DCTopologicalNode_factory)); +} -void DCTopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTopologicalIsland"), &assign_DCTopologicalNode_DCTopologicalIsland)); - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTerminals"), &assign_DCTopologicalNode_DCTerminals)); - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCEquipmentContainer"), &assign_DCTopologicalNode_DCEquipmentContainer)); - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCNodes"), &assign_DCTopologicalNode_DCNodes)); +void DCTopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCTopologicalNode::debugName[] = "DCTopologicalNode"; -const char* DCTopologicalNode::debugString() +void DCTopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCTopologicalNode::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCEquipmentContainer"), &assign_DCTopologicalNode_DCEquipmentContainer)); + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCNodes"), &assign_DCTopologicalNode_DCNodes)); + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTerminals"), &assign_DCTopologicalNode_DCTerminals)); + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTopologicalIsland"), &assign_DCTopologicalNode_DCTopologicalIsland)); } const BaseClassDefiner DCTopologicalNode::declare() @@ -89,4 +118,10 @@ const BaseClassDefiner DCTopologicalNode::declare() return BaseClassDefiner(DCTopologicalNode::addConstructToMap, DCTopologicalNode::addPrimitiveAssignFnsToMap, DCTopologicalNode::addClassAssignFnsToMap, DCTopologicalNode::debugName); } - +namespace CIMPP +{ + BaseClass* DCTopologicalNode_factory() + { + return new DCTopologicalNode; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DCTopologicalNode.hpp b/CGMES_2.4.15_16FEB2016/DCTopologicalNode.hpp index 877f508fb..b7006a6b3 100644 --- a/CGMES_2.4.15_16FEB2016/DCTopologicalNode.hpp +++ b/CGMES_2.4.15_16FEB2016/DCTopologicalNode.hpp @@ -1,44 +1,45 @@ #ifndef DCTopologicalNode_H #define DCTopologicalNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCBaseTerminal; + class DCEquipmentContainer; + class DCNode; + class DCTopologicalIsland; -class DCTopologicalIsland; -class DCBaseTerminal; -class DCEquipmentContainer; -class DCNode; /* DC bus. */ - class DCTopologicalNode: public IdentifiedObject + class DCTopologicalNode : public IdentifiedObject { - public: - CIMPP::DCTopologicalIsland* DCTopologicalIsland; /* Default: 0 */ - std::list DCTerminals; /* See association end Terminal.TopologicalNode. Default: 0 */ - CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ - std::list DCNodes; /* See association end ConnectivityNode.TopologicalNode. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCTopologicalNode(); - virtual ~DCTopologicalNode(); - + ~DCTopologicalNode() override; + + CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ + std::list DCNodes; /* See association end ConnectivityNode.TopologicalNode. Default: 0 */ + std::list DCTerminals; /* See association end Terminal.TopologicalNode. Default: 0 */ + CIMPP::DCTopologicalIsland* DCTopologicalIsland; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCTopologicalNode_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Date.cpp b/CGMES_2.4.15_16FEB2016/Date.cpp new file mode 100644 index 000000000..6bcf3159e --- /dev/null +++ b/CGMES_2.4.15_16FEB2016/Date.cpp @@ -0,0 +1,49 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ +#include "Date.hpp" + +#include "../src/CIMExceptions.hpp" + +using namespace CIMPP; + +Date& Date::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; +} + +Date::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Date::debugName[] = "Date"; +const char* Date::debugString() const +{ + return Date::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Date& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + + std::ostream& operator<<(std::ostream& os, const Date& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Date.hpp b/CGMES_2.4.15_16FEB2016/Date.hpp new file mode 100644 index 000000000..e2063f08d --- /dev/null +++ b/CGMES_2.4.15_16FEB2016/Date.hpp @@ -0,0 +1,35 @@ +#ifndef Date_H +#define Date_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + +#include +#include +#include + +namespace CIMPP +{ + /* + Date as "yyyy-mm-dd", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddZ". A local timezone relative UTC is specified as "yyyy-mm-dd(+/-)hh:mm". + */ + class Date + { + public: + Date() : initialized(false) {} + Date(const std::string& value) : value(value), initialized(true) {} + + Date& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Date& rop); + friend std::ostream& operator<<(std::ostream& os, const Date& obj); + }; +} +#endif diff --git a/CGMES_2.4.15_16FEB2016/DateTime.cpp b/CGMES_2.4.15_16FEB2016/DateTime.cpp index 97315713b..866aa87b0 100644 --- a/CGMES_2.4.15_16FEB2016/DateTime.cpp +++ b/CGMES_2.4.15_16FEB2016/DateTime.cpp @@ -1,41 +1,49 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DateTime.hpp" +#include "../src/CIMExceptions.hpp" using namespace CIMPP; -DateTime::DateTime() {}; - -DateTime::~DateTime() {}; - - - -namespace CIMPP { - BaseClass* DateTime_factory() { - return new DateTime; - } -} - -void DateTime::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DateTime"), &DateTime_factory)); -} - -void DateTime::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +DateTime& DateTime::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; } -void DateTime::addClassAssignFnsToMap(std::unordered_map& assign_map) { +DateTime::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; } const char DateTime::debugName[] = "DateTime"; -const char* DateTime::debugString() +const char* DateTime::debugString() const { return DateTime::debugName; } -const BaseClassDefiner DateTime::declare() +namespace CIMPP { - return BaseClassDefiner(DateTime::addConstructToMap, DateTime::addPrimitiveAssignFnsToMap, DateTime::addClassAssignFnsToMap, DateTime::debugName); -} - + std::istream& operator>>(std::istream& lop, DateTime& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const DateTime& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DateTime.hpp b/CGMES_2.4.15_16FEB2016/DateTime.hpp index 43fe97eba..745e7583b 100644 --- a/CGMES_2.4.15_16FEB2016/DateTime.hpp +++ b/CGMES_2.4.15_16FEB2016/DateTime.hpp @@ -1,38 +1,35 @@ #ifndef DateTime_H #define DateTime_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { - +#include +#include +#include +namespace CIMPP +{ /* Date and time as "yyyy-mm-ddThh:mm:ss.sss", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddThh:mm:ss.sssZ". A local timezone relative UTC is specified as "yyyy-mm-ddThh:mm:ss.sss-hh:mm". The second component (shown here as "ss.sss") could have any number of digits in its fractional part to allow any kind of precision beyond seconds. */ - class DateTime: public BaseClass + class DateTime { - public: - + DateTime() : initialized(false) {} + DateTime(const std::string& value) : value(value), initialized(true) {} + + DateTime& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - DateTime(); - virtual ~DateTime(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; + friend std::istream& operator>>(std::istream& lop, DateTime& rop); + friend std::ostream& operator<<(std::ostream& os, const DateTime& obj); }; - - BaseClass* DateTime_factory(); } #endif diff --git a/CGMES_2.4.15_16FEB2016/DayType.cpp b/CGMES_2.4.15_16FEB2016/DayType.cpp index 0f8ebddda..e53f29f9f 100644 --- a/CGMES_2.4.15_16FEB2016/DayType.cpp +++ b/CGMES_2.4.15_16FEB2016/DayType.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DayType.hpp" +#include +#include + #include "SeasonDayTypeSchedule.hpp" using namespace CIMPP; DayType::DayType() {}; - DayType::~DayType() {}; -bool assign_DayType_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DayType* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SeasonDayTypeSchedules.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_SeasonDayTypeSchedule_DayType(BaseClass*, BaseClass*); +bool assign_DayType_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DayType* element = dynamic_cast(BaseClass_ptr1); + SeasonDayTypeSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SeasonDayTypeSchedules.begin(), element->SeasonDayTypeSchedules.end(), element2) == element->SeasonDayTypeSchedules.end()) + { + element->SeasonDayTypeSchedules.push_back(element2); + return assign_SeasonDayTypeSchedule_DayType(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DayType_factory() { - return new DayType; - } +const char DayType::debugName[] = "DayType"; +const char* DayType::debugString() const +{ + return DayType::debugName; } -void DayType::addConstructToMap(std::unordered_map& factory_map) { +void DayType::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DayType"), &DayType_factory)); } -void DayType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DayType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DayType.SeasonDayTypeSchedules"), &assign_DayType_SeasonDayTypeSchedules)); +void DayType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DayType::debugName[] = "DayType"; -const char* DayType::debugString() +void DayType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DayType::debugName; + assign_map.insert(std::make_pair(std::string("cim:DayType.SeasonDayTypeSchedules"), &assign_DayType_SeasonDayTypeSchedules)); } const BaseClassDefiner DayType::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DayType::declare() return BaseClassDefiner(DayType::addConstructToMap, DayType::addPrimitiveAssignFnsToMap, DayType::addClassAssignFnsToMap, DayType::debugName); } - +namespace CIMPP +{ + BaseClass* DayType_factory() + { + return new DayType; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DayType.hpp b/CGMES_2.4.15_16FEB2016/DayType.hpp index 5242c9393..578cabc93 100644 --- a/CGMES_2.4.15_16FEB2016/DayType.hpp +++ b/CGMES_2.4.15_16FEB2016/DayType.hpp @@ -1,38 +1,39 @@ #ifndef DayType_H #define DayType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SeasonDayTypeSchedule; -class SeasonDayTypeSchedule; /* Group of similar days. For example it could be used to represent weekdays, weekend, or holidays. */ - class DayType: public IdentifiedObject + class DayType : public IdentifiedObject { - public: - std::list SeasonDayTypeSchedules; /* DayType for the Schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DayType(); - virtual ~DayType(); - + ~DayType() override; + + std::list SeasonDayTypeSchedules; /* DayType for the Schedule. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DayType_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Decimal.cpp b/CGMES_2.4.15_16FEB2016/Decimal.cpp index 8556ce687..98be5f30e 100644 --- a/CGMES_2.4.15_16FEB2016/Decimal.cpp +++ b/CGMES_2.4.15_16FEB2016/Decimal.cpp @@ -1,41 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Decimal.hpp" +#include -using namespace CIMPP; - -Decimal::Decimal() {}; - -Decimal::~Decimal() {}; +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; +Decimal& Decimal::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -namespace CIMPP { - BaseClass* Decimal_factory() { - return new Decimal; +Decimal::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void Decimal::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:Decimal"), &Decimal_factory)); +const char Decimal::debugName[] = "Decimal"; +const char* Decimal::debugString() const +{ + return Decimal::debugName; } -void Decimal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +Decimal& Decimal::operator+=(const Decimal& rhs) +{ + value += rhs.value; + return *this; } -void Decimal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +Decimal& Decimal::operator-=(const Decimal& rhs) +{ + value -= rhs.value; + return *this; } -const char Decimal::debugName[] = "Decimal"; -const char* Decimal::debugString() +Decimal& Decimal::operator*=(const Decimal& rhs) { - return Decimal::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner Decimal::declare() +Decimal& Decimal::operator/=(const Decimal& rhs) { - return BaseClassDefiner(Decimal::addConstructToMap, Decimal::addPrimitiveAssignFnsToMap, Decimal::addClassAssignFnsToMap, Decimal::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Decimal& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const Decimal& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Decimal.hpp b/CGMES_2.4.15_16FEB2016/Decimal.hpp index 659729ccc..fa74e37f8 100644 --- a/CGMES_2.4.15_16FEB2016/Decimal.hpp +++ b/CGMES_2.4.15_16FEB2016/Decimal.hpp @@ -1,38 +1,39 @@ #ifndef Decimal_H #define Decimal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { - +#include +#include +namespace CIMPP +{ /* Decimal is the base-10 notational system for representing real numbers. */ - class Decimal: public BaseClass + class Decimal { - public: - + Decimal() : value(0.0), initialized(false) {} + Decimal(long double value) : value(value), initialized(true) {} + + Decimal& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - Decimal(); - virtual ~Decimal(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + Decimal& operator+=(const Decimal& rhs); + Decimal& operator-=(const Decimal& rhs); + Decimal& operator*=(const Decimal& rhs); + Decimal& operator/=(const Decimal& rhs); - BaseClass* Decimal_factory(); + friend std::istream& operator>>(std::istream& lop, Decimal& rop); + friend std::ostream& operator<<(std::ostream& os, const Decimal& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/Diagram.cpp b/CGMES_2.4.15_16FEB2016/Diagram.cpp index 744e0555a..c90822887 100644 --- a/CGMES_2.4.15_16FEB2016/Diagram.cpp +++ b/CGMES_2.4.15_16FEB2016/Diagram.cpp @@ -1,137 +1,156 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Diagram.hpp" +#include +#include + +#include "DiagramObject.hpp" #include "DiagramStyle.hpp" #include "OrientationKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "DiagramObject.hpp" using namespace CIMPP; -Diagram::Diagram(): DiagramStyle(nullptr) {}; - +Diagram::Diagram() : DiagramStyle(nullptr) {}; Diagram::~Diagram() {}; -bool assign_DiagramStyle_Diagram(BaseClass*, BaseClass*); -bool assign_Diagram_DiagramStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramStyle = dynamic_cast(BaseClass_ptr2); - if(element->DiagramStyle != nullptr) - return assign_DiagramStyle_Diagram(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_Diagram_orientation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->orientation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Diagram_x1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x1InitialView; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Diagram_x2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2InitialView; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Diagram_DiagramElements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiagramElements.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Diagram_y1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y1InitialView; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_Diagram_y2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y2InitialView; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Diagram_orientation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->orientation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObject_Diagram(BaseClass*, BaseClass*); +bool assign_Diagram_DiagramElements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Diagram* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramElements.begin(), element->DiagramElements.end(), element2) == element->DiagramElements.end()) + { + element->DiagramElements.push_back(element2); + return assign_DiagramObject_Diagram(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Diagram_x1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x1InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramStyle_Diagram(BaseClass*, BaseClass*); +bool assign_Diagram_DiagramStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Diagram* element = dynamic_cast(BaseClass_ptr1); + DiagramStyle* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramStyle != element2) + { + element->DiagramStyle = element2; + return assign_DiagramStyle_Diagram(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Diagram_x2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Diagram_y1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y1InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Diagram_y2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y2InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Diagram_factory() { - return new Diagram; - } + +const char Diagram::debugName[] = "Diagram"; +const char* Diagram::debugString() const +{ + return Diagram::debugName; } -void Diagram::addConstructToMap(std::unordered_map& factory_map) { +void Diagram::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Diagram"), &Diagram_factory)); } -void Diagram::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Diagram.orientation"), &assign_Diagram_orientation)); +void Diagram::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Diagram.orientation"), &assign_Diagram_orientation)); assign_map.insert(std::make_pair(std::string("cim:Diagram.x1InitialView"), &assign_Diagram_x1InitialView)); assign_map.insert(std::make_pair(std::string("cim:Diagram.x2InitialView"), &assign_Diagram_x2InitialView)); assign_map.insert(std::make_pair(std::string("cim:Diagram.y1InitialView"), &assign_Diagram_y1InitialView)); assign_map.insert(std::make_pair(std::string("cim:Diagram.y2InitialView"), &assign_Diagram_y2InitialView)); - } - -void Diagram::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramStyle"), &assign_Diagram_DiagramStyle)); - assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramElements"), &assign_Diagram_DiagramElements)); } -const char Diagram::debugName[] = "Diagram"; -const char* Diagram::debugString() +void Diagram::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Diagram::debugName; + assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramElements"), &assign_Diagram_DiagramElements)); + assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramStyle"), &assign_Diagram_DiagramStyle)); } const BaseClassDefiner Diagram::declare() @@ -139,4 +158,10 @@ const BaseClassDefiner Diagram::declare() return BaseClassDefiner(Diagram::addConstructToMap, Diagram::addPrimitiveAssignFnsToMap, Diagram::addClassAssignFnsToMap, Diagram::debugName); } - +namespace CIMPP +{ + BaseClass* Diagram_factory() + { + return new Diagram; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Diagram.hpp b/CGMES_2.4.15_16FEB2016/Diagram.hpp index 163978d01..571c85e7c 100644 --- a/CGMES_2.4.15_16FEB2016/Diagram.hpp +++ b/CGMES_2.4.15_16FEB2016/Diagram.hpp @@ -1,47 +1,48 @@ #ifndef Diagram_H #define Diagram_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "OrientationKind.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; + class DiagramStyle; - -class DiagramStyle; -class DiagramObject; /* The diagram being exchanged. The coordinate system is a standard Cartesian coordinate system and the orientation attribute defines the orientation. */ - class Diagram: public IdentifiedObject + class Diagram : public IdentifiedObject { - public: - CIMPP::DiagramStyle* DiagramStyle; /* A Diagram may have a DiagramStyle. Default: 0 */ - CIMPP::OrientationKind orientation; /* Coordinate system orientation of the diagram. Default: 0 */ - CIMPP::Simple_Float x1InitialView; /* X coordinate of the first corner of the initial view. Default: nullptr */ - CIMPP::Simple_Float x2InitialView; /* X coordinate of the second corner of the initial view. Default: nullptr */ - CIMPP::Simple_Float y1InitialView; /* Y coordinate of the first corner of the initial view. Default: nullptr */ - CIMPP::Simple_Float y2InitialView; /* Y coordinate of the second corner of the initial view. Default: nullptr */ - std::list DiagramElements; /* A diagram is made up of multiple diagram objects. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Diagram(); - virtual ~Diagram(); - + ~Diagram() override; + + std::list DiagramElements; /* A diagram is made up of multiple diagram objects. Default: 0 */ + CIMPP::DiagramStyle* DiagramStyle; /* A Diagram may have a DiagramStyle. Default: 0 */ + CIMPP::OrientationKind orientation; /* Coordinate system orientation of the diagram. Default: 0 */ + CIMPP::Simple_Float x1InitialView; /* X coordinate of the first corner of the initial view. Default: nullptr */ + CIMPP::Simple_Float x2InitialView; /* X coordinate of the second corner of the initial view. Default: nullptr */ + CIMPP::Simple_Float y1InitialView; /* Y coordinate of the first corner of the initial view. Default: nullptr */ + CIMPP::Simple_Float y2InitialView; /* Y coordinate of the second corner of the initial view. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Diagram_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.cpp b/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.cpp index a63a57174..24968c480 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramLayoutVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -DiagramLayoutVersion::DiagramLayoutVersion(): date(nullptr) {}; - +DiagramLayoutVersion::DiagramLayoutVersion() {}; DiagramLayoutVersion::~DiagramLayoutVersion() {}; - - -bool assign_DiagramLayoutVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_DiagramLayoutVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_DiagramLayoutVersion_baseUML(std::stringstream &buffer, BaseClass* B return false; } -bool assign_DiagramLayoutVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_DiagramLayoutVersion_baseURI(std::stringstream &buffer, BaseClass* B return false; } +bool assign_DiagramLayoutVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiagramLayoutVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_DiagramLayoutVersion_differenceModelURI(std::stringstream &buffer, B return false; } -bool assign_DiagramLayoutVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_DiagramLayoutVersion_entsoeUML(std::stringstream &buffer, BaseClass* return false; } -bool assign_DiagramLayoutVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_DiagramLayoutVersion_entsoeURI(std::stringstream &buffer, BaseClass* return false; } -bool assign_DiagramLayoutVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_DiagramLayoutVersion_modelDescriptionURI(std::stringstream &buffer, return false; } -bool assign_DiagramLayoutVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_DiagramLayoutVersion_namespaceRDF(std::stringstream &buffer, BaseCla return false; } -bool assign_DiagramLayoutVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_DiagramLayoutVersion_namespaceUML(std::stringstream &buffer, BaseCla return false; } -bool assign_DiagramLayoutVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_DiagramLayoutVersion_shortName(std::stringstream &buffer, BaseClass* return false; } -namespace CIMPP { - BaseClass* DiagramLayoutVersion_factory() { - return new DiagramLayoutVersion; - } + + + + + + + + + + + +const char DiagramLayoutVersion::debugName[] = "DiagramLayoutVersion"; +const char* DiagramLayoutVersion::debugString() const +{ + return DiagramLayoutVersion::debugName; } -void DiagramLayoutVersion::addConstructToMap(std::unordered_map& factory_map) { +void DiagramLayoutVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion"), &DiagramLayoutVersion_factory)); } -void DiagramLayoutVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DiagramLayoutVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.baseUML"), &assign_DiagramLayoutVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.baseURI"), &assign_DiagramLayoutVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.differenceModelURI"), &assign_DiagramLayoutVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.date"), &assign_DiagramLayoutVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.differenceModelURI"), &assign_DiagramLayoutVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.entsoeUML"), &assign_DiagramLayoutVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.entsoeURI"), &assign_DiagramLayoutVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.modelDescriptionURI"), &assign_DiagramLayoutVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void DiagramLayoutVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.date"), &assign_DiagramLayoutVersion_date)); - } - -const char DiagramLayoutVersion::debugName[] = "DiagramLayoutVersion"; -const char* DiagramLayoutVersion::debugString() +void DiagramLayoutVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramLayoutVersion::debugName; } const BaseClassDefiner DiagramLayoutVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner DiagramLayoutVersion::declare() return BaseClassDefiner(DiagramLayoutVersion::addConstructToMap, DiagramLayoutVersion::addPrimitiveAssignFnsToMap, DiagramLayoutVersion::addClassAssignFnsToMap, DiagramLayoutVersion::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramLayoutVersion_factory() + { + return new DiagramLayoutVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.hpp b/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.hpp index 3c777f1e5..4cef20371 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/DiagramLayoutVersion.hpp @@ -1,48 +1,49 @@ #ifndef DiagramLayoutVersion_H #define DiagramLayoutVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class DiagramLayoutVersion: public BaseClass + class DiagramLayoutVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/DiagramLayout/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramLayoutVersion(); - virtual ~DiagramLayoutVersion(); - + ~DiagramLayoutVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/DiagramLayout/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramLayoutVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiagramObject.cpp b/CGMES_2.4.15_16FEB2016/DiagramObject.cpp index cc2e3475e..686fdca1f 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObject.cpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObject.cpp @@ -1,176 +1,216 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObject.hpp" +#include +#include + #include "Diagram.hpp" +#include "DiagramObjectPoint.hpp" +#include "DiagramObjectStyle.hpp" +#include "IdentifiedObject.hpp" +#include "VisibilityLayer.hpp" #include "Integer.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "AngleDegrees.hpp" -#include "IdentifiedObject.hpp" -#include "DiagramObjectPoint.hpp" -#include "VisibilityLayer.hpp" -#include "DiagramObjectStyle.hpp" using namespace CIMPP; -DiagramObject::DiagramObject(): Diagram(nullptr), IdentifiedObject(nullptr), DiagramObjectStyle(nullptr) {}; - +DiagramObject::DiagramObject() : Diagram(nullptr), DiagramObjectStyle(nullptr), IdentifiedObject(nullptr) {}; DiagramObject::~DiagramObject() {}; -bool assign_Diagram_DiagramElements(BaseClass*, BaseClass*); -bool assign_DiagramObject_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - element->Diagram = dynamic_cast(BaseClass_ptr2); - if(element->Diagram != nullptr) - return assign_Diagram_DiagramElements(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_DiagramObject_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->drawingOrder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_IdentifiedObject_DiagramObjects(BaseClass*, BaseClass*); -bool assign_DiagramObject_IdentifiedObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - element->IdentifiedObject = dynamic_cast(BaseClass_ptr2); - if(element->IdentifiedObject != nullptr) - return assign_IdentifiedObject_DiagramObjects(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_DiagramObject_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiagramObjectPoints.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_DiagramObject_isPolygon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isPolygon; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_DiagramObject_VisibilityLayers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VisibilityLayers.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_DiagramObject_offsetX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->offsetX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_DiagramObject_offsetY(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->offsetY; + if (buffer.fail()) + return false; + else return true; + } + return false; +} + +bool assign_DiagramObject_rotation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rotation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + + +bool assign_Diagram_DiagramElements(BaseClass*, BaseClass*); +bool assign_DiagramObject_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + Diagram* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Diagram != element2) + { + element->Diagram = element2; + return assign_Diagram_DiagramElements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_DiagramObjectPoint_DiagramObject(BaseClass*, BaseClass*); +bool assign_DiagramObject_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramObjectPoints.begin(), element->DiagramObjectPoints.end(), element2) == element->DiagramObjectPoints.end()) + { + element->DiagramObjectPoints.push_back(element2); + return assign_DiagramObjectPoint_DiagramObject(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_DiagramObjectStyle_StyledObjects(BaseClass*, BaseClass*); -bool assign_DiagramObject_DiagramObjectStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObjectStyle = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObjectStyle != nullptr) - return assign_DiagramObjectStyle_StyledObjects(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - -bool assign_DiagramObject_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->drawingOrder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_isPolygon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isPolygon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_offsetX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->offsetX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_offsetY(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->offsetY; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_rotation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rotation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - - - -namespace CIMPP { - BaseClass* DiagramObject_factory() { - return new DiagramObject; +bool assign_DiagramObject_DiagramObjectStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectStyle* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramObjectStyle != element2) + { + element->DiagramObjectStyle = element2; + return assign_DiagramObjectStyle_StyledObjects(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + +bool assign_IdentifiedObject_DiagramObjects(BaseClass*, BaseClass*); +bool assign_DiagramObject_IdentifiedObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + IdentifiedObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->IdentifiedObject != element2) + { + element->IdentifiedObject = element2; + return assign_IdentifiedObject_DiagramObjects(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_VisibilityLayer_VisibleObjects(BaseClass*, BaseClass*); +bool assign_DiagramObject_VisibilityLayers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + VisibilityLayer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VisibilityLayers.begin(), element->VisibilityLayers.end(), element2) == element->VisibilityLayers.end()) + { + element->VisibilityLayers.push_back(element2); + return assign_VisibilityLayer_VisibleObjects(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + +const char DiagramObject::debugName[] = "DiagramObject"; +const char* DiagramObject::debugString() const +{ + return DiagramObject::debugName; } -void DiagramObject::addConstructToMap(std::unordered_map& factory_map) { +void DiagramObject::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramObject"), &DiagramObject_factory)); } -void DiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObject.drawingOrder"), &assign_DiagramObject_drawingOrder)); +void DiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:DiagramObject.drawingOrder"), &assign_DiagramObject_drawingOrder)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.isPolygon"), &assign_DiagramObject_isPolygon)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.offsetX"), &assign_DiagramObject_offsetX)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.offsetY"), &assign_DiagramObject_offsetY)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.rotation"), &assign_DiagramObject_rotation)); - } +} -void DiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiagramObject.Diagram"), &assign_DiagramObject_Diagram)); - assign_map.insert(std::make_pair(std::string("cim:DiagramObject.IdentifiedObject"), &assign_DiagramObject_IdentifiedObject)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.DiagramObjectPoints"), &assign_DiagramObject_DiagramObjectPoints)); - assign_map.insert(std::make_pair(std::string("cim:DiagramObject.VisibilityLayers"), &assign_DiagramObject_VisibilityLayers)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.DiagramObjectStyle"), &assign_DiagramObject_DiagramObjectStyle)); -} - -const char DiagramObject::debugName[] = "DiagramObject"; -const char* DiagramObject::debugString() -{ - return DiagramObject::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramObject.IdentifiedObject"), &assign_DiagramObject_IdentifiedObject)); + assign_map.insert(std::make_pair(std::string("cim:DiagramObject.VisibilityLayers"), &assign_DiagramObject_VisibilityLayers)); } const BaseClassDefiner DiagramObject::declare() @@ -178,4 +218,10 @@ const BaseClassDefiner DiagramObject::declare() return BaseClassDefiner(DiagramObject::addConstructToMap, DiagramObject::addPrimitiveAssignFnsToMap, DiagramObject::addClassAssignFnsToMap, DiagramObject::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObject_factory() + { + return new DiagramObject; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiagramObject.hpp b/CGMES_2.4.15_16FEB2016/DiagramObject.hpp index 7fc11266b..63b5c821b 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObject.hpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObject.hpp @@ -1,55 +1,56 @@ #ifndef DiagramObject_H #define DiagramObject_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "Boolean.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" -#include "AngleDegrees.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Diagram; + class DiagramObjectPoint; + class DiagramObjectStyle; + class IdentifiedObject; + class VisibilityLayer; - -class Diagram; -class IdentifiedObject; -class DiagramObjectPoint; -class VisibilityLayer; -class DiagramObjectStyle; /* An object that defines one or more points in a given space. This object can be associated with anything that specializes IdentifiedObject. For single line diagrams such objects typically include such items as analog values, breakers, disconnectors, power transformers, and transmission lines. */ - class DiagramObject: public IdentifiedObject + class DiagramObject : public IdentifiedObject { - public: - CIMPP::Diagram* Diagram; /* A diagram object is part of a diagram. Default: 0 */ - CIMPP::Integer drawingOrder; /* The drawing order of this element. The higher the number, the later the element is drawn in sequence. This is used to ensure that elements that overlap are rendered in the correct order. Default: 0 */ - CIMPP::Boolean isPolygon; /* Defines whether or not the diagram objects points define the boundaries of a polygon or the routing of a polyline. If this value is true then a receiving application should consider the first and last points to be connected. Default: false */ - CIMPP::Simple_Float offsetX; /* The offset in the X direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the horizontal centre of the icon. -0.5 indicates it is offset by 50% to the left and 0.5 indicates an offset of 50% to the right. Default: nullptr */ - CIMPP::Simple_Float offsetY; /* The offset in the Y direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the vertical centre of the icon. The offset direction is dependent on the orientation of the diagram, with -0.5 and 0.5 indicating an offset of +/- 50% on the vertical axis. Default: nullptr */ - CIMPP::AngleDegrees rotation; /* Sets the angle of rotation of the diagram object. Zero degrees is pointing to the top of the diagram. Rotation is clockwise. Default: nullptr */ - CIMPP::IdentifiedObject* IdentifiedObject; /* The diagram objects that are associated with the domain object. Default: 0 */ - std::list DiagramObjectPoints; /* A diagram object can have 0 or more points to reflect its layout position, routing (for polylines) or boundary (for polygons). Default: 0 */ - std::list VisibilityLayers; /* A diagram object can be part of multiple visibility layers. Default: 0 */ - CIMPP::DiagramObjectStyle* DiagramObjectStyle; /* A diagram object has a style associated that provides a reference for the style used in the originating system. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObject(); - virtual ~DiagramObject(); - + ~DiagramObject() override; + + CIMPP::Diagram* Diagram; /* A diagram object is part of a diagram. Default: 0 */ + std::list DiagramObjectPoints; /* A diagram object can have 0 or more points to reflect its layout position, routing (for polylines) or boundary (for polygons). Default: 0 */ + CIMPP::DiagramObjectStyle* DiagramObjectStyle; /* A diagram object has a style associated that provides a reference for the style used in the originating system. Default: 0 */ + CIMPP::IdentifiedObject* IdentifiedObject; /* The diagram objects that are associated with the domain object. Default: 0 */ + std::list VisibilityLayers; /* A diagram object can be part of multiple visibility layers. Default: 0 */ + CIMPP::Integer drawingOrder; /* The drawing order of this element. The higher the number, the later the element is drawn in sequence. This is used to ensure that elements that overlap are rendered in the correct order. Default: 0 */ + CIMPP::Boolean isPolygon; /* Defines whether or not the diagram objects points define the boundaries of a polygon or the routing of a polyline. If this value is true then a receiving application should consider the first and last points to be connected. Default: false */ + CIMPP::Simple_Float offsetX; /* The offset in the X direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the horizontal centre of the icon. -0.5 indicates it is offset by 50% to the left and 0.5 indicates an offset of 50% to the right. Default: nullptr */ + CIMPP::Simple_Float offsetY; /* The offset in the Y direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the vertical centre of the icon. The offset direction is dependent on the orientation of the diagram, with -0.5 and 0.5 indicating an offset of +/- 50% on the vertical axis. Default: nullptr */ + CIMPP::AngleDegrees rotation; /* Sets the angle of rotation of the diagram object. Zero degrees is pointing to the top of the diagram. Rotation is clockwise. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObject_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.cpp b/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.cpp index 201d1aee0..9efe6a370 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.cpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.cpp @@ -1,48 +1,56 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObjectGluePoint.hpp" +#include +#include + #include "DiagramObjectPoint.hpp" using namespace CIMPP; -DiagramObjectGluePoint::DiagramObjectGluePoint(): DiagramObjectPoints(nullptr) {}; - +DiagramObjectGluePoint::DiagramObjectGluePoint() {}; DiagramObjectGluePoint::~DiagramObjectGluePoint() {}; -bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectGluePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObjectPoints = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObjectPoints != nullptr) - return true; - } - return false; -} - -namespace CIMPP { - BaseClass* DiagramObjectGluePoint_factory() { - return new DiagramObjectGluePoint; +bool assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass*, BaseClass*); +bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectGluePoint* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramObjectPoints.begin(), element->DiagramObjectPoints.end(), element2) == element->DiagramObjectPoints.end()) + { + element->DiagramObjectPoints.push_back(element2); + return assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DiagramObjectGluePoint::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint"), &DiagramObjectGluePoint_factory)); +const char DiagramObjectGluePoint::debugName[] = "DiagramObjectGluePoint"; +const char* DiagramObjectGluePoint::debugString() const +{ + return DiagramObjectGluePoint::debugName; } -void DiagramObjectGluePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DiagramObjectGluePoint::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint"), &DiagramObjectGluePoint_factory)); +} -void DiagramObjectGluePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint.DiagramObjectPoints"), &assign_DiagramObjectGluePoint_DiagramObjectPoints)); +void DiagramObjectGluePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiagramObjectGluePoint::debugName[] = "DiagramObjectGluePoint"; -const char* DiagramObjectGluePoint::debugString() +void DiagramObjectGluePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramObjectGluePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint.DiagramObjectPoints"), &assign_DiagramObjectGluePoint_DiagramObjectPoints)); } const BaseClassDefiner DiagramObjectGluePoint::declare() @@ -50,4 +58,10 @@ const BaseClassDefiner DiagramObjectGluePoint::declare() return BaseClassDefiner(DiagramObjectGluePoint::addConstructToMap, DiagramObjectGluePoint::addPrimitiveAssignFnsToMap, DiagramObjectGluePoint::addClassAssignFnsToMap, DiagramObjectGluePoint::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObjectGluePoint_factory() + { + return new DiagramObjectGluePoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.hpp b/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.hpp index d963bdb3c..09f9a7fe8 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.hpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObjectGluePoint.hpp @@ -1,38 +1,39 @@ #ifndef DiagramObjectGluePoint_H #define DiagramObjectGluePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DiagramObjectPoint; -class DiagramObjectPoint; /* This is used for grouping diagram object points from different diagram objects that are considered to be glued together in a diagram even if they are not at the exact same coordinates. */ - class DiagramObjectGluePoint: public BaseClass + class DiagramObjectGluePoint : public BaseClass { - public: - CIMPP::DiagramObjectPoint* DiagramObjectPoints; /* The `glue` point to which this point is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObjectGluePoint(); - virtual ~DiagramObjectGluePoint(); - + ~DiagramObjectGluePoint() override; + + std::list DiagramObjectPoints; /* The `glue` point to which this point is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObjectGluePoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.cpp b/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.cpp index 61136318d..488a291cc 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.cpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObjectPoint.hpp" +#include +#include + #include "DiagramObject.hpp" #include "DiagramObjectGluePoint.hpp" #include "Integer.hpp" @@ -11,112 +15,126 @@ using namespace CIMPP; -DiagramObjectPoint::DiagramObjectPoint(): DiagramObject(nullptr), DiagramObjectGluePoint(nullptr) {}; - +DiagramObjectPoint::DiagramObjectPoint() : DiagramObject(nullptr), DiagramObjectGluePoint(nullptr) {}; DiagramObjectPoint::~DiagramObjectPoint() {}; -bool assign_DiagramObject_DiagramObjectPoints(BaseClass*, BaseClass*); -bool assign_DiagramObjectPoint_DiagramObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObject = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObject != nullptr) - return assign_DiagramObject_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass*, BaseClass*); -bool assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObjectGluePoint = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObjectGluePoint != nullptr) - return assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_DiagramObjectPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiagramObjectPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xPosition; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiagramObjectPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yPosition; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiagramObjectPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zPosition; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiagramObjectPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObject_DiagramObjectPoints(BaseClass*, BaseClass*); +bool assign_DiagramObjectPoint_DiagramObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramObject != element2) + { + element->DiagramObject = element2; + return assign_DiagramObject_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DiagramObjectPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xPosition; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass*, BaseClass*); +bool assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectGluePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramObjectGluePoint != element2) + { + element->DiagramObjectGluePoint = element2; + return assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DiagramObjectPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yPosition; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiagramObjectPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zPosition; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiagramObjectPoint_factory() { - return new DiagramObjectPoint; - } + + +const char DiagramObjectPoint::debugName[] = "DiagramObjectPoint"; +const char* DiagramObjectPoint::debugString() const +{ + return DiagramObjectPoint::debugName; } -void DiagramObjectPoint::addConstructToMap(std::unordered_map& factory_map) { +void DiagramObjectPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint"), &DiagramObjectPoint_factory)); } -void DiagramObjectPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.sequenceNumber"), &assign_DiagramObjectPoint_sequenceNumber)); +void DiagramObjectPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.sequenceNumber"), &assign_DiagramObjectPoint_sequenceNumber)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.xPosition"), &assign_DiagramObjectPoint_xPosition)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.yPosition"), &assign_DiagramObjectPoint_yPosition)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.zPosition"), &assign_DiagramObjectPoint_zPosition)); } -void DiagramObjectPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DiagramObjectPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.DiagramObject"), &assign_DiagramObjectPoint_DiagramObject)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.DiagramObjectGluePoint"), &assign_DiagramObjectPoint_DiagramObjectGluePoint)); - } - -const char DiagramObjectPoint::debugName[] = "DiagramObjectPoint"; -const char* DiagramObjectPoint::debugString() -{ - return DiagramObjectPoint::debugName; } const BaseClassDefiner DiagramObjectPoint::declare() @@ -124,4 +142,10 @@ const BaseClassDefiner DiagramObjectPoint::declare() return BaseClassDefiner(DiagramObjectPoint::addConstructToMap, DiagramObjectPoint::addPrimitiveAssignFnsToMap, DiagramObjectPoint::addClassAssignFnsToMap, DiagramObjectPoint::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObjectPoint_factory() + { + return new DiagramObjectPoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.hpp b/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.hpp index 860de0392..d433fab0e 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.hpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObjectPoint.hpp @@ -1,46 +1,47 @@ #ifndef DiagramObjectPoint_H #define DiagramObjectPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; + class DiagramObjectGluePoint; - -class DiagramObject; -class DiagramObjectGluePoint; /* A point in a given space defined by 3 coordinates and associated to a diagram object. The coordinates may be positive or negative as the origin does not have to be in the corner of a diagram. */ - class DiagramObjectPoint: public BaseClass + class DiagramObjectPoint : public BaseClass { - public: - CIMPP::DiagramObject* DiagramObject; /* The diagram object with which the points are associated. Default: 0 */ - CIMPP::DiagramObjectGluePoint* DiagramObjectGluePoint; /* A diagram object glue point is associated with 2 or more object points that are considered to be `glued` together. Default: 0 */ - CIMPP::Integer sequenceNumber; /* The sequence position of the point, used for defining the order of points for diagram objects acting as a polyline or polygon with more than one point. Default: 0 */ - CIMPP::Simple_Float xPosition; /* The X coordinate of this point. Default: nullptr */ - CIMPP::Simple_Float yPosition; /* The Y coordinate of this point. Default: nullptr */ - CIMPP::Simple_Float zPosition; /* The Z coordinate of this point. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObjectPoint(); - virtual ~DiagramObjectPoint(); - + ~DiagramObjectPoint() override; + + CIMPP::DiagramObject* DiagramObject; /* The diagram object with which the points are associated. Default: 0 */ + CIMPP::DiagramObjectGluePoint* DiagramObjectGluePoint; /* A diagram object glue point is associated with 2 or more object points that are considered to be `glued` together. Default: 0 */ + CIMPP::Integer sequenceNumber; /* The sequence position of the point, used for defining the order of points for diagram objects acting as a polyline or polygon with more than one point. Default: 0 */ + CIMPP::Simple_Float xPosition; /* The X coordinate of this point. Default: nullptr */ + CIMPP::Simple_Float yPosition; /* The Y coordinate of this point. Default: nullptr */ + CIMPP::Simple_Float zPosition; /* The Z coordinate of this point. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObjectPoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.cpp b/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.cpp index 2f75f914d..8bf2e688d 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.cpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObjectStyle.hpp" +#include +#include + #include "DiagramObject.hpp" using namespace CIMPP; DiagramObjectStyle::DiagramObjectStyle() {}; - DiagramObjectStyle::~DiagramObjectStyle() {}; -bool assign_DiagramObjectStyle_StyledObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectStyle* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->StyledObjects.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_DiagramObject_DiagramObjectStyle(BaseClass*, BaseClass*); +bool assign_DiagramObjectStyle_StyledObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectStyle* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->StyledObjects.begin(), element->StyledObjects.end(), element2) == element->StyledObjects.end()) + { + element->StyledObjects.push_back(element2); + return assign_DiagramObject_DiagramObjectStyle(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DiagramObjectStyle_factory() { - return new DiagramObjectStyle; - } +const char DiagramObjectStyle::debugName[] = "DiagramObjectStyle"; +const char* DiagramObjectStyle::debugString() const +{ + return DiagramObjectStyle::debugName; } -void DiagramObjectStyle::addConstructToMap(std::unordered_map& factory_map) { +void DiagramObjectStyle::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramObjectStyle"), &DiagramObjectStyle_factory)); } -void DiagramObjectStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DiagramObjectStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObjectStyle.StyledObjects"), &assign_DiagramObjectStyle_StyledObjects)); +void DiagramObjectStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiagramObjectStyle::debugName[] = "DiagramObjectStyle"; -const char* DiagramObjectStyle::debugString() +void DiagramObjectStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramObjectStyle::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramObjectStyle.StyledObjects"), &assign_DiagramObjectStyle_StyledObjects)); } const BaseClassDefiner DiagramObjectStyle::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DiagramObjectStyle::declare() return BaseClassDefiner(DiagramObjectStyle::addConstructToMap, DiagramObjectStyle::addPrimitiveAssignFnsToMap, DiagramObjectStyle::addClassAssignFnsToMap, DiagramObjectStyle::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObjectStyle_factory() + { + return new DiagramObjectStyle; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.hpp b/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.hpp index a35d2d489..ff6524077 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.hpp +++ b/CGMES_2.4.15_16FEB2016/DiagramObjectStyle.hpp @@ -1,38 +1,39 @@ #ifndef DiagramObjectStyle_H #define DiagramObjectStyle_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DiagramObject; -class DiagramObject; /* A reference to a style used by the originating system for a diagram object. A diagram object style describes information such as line thickness, shape such as circle or rectangle etc, and color. */ - class DiagramObjectStyle: public IdentifiedObject + class DiagramObjectStyle : public IdentifiedObject { - public: - std::list StyledObjects; /* A style can be assigned to multiple diagram objects. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObjectStyle(); - virtual ~DiagramObjectStyle(); - + ~DiagramObjectStyle() override; + + std::list StyledObjects; /* A style can be assigned to multiple diagram objects. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObjectStyle_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiagramStyle.cpp b/CGMES_2.4.15_16FEB2016/DiagramStyle.cpp index 064099e82..eae09c4d7 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramStyle.cpp +++ b/CGMES_2.4.15_16FEB2016/DiagramStyle.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramStyle.hpp" +#include +#include + #include "Diagram.hpp" using namespace CIMPP; DiagramStyle::DiagramStyle() {}; - DiagramStyle::~DiagramStyle() {}; -bool assign_DiagramStyle_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramStyle* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Diagram.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_Diagram_DiagramStyle(BaseClass*, BaseClass*); +bool assign_DiagramStyle_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramStyle* element = dynamic_cast(BaseClass_ptr1); + Diagram* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Diagram.begin(), element->Diagram.end(), element2) == element->Diagram.end()) + { + element->Diagram.push_back(element2); + return assign_Diagram_DiagramStyle(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DiagramStyle_factory() { - return new DiagramStyle; - } +const char DiagramStyle::debugName[] = "DiagramStyle"; +const char* DiagramStyle::debugString() const +{ + return DiagramStyle::debugName; } -void DiagramStyle::addConstructToMap(std::unordered_map& factory_map) { +void DiagramStyle::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramStyle"), &DiagramStyle_factory)); } -void DiagramStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DiagramStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramStyle.Diagram"), &assign_DiagramStyle_Diagram)); +void DiagramStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiagramStyle::debugName[] = "DiagramStyle"; -const char* DiagramStyle::debugString() +void DiagramStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramStyle::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramStyle.Diagram"), &assign_DiagramStyle_Diagram)); } const BaseClassDefiner DiagramStyle::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DiagramStyle::declare() return BaseClassDefiner(DiagramStyle::addConstructToMap, DiagramStyle::addPrimitiveAssignFnsToMap, DiagramStyle::addClassAssignFnsToMap, DiagramStyle::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramStyle_factory() + { + return new DiagramStyle; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiagramStyle.hpp b/CGMES_2.4.15_16FEB2016/DiagramStyle.hpp index 615d86117..43960b981 100644 --- a/CGMES_2.4.15_16FEB2016/DiagramStyle.hpp +++ b/CGMES_2.4.15_16FEB2016/DiagramStyle.hpp @@ -1,38 +1,39 @@ #ifndef DiagramStyle_H #define DiagramStyle_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Diagram; -class Diagram; /* The diagram style refer to a style used by the originating system for a diagram. A diagram style describes information such as schematic, geographic, bus-branch etc. */ - class DiagramStyle: public IdentifiedObject + class DiagramStyle : public IdentifiedObject { - public: - std::list Diagram; /* A DiagramStyle can be used by many Diagrams. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramStyle(); - virtual ~DiagramStyle(); - + ~DiagramStyle() override; + + std::list Diagram; /* A DiagramStyle can be used by many Diagrams. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramStyle_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.cpp b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.cpp index 8886f8f76..fecfe649c 100644 --- a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.cpp +++ b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.cpp @@ -1,22 +1,26 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscExcContIEEEDEC1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -24,283 +28,297 @@ using namespace CIMPP; DiscExcContIEEEDEC1A::DiscExcContIEEEDEC1A() {}; - DiscExcContIEEEDEC1A::~DiscExcContIEEEDEC1A() {}; +bool assign_DiscExcContIEEEDEC1A_esc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->esc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_kan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kan; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_ketl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ketl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tan; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tw5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_val(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->val; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vanmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vanmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vomax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vomax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vomin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vomin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtlmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtlmt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscExcContIEEEDEC1A_vtlmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtlmt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vomax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vomax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vomin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vomin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_ketl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ketl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_val(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->val; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_esc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->esc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_kan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kan; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tan; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tw5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vtm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vtn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vanmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vanmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiscExcContIEEEDEC1A_factory() { - return new DiscExcContIEEEDEC1A; - } +const char DiscExcContIEEEDEC1A::debugName[] = "DiscExcContIEEEDEC1A"; +const char* DiscExcContIEEEDEC1A::debugString() const +{ + return DiscExcContIEEEDEC1A::debugName; } -void DiscExcContIEEEDEC1A::addConstructToMap(std::unordered_map& factory_map) { +void DiscExcContIEEEDEC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A"), &DiscExcContIEEEDEC1A_factory)); } -void DiscExcContIEEEDEC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtlmt"), &assign_DiscExcContIEEEDEC1A_vtlmt)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomax"), &assign_DiscExcContIEEEDEC1A_vomax)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomin"), &assign_DiscExcContIEEEDEC1A_vomin)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.ketl"), &assign_DiscExcContIEEEDEC1A_ketl)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtc"), &assign_DiscExcContIEEEDEC1A_vtc)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.val"), &assign_DiscExcContIEEEDEC1A_val)); +void DiscExcContIEEEDEC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.esc"), &assign_DiscExcContIEEEDEC1A_esc)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.kan"), &assign_DiscExcContIEEEDEC1A_kan)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.ketl"), &assign_DiscExcContIEEEDEC1A_ketl)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tan"), &assign_DiscExcContIEEEDEC1A_tan)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tw5"), &assign_DiscExcContIEEEDEC1A_tw5)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmax"), &assign_DiscExcContIEEEDEC1A_vsmax)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmin"), &assign_DiscExcContIEEEDEC1A_vsmin)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.td"), &assign_DiscExcContIEEEDEC1A_td)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tl1"), &assign_DiscExcContIEEEDEC1A_tl1)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tl2"), &assign_DiscExcContIEEEDEC1A_tl2)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tw5"), &assign_DiscExcContIEEEDEC1A_tw5)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.val"), &assign_DiscExcContIEEEDEC1A_val)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vanmax"), &assign_DiscExcContIEEEDEC1A_vanmax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomax"), &assign_DiscExcContIEEEDEC1A_vomax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomin"), &assign_DiscExcContIEEEDEC1A_vomin)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmax"), &assign_DiscExcContIEEEDEC1A_vsmax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmin"), &assign_DiscExcContIEEEDEC1A_vsmin)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtc"), &assign_DiscExcContIEEEDEC1A_vtc)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtlmt"), &assign_DiscExcContIEEEDEC1A_vtlmt)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtm"), &assign_DiscExcContIEEEDEC1A_vtm)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtn"), &assign_DiscExcContIEEEDEC1A_vtn)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vanmax"), &assign_DiscExcContIEEEDEC1A_vanmax)); } -void DiscExcContIEEEDEC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DiscExcContIEEEDEC1A::debugName[] = "DiscExcContIEEEDEC1A"; -const char* DiscExcContIEEEDEC1A::debugString() +void DiscExcContIEEEDEC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscExcContIEEEDEC1A::debugName; } const BaseClassDefiner DiscExcContIEEEDEC1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner DiscExcContIEEEDEC1A::declare() return BaseClassDefiner(DiscExcContIEEEDEC1A::addConstructToMap, DiscExcContIEEEDEC1A::addPrimitiveAssignFnsToMap, DiscExcContIEEEDEC1A::addClassAssignFnsToMap, DiscExcContIEEEDEC1A::debugName); } - +namespace CIMPP +{ + BaseClass* DiscExcContIEEEDEC1A_factory() + { + return new DiscExcContIEEEDEC1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.hpp b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.hpp index 5eba2d38a..e7c14b65d 100644 --- a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.hpp +++ b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC1A.hpp @@ -1,56 +1,57 @@ #ifndef DiscExcContIEEEDEC1A_H #define DiscExcContIEEEDEC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Type DEC1A discontinuous excitation control model that boosts generator excitation to a level higher than that demanded by the voltage regulator and stabilizer immediately following a system fault. Reference: IEEE Standard 421.5-2005 Section 12.2. */ - class DiscExcContIEEEDEC1A: public DiscontinuousExcitationControlDynamics + class DiscExcContIEEEDEC1A : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::PU vtlmt; /* Voltage reference (). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vomax; /* Limiter (). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU vomin; /* Limiter (). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ketl; /* Terminal voltage limiter gain (). Typical Value = 47. Default: nullptr */ - CIMPP::PU vtc; /* Terminal voltage level reference (). Typical Value = 0.95. Default: nullptr */ - CIMPP::PU val; /* Regulator voltage reference (). Typical Value = 5.5. Default: nullptr */ - CIMPP::PU esc; /* Speed change reference (). Typical Value = 0.0015. Default: nullptr */ - CIMPP::PU kan; /* Discontinuous controller gain (). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds tan; /* Discontinuous controller time constant (). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tw5; /* DEC washout time constant (). Typical Value = 5. Default: nullptr */ - CIMPP::PU vsmax; /* Limiter (). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU vsmin; /* Limiter (). Typical Value = -0.066. Default: nullptr */ - CIMPP::Seconds td; /* Time constant (). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tl1; /* Time constant (). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds tl2; /* Time constant (). Typical Value = 1.25. Default: nullptr */ - CIMPP::PU vtm; /* Voltage limits (). Typical Value = 1.13. Default: nullptr */ - CIMPP::PU vtn; /* Voltage limits (). Typical Value = 1.12. Default: nullptr */ - CIMPP::PU vanmax; /* Limiter for Van (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscExcContIEEEDEC1A(); - virtual ~DiscExcContIEEEDEC1A(); - + ~DiscExcContIEEEDEC1A() override; + + CIMPP::PU esc; /* Speed change reference (). Typical Value = 0.0015. Default: nullptr */ + CIMPP::PU kan; /* Discontinuous controller gain (). Typical Value = 400. Default: nullptr */ + CIMPP::PU ketl; /* Terminal voltage limiter gain (). Typical Value = 47. Default: nullptr */ + CIMPP::Seconds tan; /* Discontinuous controller time constant (). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds td; /* Time constant (). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tl1; /* Time constant (). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds tl2; /* Time constant (). Typical Value = 1.25. Default: nullptr */ + CIMPP::Seconds tw5; /* DEC washout time constant (). Typical Value = 5. Default: nullptr */ + CIMPP::PU val; /* Regulator voltage reference (). Typical Value = 5.5. Default: nullptr */ + CIMPP::PU vanmax; /* Limiter for Van (). Default: nullptr */ + CIMPP::PU vomax; /* Limiter (). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU vomin; /* Limiter (). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vsmax; /* Limiter (). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU vsmin; /* Limiter (). Typical Value = -0.066. Default: nullptr */ + CIMPP::PU vtc; /* Terminal voltage level reference (). Typical Value = 0.95. Default: nullptr */ + CIMPP::PU vtlmt; /* Voltage reference (). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vtm; /* Voltage limits (). Typical Value = 1.13. Default: nullptr */ + CIMPP::PU vtn; /* Voltage limits (). Typical Value = 1.12. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscExcContIEEEDEC1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.cpp b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.cpp index 3c1dbf01b..0b0a7a11a 100644 --- a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.cpp +++ b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.cpp @@ -1,111 +1,116 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscExcContIEEEDEC2A.hpp" -#include "PU.hpp" +#include +#include + #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; DiscExcContIEEEDEC2A::DiscExcContIEEEDEC2A() {}; - DiscExcContIEEEDEC2A::~DiscExcContIEEEDEC2A() {}; +bool assign_DiscExcContIEEEDEC2A_td1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_td2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_vdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_vdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_vk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscExcContIEEEDEC2A_vk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_td1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_td2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_vdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_vdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiscExcContIEEEDEC2A_factory() { - return new DiscExcContIEEEDEC2A; - } +const char DiscExcContIEEEDEC2A::debugName[] = "DiscExcContIEEEDEC2A"; +const char* DiscExcContIEEEDEC2A::debugString() const +{ + return DiscExcContIEEEDEC2A::debugName; } -void DiscExcContIEEEDEC2A::addConstructToMap(std::unordered_map& factory_map) { +void DiscExcContIEEEDEC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A"), &DiscExcContIEEEDEC2A_factory)); } -void DiscExcContIEEEDEC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vk"), &assign_DiscExcContIEEEDEC2A_vk)); +void DiscExcContIEEEDEC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.td1"), &assign_DiscExcContIEEEDEC2A_td1)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.td2"), &assign_DiscExcContIEEEDEC2A_td2)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vdmin"), &assign_DiscExcContIEEEDEC2A_vdmin)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vdmax"), &assign_DiscExcContIEEEDEC2A_vdmax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vdmin"), &assign_DiscExcContIEEEDEC2A_vdmin)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vk"), &assign_DiscExcContIEEEDEC2A_vk)); } -void DiscExcContIEEEDEC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DiscExcContIEEEDEC2A::debugName[] = "DiscExcContIEEEDEC2A"; -const char* DiscExcContIEEEDEC2A::debugString() +void DiscExcContIEEEDEC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscExcContIEEEDEC2A::debugName; } const BaseClassDefiner DiscExcContIEEEDEC2A::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner DiscExcContIEEEDEC2A::declare() return BaseClassDefiner(DiscExcContIEEEDEC2A::addConstructToMap, DiscExcContIEEEDEC2A::addPrimitiveAssignFnsToMap, DiscExcContIEEEDEC2A::addClassAssignFnsToMap, DiscExcContIEEEDEC2A::debugName); } - +namespace CIMPP +{ + BaseClass* DiscExcContIEEEDEC2A_factory() + { + return new DiscExcContIEEEDEC2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.hpp b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.hpp index 3160b03ac..35bb8c70a 100644 --- a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.hpp +++ b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC2A.hpp @@ -1,43 +1,44 @@ #ifndef DiscExcContIEEEDEC2A_H #define DiscExcContIEEEDEC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Type DEC2A model for the discontinuous excitation control. This system provides transient excitation boosting via an open-loop control as initiated by a trigger signal generated remotely. Reference: IEEE Standard 421.5-2005 Section 12.3. */ - class DiscExcContIEEEDEC2A: public DiscontinuousExcitationControlDynamics + class DiscExcContIEEEDEC2A : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::PU vk; /* Discontinuous controller input reference (). Default: nullptr */ - CIMPP::Seconds td1; /* Discontinuous controller time constant (). Default: nullptr */ - CIMPP::Seconds td2; /* Discontinuous controller washout time constant (). Default: nullptr */ - CIMPP::PU vdmin; /* Limiter (). Default: nullptr */ - CIMPP::PU vdmax; /* Limiter (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscExcContIEEEDEC2A(); - virtual ~DiscExcContIEEEDEC2A(); - + ~DiscExcContIEEEDEC2A() override; + + CIMPP::Seconds td1; /* Discontinuous controller time constant (). Default: nullptr */ + CIMPP::Seconds td2; /* Discontinuous controller washout time constant (). Default: nullptr */ + CIMPP::PU vdmax; /* Limiter (). Default: nullptr */ + CIMPP::PU vdmin; /* Limiter (). Default: nullptr */ + CIMPP::PU vk; /* Discontinuous controller input reference (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscExcContIEEEDEC2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.cpp b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.cpp index 5dd6209ae..af7d8f9ad 100644 --- a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.cpp +++ b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.cpp @@ -1,66 +1,68 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscExcContIEEEDEC3A.hpp" -#include "PU.hpp" +#include +#include + #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; DiscExcContIEEEDEC3A::DiscExcContIEEEDEC3A() {}; - DiscExcContIEEEDEC3A::~DiscExcContIEEEDEC3A() {}; +bool assign_DiscExcContIEEEDEC3A_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC3A_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscExcContIEEEDEC3A_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC3A_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiscExcContIEEEDEC3A_factory() { - return new DiscExcContIEEEDEC3A; - } +const char DiscExcContIEEEDEC3A::debugName[] = "DiscExcContIEEEDEC3A"; +const char* DiscExcContIEEEDEC3A::debugString() const +{ + return DiscExcContIEEEDEC3A::debugName; } -void DiscExcContIEEEDEC3A::addConstructToMap(std::unordered_map& factory_map) { +void DiscExcContIEEEDEC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A"), &DiscExcContIEEEDEC3A_factory)); } -void DiscExcContIEEEDEC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A.vtmin"), &assign_DiscExcContIEEEDEC3A_vtmin)); +void DiscExcContIEEEDEC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A.tdr"), &assign_DiscExcContIEEEDEC3A_tdr)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A.vtmin"), &assign_DiscExcContIEEEDEC3A_vtmin)); } -void DiscExcContIEEEDEC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DiscExcContIEEEDEC3A::debugName[] = "DiscExcContIEEEDEC3A"; -const char* DiscExcContIEEEDEC3A::debugString() +void DiscExcContIEEEDEC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscExcContIEEEDEC3A::debugName; } const BaseClassDefiner DiscExcContIEEEDEC3A::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner DiscExcContIEEEDEC3A::declare() return BaseClassDefiner(DiscExcContIEEEDEC3A::addConstructToMap, DiscExcContIEEEDEC3A::addPrimitiveAssignFnsToMap, DiscExcContIEEEDEC3A::addClassAssignFnsToMap, DiscExcContIEEEDEC3A::debugName); } - +namespace CIMPP +{ + BaseClass* DiscExcContIEEEDEC3A_factory() + { + return new DiscExcContIEEEDEC3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.hpp b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.hpp index a03be5948..b6c4728f7 100644 --- a/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.hpp +++ b/CGMES_2.4.15_16FEB2016/DiscExcContIEEEDEC3A.hpp @@ -1,40 +1,41 @@ #ifndef DiscExcContIEEEDEC3A_H #define DiscExcContIEEEDEC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Type DEC3A model. In some systems, the stabilizer output is disconnected from the regulator immediately following a severe fault to prevent the stabilizer from competing with action of voltage regulator during the first swing. Reference: IEEE Standard 421.5-2005 Section 12.4. */ - class DiscExcContIEEEDEC3A: public DiscontinuousExcitationControlDynamics + class DiscExcContIEEEDEC3A : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::PU vtmin; /* Terminal undervoltage comparison level (). Default: nullptr */ - CIMPP::Seconds tdr; /* Reset time delay (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscExcContIEEEDEC3A(); - virtual ~DiscExcContIEEEDEC3A(); - + ~DiscExcContIEEEDEC3A() override; + + CIMPP::Seconds tdr; /* Reset time delay (). Default: nullptr */ + CIMPP::PU vtmin; /* Terminal undervoltage comparison level (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscExcContIEEEDEC3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Disconnector.cpp b/CGMES_2.4.15_16FEB2016/Disconnector.cpp index b4478d691..4c56bdfb9 100644 --- a/CGMES_2.4.15_16FEB2016/Disconnector.cpp +++ b/CGMES_2.4.15_16FEB2016/Disconnector.cpp @@ -1,36 +1,36 @@ -#include -#include "Switch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Disconnector.hpp" +#include +#include + using namespace CIMPP; Disconnector::Disconnector() {}; - Disconnector::~Disconnector() {}; -namespace CIMPP { - BaseClass* Disconnector_factory() { - return new Disconnector; - } +const char Disconnector::debugName[] = "Disconnector"; +const char* Disconnector::debugString() const +{ + return Disconnector::debugName; } -void Disconnector::addConstructToMap(std::unordered_map& factory_map) { +void Disconnector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Disconnector"), &Disconnector_factory)); } -void Disconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Disconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Disconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Disconnector::debugName[] = "Disconnector"; -const char* Disconnector::debugString() +void Disconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Disconnector::debugName; } const BaseClassDefiner Disconnector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Disconnector::declare() return BaseClassDefiner(Disconnector::addConstructToMap, Disconnector::addPrimitiveAssignFnsToMap, Disconnector::addClassAssignFnsToMap, Disconnector::debugName); } - +namespace CIMPP +{ + BaseClass* Disconnector_factory() + { + return new Disconnector; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Disconnector.hpp b/CGMES_2.4.15_16FEB2016/Disconnector.hpp index 54570cd9f..a818915ac 100644 --- a/CGMES_2.4.15_16FEB2016/Disconnector.hpp +++ b/CGMES_2.4.15_16FEB2016/Disconnector.hpp @@ -1,36 +1,37 @@ #ifndef Disconnector_H #define Disconnector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Switch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Switch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made. */ - class Disconnector: public Switch + class Disconnector : public Switch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Disconnector(); - virtual ~Disconnector(); - + ~Disconnector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Disconnector_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.cpp b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.cpp index 297f1c13d..edf98a3ae 100644 --- a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.cpp @@ -1,61 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscontinuousExcitationControlDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -DiscontinuousExcitationControlDynamics::DiscontinuousExcitationControlDynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr) {}; - +DiscontinuousExcitationControlDynamics::DiscontinuousExcitationControlDynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr) {}; DiscontinuousExcitationControlDynamics::~DiscontinuousExcitationControlDynamics() {}; -bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass*, BaseClass*); -bool assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass*, BaseClass*); +bool assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* DiscontinuousExcitationControlDynamics_factory() { - return new DiscontinuousExcitationControlDynamics; +bool assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass*, BaseClass*); +bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DiscontinuousExcitationControlDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics"), &DiscontinuousExcitationControlDynamics_factory)); +const char DiscontinuousExcitationControlDynamics::debugName[] = "DiscontinuousExcitationControlDynamics"; +const char* DiscontinuousExcitationControlDynamics::debugString() const +{ + return DiscontinuousExcitationControlDynamics::debugName; } -void DiscontinuousExcitationControlDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DiscontinuousExcitationControlDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics"), &DiscontinuousExcitationControlDynamics_factory)); +} -void DiscontinuousExcitationControlDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.RemoteInputSignal"), &assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.ExcitationSystemDynamics"), &assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics)); +void DiscontinuousExcitationControlDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiscontinuousExcitationControlDynamics::debugName[] = "DiscontinuousExcitationControlDynamics"; -const char* DiscontinuousExcitationControlDynamics::debugString() +void DiscontinuousExcitationControlDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscontinuousExcitationControlDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.ExcitationSystemDynamics"), &assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.RemoteInputSignal"), &assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal)); } const BaseClassDefiner DiscontinuousExcitationControlDynamics::declare() @@ -63,4 +78,10 @@ const BaseClassDefiner DiscontinuousExcitationControlDynamics::declare() return BaseClassDefiner(DiscontinuousExcitationControlDynamics::addConstructToMap, DiscontinuousExcitationControlDynamics::addPrimitiveAssignFnsToMap, DiscontinuousExcitationControlDynamics::addClassAssignFnsToMap, DiscontinuousExcitationControlDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* DiscontinuousExcitationControlDynamics_factory() + { + return new DiscontinuousExcitationControlDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.hpp b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.hpp index 7bcd52a3b..110a96824 100644 --- a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlDynamics.hpp @@ -1,40 +1,41 @@ #ifndef DiscontinuousExcitationControlDynamics_H #define DiscontinuousExcitationControlDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Discontinuous excitation control function block whose behaviour is described by reference to a standard model . */ - class DiscontinuousExcitationControlDynamics: public DynamicsFunctionBlock + class DiscontinuousExcitationControlDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this discontinuous excitation control system model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this discontinuous excitation control model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscontinuousExcitationControlDynamics(); - virtual ~DiscontinuousExcitationControlDynamics(); - + ~DiscontinuousExcitationControlDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this discontinuous excitation control model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this discontinuous excitation control system model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscontinuousExcitationControlDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.cpp b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.cpp index a2ee92ba8..f0cdf252e 100644 --- a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscontinuousExcitationControlUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; DiscontinuousExcitationControlUserDefined::DiscontinuousExcitationControlUserDefined() {}; - DiscontinuousExcitationControlUserDefined::~DiscontinuousExcitationControlUserDefined() {}; -bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_DiscontinuousExcitationControlUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_DiscontinuousExcitationControlUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass*, BaseClass*); +bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* DiscontinuousExcitationControlUserDefined_factory() { - return new DiscontinuousExcitationControlUserDefined; - } +const char DiscontinuousExcitationControlUserDefined::debugName[] = "DiscontinuousExcitationControlUserDefined"; +const char* DiscontinuousExcitationControlUserDefined::debugString() const +{ + return DiscontinuousExcitationControlUserDefined::debugName; } -void DiscontinuousExcitationControlUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void DiscontinuousExcitationControlUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined"), &DiscontinuousExcitationControlUserDefined_factory)); } -void DiscontinuousExcitationControlUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DiscontinuousExcitationControlUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined.proprietary"), &assign_DiscontinuousExcitationControlUserDefined_proprietary)); - } - -void DiscontinuousExcitationControlUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined.ProprietaryParameterDynamics"), &assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics)); } -const char DiscontinuousExcitationControlUserDefined::debugName[] = "DiscontinuousExcitationControlUserDefined"; -const char* DiscontinuousExcitationControlUserDefined::debugString() +void DiscontinuousExcitationControlUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscontinuousExcitationControlUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined.ProprietaryParameterDynamics"), &assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner DiscontinuousExcitationControlUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner DiscontinuousExcitationControlUserDefined::declare() return BaseClassDefiner(DiscontinuousExcitationControlUserDefined::addConstructToMap, DiscontinuousExcitationControlUserDefined::addPrimitiveAssignFnsToMap, DiscontinuousExcitationControlUserDefined::addClassAssignFnsToMap, DiscontinuousExcitationControlUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* DiscontinuousExcitationControlUserDefined_factory() + { + return new DiscontinuousExcitationControlUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.hpp b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.hpp index d4ab36d67..6b48fa523 100644 --- a/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/DiscontinuousExcitationControlUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef DiscontinuousExcitationControlUserDefined_H #define DiscontinuousExcitationControlUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Discontinuous excitation control function block whose dynamic behaviour is described by */ - class DiscontinuousExcitationControlUserDefined: public DiscontinuousExcitationControlDynamics + class DiscontinuousExcitationControlUserDefined : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscontinuousExcitationControlUserDefined(); - virtual ~DiscontinuousExcitationControlUserDefined(); - + ~DiscontinuousExcitationControlUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscontinuousExcitationControlUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Discrete.cpp b/CGMES_2.4.15_16FEB2016/Discrete.cpp index 1346f5043..d6d1f006f 100644 --- a/CGMES_2.4.15_16FEB2016/Discrete.cpp +++ b/CGMES_2.4.15_16FEB2016/Discrete.cpp @@ -1,62 +1,76 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Discrete.hpp" +#include +#include + #include "DiscreteValue.hpp" #include "ValueAliasSet.hpp" using namespace CIMPP; -Discrete::Discrete(): ValueAliasSet(nullptr) {}; - +Discrete::Discrete() : ValueAliasSet(nullptr) {}; Discrete::~Discrete() {}; -bool assign_Discrete_DiscreteValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Discrete* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiscreteValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_DiscreteValue_Discrete(BaseClass*, BaseClass*); +bool assign_Discrete_DiscreteValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Discrete* element = dynamic_cast(BaseClass_ptr1); + DiscreteValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiscreteValues.begin(), element->DiscreteValues.end(), element2) == element->DiscreteValues.end()) + { + element->DiscreteValues.push_back(element2); + return assign_DiscreteValue_Discrete(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_ValueAliasSet_Discretes(BaseClass*, BaseClass*); -bool assign_Discrete_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Discrete* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_Discretes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Discrete_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Discrete* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_Discretes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* Discrete_factory() { - return new Discrete; - } +const char Discrete::debugName[] = "Discrete"; +const char* Discrete::debugString() const +{ + return Discrete::debugName; } -void Discrete::addConstructToMap(std::unordered_map& factory_map) { +void Discrete::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Discrete"), &Discrete_factory)); } -void Discrete::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Discrete::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Discrete.DiscreteValues"), &assign_Discrete_DiscreteValues)); - assign_map.insert(std::make_pair(std::string("cim:Discrete.ValueAliasSet"), &assign_Discrete_ValueAliasSet)); +void Discrete::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Discrete::debugName[] = "Discrete"; -const char* Discrete::debugString() +void Discrete::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Discrete::debugName; + assign_map.insert(std::make_pair(std::string("cim:Discrete.DiscreteValues"), &assign_Discrete_DiscreteValues)); + assign_map.insert(std::make_pair(std::string("cim:Discrete.ValueAliasSet"), &assign_Discrete_ValueAliasSet)); } const BaseClassDefiner Discrete::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner Discrete::declare() return BaseClassDefiner(Discrete::addConstructToMap, Discrete::addPrimitiveAssignFnsToMap, Discrete::addClassAssignFnsToMap, Discrete::debugName); } - +namespace CIMPP +{ + BaseClass* Discrete_factory() + { + return new Discrete; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Discrete.hpp b/CGMES_2.4.15_16FEB2016/Discrete.hpp index 68de8657a..3a3e2b07c 100644 --- a/CGMES_2.4.15_16FEB2016/Discrete.hpp +++ b/CGMES_2.4.15_16FEB2016/Discrete.hpp @@ -1,40 +1,41 @@ #ifndef Discrete_H #define Discrete_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DiscreteValue; + class ValueAliasSet; -class DiscreteValue; -class ValueAliasSet; /* Discrete represents a discrete Measurement, i.e. a Measurement representing discrete values, e.g. a Breaker position. */ - class Discrete: public Measurement + class Discrete : public Measurement { - public: - std::list DiscreteValues; /* Measurement to which this value is connected. Default: 0 */ - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a MeasurementValue.value to a name. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Discrete(); - virtual ~Discrete(); - + ~Discrete() override; + + std::list DiscreteValues; /* Measurement to which this value is connected. Default: 0 */ + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a MeasurementValue.value to a name. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Discrete_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DiscreteValue.cpp b/CGMES_2.4.15_16FEB2016/DiscreteValue.cpp index 56227f7be..52264d6bd 100644 --- a/CGMES_2.4.15_16FEB2016/DiscreteValue.cpp +++ b/CGMES_2.4.15_16FEB2016/DiscreteValue.cpp @@ -1,76 +1,92 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscreteValue.hpp" +#include +#include + #include "Command.hpp" #include "Discrete.hpp" #include "Integer.hpp" using namespace CIMPP; -DiscreteValue::DiscreteValue(): Command(nullptr), Discrete(nullptr) {}; - +DiscreteValue::DiscreteValue() : Command(nullptr), Discrete(nullptr) {}; DiscreteValue::~DiscreteValue() {}; -bool assign_DiscreteValue_Command(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Command = dynamic_cast(BaseClass_ptr2); - if(element->Command != nullptr) - return true; - } - return false; -} - -bool assign_Discrete_DiscreteValues(BaseClass*, BaseClass*); -bool assign_DiscreteValue_Discrete(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Discrete = dynamic_cast(BaseClass_ptr2); - if(element->Discrete != nullptr) - return assign_Discrete_DiscreteValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_DiscreteValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscreteValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Command_DiscreteValue(BaseClass*, BaseClass*); +bool assign_DiscreteValue_Command(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscreteValue* element = dynamic_cast(BaseClass_ptr1); + Command* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Command != element2) + { + element->Command = element2; + return assign_Command_DiscreteValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* DiscreteValue_factory() { - return new DiscreteValue; +bool assign_Discrete_DiscreteValues(BaseClass*, BaseClass*); +bool assign_DiscreteValue_Discrete(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscreteValue* element = dynamic_cast(BaseClass_ptr1); + Discrete* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Discrete != element2) + { + element->Discrete = element2; + return assign_Discrete_DiscreteValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + +const char DiscreteValue::debugName[] = "DiscreteValue"; +const char* DiscreteValue::debugString() const +{ + return DiscreteValue::debugName; } -void DiscreteValue::addConstructToMap(std::unordered_map& factory_map) { +void DiscreteValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscreteValue"), &DiscreteValue_factory)); } -void DiscreteValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.value"), &assign_DiscreteValue_value)); +void DiscreteValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.value"), &assign_DiscreteValue_value)); } -void DiscreteValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DiscreteValue::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.Command"), &assign_DiscreteValue_Command)); assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.Discrete"), &assign_DiscreteValue_Discrete)); - } - -const char DiscreteValue::debugName[] = "DiscreteValue"; -const char* DiscreteValue::debugString() -{ - return DiscreteValue::debugName; } const BaseClassDefiner DiscreteValue::declare() @@ -78,4 +94,10 @@ const BaseClassDefiner DiscreteValue::declare() return BaseClassDefiner(DiscreteValue::addConstructToMap, DiscreteValue::addPrimitiveAssignFnsToMap, DiscreteValue::addClassAssignFnsToMap, DiscreteValue::debugName); } - +namespace CIMPP +{ + BaseClass* DiscreteValue_factory() + { + return new DiscreteValue; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DiscreteValue.hpp b/CGMES_2.4.15_16FEB2016/DiscreteValue.hpp index 1f612822d..9345c3775 100644 --- a/CGMES_2.4.15_16FEB2016/DiscreteValue.hpp +++ b/CGMES_2.4.15_16FEB2016/DiscreteValue.hpp @@ -1,42 +1,43 @@ #ifndef DiscreteValue_H #define DiscreteValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Command; + class Discrete; - -class Command; -class Discrete; /* DiscreteValue represents a discrete MeasurementValue. */ - class DiscreteValue: public MeasurementValue + class DiscreteValue : public MeasurementValue { - public: - CIMPP::Command* Command; /* The MeasurementValue that is controlled. Default: 0 */ - CIMPP::Discrete* Discrete; /* The values connected to this measurement. Default: 0 */ - CIMPP::Integer value; /* The value to supervise. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscreteValue(); - virtual ~DiscreteValue(); - + ~DiscreteValue() override; + + CIMPP::Command* Command; /* The MeasurementValue that is controlled. Default: 0 */ + CIMPP::Discrete* Discrete; /* The values connected to this measurement. Default: 0 */ + CIMPP::Integer value; /* The value to supervise. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscreteValue_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.cpp b/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.cpp index 63914b160..ca339f115 100644 --- a/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.cpp +++ b/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DroopSignalFeedbackKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::DroopSignalFeedbackKind& rop) +DroopSignalFeedbackKind& DroopSignalFeedbackKind::operator=(DroopSignalFeedbackKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +DroopSignalFeedbackKind::operator DroopSignalFeedbackKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char DroopSignalFeedbackKind::debugName[] = "DroopSignalFeedbackKind"; +const char* DroopSignalFeedbackKind::debugString() const +{ + return DroopSignalFeedbackKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, DroopSignalFeedbackKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const DroopSignalFeedbackKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == DroopSignalFeedbackKind::electricalPower) + { + EnumSymbol = "electricalPower"; + } + if (obj.value == DroopSignalFeedbackKind::none) + { + EnumSymbol = "none"; + } + if (obj.value == DroopSignalFeedbackKind::fuelValveStroke) + { + EnumSymbol = "fuelValveStroke"; + } + if (obj.value == DroopSignalFeedbackKind::governorOutput) + { + EnumSymbol = "governorOutput"; + } + + if (!EnumSymbol.empty()) + { + os << "DroopSignalFeedbackKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.hpp b/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.hpp index 01984347c..de948a1bc 100644 --- a/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.hpp +++ b/CGMES_2.4.15_16FEB2016/DroopSignalFeedbackKind.hpp @@ -1,29 +1,54 @@ #ifndef DroopSignalFeedbackKind_H #define DroopSignalFeedbackKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Governor droop signal feedback source. */ - enum class DroopSignalFeedbackKind + class DroopSignalFeedbackKind { - /** - * Electrical power feedback (connection indicated as 1 in the block diagrams of models, e.g. GovCT1, GovCT2). - */ - electricalPower, - /** - * No droop signal feedback, is isochronous governor. - */ - none, - /** - * Fuel valve stroke feedback (true stroke) (connection indicated as 2 in the block diagrams of model, e.g. GovCT1, GovCT2). - */ - fuelValveStroke, - /** - * Governor output feedback (requested stroke) (connection indicated as 3 in the block diagrams of models, e.g. GovCT1, GovCT2). - */ - governorOutput, + public: + enum DroopSignalFeedbackKind_ENUM + { + /** + * Electrical power feedback (connection indicated as 1 in the block diagrams of models, e.g. GovCT1, GovCT2). + */ + electricalPower, + /** + * No droop signal feedback, is isochronous governor. + */ + none, + /** + * Fuel valve stroke feedback (true stroke) (connection indicated as 2 in the block diagrams of model, e.g. GovCT1, GovCT2). + */ + fuelValveStroke, + /** + * Governor output feedback (requested stroke) (connection indicated as 3 in the block diagrams of models, e.g. GovCT1, GovCT2). + */ + governorOutput, + }; + + DroopSignalFeedbackKind() : value(), initialized(false) {} + DroopSignalFeedbackKind(DroopSignalFeedbackKind_ENUM value) : value(value), initialized(true) {} + + DroopSignalFeedbackKind& operator=(DroopSignalFeedbackKind_ENUM rop); + operator DroopSignalFeedbackKind_ENUM() const; + + DroopSignalFeedbackKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, DroopSignalFeedbackKind& rop); + friend std::ostream& operator<<(std::ostream& os, const DroopSignalFeedbackKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::DroopSignalFeedbackKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.cpp b/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.cpp index 01d8bdb3c..d45cc9fc5 100644 --- a/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.cpp +++ b/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.cpp @@ -1,51 +1,52 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DynamicsFunctionBlock.hpp" +#include +#include + #include "Boolean.hpp" using namespace CIMPP; DynamicsFunctionBlock::DynamicsFunctionBlock() {}; - DynamicsFunctionBlock::~DynamicsFunctionBlock() {}; +bool assign_DynamicsFunctionBlock_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsFunctionBlock* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->enabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DynamicsFunctionBlock_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsFunctionBlock* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->enabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DynamicsFunctionBlock_factory() { - return new DynamicsFunctionBlock; - } +const char DynamicsFunctionBlock::debugName[] = "DynamicsFunctionBlock"; +const char* DynamicsFunctionBlock::debugString() const +{ + return DynamicsFunctionBlock::debugName; } -void DynamicsFunctionBlock::addConstructToMap(std::unordered_map& factory_map) { +void DynamicsFunctionBlock::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DynamicsFunctionBlock"), &DynamicsFunctionBlock_factory)); } -void DynamicsFunctionBlock::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DynamicsFunctionBlock::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DynamicsFunctionBlock.enabled"), &assign_DynamicsFunctionBlock_enabled)); } -void DynamicsFunctionBlock::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DynamicsFunctionBlock::debugName[] = "DynamicsFunctionBlock"; -const char* DynamicsFunctionBlock::debugString() +void DynamicsFunctionBlock::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DynamicsFunctionBlock::debugName; } const BaseClassDefiner DynamicsFunctionBlock::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner DynamicsFunctionBlock::declare() return BaseClassDefiner(DynamicsFunctionBlock::addConstructToMap, DynamicsFunctionBlock::addPrimitiveAssignFnsToMap, DynamicsFunctionBlock::addClassAssignFnsToMap, DynamicsFunctionBlock::debugName); } - +namespace CIMPP +{ + BaseClass* DynamicsFunctionBlock_factory() + { + return new DynamicsFunctionBlock; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.hpp b/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.hpp index d2be285ab..75c86d07d 100644 --- a/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.hpp +++ b/CGMES_2.4.15_16FEB2016/DynamicsFunctionBlock.hpp @@ -1,38 +1,39 @@ #ifndef DynamicsFunctionBlock_H #define DynamicsFunctionBlock_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Abstract parent class for all Dynamics function blocks. */ - class DynamicsFunctionBlock: public IdentifiedObject + class DynamicsFunctionBlock : public IdentifiedObject { - public: - CIMPP::Boolean enabled; /* Function block used indicator. true = use of function block is enabled false = use of function block is disabled. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DynamicsFunctionBlock(); - virtual ~DynamicsFunctionBlock(); - + ~DynamicsFunctionBlock() override; + + CIMPP::Boolean enabled; /* Function block used indicator. true = use of function block is enabled false = use of function block is disabled. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DynamicsFunctionBlock_factory(); diff --git a/CGMES_2.4.15_16FEB2016/DynamicsVersion.cpp b/CGMES_2.4.15_16FEB2016/DynamicsVersion.cpp index 6cdce7312..959b46475 100644 --- a/CGMES_2.4.15_16FEB2016/DynamicsVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/DynamicsVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DynamicsVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -DynamicsVersion::DynamicsVersion(): date(nullptr) {}; - +DynamicsVersion::DynamicsVersion() {}; DynamicsVersion::~DynamicsVersion() {}; - - -bool assign_DynamicsVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_DynamicsVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_DynamicsVersion_baseUML(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_DynamicsVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_DynamicsVersion_baseURI(std::stringstream &buffer, BaseClass* BaseCl return false; } +bool assign_DynamicsVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DynamicsVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_DynamicsVersion_differenceModelURI(std::stringstream &buffer, BaseCl return false; } -bool assign_DynamicsVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_DynamicsVersion_entsoeUML(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_DynamicsVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_DynamicsVersion_entsoeURI(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_DynamicsVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_DynamicsVersion_modelDescriptionURI(std::stringstream &buffer, BaseC return false; } -bool assign_DynamicsVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_DynamicsVersion_namespaceRDF(std::stringstream &buffer, BaseClass* B return false; } -bool assign_DynamicsVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_DynamicsVersion_namespaceUML(std::stringstream &buffer, BaseClass* B return false; } -bool assign_DynamicsVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_DynamicsVersion_shortName(std::stringstream &buffer, BaseClass* Base return false; } -namespace CIMPP { - BaseClass* DynamicsVersion_factory() { - return new DynamicsVersion; - } + + + + + + + + + + + +const char DynamicsVersion::debugName[] = "DynamicsVersion"; +const char* DynamicsVersion::debugString() const +{ + return DynamicsVersion::debugName; } -void DynamicsVersion::addConstructToMap(std::unordered_map& factory_map) { +void DynamicsVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DynamicsVersion"), &DynamicsVersion_factory)); } -void DynamicsVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DynamicsVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.baseUML"), &assign_DynamicsVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.baseURI"), &assign_DynamicsVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.differenceModelURI"), &assign_DynamicsVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.date"), &assign_DynamicsVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.differenceModelURI"), &assign_DynamicsVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.entsoeUML"), &assign_DynamicsVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.entsoeURI"), &assign_DynamicsVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.modelDescriptionURI"), &assign_DynamicsVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void DynamicsVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.date"), &assign_DynamicsVersion_date)); - } - -const char DynamicsVersion::debugName[] = "DynamicsVersion"; -const char* DynamicsVersion::debugString() +void DynamicsVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DynamicsVersion::debugName; } const BaseClassDefiner DynamicsVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner DynamicsVersion::declare() return BaseClassDefiner(DynamicsVersion::addConstructToMap, DynamicsVersion::addPrimitiveAssignFnsToMap, DynamicsVersion::addClassAssignFnsToMap, DynamicsVersion::debugName); } - +namespace CIMPP +{ + BaseClass* DynamicsVersion_factory() + { + return new DynamicsVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/DynamicsVersion.hpp b/CGMES_2.4.15_16FEB2016/DynamicsVersion.hpp index 4894926e0..4f0dde70f 100644 --- a/CGMES_2.4.15_16FEB2016/DynamicsVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/DynamicsVersion.hpp @@ -1,48 +1,49 @@ #ifndef DynamicsVersion_H #define DynamicsVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class DynamicsVersion: public BaseClass + class DynamicsVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Dynamics/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DynamicsVersion(); - virtual ~DynamicsVersion(); - + ~DynamicsVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Dynamics/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DynamicsVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.cpp b/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.cpp index becdc044c..3d4c826d4 100644 --- a/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.cpp +++ b/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.cpp @@ -1,51 +1,52 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EarthFaultCompensator.hpp" +#include +#include + #include "Resistance.hpp" using namespace CIMPP; EarthFaultCompensator::EarthFaultCompensator() {}; - EarthFaultCompensator::~EarthFaultCompensator() {}; +bool assign_EarthFaultCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EarthFaultCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EarthFaultCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EarthFaultCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EarthFaultCompensator_factory() { - return new EarthFaultCompensator; - } +const char EarthFaultCompensator::debugName[] = "EarthFaultCompensator"; +const char* EarthFaultCompensator::debugString() const +{ + return EarthFaultCompensator::debugName; } -void EarthFaultCompensator::addConstructToMap(std::unordered_map& factory_map) { +void EarthFaultCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EarthFaultCompensator"), &EarthFaultCompensator_factory)); } -void EarthFaultCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EarthFaultCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EarthFaultCompensator.r"), &assign_EarthFaultCompensator_r)); } -void EarthFaultCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char EarthFaultCompensator::debugName[] = "EarthFaultCompensator"; -const char* EarthFaultCompensator::debugString() +void EarthFaultCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EarthFaultCompensator::debugName; } const BaseClassDefiner EarthFaultCompensator::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner EarthFaultCompensator::declare() return BaseClassDefiner(EarthFaultCompensator::addConstructToMap, EarthFaultCompensator::addPrimitiveAssignFnsToMap, EarthFaultCompensator::addClassAssignFnsToMap, EarthFaultCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* EarthFaultCompensator_factory() + { + return new EarthFaultCompensator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.hpp b/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.hpp index 84fa2a201..9d323d750 100644 --- a/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.hpp +++ b/CGMES_2.4.15_16FEB2016/EarthFaultCompensator.hpp @@ -1,38 +1,39 @@ #ifndef EarthFaultCompensator_H #define EarthFaultCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A conducting equipment used to represent a connection to ground which is typically used to compensate earth faults.. An earth fault compensator device modeled with a single terminal implies a second terminal solidly connected to ground. If two terminals are modeled, the ground is not assumed and normal connection rules apply. */ - class EarthFaultCompensator: public ConductingEquipment + class EarthFaultCompensator : public ConductingEquipment { - public: - CIMPP::Resistance r; /* Nominal resistance of device. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EarthFaultCompensator(); - virtual ~EarthFaultCompensator(); - + ~EarthFaultCompensator() override; + + CIMPP::Resistance r; /* Nominal resistance of device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EarthFaultCompensator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EnergyArea.cpp b/CGMES_2.4.15_16FEB2016/EnergyArea.cpp index b9e2eeca6..e32dc8db6 100644 --- a/CGMES_2.4.15_16FEB2016/EnergyArea.cpp +++ b/CGMES_2.4.15_16FEB2016/EnergyArea.cpp @@ -1,48 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergyArea.hpp" +#include +#include + #include "ControlArea.hpp" using namespace CIMPP; -EnergyArea::EnergyArea(): ControlArea(nullptr) {}; - +EnergyArea::EnergyArea() : ControlArea(nullptr) {}; EnergyArea::~EnergyArea() {}; -bool assign_EnergyArea_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergyArea* element = dynamic_cast(BaseClass_ptr1)) { - element->ControlArea = dynamic_cast(BaseClass_ptr2); - if(element->ControlArea != nullptr) - return true; - } - return false; -} - -namespace CIMPP { - BaseClass* EnergyArea_factory() { - return new EnergyArea; +bool assign_ControlArea_EnergyArea(BaseClass*, BaseClass*); +bool assign_EnergyArea_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergyArea* element = dynamic_cast(BaseClass_ptr1); + ControlArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ControlArea != element2) + { + element->ControlArea = element2; + return assign_ControlArea_EnergyArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void EnergyArea::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:EnergyArea"), &EnergyArea_factory)); +const char EnergyArea::debugName[] = "EnergyArea"; +const char* EnergyArea::debugString() const +{ + return EnergyArea::debugName; } -void EnergyArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void EnergyArea::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:EnergyArea"), &EnergyArea_factory)); +} -void EnergyArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergyArea.ControlArea"), &assign_EnergyArea_ControlArea)); +void EnergyArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EnergyArea::debugName[] = "EnergyArea"; -const char* EnergyArea::debugString() +void EnergyArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergyArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergyArea.ControlArea"), &assign_EnergyArea_ControlArea)); } const BaseClassDefiner EnergyArea::declare() @@ -50,4 +58,10 @@ const BaseClassDefiner EnergyArea::declare() return BaseClassDefiner(EnergyArea::addConstructToMap, EnergyArea::addPrimitiveAssignFnsToMap, EnergyArea::addClassAssignFnsToMap, EnergyArea::debugName); } - +namespace CIMPP +{ + BaseClass* EnergyArea_factory() + { + return new EnergyArea; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EnergyArea.hpp b/CGMES_2.4.15_16FEB2016/EnergyArea.hpp index 1ea400bdb..6974a9a94 100644 --- a/CGMES_2.4.15_16FEB2016/EnergyArea.hpp +++ b/CGMES_2.4.15_16FEB2016/EnergyArea.hpp @@ -1,38 +1,39 @@ #ifndef EnergyArea_H #define EnergyArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ControlArea; -class ControlArea; /* Describes an area having energy production or consumption. Specializations are intended to support the load allocation function as typically required in energy management systems or planning studies to allocate hypothesized load levels to individual load points for power flow analysis. Often the energy area can be linked to both measured and forecast load levels. */ - class EnergyArea: public IdentifiedObject + class EnergyArea : public IdentifiedObject { - public: - CIMPP::ControlArea* ControlArea; /* The control area specification that is used for the load forecast. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergyArea(); - virtual ~EnergyArea(); - + ~EnergyArea() override; + + CIMPP::ControlArea* ControlArea; /* The control area specification that is used for the load forecast. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergyArea_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EnergyConsumer.cpp b/CGMES_2.4.15_16FEB2016/EnergyConsumer.cpp index 804db7803..8aa4ba5f9 100644 --- a/CGMES_2.4.15_16FEB2016/EnergyConsumer.cpp +++ b/CGMES_2.4.15_16FEB2016/EnergyConsumer.cpp @@ -1,152 +1,172 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergyConsumer.hpp" +#include +#include + #include "LoadDynamics.hpp" +#include "LoadResponseCharacteristic.hpp" +#include "ActivePower.hpp" #include "ActivePower.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" -#include "PerCent.hpp" -#include "LoadResponseCharacteristic.hpp" -#include "ActivePower.hpp" #include "ReactivePower.hpp" +#include "PerCent.hpp" using namespace CIMPP; -EnergyConsumer::EnergyConsumer(): LoadDynamics(nullptr), LoadResponse(nullptr) {}; - +EnergyConsumer::EnergyConsumer() : LoadDynamics(nullptr), LoadResponse(nullptr) {}; EnergyConsumer::~EnergyConsumer() {}; -bool assign_LoadDynamics_EnergyConsumer(BaseClass*, BaseClass*); -bool assign_EnergyConsumer_LoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadDynamics = dynamic_cast(BaseClass_ptr2); - if(element->LoadDynamics != nullptr) - return assign_LoadDynamics_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_EnergyConsumer_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_pfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfixed; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass*, BaseClass*); -bool assign_EnergyConsumer_LoadResponse(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadResponse = dynamic_cast(BaseClass_ptr2); - if(element->LoadResponse != nullptr) - return assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_EnergyConsumer_pfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfixedPct; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_EnergyConsumer_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_qfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qfixed; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_qfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qfixedPct; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EnergyConsumer_pfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfixed; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_LoadDynamics_EnergyConsumer(BaseClass*, BaseClass*); +bool assign_EnergyConsumer_LoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergyConsumer* element = dynamic_cast(BaseClass_ptr1); + LoadDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadDynamics != element2) + { + element->LoadDynamics = element2; + return assign_LoadDynamics_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EnergyConsumer_pfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfixedPct; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass*, BaseClass*); +bool assign_EnergyConsumer_LoadResponse(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergyConsumer* element = dynamic_cast(BaseClass_ptr1); + LoadResponseCharacteristic* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadResponse != element2) + { + element->LoadResponse = element2; + return assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EnergyConsumer_qfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qfixed; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EnergyConsumer_qfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qfixedPct; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EnergyConsumer_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EnergyConsumer_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EnergyConsumer_factory() { - return new EnergyConsumer; - } + +const char EnergyConsumer::debugName[] = "EnergyConsumer"; +const char* EnergyConsumer::debugString() const +{ + return EnergyConsumer::debugName; } -void EnergyConsumer::addConstructToMap(std::unordered_map& factory_map) { +void EnergyConsumer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EnergyConsumer"), &EnergyConsumer_factory)); } -void EnergyConsumer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.pfixed"), &assign_EnergyConsumer_pfixed)); +void EnergyConsumer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.p"), &assign_EnergyConsumer_p)); + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.pfixed"), &assign_EnergyConsumer_pfixed)); assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.pfixedPct"), &assign_EnergyConsumer_pfixedPct)); + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.q"), &assign_EnergyConsumer_q)); assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.qfixed"), &assign_EnergyConsumer_qfixed)); assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.qfixedPct"), &assign_EnergyConsumer_qfixedPct)); - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.p"), &assign_EnergyConsumer_p)); - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.q"), &assign_EnergyConsumer_q)); } -void EnergyConsumer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadDynamics"), &assign_EnergyConsumer_LoadDynamics)); - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadResponse"), &assign_EnergyConsumer_LoadResponse)); - } - -const char EnergyConsumer::debugName[] = "EnergyConsumer"; -const char* EnergyConsumer::debugString() +void EnergyConsumer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergyConsumer::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadDynamics"), &assign_EnergyConsumer_LoadDynamics)); + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadResponse"), &assign_EnergyConsumer_LoadResponse)); } const BaseClassDefiner EnergyConsumer::declare() @@ -154,4 +174,10 @@ const BaseClassDefiner EnergyConsumer::declare() return BaseClassDefiner(EnergyConsumer::addConstructToMap, EnergyConsumer::addPrimitiveAssignFnsToMap, EnergyConsumer::addClassAssignFnsToMap, EnergyConsumer::debugName); } - +namespace CIMPP +{ + BaseClass* EnergyConsumer_factory() + { + return new EnergyConsumer; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EnergyConsumer.hpp b/CGMES_2.4.15_16FEB2016/EnergyConsumer.hpp index 723c6fa0f..7d04fdbfc 100644 --- a/CGMES_2.4.15_16FEB2016/EnergyConsumer.hpp +++ b/CGMES_2.4.15_16FEB2016/EnergyConsumer.hpp @@ -1,49 +1,50 @@ #ifndef EnergyConsumer_H #define EnergyConsumer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class LoadDynamics; + class LoadResponseCharacteristic; - -class LoadDynamics; -class LoadResponseCharacteristic; /* Generic user of energy - a point of consumption on the power system model. */ - class EnergyConsumer: public ConductingEquipment + class EnergyConsumer : public ConductingEquipment { - public: - CIMPP::LoadDynamics* LoadDynamics; /* Load dynamics model used to describe dynamic behavior of this energy consumer. Default: 0 */ - CIMPP::ActivePower pfixed; /* Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::PerCent pfixedPct; /* Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::ReactivePower qfixed; /* Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::PerCent qfixedPct; /* Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::LoadResponseCharacteristic* LoadResponse; /* The load response characteristic of this load. If missing, this load is assumed to be constant power. Default: 0 */ - CIMPP::ActivePower p; /* Active power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergyConsumer(); - virtual ~EnergyConsumer(); - + ~EnergyConsumer() override; + + CIMPP::LoadDynamics* LoadDynamics; /* Load dynamics model used to describe dynamic behavior of this energy consumer. Default: 0 */ + CIMPP::LoadResponseCharacteristic* LoadResponse; /* The load response characteristic of this load. If missing, this load is assumed to be constant power. Default: 0 */ + CIMPP::ActivePower p; /* Active power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ + CIMPP::ActivePower pfixed; /* Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + CIMPP::PerCent pfixedPct; /* Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ + CIMPP::ReactivePower qfixed; /* Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + CIMPP::PerCent qfixedPct; /* Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergyConsumer_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EnergySchedulingType.cpp b/CGMES_2.4.15_16FEB2016/EnergySchedulingType.cpp index 0e4e4a649..aba3d7573 100644 --- a/CGMES_2.4.15_16FEB2016/EnergySchedulingType.cpp +++ b/CGMES_2.4.15_16FEB2016/EnergySchedulingType.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergySchedulingType.hpp" +#include +#include + #include "EnergySource.hpp" using namespace CIMPP; EnergySchedulingType::EnergySchedulingType() {}; - EnergySchedulingType::~EnergySchedulingType() {}; -bool assign_EnergySchedulingType_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergySchedulingType* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergySource.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_EnergySource_EnergySchedulingType(BaseClass*, BaseClass*); +bool assign_EnergySchedulingType_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergySchedulingType* element = dynamic_cast(BaseClass_ptr1); + EnergySource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergySource.begin(), element->EnergySource.end(), element2) == element->EnergySource.end()) + { + element->EnergySource.push_back(element2); + return assign_EnergySource_EnergySchedulingType(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* EnergySchedulingType_factory() { - return new EnergySchedulingType; - } +const char EnergySchedulingType::debugName[] = "EnergySchedulingType"; +const char* EnergySchedulingType::debugString() const +{ + return EnergySchedulingType::debugName; } -void EnergySchedulingType::addConstructToMap(std::unordered_map& factory_map) { +void EnergySchedulingType::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EnergySchedulingType"), &EnergySchedulingType_factory)); } -void EnergySchedulingType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void EnergySchedulingType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergySchedulingType.EnergySource"), &assign_EnergySchedulingType_EnergySource)); +void EnergySchedulingType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EnergySchedulingType::debugName[] = "EnergySchedulingType"; -const char* EnergySchedulingType::debugString() +void EnergySchedulingType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergySchedulingType::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergySchedulingType.EnergySource"), &assign_EnergySchedulingType_EnergySource)); } const BaseClassDefiner EnergySchedulingType::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EnergySchedulingType::declare() return BaseClassDefiner(EnergySchedulingType::addConstructToMap, EnergySchedulingType::addPrimitiveAssignFnsToMap, EnergySchedulingType::addClassAssignFnsToMap, EnergySchedulingType::debugName); } - +namespace CIMPP +{ + BaseClass* EnergySchedulingType_factory() + { + return new EnergySchedulingType; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EnergySchedulingType.hpp b/CGMES_2.4.15_16FEB2016/EnergySchedulingType.hpp index 7ce7f9c1b..738e505bb 100644 --- a/CGMES_2.4.15_16FEB2016/EnergySchedulingType.hpp +++ b/CGMES_2.4.15_16FEB2016/EnergySchedulingType.hpp @@ -1,38 +1,39 @@ #ifndef EnergySchedulingType_H #define EnergySchedulingType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EnergySource; -class EnergySource; /* Used to define the type of generation for scheduling purposes. */ - class EnergySchedulingType: public IdentifiedObject + class EnergySchedulingType : public IdentifiedObject { - public: - std::list EnergySource; /* Energy Scheduling Type of an Energy Source Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergySchedulingType(); - virtual ~EnergySchedulingType(); - + ~EnergySchedulingType() override; + + std::list EnergySource; /* Energy Source of a particular Energy Scheduling Type Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergySchedulingType_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EnergySource.cpp b/CGMES_2.4.15_16FEB2016/EnergySource.cpp index 73180bdb2..2b02d4b7d 100644 --- a/CGMES_2.4.15_16FEB2016/EnergySource.cpp +++ b/CGMES_2.4.15_16FEB2016/EnergySource.cpp @@ -1,226 +1,252 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergySource.hpp" +#include +#include + +#include "EnergySchedulingType.hpp" #include "WindTurbineType3or4Dynamics.hpp" +#include "ActivePower.hpp" #include "Voltage.hpp" #include "Resistance.hpp" #include "Resistance.hpp" +#include "ReactivePower.hpp" #include "Resistance.hpp" #include "AngleRadians.hpp" #include "Voltage.hpp" #include "Reactance.hpp" #include "Reactance.hpp" #include "Reactance.hpp" -#include "EnergySchedulingType.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" using namespace CIMPP; -EnergySource::EnergySource(): WindTurbineType3or4Dynamics(nullptr), EnergySchedulingType(nullptr) {}; - +EnergySource::EnergySource() : EnergySchedulingType(nullptr), WindTurbineType3or4Dynamics(nullptr) {}; EnergySource::~EnergySource() {}; -bool assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4Dynamics != nullptr) - return true; - } - return false; + + +bool assign_EnergySource_activePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->activePower; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_EnergySource_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalVoltage; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_reactivePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->reactivePower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_rn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_voltageAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageAngle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_voltageMagnitude(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageMagnitude; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_EnergySource_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_EnergySource_xn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} bool assign_EnergySchedulingType_EnergySource(BaseClass*, BaseClass*); -bool assign_EnergySource_EnergySchedulingType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - element->EnergySchedulingType = dynamic_cast(BaseClass_ptr2); - if(element->EnergySchedulingType != nullptr) - return assign_EnergySchedulingType_EnergySource(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - - - -bool assign_EnergySource_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalVoltage; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_rn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_voltageAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageAngle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_voltageMagnitude(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageMagnitude; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_xn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_EnergySource_activePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->activePower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_reactivePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->reactivePower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* EnergySource_factory() { - return new EnergySource; +bool assign_EnergySource_EnergySchedulingType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergySource* element = dynamic_cast(BaseClass_ptr1); + EnergySchedulingType* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EnergySchedulingType != element2) + { + element->EnergySchedulingType = element2; + return assign_EnergySchedulingType_EnergySource(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass*, BaseClass*); +bool assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergySource* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4Dynamics != element2) + { + element->WindTurbineType3or4Dynamics = element2; + return assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + + + + +const char EnergySource::debugName[] = "EnergySource"; +const char* EnergySource::debugString() const +{ + return EnergySource::debugName; } -void EnergySource::addConstructToMap(std::unordered_map& factory_map) { +void EnergySource::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EnergySource"), &EnergySource_factory)); } -void EnergySource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergySource.nominalVoltage"), &assign_EnergySource_nominalVoltage)); +void EnergySource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:EnergySource.activePower"), &assign_EnergySource_activePower)); + assign_map.insert(std::make_pair(std::string("cim:EnergySource.nominalVoltage"), &assign_EnergySource_nominalVoltage)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.r"), &assign_EnergySource_r)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.r0"), &assign_EnergySource_r0)); + assign_map.insert(std::make_pair(std::string("cim:EnergySource.reactivePower"), &assign_EnergySource_reactivePower)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.rn"), &assign_EnergySource_rn)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.voltageAngle"), &assign_EnergySource_voltageAngle)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.voltageMagnitude"), &assign_EnergySource_voltageMagnitude)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.x"), &assign_EnergySource_x)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.x0"), &assign_EnergySource_x0)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.xn"), &assign_EnergySource_xn)); - assign_map.insert(std::make_pair(std::string("cim:EnergySource.activePower"), &assign_EnergySource_activePower)); - assign_map.insert(std::make_pair(std::string("cim:EnergySource.reactivePower"), &assign_EnergySource_reactivePower)); } -void EnergySource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergySource.WindTurbineType3or4Dynamics"), &assign_EnergySource_WindTurbineType3or4Dynamics)); - assign_map.insert(std::make_pair(std::string("cim:EnergySource.EnergySchedulingType"), &assign_EnergySource_EnergySchedulingType)); - } - -const char EnergySource::debugName[] = "EnergySource"; -const char* EnergySource::debugString() +void EnergySource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergySource::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergySource.EnergySchedulingType"), &assign_EnergySource_EnergySchedulingType)); + assign_map.insert(std::make_pair(std::string("cim:EnergySource.WindTurbineType3or4Dynamics"), &assign_EnergySource_WindTurbineType3or4Dynamics)); } const BaseClassDefiner EnergySource::declare() @@ -228,4 +254,10 @@ const BaseClassDefiner EnergySource::declare() return BaseClassDefiner(EnergySource::addConstructToMap, EnergySource::addPrimitiveAssignFnsToMap, EnergySource::addClassAssignFnsToMap, EnergySource::debugName); } - +namespace CIMPP +{ + BaseClass* EnergySource_factory() + { + return new EnergySource; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EnergySource.hpp b/CGMES_2.4.15_16FEB2016/EnergySource.hpp index 3b060e1a8..009e0eac2 100644 --- a/CGMES_2.4.15_16FEB2016/EnergySource.hpp +++ b/CGMES_2.4.15_16FEB2016/EnergySource.hpp @@ -1,57 +1,58 @@ #ifndef EnergySource_H #define EnergySource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Voltage.hpp" -#include "Resistance.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +#include "ActivePower.hpp" #include "AngleRadians.hpp" #include "Reactance.hpp" -#include "ActivePower.hpp" #include "ReactivePower.hpp" +#include "Resistance.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class EnergySchedulingType; + class WindTurbineType3or4Dynamics; -class WindTurbineType3or4Dynamics; -class EnergySchedulingType; /* A generic equivalent for an energy supplier on a transmission or distribution voltage level. */ - class EnergySource: public ConductingEquipment + class EnergySource : public ConductingEquipment { - public: - CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Wind generator Type 3 or 4 dynamics model associated with this energy source. Default: 0 */ - CIMPP::Voltage nominalVoltage; /* Phase-to-phase nominal voltage. Default: nullptr */ - CIMPP::Resistance r; /* Positive sequence Thevenin resistance. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence Thevenin resistance. Default: nullptr */ - CIMPP::Resistance rn; /* Negative sequence Thevenin resistance. Default: nullptr */ - CIMPP::AngleRadians voltageAngle; /* Phase angle of a-phase open circuit. Default: nullptr */ - CIMPP::Voltage voltageMagnitude; /* Phase-to-phase open circuit voltage magnitude. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence Thevenin reactance. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence Thevenin reactance. Default: nullptr */ - CIMPP::Reactance xn; /* Negative sequence Thevenin reactance. Default: nullptr */ - CIMPP::EnergySchedulingType* EnergySchedulingType; /* Energy Source of a particular Energy Scheduling Type Default: 0 */ - CIMPP::ActivePower activePower; /* High voltage source active injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::ReactivePower reactivePower; /* High voltage source reactive injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergySource(); - virtual ~EnergySource(); - + ~EnergySource() override; + + CIMPP::EnergySchedulingType* EnergySchedulingType; /* Energy Scheduling Type of an Energy Source Default: 0 */ + CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Wind generator Type 3 or 4 dynamics model associated with this energy source. Default: 0 */ + CIMPP::ActivePower activePower; /* High voltage source active injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Voltage nominalVoltage; /* Phase-to-phase nominal voltage. Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence Thevenin resistance. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence Thevenin resistance. Default: nullptr */ + CIMPP::ReactivePower reactivePower; /* High voltage source reactive injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Resistance rn; /* Negative sequence Thevenin resistance. Default: nullptr */ + CIMPP::AngleRadians voltageAngle; /* Phase angle of a-phase open circuit. Default: nullptr */ + CIMPP::Voltage voltageMagnitude; /* Phase-to-phase open circuit voltage magnitude. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence Thevenin reactance. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence Thevenin reactance. Default: nullptr */ + CIMPP::Reactance xn; /* Negative sequence Thevenin reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergySource_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Equipment.cpp b/CGMES_2.4.15_16FEB2016/Equipment.cpp index bb5c62106..a3f0d0b62 100644 --- a/CGMES_2.4.15_16FEB2016/Equipment.cpp +++ b/CGMES_2.4.15_16FEB2016/Equipment.cpp @@ -1,77 +1,92 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Equipment.hpp" -#include "Boolean.hpp" +#include +#include + #include "EquipmentContainer.hpp" #include "OperationalLimitSet.hpp" +#include "Boolean.hpp" using namespace CIMPP; -Equipment::Equipment(): EquipmentContainer(nullptr) {}; - +Equipment::Equipment() : EquipmentContainer(nullptr) {}; Equipment::~Equipment() {}; -bool assign_EquipmentContainer_Equipments(BaseClass*, BaseClass*); -bool assign_Equipment_EquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Equipment* element = dynamic_cast(BaseClass_ptr1)) { - element->EquipmentContainer = dynamic_cast(BaseClass_ptr2); - if(element->EquipmentContainer != nullptr) - return assign_EquipmentContainer_Equipments(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_Equipment_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Equipment* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimitSet.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Equipment_aggregate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Equipment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aggregate; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Equipment_aggregate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Equipment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aggregate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_EquipmentContainer_Equipments(BaseClass*, BaseClass*); +bool assign_Equipment_EquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Equipment* element = dynamic_cast(BaseClass_ptr1); + EquipmentContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EquipmentContainer != element2) + { + element->EquipmentContainer = element2; + return assign_EquipmentContainer_Equipments(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_OperationalLimitSet_Equipment(BaseClass*, BaseClass*); +bool assign_Equipment_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Equipment* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimitSet.begin(), element->OperationalLimitSet.end(), element2) == element->OperationalLimitSet.end()) + { + element->OperationalLimitSet.push_back(element2); + return assign_OperationalLimitSet_Equipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* Equipment_factory() { - return new Equipment; - } +const char Equipment::debugName[] = "Equipment"; +const char* Equipment::debugString() const +{ + return Equipment::debugName; } -void Equipment::addConstructToMap(std::unordered_map& factory_map) { +void Equipment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Equipment"), &Equipment_factory)); } -void Equipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Equipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Equipment.aggregate"), &assign_Equipment_aggregate)); - } - -void Equipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Equipment.EquipmentContainer"), &assign_Equipment_EquipmentContainer)); - assign_map.insert(std::make_pair(std::string("cim:Equipment.OperationalLimitSet"), &assign_Equipment_OperationalLimitSet)); } -const char Equipment::debugName[] = "Equipment"; -const char* Equipment::debugString() +void Equipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Equipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:Equipment.EquipmentContainer"), &assign_Equipment_EquipmentContainer)); + assign_map.insert(std::make_pair(std::string("cim:Equipment.OperationalLimitSet"), &assign_Equipment_OperationalLimitSet)); } const BaseClassDefiner Equipment::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner Equipment::declare() return BaseClassDefiner(Equipment::addConstructToMap, Equipment::addPrimitiveAssignFnsToMap, Equipment::addClassAssignFnsToMap, Equipment::debugName); } - +namespace CIMPP +{ + BaseClass* Equipment_factory() + { + return new Equipment; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Equipment.hpp b/CGMES_2.4.15_16FEB2016/Equipment.hpp index be97d9c9b..731df8bcc 100644 --- a/CGMES_2.4.15_16FEB2016/Equipment.hpp +++ b/CGMES_2.4.15_16FEB2016/Equipment.hpp @@ -1,42 +1,43 @@ #ifndef Equipment_H #define Equipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class EquipmentContainer; + class OperationalLimitSet; -class EquipmentContainer; -class OperationalLimitSet; /* The parts of a power system that are physical devices, electronic or mechanical. */ - class Equipment: public PowerSystemResource + class Equipment : public PowerSystemResource { - public: - CIMPP::Boolean aggregate; /* The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be power transformers or synchronous machines operating in parallel modeled as a single aggregate power transformer or aggregate synchronous machine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. Default: false */ - CIMPP::EquipmentContainer* EquipmentContainer; /* Container of this equipment. Default: 0 */ - std::list OperationalLimitSet; /* The operational limit sets associated with this equipment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Equipment(); - virtual ~Equipment(); - + ~Equipment() override; + + CIMPP::EquipmentContainer* EquipmentContainer; /* Container of this equipment. Default: 0 */ + std::list OperationalLimitSet; /* The operational limit sets associated with this equipment. Default: 0 */ + CIMPP::Boolean aggregate; /* The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be power transformers or synchronous machines operating in parallel modeled as a single aggregate power transformer or aggregate synchronous machine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Equipment_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.cpp b/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.cpp index c8d95b34e..a9d39fa2e 100644 --- a/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquipmentBoundaryVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -16,35 +20,16 @@ using namespace CIMPP; -EquipmentBoundaryVersion::EquipmentBoundaryVersion(): date(nullptr) {}; - +EquipmentBoundaryVersion::EquipmentBoundaryVersion() {}; EquipmentBoundaryVersion::~EquipmentBoundaryVersion() {}; - - -bool assign_EquipmentBoundaryVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - - -bool assign_EquipmentBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -52,10 +37,12 @@ bool assign_EquipmentBoundaryVersion_baseUML(std::stringstream &buffer, BaseClas return false; } -bool assign_EquipmentBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -63,11 +50,25 @@ bool assign_EquipmentBoundaryVersion_baseURI(std::stringstream &buffer, BaseClas return false; } +bool assign_EquipmentBoundaryVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquipmentBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -75,10 +76,12 @@ bool assign_EquipmentBoundaryVersion_differenceModelURI(std::stringstream &buffe return false; } -bool assign_EquipmentBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -86,10 +89,12 @@ bool assign_EquipmentBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseCl return false; } -bool assign_EquipmentBoundaryVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIcore = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -97,10 +102,12 @@ bool assign_EquipmentBoundaryVersion_entsoeURIcore(std::stringstream &buffer, Ba return false; } -bool assign_EquipmentBoundaryVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIoperation = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -108,10 +115,12 @@ bool assign_EquipmentBoundaryVersion_entsoeURIoperation(std::stringstream &buffe return false; } -bool assign_EquipmentBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -119,10 +128,12 @@ bool assign_EquipmentBoundaryVersion_modelDescriptionURI(std::stringstream &buff return false; } -bool assign_EquipmentBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -130,10 +141,12 @@ bool assign_EquipmentBoundaryVersion_namespaceRDF(std::stringstream &buffer, Bas return false; } -bool assign_EquipmentBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -141,10 +154,12 @@ bool assign_EquipmentBoundaryVersion_namespaceUML(std::stringstream &buffer, Bas return false; } -bool assign_EquipmentBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -152,20 +167,35 @@ bool assign_EquipmentBoundaryVersion_shortName(std::stringstream &buffer, BaseCl return false; } -namespace CIMPP { - BaseClass* EquipmentBoundaryVersion_factory() { - return new EquipmentBoundaryVersion; - } + + + + + + + + + + + + +const char EquipmentBoundaryVersion::debugName[] = "EquipmentBoundaryVersion"; +const char* EquipmentBoundaryVersion::debugString() const +{ + return EquipmentBoundaryVersion::debugName; } -void EquipmentBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) { +void EquipmentBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion"), &EquipmentBoundaryVersion_factory)); } -void EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.baseUML"), &assign_EquipmentBoundaryVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.baseURI"), &assign_EquipmentBoundaryVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.differenceModelURI"), &assign_EquipmentBoundaryVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.date"), &assign_EquipmentBoundaryVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.differenceModelURI"), &assign_EquipmentBoundaryVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.entsoeUML"), &assign_EquipmentBoundaryVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.entsoeURIcore"), &assign_EquipmentBoundaryVersion_entsoeURIcore)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.entsoeURIoperation"), &assign_EquipmentBoundaryVersion_entsoeURIoperation)); @@ -175,14 +205,8 @@ void EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.date"), &assign_EquipmentBoundaryVersion_date)); - } - -const char EquipmentBoundaryVersion::debugName[] = "EquipmentBoundaryVersion"; -const char* EquipmentBoundaryVersion::debugString() +void EquipmentBoundaryVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquipmentBoundaryVersion::debugName; } const BaseClassDefiner EquipmentBoundaryVersion::declare() @@ -190,4 +214,10 @@ const BaseClassDefiner EquipmentBoundaryVersion::declare() return BaseClassDefiner(EquipmentBoundaryVersion::addConstructToMap, EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap, EquipmentBoundaryVersion::addClassAssignFnsToMap, EquipmentBoundaryVersion::debugName); } - +namespace CIMPP +{ + BaseClass* EquipmentBoundaryVersion_factory() + { + return new EquipmentBoundaryVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.hpp b/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.hpp index 9fada91bf..0f14a07f6 100644 --- a/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/EquipmentBoundaryVersion.hpp @@ -1,49 +1,50 @@ #ifndef EquipmentBoundaryVersion_H #define EquipmentBoundaryVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Profile version details. */ - class EquipmentBoundaryVersion: public BaseClass + class EquipmentBoundaryVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundaryOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquipmentBoundaryVersion(); - virtual ~EquipmentBoundaryVersion(); - + ~EquipmentBoundaryVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundaryOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquipmentBoundaryVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquipmentContainer.cpp b/CGMES_2.4.15_16FEB2016/EquipmentContainer.cpp index 7b60e6a9f..c2a2d9b74 100644 --- a/CGMES_2.4.15_16FEB2016/EquipmentContainer.cpp +++ b/CGMES_2.4.15_16FEB2016/EquipmentContainer.cpp @@ -1,49 +1,56 @@ -#include -#include "ConnectivityNodeContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquipmentContainer.hpp" +#include +#include + #include "Equipment.hpp" using namespace CIMPP; EquipmentContainer::EquipmentContainer() {}; - EquipmentContainer::~EquipmentContainer() {}; -bool assign_EquipmentContainer_Equipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquipmentContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Equipments.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_Equipment_EquipmentContainer(BaseClass*, BaseClass*); +bool assign_EquipmentContainer_Equipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquipmentContainer* element = dynamic_cast(BaseClass_ptr1); + Equipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Equipments.begin(), element->Equipments.end(), element2) == element->Equipments.end()) + { + element->Equipments.push_back(element2); + return assign_Equipment_EquipmentContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* EquipmentContainer_factory() { - return new EquipmentContainer; - } +const char EquipmentContainer::debugName[] = "EquipmentContainer"; +const char* EquipmentContainer::debugString() const +{ + return EquipmentContainer::debugName; } -void EquipmentContainer::addConstructToMap(std::unordered_map& factory_map) { +void EquipmentContainer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquipmentContainer"), &EquipmentContainer_factory)); } -void EquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void EquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquipmentContainer.Equipments"), &assign_EquipmentContainer_Equipments)); +void EquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EquipmentContainer::debugName[] = "EquipmentContainer"; -const char* EquipmentContainer::debugString() +void EquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquipmentContainer::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquipmentContainer.Equipments"), &assign_EquipmentContainer_Equipments)); } const BaseClassDefiner EquipmentContainer::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EquipmentContainer::declare() return BaseClassDefiner(EquipmentContainer::addConstructToMap, EquipmentContainer::addPrimitiveAssignFnsToMap, EquipmentContainer::addClassAssignFnsToMap, EquipmentContainer::debugName); } - +namespace CIMPP +{ + BaseClass* EquipmentContainer_factory() + { + return new EquipmentContainer; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquipmentContainer.hpp b/CGMES_2.4.15_16FEB2016/EquipmentContainer.hpp index 5407d798f..7b4688598 100644 --- a/CGMES_2.4.15_16FEB2016/EquipmentContainer.hpp +++ b/CGMES_2.4.15_16FEB2016/EquipmentContainer.hpp @@ -1,38 +1,39 @@ #ifndef EquipmentContainer_H #define EquipmentContainer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConnectivityNodeContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConnectivityNodeContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Equipment; -class Equipment; /* A modeling construct to provide a root class for containing equipment. */ - class EquipmentContainer: public ConnectivityNodeContainer + class EquipmentContainer : public ConnectivityNodeContainer { - public: - std::list Equipments; /* Contained equipment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquipmentContainer(); - virtual ~EquipmentContainer(); - + ~EquipmentContainer() override; + + std::list Equipments; /* Contained equipment. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquipmentContainer_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquipmentVersion.cpp b/CGMES_2.4.15_16FEB2016/EquipmentVersion.cpp index 0c387fc5b..09b0153e0 100644 --- a/CGMES_2.4.15_16FEB2016/EquipmentVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/EquipmentVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquipmentVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "String.hpp" @@ -19,38 +23,16 @@ using namespace CIMPP; -EquipmentVersion::EquipmentVersion(): date(nullptr) {}; - +EquipmentVersion::EquipmentVersion() {}; EquipmentVersion::~EquipmentVersion() {}; - - - - -bool assign_EquipmentVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - - - -bool assign_EquipmentVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -58,10 +40,12 @@ bool assign_EquipmentVersion_baseUML(std::stringstream &buffer, BaseClass* BaseC return false; } -bool assign_EquipmentVersion_baseURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURIcore = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -69,10 +53,12 @@ bool assign_EquipmentVersion_baseURIcore(std::stringstream &buffer, BaseClass* B return false; } -bool assign_EquipmentVersion_baseURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURIoperation = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -80,10 +66,12 @@ bool assign_EquipmentVersion_baseURIoperation(std::stringstream &buffer, BaseCla return false; } -bool assign_EquipmentVersion_baseURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURIshortCircuit = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -91,11 +79,25 @@ bool assign_EquipmentVersion_baseURIshortCircuit(std::stringstream &buffer, Base return false; } +bool assign_EquipmentVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquipmentVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -103,10 +105,12 @@ bool assign_EquipmentVersion_differenceModelURI(std::stringstream &buffer, BaseC return false; } -bool assign_EquipmentVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -114,10 +118,12 @@ bool assign_EquipmentVersion_entsoeUML(std::stringstream &buffer, BaseClass* Bas return false; } -bool assign_EquipmentVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIcore = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -125,10 +131,12 @@ bool assign_EquipmentVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* return false; } -bool assign_EquipmentVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIoperation = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -136,10 +144,12 @@ bool assign_EquipmentVersion_entsoeURIoperation(std::stringstream &buffer, BaseC return false; } -bool assign_EquipmentVersion_entsoeURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIshortCircuit = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -147,10 +157,12 @@ bool assign_EquipmentVersion_entsoeURIshortCircuit(std::stringstream &buffer, Ba return false; } -bool assign_EquipmentVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -158,10 +170,12 @@ bool assign_EquipmentVersion_modelDescriptionURI(std::stringstream &buffer, Base return false; } -bool assign_EquipmentVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -169,10 +183,12 @@ bool assign_EquipmentVersion_namespaceRDF(std::stringstream &buffer, BaseClass* return false; } -bool assign_EquipmentVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -180,10 +196,12 @@ bool assign_EquipmentVersion_namespaceUML(std::stringstream &buffer, BaseClass* return false; } -bool assign_EquipmentVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -191,22 +209,40 @@ bool assign_EquipmentVersion_shortName(std::stringstream &buffer, BaseClass* Bas return false; } -namespace CIMPP { - BaseClass* EquipmentVersion_factory() { - return new EquipmentVersion; - } + + + + + + + + + + + + + + + +const char EquipmentVersion::debugName[] = "EquipmentVersion"; +const char* EquipmentVersion::debugString() const +{ + return EquipmentVersion::debugName; } -void EquipmentVersion::addConstructToMap(std::unordered_map& factory_map) { +void EquipmentVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquipmentVersion"), &EquipmentVersion_factory)); } -void EquipmentVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquipmentVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseUML"), &assign_EquipmentVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseURIcore"), &assign_EquipmentVersion_baseURIcore)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseURIoperation"), &assign_EquipmentVersion_baseURIoperation)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseURIshortCircuit"), &assign_EquipmentVersion_baseURIshortCircuit)); - assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.differenceModelURI"), &assign_EquipmentVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.date"), &assign_EquipmentVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.differenceModelURI"), &assign_EquipmentVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.entsoeUML"), &assign_EquipmentVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.entsoeURIcore"), &assign_EquipmentVersion_entsoeURIcore)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.entsoeURIoperation"), &assign_EquipmentVersion_entsoeURIoperation)); @@ -217,14 +253,8 @@ void EquipmentVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.date"), &assign_EquipmentVersion_date)); - } - -const char EquipmentVersion::debugName[] = "EquipmentVersion"; -const char* EquipmentVersion::debugString() +void EquipmentVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquipmentVersion::debugName; } const BaseClassDefiner EquipmentVersion::declare() @@ -232,4 +262,10 @@ const BaseClassDefiner EquipmentVersion::declare() return BaseClassDefiner(EquipmentVersion::addConstructToMap, EquipmentVersion::addPrimitiveAssignFnsToMap, EquipmentVersion::addClassAssignFnsToMap, EquipmentVersion::debugName); } - +namespace CIMPP +{ + BaseClass* EquipmentVersion_factory() + { + return new EquipmentVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquipmentVersion.hpp b/CGMES_2.4.15_16FEB2016/EquipmentVersion.hpp index 16fb8c119..a6ff60989 100644 --- a/CGMES_2.4.15_16FEB2016/EquipmentVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/EquipmentVersion.hpp @@ -1,52 +1,53 @@ #ifndef EquipmentVersion_H #define EquipmentVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class EquipmentVersion: public BaseClass + class EquipmentVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURIcore; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::String baseURIoperation; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::String baseURIshortCircuit; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentCore/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String entsoeURIshortCircuit; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentShortCircuit/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquipmentVersion(); - virtual ~EquipmentVersion(); - + ~EquipmentVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURIcore; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::String baseURIoperation; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::String baseURIshortCircuit; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentCore/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String entsoeURIshortCircuit; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentShortCircuit/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquipmentVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquivalentBranch.cpp b/CGMES_2.4.15_16FEB2016/EquivalentBranch.cpp index a8a8550ab..306a28be7 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentBranch.cpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentBranch.cpp @@ -1,7 +1,11 @@ -#include -#include "EquivalentEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentBranch.hpp" +#include +#include + #include "Resistance.hpp" #include "Resistance.hpp" #include "Reactance.hpp" @@ -22,234 +26,247 @@ using namespace CIMPP; EquivalentBranch::EquivalentBranch() {}; - EquivalentBranch::~EquivalentBranch() {}; +bool assign_EquivalentBranch_negativeR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeR12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_negativeR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeR21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_negativeX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeX12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_negativeX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeX21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveR12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveR21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveX12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveX21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_r21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_x21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroR12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroR21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroX12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroX21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquivalentBranch_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_r21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_x21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeR12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeR21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeX12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeX21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveR12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveR21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveX12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveX21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroR12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroR21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroX12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroX21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EquivalentBranch_factory() { - return new EquivalentBranch; - } +const char EquivalentBranch::debugName[] = "EquivalentBranch"; +const char* EquivalentBranch::debugString() const +{ + return EquivalentBranch::debugName; } -void EquivalentBranch::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentBranch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentBranch"), &EquivalentBranch_factory)); } -void EquivalentBranch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.r"), &assign_EquivalentBranch_r)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.r21"), &assign_EquivalentBranch_r21)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.x"), &assign_EquivalentBranch_x)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.x21"), &assign_EquivalentBranch_x21)); +void EquivalentBranch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.negativeR12"), &assign_EquivalentBranch_negativeR12)); assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.negativeR21"), &assign_EquivalentBranch_negativeR21)); assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.negativeX12"), &assign_EquivalentBranch_negativeX12)); @@ -258,19 +275,18 @@ void EquivalentBranch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char EquivalentBranch::debugName[] = "EquivalentBranch"; -const char* EquivalentBranch::debugString() +void EquivalentBranch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentBranch::debugName; } const BaseClassDefiner EquivalentBranch::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner EquivalentBranch::declare() return BaseClassDefiner(EquivalentBranch::addConstructToMap, EquivalentBranch::addPrimitiveAssignFnsToMap, EquivalentBranch::addClassAssignFnsToMap, EquivalentBranch::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentBranch_factory() + { + return new EquivalentBranch; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquivalentBranch.hpp b/CGMES_2.4.15_16FEB2016/EquivalentBranch.hpp index 6ea22b2c9..72cff31a3 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentBranch.hpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentBranch.hpp @@ -1,54 +1,55 @@ #ifndef EquivalentBranch_H #define EquivalentBranch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquivalentEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Resistance.hpp" +#include "EquivalentEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents equivalent branches. */ - class EquivalentBranch: public EquivalentEquipment + class EquivalentBranch : public EquivalentEquipment { - public: - CIMPP::Resistance r; /* Positive sequence series resistance of the reduced branch. Default: nullptr */ - CIMPP::Resistance r21; /* Resistance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.r is given, then EquivalentBranch.r21 is assumed equal to EquivalentBranch.r. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence series reactance of the reduced branch. Default: nullptr */ - CIMPP::Reactance x21; /* Reactance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.x is given, then EquivalentBranch.x21 is assumed equal to EquivalentBranch.x. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance negativeR12; /* Negative sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance negativeR21; /* Negative sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance negativeX12; /* Negative sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance negativeX21; /* Negative sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909. Usage: EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance positiveR12; /* Positive sequence series resistance from terminal sequence 1 to terminal sequence 2 . Used for short circuit data exchange according to IEC 60909. EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance positiveR21; /* Positive sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance positiveX12; /* Positive sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance positiveX21; /* Positive sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance zeroR12; /* Zero sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance zeroR21; /* Zero sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance zeroX12; /* Zero sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance zeroX21; /* Zero sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentBranch(); - virtual ~EquivalentBranch(); - + ~EquivalentBranch() override; + + CIMPP::Resistance negativeR12; /* Negative sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance negativeR21; /* Negative sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance negativeX12; /* Negative sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance negativeX21; /* Negative sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909. Usage: EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance positiveR12; /* Positive sequence series resistance from terminal sequence 1 to terminal sequence 2 . Used for short circuit data exchange according to IEC 60909. EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance positiveR21; /* Positive sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance positiveX12; /* Positive sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance positiveX21; /* Positive sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence series resistance of the reduced branch. Default: nullptr */ + CIMPP::Resistance r21; /* Resistance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.r is given, then EquivalentBranch.r21 is assumed equal to EquivalentBranch.r. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence series reactance of the reduced branch. Default: nullptr */ + CIMPP::Reactance x21; /* Reactance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.x is given, then EquivalentBranch.x21 is assumed equal to EquivalentBranch.x. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance zeroR12; /* Zero sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance zeroR21; /* Zero sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance zeroX12; /* Zero sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance zeroX21; /* Zero sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentBranch_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquivalentEquipment.cpp b/CGMES_2.4.15_16FEB2016/EquivalentEquipment.cpp index bc2c92288..4591a9d2c 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentEquipment.cpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentEquipment.cpp @@ -1,49 +1,56 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentEquipment.hpp" +#include +#include + #include "EquivalentNetwork.hpp" using namespace CIMPP; -EquivalentEquipment::EquivalentEquipment(): EquivalentNetwork(nullptr) {}; - +EquivalentEquipment::EquivalentEquipment() : EquivalentNetwork(nullptr) {}; EquivalentEquipment::~EquivalentEquipment() {}; -bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass*, BaseClass*); -bool assign_EquivalentEquipment_EquivalentNetwork(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquivalentEquipment* element = dynamic_cast(BaseClass_ptr1)) { - element->EquivalentNetwork = dynamic_cast(BaseClass_ptr2); - if(element->EquivalentNetwork != nullptr) - return assign_EquivalentNetwork_EquivalentEquipments(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* EquivalentEquipment_factory() { - return new EquivalentEquipment; +bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass*, BaseClass*); +bool assign_EquivalentEquipment_EquivalentNetwork(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquivalentEquipment* element = dynamic_cast(BaseClass_ptr1); + EquivalentNetwork* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EquivalentNetwork != element2) + { + element->EquivalentNetwork = element2; + return assign_EquivalentNetwork_EquivalentEquipments(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void EquivalentEquipment::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:EquivalentEquipment"), &EquivalentEquipment_factory)); +const char EquivalentEquipment::debugName[] = "EquivalentEquipment"; +const char* EquivalentEquipment::debugString() const +{ + return EquivalentEquipment::debugName; } -void EquivalentEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void EquivalentEquipment::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:EquivalentEquipment"), &EquivalentEquipment_factory)); +} -void EquivalentEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentEquipment.EquivalentNetwork"), &assign_EquivalentEquipment_EquivalentNetwork)); +void EquivalentEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EquivalentEquipment::debugName[] = "EquivalentEquipment"; -const char* EquivalentEquipment::debugString() +void EquivalentEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentEquipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquivalentEquipment.EquivalentNetwork"), &assign_EquivalentEquipment_EquivalentNetwork)); } const BaseClassDefiner EquivalentEquipment::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EquivalentEquipment::declare() return BaseClassDefiner(EquivalentEquipment::addConstructToMap, EquivalentEquipment::addPrimitiveAssignFnsToMap, EquivalentEquipment::addClassAssignFnsToMap, EquivalentEquipment::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentEquipment_factory() + { + return new EquivalentEquipment; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquivalentEquipment.hpp b/CGMES_2.4.15_16FEB2016/EquivalentEquipment.hpp index 3fc6d9f94..9cab80178 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentEquipment.hpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentEquipment.hpp @@ -1,38 +1,39 @@ #ifndef EquivalentEquipment_H #define EquivalentEquipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EquivalentNetwork; -class EquivalentNetwork; /* The class represents equivalent objects that are the result of a network reduction. The class is the base for equivalent objects of different types. */ - class EquivalentEquipment: public ConductingEquipment + class EquivalentEquipment : public ConductingEquipment { - public: - CIMPP::EquivalentNetwork* EquivalentNetwork; /* The associated reduced equivalents. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentEquipment(); - virtual ~EquivalentEquipment(); - + ~EquivalentEquipment() override; + + CIMPP::EquivalentNetwork* EquivalentNetwork; /* The associated reduced equivalents. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentEquipment_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquivalentInjection.cpp b/CGMES_2.4.15_16FEB2016/EquivalentInjection.cpp index d50f95f19..c2be44fd4 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentInjection.cpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentInjection.cpp @@ -1,274 +1,296 @@ -#include -#include "EquivalentEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentInjection.hpp" +#include +#include + +#include "ReactiveCapabilityCurve.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -#include "Boolean.hpp" -#include "ReactiveCapabilityCurve.hpp" #include "Resistance.hpp" #include "Resistance.hpp" #include "Resistance.hpp" +#include "Boolean.hpp" +#include "Boolean.hpp" +#include "Voltage.hpp" #include "Reactance.hpp" #include "Reactance.hpp" #include "Reactance.hpp" -#include "Boolean.hpp" -#include "Voltage.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" using namespace CIMPP; -EquivalentInjection::EquivalentInjection(): ReactiveCapabilityCurve(nullptr) {}; - +EquivalentInjection::EquivalentInjection() : ReactiveCapabilityCurve(nullptr) {}; EquivalentInjection::~EquivalentInjection() {}; +bool assign_EquivalentInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass*, BaseClass*); -bool assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - element->ReactiveCapabilityCurve = dynamic_cast(BaseClass_ptr2); - if(element->ReactiveCapabilityCurve != nullptr) - return assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_EquivalentInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_EquivalentInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_regulationCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->regulationCapability; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_regulationStatus(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->regulationStatus; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_regulationTarget(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->regulationTarget; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquivalentInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass*, BaseClass*); +bool assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquivalentInjection* element = dynamic_cast(BaseClass_ptr1); + ReactiveCapabilityCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ReactiveCapabilityCurve != element2) + { + element->ReactiveCapabilityCurve = element2; + return assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EquivalentInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_regulationCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->regulationCapability; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_regulationStatus(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->regulationStatus; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_regulationTarget(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->regulationTarget; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EquivalentInjection_factory() { - return new EquivalentInjection; - } +const char EquivalentInjection::debugName[] = "EquivalentInjection"; +const char* EquivalentInjection::debugString() const +{ + return EquivalentInjection::debugName; } -void EquivalentInjection::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentInjection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentInjection"), &EquivalentInjection_factory)); } -void EquivalentInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquivalentInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.maxP"), &assign_EquivalentInjection_maxP)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.maxQ"), &assign_EquivalentInjection_maxQ)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.minP"), &assign_EquivalentInjection_minP)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.minQ"), &assign_EquivalentInjection_minQ)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationCapability"), &assign_EquivalentInjection_regulationCapability)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r"), &assign_EquivalentInjection_r)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.p"), &assign_EquivalentInjection_p)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.q"), &assign_EquivalentInjection_q)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r"), &assign_EquivalentInjection_r)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r0"), &assign_EquivalentInjection_r0)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r2"), &assign_EquivalentInjection_r2)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationCapability"), &assign_EquivalentInjection_regulationCapability)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationStatus"), &assign_EquivalentInjection_regulationStatus)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationTarget"), &assign_EquivalentInjection_regulationTarget)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.x"), &assign_EquivalentInjection_x)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.x0"), &assign_EquivalentInjection_x0)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.x2"), &assign_EquivalentInjection_x2)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationStatus"), &assign_EquivalentInjection_regulationStatus)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationTarget"), &assign_EquivalentInjection_regulationTarget)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.p"), &assign_EquivalentInjection_p)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.q"), &assign_EquivalentInjection_q)); } -void EquivalentInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.ReactiveCapabilityCurve"), &assign_EquivalentInjection_ReactiveCapabilityCurve)); - } - -const char EquivalentInjection::debugName[] = "EquivalentInjection"; -const char* EquivalentInjection::debugString() +void EquivalentInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentInjection::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.ReactiveCapabilityCurve"), &assign_EquivalentInjection_ReactiveCapabilityCurve)); } const BaseClassDefiner EquivalentInjection::declare() @@ -276,4 +298,10 @@ const BaseClassDefiner EquivalentInjection::declare() return BaseClassDefiner(EquivalentInjection::addConstructToMap, EquivalentInjection::addPrimitiveAssignFnsToMap, EquivalentInjection::addClassAssignFnsToMap, EquivalentInjection::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentInjection_factory() + { + return new EquivalentInjection; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquivalentInjection.hpp b/CGMES_2.4.15_16FEB2016/EquivalentInjection.hpp index 8508e7b14..6cc6a8342 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentInjection.hpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentInjection.hpp @@ -1,59 +1,60 @@ #ifndef EquivalentInjection_H #define EquivalentInjection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquivalentEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "EquivalentEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "ReactivePower.hpp" #include "Boolean.hpp" -#include "Resistance.hpp" #include "Reactance.hpp" +#include "ReactivePower.hpp" +#include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ReactiveCapabilityCurve; - -class ReactiveCapabilityCurve; /* This class represents equivalent injections (generation or load). Voltage regulation is allowed only at the point of connection. */ - class EquivalentInjection: public EquivalentEquipment + class EquivalentInjection : public EquivalentEquipment { - public: - CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower maxQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ - CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower minQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ - CIMPP::Boolean regulationCapability; /* Specifies whether or not the EquivalentInjection has the capability to regulate the local voltage. Default: false */ - CIMPP::ReactiveCapabilityCurve* ReactiveCapabilityCurve; /* The equivalent injection using this reactive capability curve. Default: 0 */ - CIMPP::Resistance r; /* Positive sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance r2; /* Negative sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x2; /* Negative sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Boolean regulationStatus; /* Specifies the default regulation status of the EquivalentInjection. True is regulating. False is not regulating. Default: false */ - CIMPP::Voltage regulationTarget; /* The target voltage for voltage regulation. Default: nullptr */ - CIMPP::ActivePower p; /* Equivalent active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::ReactivePower q; /* Equivalent reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentInjection(); - virtual ~EquivalentInjection(); - + ~EquivalentInjection() override; + + CIMPP::ReactiveCapabilityCurve* ReactiveCapabilityCurve; /* The equivalent injection using this reactive capability curve. Default: 0 */ + CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower maxQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ + CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower minQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ + CIMPP::ActivePower p; /* Equivalent active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::ReactivePower q; /* Equivalent reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance r2; /* Negative sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Boolean regulationCapability; /* Specifies whether or not the EquivalentInjection has the capability to regulate the local voltage. Default: false */ + CIMPP::Boolean regulationStatus; /* Specifies the default regulation status of the EquivalentInjection. True is regulating. False is not regulating. Default: false */ + CIMPP::Voltage regulationTarget; /* The target voltage for voltage regulation. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Reactance x2; /* Negative sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentInjection_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquivalentNetwork.cpp b/CGMES_2.4.15_16FEB2016/EquivalentNetwork.cpp index 46d146976..f8ed0f8da 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentNetwork.cpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentNetwork.cpp @@ -1,49 +1,56 @@ -#include -#include "ConnectivityNodeContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentNetwork.hpp" +#include +#include + #include "EquivalentEquipment.hpp" using namespace CIMPP; EquivalentNetwork::EquivalentNetwork() {}; - EquivalentNetwork::~EquivalentNetwork() {}; -bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquivalentNetwork* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EquivalentEquipments.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_EquivalentEquipment_EquivalentNetwork(BaseClass*, BaseClass*); +bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquivalentNetwork* element = dynamic_cast(BaseClass_ptr1); + EquivalentEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EquivalentEquipments.begin(), element->EquivalentEquipments.end(), element2) == element->EquivalentEquipments.end()) + { + element->EquivalentEquipments.push_back(element2); + return assign_EquivalentEquipment_EquivalentNetwork(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* EquivalentNetwork_factory() { - return new EquivalentNetwork; - } +const char EquivalentNetwork::debugName[] = "EquivalentNetwork"; +const char* EquivalentNetwork::debugString() const +{ + return EquivalentNetwork::debugName; } -void EquivalentNetwork::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentNetwork::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentNetwork"), &EquivalentNetwork_factory)); } -void EquivalentNetwork::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void EquivalentNetwork::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentNetwork.EquivalentEquipments"), &assign_EquivalentNetwork_EquivalentEquipments)); +void EquivalentNetwork::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EquivalentNetwork::debugName[] = "EquivalentNetwork"; -const char* EquivalentNetwork::debugString() +void EquivalentNetwork::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentNetwork::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquivalentNetwork.EquivalentEquipments"), &assign_EquivalentNetwork_EquivalentEquipments)); } const BaseClassDefiner EquivalentNetwork::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EquivalentNetwork::declare() return BaseClassDefiner(EquivalentNetwork::addConstructToMap, EquivalentNetwork::addPrimitiveAssignFnsToMap, EquivalentNetwork::addClassAssignFnsToMap, EquivalentNetwork::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentNetwork_factory() + { + return new EquivalentNetwork; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquivalentNetwork.hpp b/CGMES_2.4.15_16FEB2016/EquivalentNetwork.hpp index febd34b67..39b7c3b62 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentNetwork.hpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentNetwork.hpp @@ -1,38 +1,39 @@ #ifndef EquivalentNetwork_H #define EquivalentNetwork_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConnectivityNodeContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConnectivityNodeContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EquivalentEquipment; -class EquivalentEquipment; /* A class that represents an external meshed network that has been reduced to an electrically equivalent model. The ConnectivityNodes contained in the equivalent are intended to reflect internal nodes of the equivalent. The boundary Connectivity nodes where the equivalent connects outside itself are NOT contained by the equivalent. */ - class EquivalentNetwork: public ConnectivityNodeContainer + class EquivalentNetwork : public ConnectivityNodeContainer { - public: - std::list EquivalentEquipments; /* The equivalent where the reduced model belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentNetwork(); - virtual ~EquivalentNetwork(); - + ~EquivalentNetwork() override; + + std::list EquivalentEquipments; /* The equivalent where the reduced model belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentNetwork_factory(); diff --git a/CGMES_2.4.15_16FEB2016/EquivalentShunt.cpp b/CGMES_2.4.15_16FEB2016/EquivalentShunt.cpp index 1a652d829..b62bb06bd 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentShunt.cpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentShunt.cpp @@ -1,66 +1,68 @@ -#include -#include "EquivalentEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentShunt.hpp" +#include +#include + #include "Susceptance.hpp" #include "Conductance.hpp" using namespace CIMPP; EquivalentShunt::EquivalentShunt() {}; - EquivalentShunt::~EquivalentShunt() {}; +bool assign_EquivalentShunt_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentShunt_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquivalentShunt_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentShunt_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EquivalentShunt_factory() { - return new EquivalentShunt; - } +const char EquivalentShunt::debugName[] = "EquivalentShunt"; +const char* EquivalentShunt::debugString() const +{ + return EquivalentShunt::debugName; } -void EquivalentShunt::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentShunt::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentShunt"), &EquivalentShunt_factory)); } -void EquivalentShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquivalentShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquivalentShunt.b"), &assign_EquivalentShunt_b)); assign_map.insert(std::make_pair(std::string("cim:EquivalentShunt.g"), &assign_EquivalentShunt_g)); } -void EquivalentShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char EquivalentShunt::debugName[] = "EquivalentShunt"; -const char* EquivalentShunt::debugString() +void EquivalentShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentShunt::debugName; } const BaseClassDefiner EquivalentShunt::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner EquivalentShunt::declare() return BaseClassDefiner(EquivalentShunt::addConstructToMap, EquivalentShunt::addPrimitiveAssignFnsToMap, EquivalentShunt::addClassAssignFnsToMap, EquivalentShunt::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentShunt_factory() + { + return new EquivalentShunt; + } +} diff --git a/CGMES_2.4.15_16FEB2016/EquivalentShunt.hpp b/CGMES_2.4.15_16FEB2016/EquivalentShunt.hpp index 80e5b7b6e..f6edab3a2 100644 --- a/CGMES_2.4.15_16FEB2016/EquivalentShunt.hpp +++ b/CGMES_2.4.15_16FEB2016/EquivalentShunt.hpp @@ -1,40 +1,41 @@ #ifndef EquivalentShunt_H #define EquivalentShunt_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquivalentEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "EquivalentEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents equivalent shunts. */ - class EquivalentShunt: public EquivalentEquipment + class EquivalentShunt : public EquivalentEquipment { - public: - CIMPP::Susceptance b; /* Positive sequence shunt susceptance. Default: nullptr */ - CIMPP::Conductance g; /* Positive sequence shunt conductance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentShunt(); - virtual ~EquivalentShunt(); - + ~EquivalentShunt() override; + + CIMPP::Susceptance b; /* Positive sequence shunt susceptance. Default: nullptr */ + CIMPP::Conductance g; /* Positive sequence shunt conductance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentShunt_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC1A.cpp b/CGMES_2.4.15_16FEB2016/ExcAC1A.cpp index d518305a3..e1183202a 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC1A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC1A.cpp @@ -1,366 +1,388 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC1A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcAC1A::ExcAC1A() {}; - ExcAC1A::~ExcAC1A() {}; +bool assign_ExcAC1A_hvlvgates(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hvlvgates; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_hvlvgates(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hvlvgates; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC1A_factory() { - return new ExcAC1A; - } +const char ExcAC1A::debugName[] = "ExcAC1A"; +const char* ExcAC1A::debugString() const +{ + return ExcAC1A::debugName; } -void ExcAC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC1A"), &ExcAC1A_factory)); } -void ExcAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tb"), &assign_ExcAC1A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tc"), &assign_ExcAC1A_tc)); +void ExcAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.hvlvgates"), &assign_ExcAC1A_hvlvgates)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ka"), &assign_ExcAC1A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ta"), &assign_ExcAC1A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamax"), &assign_ExcAC1A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamin"), &assign_ExcAC1A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.te"), &assign_ExcAC1A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kc"), &assign_ExcAC1A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kd"), &assign_ExcAC1A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ke"), &assign_ExcAC1A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kf"), &assign_ExcAC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kf1"), &assign_ExcAC1A_kf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kf2"), &assign_ExcAC1A_kf2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ks"), &assign_ExcAC1A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve1"), &assign_ExcAC1A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve2"), &assign_ExcAC1A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ta"), &assign_ExcAC1A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tb"), &assign_ExcAC1A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tc"), &assign_ExcAC1A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.te"), &assign_ExcAC1A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tf"), &assign_ExcAC1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kc"), &assign_ExcAC1A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kd"), &assign_ExcAC1A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ke"), &assign_ExcAC1A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamax"), &assign_ExcAC1A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamin"), &assign_ExcAC1A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ve1"), &assign_ExcAC1A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve1"), &assign_ExcAC1A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ve2"), &assign_ExcAC1A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve2"), &assign_ExcAC1A_seve2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vrmax"), &assign_ExcAC1A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vrmin"), &assign_ExcAC1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.hvlvgates"), &assign_ExcAC1A_hvlvgates)); } -void ExcAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC1A::debugName[] = "ExcAC1A"; -const char* ExcAC1A::debugString() +void ExcAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC1A::debugName; } const BaseClassDefiner ExcAC1A::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner ExcAC1A::declare() return BaseClassDefiner(ExcAC1A::addConstructToMap, ExcAC1A::addPrimitiveAssignFnsToMap, ExcAC1A::addClassAssignFnsToMap, ExcAC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC1A_factory() + { + return new ExcAC1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC1A.hpp b/CGMES_2.4.15_16FEB2016/ExcAC1A.hpp index 5ca0eb61f..8880dc0e4 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC1A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC1A.hpp @@ -1,62 +1,63 @@ #ifndef ExcAC1A_H #define ExcAC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE AC1A alternator-supplied rectifier excitation system with different rate feedback source. */ - class ExcAC1A: public ExcitationSystemDynamics + class ExcAC1A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 0. Default: nullptr */ - CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.38. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 6.03. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Rrmin). Typical Value = -5.43. Default: nullptr */ - CIMPP::Boolean hvlvgates; /* Indicates if both HV gate and LV gate are active (HVLVgates). true = gates are used false = gates are not used. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC1A(); - virtual ~ExcAC1A(); - + ~ExcAC1A() override; + + CIMPP::Boolean hvlvgates; /* Indicates if both HV gate and LV gate are active (HVLVgates). true = gates are used false = gates are not used. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.38. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 3.14. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 6.03. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Rrmin). Typical Value = -5.43. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC2A.cpp b/CGMES_2.4.15_16FEB2016/ExcAC2A.cpp index daacc9483..6f3c74e6d 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC2A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC2A.cpp @@ -1,456 +1,484 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC2A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcAC2A::ExcAC2A() {}; - ExcAC2A::~ExcAC2A() {}; +bool assign_ExcAC2A_hvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hvgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lvgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vlr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vlr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_hvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hvgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lvgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAC2A_factory() { - return new ExcAC2A; - } + + + + + + + + + + + + + + + + + + + + + + +const char ExcAC2A::debugName[] = "ExcAC2A"; +const char* ExcAC2A::debugString() const +{ + return ExcAC2A::debugName; } -void ExcAC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC2A"), &ExcAC2A_factory)); } -void ExcAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tb"), &assign_ExcAC2A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tc"), &assign_ExcAC2A_tc)); +void ExcAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.hvgate"), &assign_ExcAC2A_hvgate)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ka"), &assign_ExcAC2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ta"), &assign_ExcAC2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamax"), &assign_ExcAC2A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamin"), &assign_ExcAC2A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kb"), &assign_ExcAC2A_kb)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kb1"), &assign_ExcAC2A_kb1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmax"), &assign_ExcAC2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmin"), &assign_ExcAC2A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.te"), &assign_ExcAC2A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vfemax"), &assign_ExcAC2A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kh"), &assign_ExcAC2A_kh)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kc"), &assign_ExcAC2A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kd"), &assign_ExcAC2A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ke"), &assign_ExcAC2A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kf"), &assign_ExcAC2A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kh"), &assign_ExcAC2A_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kl"), &assign_ExcAC2A_kl)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vlr"), &assign_ExcAC2A_vlr)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kl1"), &assign_ExcAC2A_kl1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ks"), &assign_ExcAC2A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.lvgate"), &assign_ExcAC2A_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve1"), &assign_ExcAC2A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve2"), &assign_ExcAC2A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ta"), &assign_ExcAC2A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tb"), &assign_ExcAC2A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tc"), &assign_ExcAC2A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.te"), &assign_ExcAC2A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tf"), &assign_ExcAC2A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kc"), &assign_ExcAC2A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kd"), &assign_ExcAC2A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ke"), &assign_ExcAC2A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamax"), &assign_ExcAC2A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamin"), &assign_ExcAC2A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ve1"), &assign_ExcAC2A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve1"), &assign_ExcAC2A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ve2"), &assign_ExcAC2A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve2"), &assign_ExcAC2A_seve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.hvgate"), &assign_ExcAC2A_hvgate)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.lvgate"), &assign_ExcAC2A_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vfemax"), &assign_ExcAC2A_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vlr"), &assign_ExcAC2A_vlr)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmax"), &assign_ExcAC2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmin"), &assign_ExcAC2A_vrmin)); } -void ExcAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC2A::debugName[] = "ExcAC2A"; -const char* ExcAC2A::debugString() +void ExcAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC2A::debugName; } const BaseClassDefiner ExcAC2A::declare() @@ -458,4 +486,10 @@ const BaseClassDefiner ExcAC2A::declare() return BaseClassDefiner(ExcAC2A::addConstructToMap, ExcAC2A::addPrimitiveAssignFnsToMap, ExcAC2A::addClassAssignFnsToMap, ExcAC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC2A_factory() + { + return new ExcAC2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC2A.hpp b/CGMES_2.4.15_16FEB2016/ExcAC2A.hpp index 33453b599..17de55256 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC2A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC2A.hpp @@ -1,68 +1,69 @@ #ifndef ExcAC2A_H #define ExcAC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE AC2A alternator-supplied rectifier excitation system with different field current limit. */ - class ExcAC2A: public ExcitationSystemDynamics + class ExcAC2A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ - CIMPP::PU kb; /* Second stage regulator gain (Kb) (>0). Exciter field current controller gain. Typical Value = 25. Default: nullptr */ - CIMPP::PU kb1; /* Second stage regulator gain (Kb1). It is exciter field current controller gain used as alternative to Kb to represent a variant of the ExcAC2A model. Typical Value = 25. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 105. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 4.4. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current feedback gain (Kh). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU kl; /* Exciter field current limiter gain (Kl). Typical Value = 10. Default: nullptr */ - CIMPP::PU vlr; /* Maximum exciter field current (Vlr). Typical Value = 4.4. Default: nullptr */ - CIMPP::PU kl1; /* Coefficient to allow different usage of the model (Kl1). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.28. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.35. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.037. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 3.3. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.012. Default: nullptr */ - CIMPP::Boolean hvgate; /* Indicates if HV gate is active (HVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ - CIMPP::Boolean lvgate; /* Indicates if LV gate is active (LVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC2A(); - virtual ~ExcAC2A(); - + ~ExcAC2A() override; + + CIMPP::Boolean hvgate; /* Indicates if HV gate is active (HVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ + CIMPP::PU kb; /* Second stage regulator gain (Kb) (>0). Exciter field current controller gain. Typical Value = 25. Default: nullptr */ + CIMPP::PU kb1; /* Second stage regulator gain (Kb1). It is exciter field current controller gain used as alternative to Kb to represent a variant of the ExcAC2A model. Typical Value = 25. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.28. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.35. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current feedback gain (Kh). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl; /* Exciter field current limiter gain (Kl). Typical Value = 10. Default: nullptr */ + CIMPP::PU kl1; /* Coefficient to allow different usage of the model (Kl1). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean lvgate; /* Indicates if LV gate is active (LVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.037. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.6. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 3.3. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU vlr; /* Maximum exciter field current (Vlr). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 105. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -95. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC3A.cpp b/CGMES_2.4.15_16FEB2016/ExcAC3A.cpp index c9b9a205c..87e00405c 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC3A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC3A.cpp @@ -1,426 +1,452 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC3A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" using namespace CIMPP; ExcAC3A::ExcAC3A() {}; - ExcAC3A::~ExcAC3A() {}; +bool assign_ExcAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_klv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vlv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_klv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_vlv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAC3A_factory() { - return new ExcAC3A; - } + + + + + + + + + + + + + + + + + + + + +const char ExcAC3A::debugName[] = "ExcAC3A"; +const char* ExcAC3A::debugString() const +{ + return ExcAC3A::debugName; } -void ExcAC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC3A"), &ExcAC3A_factory)); } -void ExcAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tb"), &assign_ExcAC3A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tc"), &assign_ExcAC3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ka"), &assign_ExcAC3A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ta"), &assign_ExcAC3A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamax"), &assign_ExcAC3A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamin"), &assign_ExcAC3A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.te"), &assign_ExcAC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vemin"), &assign_ExcAC3A_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kr"), &assign_ExcAC3A_kr)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf"), &assign_ExcAC3A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tf"), &assign_ExcAC3A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kn"), &assign_ExcAC3A_kn)); +void ExcAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.efdn"), &assign_ExcAC3A_efdn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ka"), &assign_ExcAC3A_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kc"), &assign_ExcAC3A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kd"), &assign_ExcAC3A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ke"), &assign_ExcAC3A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.klv"), &assign_ExcAC3A_klv)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf"), &assign_ExcAC3A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf1"), &assign_ExcAC3A_kf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf2"), &assign_ExcAC3A_kf2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.klv"), &assign_ExcAC3A_klv)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kn"), &assign_ExcAC3A_kn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kr"), &assign_ExcAC3A_kr)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ks"), &assign_ExcAC3A_ks)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vfemax"), &assign_ExcAC3A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve1"), &assign_ExcAC3A_ve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.seve1"), &assign_ExcAC3A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve2"), &assign_ExcAC3A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.seve2"), &assign_ExcAC3A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ta"), &assign_ExcAC3A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tb"), &assign_ExcAC3A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tc"), &assign_ExcAC3A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.te"), &assign_ExcAC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tf"), &assign_ExcAC3A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamax"), &assign_ExcAC3A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamin"), &assign_ExcAC3A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve1"), &assign_ExcAC3A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve2"), &assign_ExcAC3A_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vemin"), &assign_ExcAC3A_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vfemax"), &assign_ExcAC3A_vfemax)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vlv"), &assign_ExcAC3A_vlv)); } -void ExcAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC3A::debugName[] = "ExcAC3A"; -const char* ExcAC3A::debugString() +void ExcAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC3A::debugName; } const BaseClassDefiner ExcAC3A::declare() @@ -428,4 +454,10 @@ const BaseClassDefiner ExcAC3A::declare() return BaseClassDefiner(ExcAC3A::addConstructToMap, ExcAC3A::addPrimitiveAssignFnsToMap, ExcAC3A::addClassAssignFnsToMap, ExcAC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC3A_factory() + { + return new ExcAC3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC3A.hpp b/CGMES_2.4.15_16FEB2016/ExcAC3A.hpp index 70e872bed..db3685cc7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC3A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC3A.hpp @@ -1,65 +1,66 @@ #ifndef ExcAC3A_H #define ExcAC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC3A alternator-supplied rectifier excitation system with different field current limit. */ - class ExcAC3A: public ExcitationSystemDynamics + class ExcAC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ka; /* Voltage regulator gain (Ka). Typical Value = 45.62. Default: nullptr */ - CIMPP::PU ta; /* Voltage regulator time constant (Ta). Typical Value = 0.013. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.17. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (Kr). Typical Value =3.77. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.143. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU kn; /* Excitation control system stabilizer gain (Kn). Typical Value =0.05. Default: nullptr */ - CIMPP::PU efdn; /* Value of at which feedback gain changes (Efdn). Typical Value = 2.36. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.104. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.499. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU klv; /* Gain used in the minimum field voltage limiter loop (Klv). Typical Value = 0.194. Default: nullptr */ - CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 16. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1) equals Vemax (Ve1). Typical Value = 6.24. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 1.143. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.68. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vlv; /* Field voltage used in the minimum field voltage limiter loop (Vlv). Typical Value = 0.79. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC3A(); - virtual ~ExcAC3A(); - + ~ExcAC3A() override; + + CIMPP::PU efdn; /* Value of at which feedback gain changes (Efdn). Typical Value = 2.36. Default: nullptr */ + CIMPP::Seconds ka; /* Voltage regulator gain (Ka). Typical Value = 45.62. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.104. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.499. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.143. Default: nullptr */ + CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 0. Default: nullptr */ + CIMPP::PU klv; /* Gain used in the minimum field voltage limiter loop (Klv). Typical Value = 0.194. Default: nullptr */ + CIMPP::PU kn; /* Excitation control system stabilizer gain (Kn). Typical Value =0.05. Default: nullptr */ + CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (Kr). Typical Value =3.77. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 1.143. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ta; /* Voltage regulator time constant (Ta). Typical Value = 0.013. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.17. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1) equals Vemax (Ve1). Typical Value = 6.24. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.68. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 16. Default: nullptr */ + CIMPP::PU vlv; /* Field voltage used in the minimum field voltage limiter loop (Vlv). Typical Value = 0.79. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC4A.cpp b/CGMES_2.4.15_16FEB2016/ExcAC4A.cpp index cc5f6f7fd..42910c5bc 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC4A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC4A.cpp @@ -1,171 +1,180 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC4A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAC4A::ExcAC4A() {}; - ExcAC4A::~ExcAC4A() {}; +bool assign_ExcAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC4A_factory() { - return new ExcAC4A; - } +const char ExcAC4A::debugName[] = "ExcAC4A"; +const char* ExcAC4A::debugString() const +{ + return ExcAC4A::debugName; } -void ExcAC4A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC4A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC4A"), &ExcAC4A_factory)); } -void ExcAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimax"), &assign_ExcAC4A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimin"), &assign_ExcAC4A_vimin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tc"), &assign_ExcAC4A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tb"), &assign_ExcAC4A_tb)); +void ExcAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.ka"), &assign_ExcAC4A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.kc"), &assign_ExcAC4A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.ta"), &assign_ExcAC4A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tb"), &assign_ExcAC4A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tc"), &assign_ExcAC4A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimax"), &assign_ExcAC4A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimin"), &assign_ExcAC4A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vrmax"), &assign_ExcAC4A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vrmin"), &assign_ExcAC4A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.kc"), &assign_ExcAC4A_kc)); } -void ExcAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC4A::debugName[] = "ExcAC4A"; -const char* ExcAC4A::debugString() +void ExcAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC4A::debugName; } const BaseClassDefiner ExcAC4A::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner ExcAC4A::declare() return BaseClassDefiner(ExcAC4A::addConstructToMap, ExcAC4A::addPrimitiveAssignFnsToMap, ExcAC4A::addClassAssignFnsToMap, ExcAC4A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC4A_factory() + { + return new ExcAC4A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC4A.hpp b/CGMES_2.4.15_16FEB2016/ExcAC4A.hpp index b436fb11a..3351ab9be 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC4A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC4A.hpp @@ -1,47 +1,48 @@ #ifndef ExcAC4A_H #define ExcAC4A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC4A alternator-supplied rectifier excitation system with different minimum controller output. */ - class ExcAC4A: public ExcitationSystemDynamics + class ExcAC4A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.015. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5.64. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.53. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC4A(); - virtual ~ExcAC4A(); - + ~ExcAC4A() override; + + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 200. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.015. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5.64. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.53. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC4A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC5A.cpp b/CGMES_2.4.15_16FEB2016/ExcAC5A.cpp index 22eef41fd..405cbcaba 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC5A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC5A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC5A.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcAC5A::ExcAC5A() {}; - ExcAC5A::~ExcAC5A() {}; +bool assign_ExcAC5A_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC5A_factory() { - return new ExcAC5A; - } +const char ExcAC5A::debugName[] = "ExcAC5A"; +const char* ExcAC5A::debugString() const +{ + return ExcAC5A::debugName; } -void ExcAC5A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC5A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC5A"), &ExcAC5A_factory)); } -void ExcAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.a"), &assign_ExcAC5A_a)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd1"), &assign_ExcAC5A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd2"), &assign_ExcAC5A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ka"), &assign_ExcAC5A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ke"), &assign_ExcAC5A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.kf"), &assign_ExcAC5A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ks"), &assign_ExcAC5A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd1"), &assign_ExcAC5A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd2"), &assign_ExcAC5A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ta"), &assign_ExcAC5A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tb"), &assign_ExcAC5A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tc"), &assign_ExcAC5A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ta"), &assign_ExcAC5A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmax"), &assign_ExcAC5A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmin"), &assign_ExcAC5A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ke"), &assign_ExcAC5A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.te"), &assign_ExcAC5A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.kf"), &assign_ExcAC5A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tf1"), &assign_ExcAC5A_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tf2"), &assign_ExcAC5A_tf2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tf3"), &assign_ExcAC5A_tf3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd1"), &assign_ExcAC5A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd1"), &assign_ExcAC5A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd2"), &assign_ExcAC5A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd2"), &assign_ExcAC5A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.a"), &assign_ExcAC5A_a)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmax"), &assign_ExcAC5A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmin"), &assign_ExcAC5A_vrmin)); } -void ExcAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC5A::debugName[] = "ExcAC5A"; -const char* ExcAC5A::debugString() +void ExcAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC5A::debugName; } const BaseClassDefiner ExcAC5A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcAC5A::declare() return BaseClassDefiner(ExcAC5A::addConstructToMap, ExcAC5A::addPrimitiveAssignFnsToMap, ExcAC5A::addClassAssignFnsToMap, ExcAC5A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC5A_factory() + { + return new ExcAC5A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC5A.hpp b/CGMES_2.4.15_16FEB2016/ExcAC5A.hpp index 621c3067b..8e36cf0c6 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC5A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC5A.hpp @@ -1,57 +1,58 @@ #ifndef ExcAC5A_H #define ExcAC5A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC5A alternator-supplied rectifier excitation system with different minimum controller output. */ - class ExcAC5A: public ExcitationSystemDynamics + class ExcAC5A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 7.3. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value =-7.3. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (Tf2). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (Tf3). Typical Value = 0. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 5.6. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (S[Efd1]). Typical Value = 0.86. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 4.2. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (S[Efd2]). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float a; /* Coefficient to allow different usage of the model (a). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC5A(); - virtual ~ExcAC5A(); - + ~ExcAC5A() override; + + CIMPP::Simple_Float a; /* Coefficient to allow different usage of the model (a). Typical Value = 1. Default: nullptr */ + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 5.6. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 4.2. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (S[Efd1]). Typical Value = 0.86. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (S[Efd2]). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (Tf2). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (Tf3). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 7.3. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value =-7.3. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC5A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC6A.cpp b/CGMES_2.4.15_16FEB2016/ExcAC6A.cpp index c8afc58ab..f19cc0233 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC6A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC6A.cpp @@ -1,19 +1,24 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC6A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -22,360 +27,378 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAC6A::ExcAC6A() {}; - ExcAC6A::~ExcAC6A() {}; +bool assign_ExcAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tj; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfelim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tj; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfelim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC6A_factory() { - return new ExcAC6A; - } +const char ExcAC6A::debugName[] = "ExcAC6A"; +const char* ExcAC6A::debugString() const +{ + return ExcAC6A::debugName; } -void ExcAC6A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC6A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC6A"), &ExcAC6A_factory)); } -void ExcAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ka"), &assign_ExcAC6A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kc"), &assign_ExcAC6A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kd"), &assign_ExcAC6A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ke"), &assign_ExcAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kh"), &assign_ExcAC6A_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ks"), &assign_ExcAC6A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve1"), &assign_ExcAC6A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve2"), &assign_ExcAC6A_seve2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ta"), &assign_ExcAC6A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tk"), &assign_ExcAC6A_tk)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tb"), &assign_ExcAC6A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tc"), &assign_ExcAC6A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamax"), &assign_ExcAC6A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamin"), &assign_ExcAC6A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmax"), &assign_ExcAC6A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmin"), &assign_ExcAC6A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.te"), &assign_ExcAC6A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kh"), &assign_ExcAC6A_kh)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tj"), &assign_ExcAC6A_tj)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.th"), &assign_ExcAC6A_th)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vfelim"), &assign_ExcAC6A_vfelim)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vhmax"), &assign_ExcAC6A_vhmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kc"), &assign_ExcAC6A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kd"), &assign_ExcAC6A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ke"), &assign_ExcAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tj"), &assign_ExcAC6A_tj)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tk"), &assign_ExcAC6A_tk)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamax"), &assign_ExcAC6A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamin"), &assign_ExcAC6A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ve1"), &assign_ExcAC6A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve1"), &assign_ExcAC6A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ve2"), &assign_ExcAC6A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve2"), &assign_ExcAC6A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vfelim"), &assign_ExcAC6A_vfelim)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vhmax"), &assign_ExcAC6A_vhmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmax"), &assign_ExcAC6A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmin"), &assign_ExcAC6A_vrmin)); } -void ExcAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC6A::debugName[] = "ExcAC6A"; -const char* ExcAC6A::debugString() +void ExcAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC6A::debugName; } const BaseClassDefiner ExcAC6A::declare() @@ -383,4 +406,10 @@ const BaseClassDefiner ExcAC6A::declare() return BaseClassDefiner(ExcAC6A::addConstructToMap, ExcAC6A::addPrimitiveAssignFnsToMap, ExcAC6A::addClassAssignFnsToMap, ExcAC6A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC6A_factory() + { + return new ExcAC6A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC6A.hpp b/CGMES_2.4.15_16FEB2016/ExcAC6A.hpp index e2b21d058..479374d09 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC6A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC6A.hpp @@ -1,62 +1,63 @@ #ifndef ExcAC6A_H #define ExcAC6A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC6A alternator-supplied rectifier excitation system with speed input. */ - class ExcAC6A: public ExcitationSystemDynamics + class ExcAC6A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 536. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.086. Default: nullptr */ - CIMPP::Seconds tk; /* Voltage regulator time constant (Tk). Typical Value = 0.18. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 3. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 75. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -75. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 44. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -36. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current limiter gain (Kh). Typical Value = 92. Default: nullptr */ - CIMPP::Seconds tj; /* Exciter field current limiter time constant (Tj). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds th; /* Exciter field current limiter time constant (Th). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU vfelim; /* Exciter field current limit reference (Vfelim). Typical Value = 19. Default: nullptr */ - CIMPP::PU vhmax; /* Maximum field current limiter signal reference (Vhmax). Typical Value = 75. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.173. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.91. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1.6. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 7.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.214. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 5.55. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.044. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC6A(); - virtual ~ExcAC6A(); - + ~ExcAC6A() override; + + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 536. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.173. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.91. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1.6. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current limiter gain (Kh). Typical Value = 92. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.214. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.044. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.086. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 9. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds th; /* Exciter field current limiter time constant (Th). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tj; /* Exciter field current limiter time constant (Tj). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tk; /* Voltage regulator time constant (Tk). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 75. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -75. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 7.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 5.55. Default: nullptr */ + CIMPP::PU vfelim; /* Exciter field current limit reference (Vfelim). Typical Value = 19. Default: nullptr */ + CIMPP::PU vhmax; /* Maximum field current limiter signal reference (Vhmax). Typical Value = 75. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 44. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -36. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC6A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAC8B.cpp b/CGMES_2.4.15_16FEB2016/ExcAC8B.cpp index 7b16aa3ff..d926b91ad 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC8B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC8B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC8B.hpp" +#include +#include + #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" @@ -33,373 +37,401 @@ using namespace CIMPP; ExcAC8B::ExcAC8B() {}; - ExcAC8B::~ExcAC8B() {}; +bool assign_ExcAC8B_inlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_pidlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pidlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_telim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->telim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAC8B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAC8B_vpidmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpidmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAC8B_vpidmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpidmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vtmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmult; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC8B_inlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_pidlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pidlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_telim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->telim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vpidmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpidmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vpidmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpidmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vtmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmult; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAC8B_factory() { - return new ExcAC8B; - } + + + + + + + + + + + + + + + + + + +const char ExcAC8B::debugName[] = "ExcAC8B"; +const char* ExcAC8B::debugString() const +{ + return ExcAC8B::debugName; } -void ExcAC8B::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC8B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC8B"), &ExcAC8B_factory)); } -void ExcAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC8B.inlim"), &assign_ExcAC8B_inlim)); assign_map.insert(std::make_pair(std::string("cim:ExcAC8B.ka"), &assign_ExcAC8B_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcAC8B.kc"), &assign_ExcAC8B_kc)); @@ -429,13 +461,8 @@ void ExcAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC8B::debugName[] = "ExcAC8B"; -const char* ExcAC8B::debugString() +void ExcAC8B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC8B::debugName; } const BaseClassDefiner ExcAC8B::declare() @@ -443,4 +470,10 @@ const BaseClassDefiner ExcAC8B::declare() return BaseClassDefiner(ExcAC8B::addConstructToMap, ExcAC8B::addPrimitiveAssignFnsToMap, ExcAC8B::addClassAssignFnsToMap, ExcAC8B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC8B_factory() + { + return new ExcAC8B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAC8B.hpp b/CGMES_2.4.15_16FEB2016/ExcAC8B.hpp index f6b50df1a..83af54d73 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAC8B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAC8B.hpp @@ -1,67 +1,68 @@ #ifndef ExcAC8B_H #define ExcAC8B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC8B alternator-supplied rectifier excitation system with speed input and input limiter. */ - class ExcAC8B: public ExcitationSystemDynamics + class ExcAC8B : public ExcitationSystemDynamics { - public: - CIMPP::Boolean inlim; /* Input limiter indicator. true = input limiter Vimax and Vimin is considered false = input limiter Vimax and Vimin is not considered. Typical Value = true. Default: false */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.55. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU kdr; /* Voltage regulator derivative gain (Kdr). Typical Value = 10. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 5. Default: nullptr */ - CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 80. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean pidlim; /* PID limiter indicator. true = input limiter Vpidmax and Vpidmin is considered false = input limiter Vpidmax and Vpidmin is not considered. Typical Value = true. Default: false */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve1]). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve2]). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdr; /* Lag time constant (Tdr). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.2. Default: nullptr */ - CIMPP::Boolean telim; /* Selector for the limiter on the block [1/sTe]. See diagram for meaning of true and false. Typical Value = false. Default: false */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve) equals V (Ve1). Typical Value = 6.5. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 9. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 6. Default: nullptr */ - CIMPP::PU vimax; /* Input signal maximum (Vimax). Typical Value = 35. Default: nullptr */ - CIMPP::PU vimin; /* Input signal minimum (Vimin). Typical Value = -10. Default: nullptr */ - CIMPP::PU vpidmax; /* PID maximum controller output (Vpidmax). Typical Value = 35. Default: nullptr */ - CIMPP::PU vpidmin; /* PID minimum controller output (Vpidmin). Typical Value = -10. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 35. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean vtmult; /* Multiply by generator`s terminal voltage indicator. true =the limits Vrmax and Vrmin are multiplied by the generator`s terminal voltage to represent a thyristor power stage fed from the generator terminals false = limits are not multiplied by generator`s terminal voltage. Typical Value = false. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC8B(); - virtual ~ExcAC8B(); - + ~ExcAC8B() override; + + CIMPP::Boolean inlim; /* Input limiter indicator. true = input limiter Vimax and Vimin is considered false = input limiter Vimax and Vimin is not considered. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 1. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.55. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU kdr; /* Voltage regulator derivative gain (Kdr). Typical Value = 10. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 5. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 80. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean pidlim; /* PID limiter indicator. true = input limiter Vpidmax and Vpidmin is considered false = input limiter Vpidmax and Vpidmin is not considered. Typical Value = true. Default: false */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve1]). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve2]). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdr; /* Lag time constant (Tdr). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.2. Default: nullptr */ + CIMPP::Boolean telim; /* Selector for the limiter on the block [1/sTe]. See diagram for meaning of true and false. Typical Value = false. Default: false */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve) equals V (Ve1). Typical Value = 6.5. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 9. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 6. Default: nullptr */ + CIMPP::PU vimax; /* Input signal maximum (Vimax). Typical Value = 35. Default: nullptr */ + CIMPP::PU vimin; /* Input signal minimum (Vimin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vpidmax; /* PID maximum controller output (Vpidmax). Typical Value = 35. Default: nullptr */ + CIMPP::PU vpidmin; /* PID minimum controller output (Vpidmin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 35. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean vtmult; /* Multiply by generator`s terminal voltage indicator. true =the limits Vrmax and Vrmin are multiplied by the generator`s terminal voltage to represent a thyristor power stage fed from the generator terminals false = limits are not multiplied by generator`s terminal voltage. Typical Value = false. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC8B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcANS.cpp b/CGMES_2.4.15_16FEB2016/ExcANS.cpp index a3aba3f57..5faf227b7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcANS.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcANS.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcANS.hpp" +#include +#include + +#include "Integer.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "Integer.hpp" +#include "Integer.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Integer.hpp" -#include "Integer.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Integer.hpp" -#include "Seconds.hpp" using namespace CIMPP; ExcANS::ExcANS() {}; - ExcANS::~ExcANS() {}; +bool assign_ExcANS_blint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->blint; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_ifmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_ifmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_krvecc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->krvecc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_kvfif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvfif; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcANS_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_blint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->blint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_kvfif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvfif; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_ifmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_ifmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_krvecc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->krvecc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcANS_factory() { - return new ExcANS; - } + + + + + + + + + + +const char ExcANS::debugName[] = "ExcANS"; +const char* ExcANS::debugString() const +{ + return ExcANS::debugName; } -void ExcANS::addConstructToMap(std::unordered_map& factory_map) { +void ExcANS::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcANS"), &ExcANS_factory)); } -void ExcANS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcANS.k3"), &assign_ExcANS_k3)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.k2"), &assign_ExcANS_k2)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.kce"), &assign_ExcANS_kce)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.t3"), &assign_ExcANS_t3)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.t2"), &assign_ExcANS_t2)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.t1"), &assign_ExcANS_t1)); +void ExcANS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcANS.blint"), &assign_ExcANS_blint)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.kvfif"), &assign_ExcANS_kvfif)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.ifmn"), &assign_ExcANS_ifmn)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.ifmx"), &assign_ExcANS_ifmx)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmn"), &assign_ExcANS_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmx"), &assign_ExcANS_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.k2"), &assign_ExcANS_k2)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.k3"), &assign_ExcANS_k3)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.kce"), &assign_ExcANS_kce)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.krvecc"), &assign_ExcANS_krvecc)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.kvfif"), &assign_ExcANS_kvfif)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.t1"), &assign_ExcANS_t1)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.t2"), &assign_ExcANS_t2)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.t3"), &assign_ExcANS_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.tb"), &assign_ExcANS_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmn"), &assign_ExcANS_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmx"), &assign_ExcANS_vrmx)); } -void ExcANS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcANS::debugName[] = "ExcANS"; -const char* ExcANS::debugString() +void ExcANS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcANS::debugName; } const BaseClassDefiner ExcANS::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcANS::declare() return BaseClassDefiner(ExcANS::addConstructToMap, ExcANS::addPrimitiveAssignFnsToMap, ExcANS::addClassAssignFnsToMap, ExcANS::debugName); } - +namespace CIMPP +{ + BaseClass* ExcANS_factory() + { + return new ExcANS; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcANS.hpp b/CGMES_2.4.15_16FEB2016/ExcANS.hpp index ebf932391..3ab370692 100644 --- a/CGMES_2.4.15_16FEB2016/ExcANS.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcANS.hpp @@ -1,54 +1,55 @@ #ifndef ExcANS_H #define ExcANS_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system. It represents static field voltage or excitation current feedback excitation system. */ - class ExcANS: public ExcitationSystemDynamics + class ExcANS : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float k3; /* AVR gain (K). Typical Value = 1000. Default: nullptr */ - CIMPP::Simple_Float k2; /* Exciter gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::Simple_Float kce; /* Ceiling factor (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T). Typical Value = 1.6. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T). Typical Value = 20. Default: nullptr */ - CIMPP::Integer blint; /* Governor Control Flag (BLINT). 0 = lead-lag regulator 1 = proportional integral regulator. Typical Value = 0. Default: 0 */ - CIMPP::Integer kvfif; /* Rate feedback signal flag (K). 0 = output voltage of the exciter 1 = exciter field current. Typical Value = 0. Default: 0 */ - CIMPP::PU ifmn; /* Minimum exciter current (I). Typical Value = -5.2. Default: nullptr */ - CIMPP::PU ifmx; /* Maximum exciter current (I). Typical Value = 6.5. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -5.2. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 6.5. Default: nullptr */ - CIMPP::Integer krvecc; /* Feedback enabling (K). 0 = Open loop control 1 = Closed loop control. Typical Value = 1. Default: 0 */ - CIMPP::Seconds tb; /* Exciter time constant (T). Typical Value = 0.04. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcANS(); - virtual ~ExcANS(); - + ~ExcANS() override; + + CIMPP::Integer blint; /* Governor Control Flag (BLINT). 0 = lead-lag regulator 1 = proportional integral regulator. Typical Value = 0. Default: 0 */ + CIMPP::PU ifmn; /* Minimum exciter current (I). Typical Value = -5.2. Default: nullptr */ + CIMPP::PU ifmx; /* Maximum exciter current (I). Typical Value = 6.5. Default: nullptr */ + CIMPP::Simple_Float k2; /* Exciter gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::Simple_Float k3; /* AVR gain (K). Typical Value = 1000. Default: nullptr */ + CIMPP::Simple_Float kce; /* Ceiling factor (K). Typical Value = 1. Default: nullptr */ + CIMPP::Integer krvecc; /* Feedback enabling (K). 0 = Open loop control 1 = Closed loop control. Typical Value = 1. Default: 0 */ + CIMPP::Integer kvfif; /* Rate feedback signal flag (K). 0 = output voltage of the exciter 1 = exciter field current. Typical Value = 0. Default: 0 */ + CIMPP::Seconds t1; /* Time constant (T). Typical Value = 20. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T). Typical Value = 1.6. Default: nullptr */ + CIMPP::Seconds tb; /* Exciter time constant (T). Typical Value = 0.04. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -5.2. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 6.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcANS_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR1.cpp b/CGMES_2.4.15_16FEB2016/ExcAVR1.cpp index 3064751c8..e94acd57f 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR1.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR1.cpp @@ -1,216 +1,228 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR1.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" using namespace CIMPP; ExcAVR1::ExcAVR1() {}; - ExcAVR1::~ExcAVR1() {}; +bool assign_ExcAVR1_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR1_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR1_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR1_factory() { - return new ExcAVR1; - } + + + + + + + + + +const char ExcAVR1::debugName[] = "ExcAVR1"; +const char* ExcAVR1::debugString() const +{ + return ExcAVR1::debugName; } -void ExcAVR1::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR1"), &ExcAVR1_factory)); } -void ExcAVR1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e1"), &assign_ExcAVR1_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e2"), &assign_ExcAVR1_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.ka"), &assign_ExcAVR1_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmn"), &assign_ExcAVR1_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmx"), &assign_ExcAVR1_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.kf"), &assign_ExcAVR1_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se1"), &assign_ExcAVR1_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se2"), &assign_ExcAVR1_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.ta"), &assign_ExcAVR1_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.tb"), &assign_ExcAVR1_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.te"), &assign_ExcAVR1_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e1"), &assign_ExcAVR1_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se1"), &assign_ExcAVR1_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e2"), &assign_ExcAVR1_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se2"), &assign_ExcAVR1_se2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.kf"), &assign_ExcAVR1_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.tf"), &assign_ExcAVR1_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmn"), &assign_ExcAVR1_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmx"), &assign_ExcAVR1_vrmx)); } -void ExcAVR1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR1::debugName[] = "ExcAVR1"; -const char* ExcAVR1::debugString() +void ExcAVR1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR1::debugName; } const BaseClassDefiner ExcAVR1::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner ExcAVR1::declare() return BaseClassDefiner(ExcAVR1::addConstructToMap, ExcAVR1::addPrimitiveAssignFnsToMap, ExcAVR1::addClassAssignFnsToMap, ExcAVR1::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR1_factory() + { + return new ExcAVR1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR1.hpp b/CGMES_2.4.15_16FEB2016/ExcAVR1.hpp index 41fed73ef..ae8f6209d 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR1.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR1.hpp @@ -1,51 +1,52 @@ #ifndef ExcAVR1_H #define ExcAVR1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system corresponding to IEEE (1968) Type 1 Model. It represents exciter dynamo and electromechanical regulator. */ - class ExcAVR1: public ExcitationSystemDynamics + class ExcAVR1 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ - CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds tf; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR1(); - virtual ~ExcAVR1(); - + ~ExcAVR1() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ + CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ + CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR2.cpp b/CGMES_2.4.15_16FEB2016/ExcAVR2.cpp index f5f25823a..30734b84e 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR2.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR2.cpp @@ -1,31 +1,199 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR2.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAVR2::ExcAVR2() {}; - ExcAVR2::~ExcAVR2() {}; +bool assign_ExcAVR2_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR2_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR2_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +205,40 @@ ExcAVR2::~ExcAVR2() {}; -bool assign_ExcAVR2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR2_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR2_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR2_factory() { - return new ExcAVR2; - } + +const char ExcAVR2::debugName[] = "ExcAVR2"; +const char* ExcAVR2::debugString() const +{ + return ExcAVR2::debugName; } -void ExcAVR2::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR2"), &ExcAVR2_factory)); } -void ExcAVR2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e1"), &assign_ExcAVR2_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e2"), &assign_ExcAVR2_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.ka"), &assign_ExcAVR2_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmn"), &assign_ExcAVR2_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmx"), &assign_ExcAVR2_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.kf"), &assign_ExcAVR2_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se1"), &assign_ExcAVR2_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se2"), &assign_ExcAVR2_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.ta"), &assign_ExcAVR2_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.tb"), &assign_ExcAVR2_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.te"), &assign_ExcAVR2_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e1"), &assign_ExcAVR2_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se1"), &assign_ExcAVR2_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e2"), &assign_ExcAVR2_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se2"), &assign_ExcAVR2_se2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.kf"), &assign_ExcAVR2_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.tf1"), &assign_ExcAVR2_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.tf2"), &assign_ExcAVR2_tf2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmn"), &assign_ExcAVR2_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmx"), &assign_ExcAVR2_vrmx)); } -void ExcAVR2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR2::debugName[] = "ExcAVR2"; -const char* ExcAVR2::debugString() +void ExcAVR2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR2::debugName; } const BaseClassDefiner ExcAVR2::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner ExcAVR2::declare() return BaseClassDefiner(ExcAVR2::addConstructToMap, ExcAVR2::addPrimitiveAssignFnsToMap, ExcAVR2::addClassAssignFnsToMap, ExcAVR2::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR2_factory() + { + return new ExcAVR2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR2.hpp b/CGMES_2.4.15_16FEB2016/ExcAVR2.hpp index cd4668ea7..56bcf98fc 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR2.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR2.hpp @@ -1,52 +1,53 @@ #ifndef ExcAVR2_H #define ExcAVR2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system corresponding to IEEE (1968) Type 2 Model. It represents alternator and rotating diodes and electromechanic voltage regulators. */ - class ExcAVR2: public ExcitationSystemDynamics + class ExcAVR2 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ - CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds tf1; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf2; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR2(); - virtual ~ExcAVR2(); - + ~ExcAVR2() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ + CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ + CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf1; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf2; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR3.cpp b/CGMES_2.4.15_16FEB2016/ExcAVR3.cpp index c055a262b..bec98de59 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR3.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR3.cpp @@ -1,216 +1,228 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR3.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcAVR3::ExcAVR3() {}; - ExcAVR3::~ExcAVR3() {}; +bool assign_ExcAVR3_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR3_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR3_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR3_factory() { - return new ExcAVR3; - } + + + + + + + + + +const char ExcAVR3::debugName[] = "ExcAVR3"; +const char* ExcAVR3::debugString() const +{ + return ExcAVR3::debugName; } -void ExcAVR3::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR3"), &ExcAVR3_factory)); } -void ExcAVR3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e1"), &assign_ExcAVR3_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e2"), &assign_ExcAVR3_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.ka"), &assign_ExcAVR3_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmn"), &assign_ExcAVR3_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmx"), &assign_ExcAVR3_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se1"), &assign_ExcAVR3_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se2"), &assign_ExcAVR3_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t1"), &assign_ExcAVR3_t1)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t2"), &assign_ExcAVR3_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t3"), &assign_ExcAVR3_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t4"), &assign_ExcAVR3_t4)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.te"), &assign_ExcAVR3_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e1"), &assign_ExcAVR3_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se1"), &assign_ExcAVR3_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e2"), &assign_ExcAVR3_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se2"), &assign_ExcAVR3_se2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmn"), &assign_ExcAVR3_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmx"), &assign_ExcAVR3_vrmx)); } -void ExcAVR3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR3::debugName[] = "ExcAVR3"; -const char* ExcAVR3::debugString() +void ExcAVR3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR3::debugName; } const BaseClassDefiner ExcAVR3::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner ExcAVR3::declare() return BaseClassDefiner(ExcAVR3::addConstructToMap, ExcAVR3::addPrimitiveAssignFnsToMap, ExcAVR3::addClassAssignFnsToMap, ExcAVR3::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR3_factory() + { + return new ExcAVR3; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR3.hpp b/CGMES_2.4.15_16FEB2016/ExcAVR3.hpp index b5f7cf86f..a3238d239 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR3.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR3.hpp @@ -1,51 +1,52 @@ #ifndef ExcAVR3_H #define ExcAVR3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system. It represents exciter dynamo and electric regulator. */ - class ExcAVR3: public ExcitationSystemDynamics + class ExcAVR3 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 3000. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -7.5. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7.5. Default: nullptr */ - CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 220. Default: nullptr */ - CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.6. Default: nullptr */ - CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0.66. Default: nullptr */ - CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0.07. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR3(); - virtual ~ExcAVR3(); - + ~ExcAVR3() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 3000. Default: nullptr */ + CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 220. Default: nullptr */ + CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.6. Default: nullptr */ + CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0.66. Default: nullptr */ + CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0.07. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -7.5. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR3_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR4.cpp b/CGMES_2.4.15_16FEB2016/ExcAVR4.cpp index f68040704..1c70c9f5a 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR4.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR4.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR4.hpp" +#include +#include + +#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAVR4::ExcAVR4() {}; - ExcAVR4::~ExcAVR4() {}; +bool assign_ExcAVR4_imul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_kif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kif; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t1if(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1if; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_tif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tif; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vfmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vfmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR4_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_vfmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_vfmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_kif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kif; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_tif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tif; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_t1if(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1if; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_imul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR4_factory() { - return new ExcAVR4; - } + + + + + + + + + + +const char ExcAVR4::debugName[] = "ExcAVR4"; +const char* ExcAVR4::debugString() const +{ + return ExcAVR4::debugName; } -void ExcAVR4::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR4"), &ExcAVR4_factory)); } -void ExcAVR4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.imul"), &assign_ExcAVR4_imul)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.ka"), &assign_ExcAVR4_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmn"), &assign_ExcAVR4_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmx"), &assign_ExcAVR4_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.ke"), &assign_ExcAVR4_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.kif"), &assign_ExcAVR4_kif)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t1"), &assign_ExcAVR4_t1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t1if"), &assign_ExcAVR4_t1if)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t2"), &assign_ExcAVR4_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t3"), &assign_ExcAVR4_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t4"), &assign_ExcAVR4_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.ke"), &assign_ExcAVR4_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmx"), &assign_ExcAVR4_vfmx)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmn"), &assign_ExcAVR4_vfmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.kif"), &assign_ExcAVR4_kif)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.tif"), &assign_ExcAVR4_tif)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t1if"), &assign_ExcAVR4_t1if)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.imul"), &assign_ExcAVR4_imul)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmn"), &assign_ExcAVR4_vfmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmx"), &assign_ExcAVR4_vfmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmn"), &assign_ExcAVR4_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmx"), &assign_ExcAVR4_vrmx)); } -void ExcAVR4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR4::debugName[] = "ExcAVR4"; -const char* ExcAVR4::debugString() +void ExcAVR4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR4::debugName; } const BaseClassDefiner ExcAVR4::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcAVR4::declare() return BaseClassDefiner(ExcAVR4::addConstructToMap, ExcAVR4::addPrimitiveAssignFnsToMap, ExcAVR4::addClassAssignFnsToMap, ExcAVR4::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR4_factory() + { + return new ExcAVR4; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR4.hpp b/CGMES_2.4.15_16FEB2016/ExcAVR4.hpp index ec3bb11da..adb83a2fe 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR4.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR4.hpp @@ -1,54 +1,55 @@ #ifndef ExcAVR4_H #define ExcAVR4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "Simple_Float.hpp" +namespace CIMPP +{ /* Italian excitation system. It represents static exciter and electric voltage regulator. */ - class ExcAVR4: public ExcitationSystemDynamics + class ExcAVR4 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 300. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 4.8. Default: nullptr */ - CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ke; /* Exciter gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU vfmx; /* Maximum exciter output (V). Typical Value = 5. Default: nullptr */ - CIMPP::PU vfmn; /* Minimum exciter output (V). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float kif; /* Exciter internal reactance (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tif; /* Exciter current feedback time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1if; /* Exciter current feedback time constant (T). Typical Value = 60. Default: nullptr */ - CIMPP::Boolean imul; /* AVR output voltage dependency selector (Imul). true = selector is connected false = selector is not connected. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR4(); - virtual ~ExcAVR4(); - + ~ExcAVR4() override; + + CIMPP::Boolean imul; /* AVR output voltage dependency selector (Imul). true = selector is connected false = selector is not connected. Typical Value = true. Default: false */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 300. Default: nullptr */ + CIMPP::Simple_Float ke; /* Exciter gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float kif; /* Exciter internal reactance (K). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 4.8. Default: nullptr */ + CIMPP::Seconds t1if; /* Exciter current feedback time constant (T). Typical Value = 60. Default: nullptr */ + CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.5. Default: nullptr */ + CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tif; /* Exciter current feedback time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfmn; /* Minimum exciter output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfmx; /* Maximum exciter output (V). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR4_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR5.cpp b/CGMES_2.4.15_16FEB2016/ExcAVR5.cpp index 1036f58fa..0232b8142 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR5.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR5.cpp @@ -1,81 +1,84 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR5.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcAVR5::ExcAVR5() {}; - ExcAVR5::~ExcAVR5() {}; +bool assign_ExcAVR5_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR5_rex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rex; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR5_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR5_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR5_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR5_rex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rex; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAVR5_factory() { - return new ExcAVR5; - } +const char ExcAVR5::debugName[] = "ExcAVR5"; +const char* ExcAVR5::debugString() const +{ + return ExcAVR5::debugName; } -void ExcAVR5::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR5::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR5"), &ExcAVR5_factory)); } -void ExcAVR5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.ka"), &assign_ExcAVR5_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.ta"), &assign_ExcAVR5_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.rex"), &assign_ExcAVR5_rex)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.ta"), &assign_ExcAVR5_ta)); } -void ExcAVR5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR5::debugName[] = "ExcAVR5"; -const char* ExcAVR5::debugString() +void ExcAVR5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR5::debugName; } const BaseClassDefiner ExcAVR5::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner ExcAVR5::declare() return BaseClassDefiner(ExcAVR5::addConstructToMap, ExcAVR5::addPrimitiveAssignFnsToMap, ExcAVR5::addClassAssignFnsToMap, ExcAVR5::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR5_factory() + { + return new ExcAVR5; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR5.hpp b/CGMES_2.4.15_16FEB2016/ExcAVR5.hpp index 26d4e1b1f..53cfd5ee7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR5.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR5.hpp @@ -1,41 +1,42 @@ #ifndef ExcAVR5_H #define ExcAVR5_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Manual excitation control with field circuit resistance. This model can be used as a very simple representation of manual voltage control. */ - class ExcAVR5: public ExcitationSystemDynamics + class ExcAVR5 : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Gain (Ka). Default: nullptr */ - CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ - CIMPP::PU rex; /* Effective Output Resistance (Rex). Rex represents the effective output resistance seen by the excitation system. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR5(); - virtual ~ExcAVR5(); - + ~ExcAVR5() override; + + CIMPP::PU ka; /* Gain (Ka). Default: nullptr */ + CIMPP::PU rex; /* Effective Output Resistance (Rex). Rex represents the effective output resistance seen by the excitation system. Default: nullptr */ + CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR5_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR7.cpp b/CGMES_2.4.15_16FEB2016/ExcAVR7.cpp index 7c6ee5455..0933e6aa5 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR7.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR7.cpp @@ -1,12 +1,15 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR7.hpp" +#include +#include + +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -14,338 +17,356 @@ #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcAVR7::ExcAVR7() {}; - ExcAVR7::~ExcAVR7() {}; +bool assign_ExcAVR7_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmax3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmax5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmin1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmin3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmin5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR7_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmin1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmax3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmin3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmax5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmin5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAVR7_factory() { - return new ExcAVR7; - } +const char ExcAVR7::debugName[] = "ExcAVR7"; +const char* ExcAVR7::debugString() const +{ + return ExcAVR7::debugName; } -void ExcAVR7::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR7::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR7"), &ExcAVR7_factory)); } -void ExcAVR7::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k1"), &assign_ExcAVR7_k1)); +void ExcAVR7::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a1"), &assign_ExcAVR7_a1)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a2"), &assign_ExcAVR7_a2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t1"), &assign_ExcAVR7_t1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t2"), &assign_ExcAVR7_t2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax1"), &assign_ExcAVR7_vmax1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin1"), &assign_ExcAVR7_vmin1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k3"), &assign_ExcAVR7_k3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a3"), &assign_ExcAVR7_a3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a4"), &assign_ExcAVR7_a4)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t3"), &assign_ExcAVR7_t3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t4"), &assign_ExcAVR7_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax3"), &assign_ExcAVR7_vmax3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin3"), &assign_ExcAVR7_vmin3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k5"), &assign_ExcAVR7_k5)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a5"), &assign_ExcAVR7_a5)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a6"), &assign_ExcAVR7_a6)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k1"), &assign_ExcAVR7_k1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k3"), &assign_ExcAVR7_k3)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k5"), &assign_ExcAVR7_k5)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t1"), &assign_ExcAVR7_t1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t2"), &assign_ExcAVR7_t2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t3"), &assign_ExcAVR7_t3)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t4"), &assign_ExcAVR7_t4)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t5"), &assign_ExcAVR7_t5)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t6"), &assign_ExcAVR7_t6)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax1"), &assign_ExcAVR7_vmax1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax3"), &assign_ExcAVR7_vmax3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax5"), &assign_ExcAVR7_vmax5)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin1"), &assign_ExcAVR7_vmin1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin3"), &assign_ExcAVR7_vmin3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin5"), &assign_ExcAVR7_vmin5)); } -void ExcAVR7::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR7::debugName[] = "ExcAVR7"; -const char* ExcAVR7::debugString() +void ExcAVR7::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR7::debugName; } const BaseClassDefiner ExcAVR7::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner ExcAVR7::declare() return BaseClassDefiner(ExcAVR7::addConstructToMap, ExcAVR7::addPrimitiveAssignFnsToMap, ExcAVR7::addClassAssignFnsToMap, ExcAVR7::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR7_factory() + { + return new ExcAVR7; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcAVR7.hpp b/CGMES_2.4.15_16FEB2016/ExcAVR7.hpp index 0edf51f18..998268aa7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcAVR7.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcAVR7.hpp @@ -1,59 +1,60 @@ #ifndef ExcAVR7_H #define ExcAVR7_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IVO excitation system. */ - class ExcAVR7: public ExcitationSystemDynamics + class ExcAVR7 : public ExcitationSystemDynamics { - public: - CIMPP::PU k1; /* Gain (K1). Typical Value = 1. Default: nullptr */ - CIMPP::PU a1; /* Lead coefficient (A1). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU a2; /* Lag coefficient (A2). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t1; /* Lead time constant (T1). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t2; /* Lag time constant (T2). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vmax1; /* Lead-lag max. limit (Vmax1). Typical Value = 5. Default: nullptr */ - CIMPP::PU vmin1; /* Lead-lag min. limit (Vmin1). Typical Value = -5. Default: nullptr */ - CIMPP::PU k3; /* Gain (K3). Typical Value = 3. Default: nullptr */ - CIMPP::PU a3; /* Lead coefficient (A3). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU a4; /* Lag coefficient (A4). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t3; /* Lead time constant (T3). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4; /* Lag time constant (T4). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vmax3; /* Lead-lag max. limit (Vmax3). Typical Value = 5. Default: nullptr */ - CIMPP::PU vmin3; /* Lead-lag min. limit (Vmin3). Typical Value = -5. Default: nullptr */ - CIMPP::PU k5; /* Gain (K5). Typical Value = 1. Default: nullptr */ - CIMPP::PU a5; /* Lead coefficient (A5). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU a6; /* Lag coefficient (A6). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t5; /* Lead time constant (T5). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t6; /* Lag time constant (T6). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vmax5; /* Lead-lag max. limit (Vmax5). Typical Value = 5. Default: nullptr */ - CIMPP::PU vmin5; /* Lead-lag min. limit (Vmin5). Typical Value = -2. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR7(); - virtual ~ExcAVR7(); - + ~ExcAVR7() override; + + CIMPP::PU a1; /* Lead coefficient (A1). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a2; /* Lag coefficient (A2). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a3; /* Lead coefficient (A3). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a4; /* Lag coefficient (A4). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a5; /* Lead coefficient (A5). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a6; /* Lag coefficient (A6). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU k1; /* Gain (K1). Typical Value = 1. Default: nullptr */ + CIMPP::PU k3; /* Gain (K3). Typical Value = 3. Default: nullptr */ + CIMPP::PU k5; /* Gain (K5). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t1; /* Lead time constant (T1). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t2; /* Lag time constant (T2). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3; /* Lead time constant (T3). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Lag time constant (T4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t5; /* Lead time constant (T5). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t6; /* Lag time constant (T6). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vmax1; /* Lead-lag max. limit (Vmax1). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmax3; /* Lead-lag max. limit (Vmax3). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmax5; /* Lead-lag max. limit (Vmax5). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmin1; /* Lead-lag min. limit (Vmin1). Typical Value = -5. Default: nullptr */ + CIMPP::PU vmin3; /* Lead-lag min. limit (Vmin3). Typical Value = -5. Default: nullptr */ + CIMPP::PU vmin5; /* Lead-lag min. limit (Vmin5). Typical Value = -2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR7_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcBBC.cpp b/CGMES_2.4.15_16FEB2016/ExcBBC.cpp index 8763915c3..e78e0f2d7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcBBC.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcBBC.cpp @@ -1,7 +1,15 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcBBC.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "Boolean.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -9,193 +17,196 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcBBC::ExcBBC() {}; - ExcBBC::~ExcBBC() {}; +bool assign_ExcBBC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_switch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->_switch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcBBC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcBBC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcBBC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_switch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->_switch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcBBC_factory() { - return new ExcBBC; - } + + + + + + + + + +const char ExcBBC::debugName[] = "ExcBBC"; +const char* ExcBBC::debugString() const +{ + return ExcBBC::debugName; } -void ExcBBC::addConstructToMap(std::unordered_map& factory_map) { +void ExcBBC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcBBC"), &ExcBBC_factory)); } -void ExcBBC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcBBC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmax"), &assign_ExcBBC_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmin"), &assign_ExcBBC_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.k"), &assign_ExcBBC_k)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.switch"), &assign_ExcBBC_switch)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t1"), &assign_ExcBBC_t1)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t2"), &assign_ExcBBC_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t3"), &assign_ExcBBC_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t4"), &assign_ExcBBC_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.k"), &assign_ExcBBC_k)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.vrmin"), &assign_ExcBBC_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.vrmax"), &assign_ExcBBC_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmin"), &assign_ExcBBC_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmax"), &assign_ExcBBC_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.vrmin"), &assign_ExcBBC_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.xe"), &assign_ExcBBC_xe)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.switch"), &assign_ExcBBC_switch)); } -void ExcBBC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcBBC::debugName[] = "ExcBBC"; -const char* ExcBBC::debugString() +void ExcBBC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcBBC::debugName; } const BaseClassDefiner ExcBBC::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner ExcBBC::declare() return BaseClassDefiner(ExcBBC::addConstructToMap, ExcBBC::addPrimitiveAssignFnsToMap, ExcBBC::addClassAssignFnsToMap, ExcBBC::debugName); } - +namespace CIMPP +{ + BaseClass* ExcBBC_factory() + { + return new ExcBBC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcBBC.hpp b/CGMES_2.4.15_16FEB2016/ExcBBC.hpp index 379cec722..2878ad4ff 100644 --- a/CGMES_2.4.15_16FEB2016/ExcBBC.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcBBC.hpp @@ -1,50 +1,51 @@ #ifndef ExcBBC_H #define ExcBBC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Transformer fed static excitation system (static with ABB regulator). This model represents a static excitation system in which a gated thyristor bridge fed by a transformer at the main generator terminals feeds the main generator directly. */ - class ExcBBC: public ExcitationSystemDynamics + class ExcBBC : public ExcitationSystemDynamics { - public: - CIMPP::Seconds t1; /* Controller time constant (T1). Typical Value = 6. Default: nullptr */ - CIMPP::Seconds t2; /* Controller time constant (T2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU k; /* Steady state gain (K). Typical Value = 300. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum control element output (Vrmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum control element output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU efdmin; /* Minimum open circuit exciter voltage (Efdmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum open circuit exciter voltage (Efdmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU xe; /* Effective excitation transformer reactance (Xe). Typical Value = 0.05. Default: nullptr */ - CIMPP::Boolean _switch; /* Supplementary signal routing selector (switch). true = Vs connected to 3rd summing point false = Vs connected to 1st summing point (see diagram). Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcBBC(); - virtual ~ExcBBC(); - + ~ExcBBC() override; + + CIMPP::PU efdmax; /* Maximum open circuit exciter voltage (Efdmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU efdmin; /* Minimum open circuit exciter voltage (Efdmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU k; /* Steady state gain (K). Typical Value = 300. Default: nullptr */ + CIMPP::Boolean _switch; /* Supplementary signal routing selector (switch). true = Vs connected to 3rd summing point false = Vs connected to 1st summing point (see diagram). Typical Value = true. Default: false */ + CIMPP::Seconds t1; /* Controller time constant (T1). Typical Value = 6. Default: nullptr */ + CIMPP::Seconds t2; /* Controller time constant (T2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum control element output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum control element output (Vrmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU xe; /* Effective excitation transformer reactance (Xe). Typical Value = 0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcBBC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcCZ.cpp b/CGMES_2.4.15_16FEB2016/ExcCZ.cpp index 6bf344d51..672a78e76 100644 --- a/CGMES_2.4.15_16FEB2016/ExcCZ.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcCZ.cpp @@ -1,186 +1,196 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcCZ.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcCZ::ExcCZ() {}; - ExcCZ::~ExcCZ() {}; +bool assign_ExcCZ_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcCZ_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcCZ_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcCZ_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcCZ_factory() { - return new ExcCZ; - } + + + +const char ExcCZ::debugName[] = "ExcCZ"; +const char* ExcCZ::debugString() const +{ + return ExcCZ::debugName; } -void ExcCZ::addConstructToMap(std::unordered_map& factory_map) { +void ExcCZ::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcCZ"), &ExcCZ_factory)); } -void ExcCZ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcCZ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmax"), &assign_ExcCZ_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmin"), &assign_ExcCZ_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ka"), &assign_ExcCZ_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ke"), &assign_ExcCZ_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.kp"), &assign_ExcCZ_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ta"), &assign_ExcCZ_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.tc"), &assign_ExcCZ_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.te"), &assign_ExcCZ_te)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.vrmax"), &assign_ExcCZ_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.vrmin"), &assign_ExcCZ_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ka"), &assign_ExcCZ_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ta"), &assign_ExcCZ_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ke"), &assign_ExcCZ_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.te"), &assign_ExcCZ_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmax"), &assign_ExcCZ_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmin"), &assign_ExcCZ_efdmin)); } -void ExcCZ::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcCZ::debugName[] = "ExcCZ"; -const char* ExcCZ::debugString() +void ExcCZ::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcCZ::debugName; } const BaseClassDefiner ExcCZ::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner ExcCZ::declare() return BaseClassDefiner(ExcCZ::addConstructToMap, ExcCZ::addPrimitiveAssignFnsToMap, ExcCZ::addClassAssignFnsToMap, ExcCZ::debugName); } - +namespace CIMPP +{ + BaseClass* ExcCZ_factory() + { + return new ExcCZ; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcCZ.hpp b/CGMES_2.4.15_16FEB2016/ExcCZ.hpp index 145ad1bdd..31978efcc 100644 --- a/CGMES_2.4.15_16FEB2016/ExcCZ.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcCZ.hpp @@ -1,48 +1,49 @@ #ifndef ExcCZ_H #define ExcCZ_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Czech Proportion/Integral Exciter. */ - class ExcCZ: public ExcitationSystemDynamics + class ExcCZ : public ExcitationSystemDynamics { - public: - CIMPP::PU kp; /* Regulator proportional gain (Kp). Default: nullptr */ - CIMPP::Seconds tc; /* Regulator integral time constant (Tc). Default: nullptr */ - CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Default: nullptr */ - CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Default: nullptr */ - CIMPP::PU ka; /* Regulator gain (Ka). Default: nullptr */ - CIMPP::Seconds ta; /* Regulator time constant (Ta). Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Default: nullptr */ - CIMPP::PU efdmax; /* Exciter output maximum limit (Efdmax). Default: nullptr */ - CIMPP::PU efdmin; /* Exciter output minimum limit (Efdmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcCZ(); - virtual ~ExcCZ(); - + ~ExcCZ() override; + + CIMPP::PU efdmax; /* Exciter output maximum limit (Efdmax). Default: nullptr */ + CIMPP::PU efdmin; /* Exciter output minimum limit (Efdmin). Default: nullptr */ + CIMPP::PU ka; /* Regulator gain (Ka). Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Default: nullptr */ + CIMPP::PU kp; /* Regulator proportional gain (Kp). Default: nullptr */ + CIMPP::Seconds ta; /* Regulator time constant (Ta). Default: nullptr */ + CIMPP::Seconds tc; /* Regulator integral time constant (Tc). Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Default: nullptr */ + CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Default: nullptr */ + CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcCZ_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcDC1A.cpp b/CGMES_2.4.15_16FEB2016/ExcDC1A.cpp index 522a9016d..f8cf51244 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC1A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC1A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcDC1A::ExcDC1A() {}; - ExcDC1A::~ExcDC1A() {}; +bool assign_ExcDC1A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->edfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->edfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcDC1A_factory() { - return new ExcDC1A; - } +const char ExcDC1A::debugName[] = "ExcDC1A"; +const char* ExcDC1A::debugString() const +{ + return ExcDC1A::debugName; } -void ExcDC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC1A"), &ExcDC1A_factory)); } -void ExcDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.edfmax"), &assign_ExcDC1A_edfmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd1"), &assign_ExcDC1A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd2"), &assign_ExcDC1A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efdmin"), &assign_ExcDC1A_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.exclim"), &assign_ExcDC1A_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ka"), &assign_ExcDC1A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ke"), &assign_ExcDC1A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.kf"), &assign_ExcDC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ks"), &assign_ExcDC1A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd1"), &assign_ExcDC1A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd2"), &assign_ExcDC1A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ta"), &assign_ExcDC1A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.tb"), &assign_ExcDC1A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.tc"), &assign_ExcDC1A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmax"), &assign_ExcDC1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmin"), &assign_ExcDC1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ke"), &assign_ExcDC1A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.te"), &assign_ExcDC1A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.kf"), &assign_ExcDC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.tf"), &assign_ExcDC1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd1"), &assign_ExcDC1A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd1"), &assign_ExcDC1A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd2"), &assign_ExcDC1A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd2"), &assign_ExcDC1A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.exclim"), &assign_ExcDC1A_exclim)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efdmin"), &assign_ExcDC1A_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.edfmax"), &assign_ExcDC1A_edfmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmax"), &assign_ExcDC1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmin"), &assign_ExcDC1A_vrmin)); } -void ExcDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC1A::debugName[] = "ExcDC1A"; -const char* ExcDC1A::debugString() +void ExcDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC1A::debugName; } const BaseClassDefiner ExcDC1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcDC1A::declare() return BaseClassDefiner(ExcDC1A::addConstructToMap, ExcDC1A::addPrimitiveAssignFnsToMap, ExcDC1A::addClassAssignFnsToMap, ExcDC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC1A_factory() + { + return new ExcDC1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcDC1A.hpp b/CGMES_2.4.15_16FEB2016/ExcDC1A.hpp index e6e48e170..d18025cc9 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC1A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC1A.hpp @@ -1,58 +1,59 @@ #ifndef ExcDC1A_H #define ExcDC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE DC1A direct current commutator exciter with speed input and without underexcitation limiters (UEL) inputs. */ - class ExcDC1A: public ExcitationSystemDynamics + class ExcDC1A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 46. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.06. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.46. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.1. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.3. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ - CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC1A(); - virtual ~ExcDC1A(); - + ~ExcDC1A() override; + + CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.1. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.3. Default: nullptr */ + CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 46. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.06. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.46. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcDC2A.cpp b/CGMES_2.4.15_16FEB2016/ExcDC2A.cpp index 900c9922f..0dc85256f 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC2A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC2A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC2A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Boolean.hpp" #include "Boolean.hpp" using namespace CIMPP; ExcDC2A::ExcDC2A() {}; - ExcDC2A::~ExcDC2A() {}; +bool assign_ExcDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_vtlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_vtlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcDC2A_factory() { - return new ExcDC2A; - } +const char ExcDC2A::debugName[] = "ExcDC2A"; +const char* ExcDC2A::debugString() const +{ + return ExcDC2A::debugName; } -void ExcDC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC2A"), &ExcDC2A_factory)); } -void ExcDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd1"), &assign_ExcDC2A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd2"), &assign_ExcDC2A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.exclim"), &assign_ExcDC2A_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ka"), &assign_ExcDC2A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ke"), &assign_ExcDC2A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.kf"), &assign_ExcDC2A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ks"), &assign_ExcDC2A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd1"), &assign_ExcDC2A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd2"), &assign_ExcDC2A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ta"), &assign_ExcDC2A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tb"), &assign_ExcDC2A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tc"), &assign_ExcDC2A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmax"), &assign_ExcDC2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmin"), &assign_ExcDC2A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ke"), &assign_ExcDC2A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.te"), &assign_ExcDC2A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.kf"), &assign_ExcDC2A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tf"), &assign_ExcDC2A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tf1"), &assign_ExcDC2A_tf1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd1"), &assign_ExcDC2A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd1"), &assign_ExcDC2A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd2"), &assign_ExcDC2A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd2"), &assign_ExcDC2A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.exclim"), &assign_ExcDC2A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmax"), &assign_ExcDC2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmin"), &assign_ExcDC2A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vtlim"), &assign_ExcDC2A_vtlim)); } -void ExcDC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC2A::debugName[] = "ExcDC2A"; -const char* ExcDC2A::debugString() +void ExcDC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC2A::debugName; } const BaseClassDefiner ExcDC2A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcDC2A::declare() return BaseClassDefiner(ExcDC2A::addConstructToMap, ExcDC2A::addPrimitiveAssignFnsToMap, ExcDC2A::addClassAssignFnsToMap, ExcDC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC2A_factory() + { + return new ExcDC2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcDC2A.hpp b/CGMES_2.4.15_16FEB2016/ExcDC2A.hpp index c9b7870fe..143921a50 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC2A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC2A.hpp @@ -1,58 +1,59 @@ #ifndef ExcDC2A_H #define ExcDC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE DC2A direct current commutator exciters with speed input, one more leg block in feedback loop and without underexcitation limiters (UEL) inputs. DC type 2 excitation system model with added speed multiplier, added lead-lag, and voltage-dependent limits. */ - class ExcDC2A: public ExcitationSystemDynamics + class ExcDC2A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.95. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). If Ke is entered as zero, the model calculates an effective value of Ke such that the initial condition value of Vr is zero. The zero value of Ke is not changed. If Ke is entered as non-zero, its value is used directly, without change. Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.33. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ - CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 0. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.05. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.279. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.29. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.117. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::Boolean vtlim; /* (Vtlim). true = limiter at the block [Ka/(1+sTa)] is dependent on Vt false = limiter at the block is not dependent on Vt. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC2A(); - virtual ~ExcDC2A(); - + ~ExcDC2A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.05. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.29. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). If Ke is entered as zero, the model calculates an effective value of Ke such that the initial condition value of Vr is zero. The zero value of Ke is not changed. If Ke is entered as non-zero, its value is used directly, without change. Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.279. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.117. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.33. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ + CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.95. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.9. Default: nullptr */ + CIMPP::Boolean vtlim; /* (Vtlim). true = limiter at the block [Ka/(1+sTa)] is dependent on Vt false = limiter at the block is not dependent on Vt. Typical Value = true. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcDC3A.cpp b/CGMES_2.4.15_16FEB2016/ExcDC3A.cpp index f70b0dd69..77fa53c3e 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC3A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC3A.cpp @@ -1,276 +1,292 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC3A.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcDC3A::ExcDC3A() {}; - ExcDC3A::~ExcDC3A() {}; +bool assign_ExcDC3A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->edfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->edfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcDC3A_factory() { - return new ExcDC3A; - } +const char ExcDC3A::debugName[] = "ExcDC3A"; +const char* ExcDC3A::debugString() const +{ + return ExcDC3A::debugName; } -void ExcDC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC3A"), &ExcDC3A_factory)); } -void ExcDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.trh"), &assign_ExcDC3A_trh)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ks"), &assign_ExcDC3A_ks)); +void ExcDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.edfmax"), &assign_ExcDC3A_edfmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd1"), &assign_ExcDC3A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd2"), &assign_ExcDC3A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdlim"), &assign_ExcDC3A_efdlim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdmin"), &assign_ExcDC3A_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.exclim"), &assign_ExcDC3A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ke"), &assign_ExcDC3A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.kr"), &assign_ExcDC3A_kr)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ks"), &assign_ExcDC3A_ks)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.kv"), &assign_ExcDC3A_kv)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmax"), &assign_ExcDC3A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmin"), &assign_ExcDC3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.te"), &assign_ExcDC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ke"), &assign_ExcDC3A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd1"), &assign_ExcDC3A_efd1)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.seefd1"), &assign_ExcDC3A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd2"), &assign_ExcDC3A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.seefd2"), &assign_ExcDC3A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.exclim"), &assign_ExcDC3A_exclim)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.edfmax"), &assign_ExcDC3A_edfmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdmin"), &assign_ExcDC3A_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdlim"), &assign_ExcDC3A_efdlim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.te"), &assign_ExcDC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.trh"), &assign_ExcDC3A_trh)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmax"), &assign_ExcDC3A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmin"), &assign_ExcDC3A_vrmin)); } -void ExcDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC3A::debugName[] = "ExcDC3A"; -const char* ExcDC3A::debugString() +void ExcDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC3A::debugName; } const BaseClassDefiner ExcDC3A::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcDC3A::declare() return BaseClassDefiner(ExcDC3A::addConstructToMap, ExcDC3A::addPrimitiveAssignFnsToMap, ExcDC3A::addClassAssignFnsToMap, ExcDC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC3A_factory() + { + return new ExcDC3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcDC3A.hpp b/CGMES_2.4.15_16FEB2016/ExcDC3A.hpp index a3aea0247..f28f29984 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC3A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC3A.hpp @@ -1,56 +1,57 @@ #ifndef ExcDC3A_H #define ExcDC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* This is modified IEEE DC3A direct current commutator exciters with speed input, and death band. DC old type 4. */ - class ExcDC3A: public ExcitationSystemDynamics + class ExcDC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds trh; /* Rheostat travel time (Trh). Typical Value = 20. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU kr; /* Death band (Kr). If Kr is not zero, the voltage regulator input changes at a constant rate if Verr > Kr or Verr < -Kr as per the IEEE (1968) Type 4 model. If Kr is zero, the error signal drives the voltage regulator continuously as per the IEEE (1980) DC3 and IEEE (1992, 2005) DC3A models. Typical Value = 0. Default: nullptr */ - CIMPP::PU kv; /* Fast raise/lower contact setting (Kv). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 2.6. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 3.45. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.35. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ - CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ - CIMPP::Boolean efdlim; /* (Efdlim). true = exciter output limiter is active false = exciter output limiter not active. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC3A(); - virtual ~ExcDC3A(); - + ~ExcDC3A() override; + + CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 2.6. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 3.45. Default: nullptr */ + CIMPP::Boolean efdlim; /* (Efdlim). true = exciter output limiter is active false = exciter output limiter not active. Typical Value = true. Default: false */ + CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kr; /* Death band (Kr). If Kr is not zero, the voltage regulator input changes at a constant rate if Verr > Kr or Verr < -Kr as per the IEEE (1968) Type 4 model. If Kr is zero, the error signal drives the voltage regulator continuously as per the IEEE (1980) DC3 and IEEE (1992, 2005) DC3A models. Typical Value = 0. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::PU kv; /* Fast raise/lower contact setting (Kv). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ + CIMPP::Seconds trh; /* Rheostat travel time (Trh). Typical Value = 20. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcDC3A1.cpp b/CGMES_2.4.15_16FEB2016/ExcDC3A1.cpp index dedb8aa31..1723a0039 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC3A1.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC3A1.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC3A1.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" +#include "PU.hpp" using namespace CIMPP; ExcDC3A1::ExcDC3A1() {}; - ExcDC3A1::~ExcDC3A1() {}; +bool assign_ExcDC3A1_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vb1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vb1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vblim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vblim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC3A1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_vb1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vb1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_vblim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vblim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcDC3A1_factory() { - return new ExcDC3A1; - } + + + + + + + + + + +const char ExcDC3A1::debugName[] = "ExcDC3A1"; +const char* ExcDC3A1::debugString() const +{ + return ExcDC3A1::debugName; } -void ExcDC3A1::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC3A1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC3A1"), &ExcDC3A1_factory)); } -void ExcDC3A1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcDC3A1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.exclim"), &assign_ExcDC3A1_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ka"), &assign_ExcDC3A1_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ke"), &assign_ExcDC3A1_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kf"), &assign_ExcDC3A1_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ki"), &assign_ExcDC3A1_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kp"), &assign_ExcDC3A1_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ta"), &assign_ExcDC3A1_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmax"), &assign_ExcDC3A1_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmin"), &assign_ExcDC3A1_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.te"), &assign_ExcDC3A1_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kf"), &assign_ExcDC3A1_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.tf"), &assign_ExcDC3A1_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kp"), &assign_ExcDC3A1_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ki"), &assign_ExcDC3A1_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vbmax"), &assign_ExcDC3A1_vbmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.exclim"), &assign_ExcDC3A1_exclim)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ke"), &assign_ExcDC3A1_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vb1max"), &assign_ExcDC3A1_vb1max)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vblim"), &assign_ExcDC3A1_vblim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vbmax"), &assign_ExcDC3A1_vbmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmax"), &assign_ExcDC3A1_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmin"), &assign_ExcDC3A1_vrmin)); } -void ExcDC3A1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC3A1::debugName[] = "ExcDC3A1"; -const char* ExcDC3A1::debugString() +void ExcDC3A1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC3A1::debugName; } const BaseClassDefiner ExcDC3A1::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcDC3A1::declare() return BaseClassDefiner(ExcDC3A1::addConstructToMap, ExcDC3A1::addPrimitiveAssignFnsToMap, ExcDC3A1::addClassAssignFnsToMap, ExcDC3A1::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC3A1_factory() + { + return new ExcDC3A1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcDC3A1.hpp b/CGMES_2.4.15_16FEB2016/ExcDC3A1.hpp index e369d70c1..1ff34b005 100644 --- a/CGMES_2.4.15_16FEB2016/ExcDC3A1.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcDC3A1.hpp @@ -1,53 +1,54 @@ #ifndef ExcDC3A1_H #define ExcDC3A1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* This is modified old IEEE type 3 excitation system. */ - class ExcDC3A1: public ExcitationSystemDynamics + class ExcDC3A1 : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.37. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ - CIMPP::PU vbmax; /* Available exciter voltage limiter (Vbmax). Typical Value = 11.63. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). true = lower limit of zero is applied to integrator output false = lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU vb1max; /* Available exciter voltage limiter (Vb1max). Typical Value = 11.63. Default: nullptr */ - CIMPP::Boolean vblim; /* Vb limiter indicator. true = exciter Vbmax limiter is active false = Vb1max is active. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC3A1(); - virtual ~ExcDC3A1(); - + ~ExcDC3A1() override; + + CIMPP::Boolean exclim; /* (exclim). true = lower limit of zero is applied to integrator output false = lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.37. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ + CIMPP::PU vb1max; /* Available exciter voltage limiter (Vb1max). Typical Value = 11.63. Default: nullptr */ + CIMPP::Boolean vblim; /* Vb limiter indicator. true = exciter Vbmax limiter is active false = Vb1max is active. Typical Value = true. Default: false */ + CIMPP::PU vbmax; /* Available exciter voltage limiter (Vbmax). Typical Value = 11.63. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC3A1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcELIN1.cpp b/CGMES_2.4.15_16FEB2016/ExcELIN1.cpp index 27c474b7a..5137c3751 100644 --- a/CGMES_2.4.15_16FEB2016/ExcELIN1.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcELIN1.cpp @@ -1,261 +1,276 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcELIN1.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" using namespace CIMPP; ExcELIN1::ExcELIN1() {}; - ExcELIN1::~ExcELIN1() {}; +bool assign_ExcELIN1_dpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpnf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_efmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_efmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_smax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->smax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_tfi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_tnu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tnu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_tsw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_vpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_vpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpnf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_vpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcELIN1_tfi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_tnu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tnu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_vpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_vpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_vpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpnf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_dpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpnf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_tsw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_efmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_efmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_smax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->smax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcELIN1_factory() { - return new ExcELIN1; - } +const char ExcELIN1::debugName[] = "ExcELIN1"; +const char* ExcELIN1::debugString() const +{ + return ExcELIN1::debugName; } -void ExcELIN1::addConstructToMap(std::unordered_map& factory_map) { +void ExcELIN1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcELIN1"), &ExcELIN1_factory)); } -void ExcELIN1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tfi"), &assign_ExcELIN1_tfi)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tnu"), &assign_ExcELIN1_tnu)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpu"), &assign_ExcELIN1_vpu)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpi"), &assign_ExcELIN1_vpi)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpnf"), &assign_ExcELIN1_vpnf)); +void ExcELIN1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.dpnf"), &assign_ExcELIN1_dpnf)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tsw"), &assign_ExcELIN1_tsw)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.efmin"), &assign_ExcELIN1_efmin)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.efmax"), &assign_ExcELIN1_efmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.xe"), &assign_ExcELIN1_xe)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.efmin"), &assign_ExcELIN1_efmin)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ks1"), &assign_ExcELIN1_ks1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ks2"), &assign_ExcELIN1_ks2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.smax"), &assign_ExcELIN1_smax)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tfi"), &assign_ExcELIN1_tfi)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tnu"), &assign_ExcELIN1_tnu)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ts1"), &assign_ExcELIN1_ts1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ts2"), &assign_ExcELIN1_ts2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.smax"), &assign_ExcELIN1_smax)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tsw"), &assign_ExcELIN1_tsw)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpi"), &assign_ExcELIN1_vpi)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpnf"), &assign_ExcELIN1_vpnf)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpu"), &assign_ExcELIN1_vpu)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.xe"), &assign_ExcELIN1_xe)); } -void ExcELIN1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcELIN1::debugName[] = "ExcELIN1"; -const char* ExcELIN1::debugString() +void ExcELIN1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcELIN1::debugName; } const BaseClassDefiner ExcELIN1::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner ExcELIN1::declare() return BaseClassDefiner(ExcELIN1::addConstructToMap, ExcELIN1::addPrimitiveAssignFnsToMap, ExcELIN1::addClassAssignFnsToMap, ExcELIN1::debugName); } - +namespace CIMPP +{ + BaseClass* ExcELIN1_factory() + { + return new ExcELIN1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcELIN1.hpp b/CGMES_2.4.15_16FEB2016/ExcELIN1.hpp index 71fdfbc8d..938588450 100644 --- a/CGMES_2.4.15_16FEB2016/ExcELIN1.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcELIN1.hpp @@ -1,53 +1,54 @@ #ifndef ExcELIN1_H #define ExcELIN1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Static PI transformer fed excitation system: ELIN (VATECH) - simplified model. This model represents an all-static excitation system. A PI voltage controller establishes a desired field current set point for a proportional current controller. The integrator of the PI controller has a follow-up input to match its signal to the present field current. A power system stabilizer with power input is included in the model. */ - class ExcELIN1: public ExcitationSystemDynamics + class ExcELIN1 : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tfi; /* Current transducer time constant (Tfi). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tnu; /* Controller reset time constant (Tnu). Typical Value = 2. Default: nullptr */ - CIMPP::PU vpu; /* Voltage controller proportional gain (Vpu). Typical Value = 34.5. Default: nullptr */ - CIMPP::PU vpi; /* Current controller gain (Vpi). Typical Value = 12.45. Default: nullptr */ - CIMPP::PU vpnf; /* Controller follow up gain (Vpnf). Typical Value = 2. Default: nullptr */ - CIMPP::PU dpnf; /* Controller follow up dead band (Dpnf). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsw; /* Stabilizer parameters (Tsw). Typical Value = 3. Default: nullptr */ - CIMPP::PU efmin; /* Minimum open circuit excitation voltage (Efmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU efmax; /* Maximum open circuit excitation voltage (Efmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU xe; /* Excitation transformer effective reactance (Xe) (>=0). Xe represents the regulation of the transformer/rectifier unit. Typical Value = 0.06. Default: nullptr */ - CIMPP::PU ks1; /* Stabilizer Gain 1 (Ks1). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks2; /* Stabilizer Gain 2 (Ks2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ts1; /* Stabilizer Phase Lag Time Constant (Ts1). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ts2; /* Stabilizer Filter Time Constant (Ts2). Typical Value = 1. Default: nullptr */ - CIMPP::PU smax; /* Stabilizer Limit Output (smax). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcELIN1(); - virtual ~ExcELIN1(); - + ~ExcELIN1() override; + + CIMPP::PU dpnf; /* Controller follow up dead band (Dpnf). Typical Value = 0. Default: nullptr */ + CIMPP::PU efmax; /* Maximum open circuit excitation voltage (Efmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU efmin; /* Minimum open circuit excitation voltage (Efmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU ks1; /* Stabilizer Gain 1 (Ks1). Typical Value = 0. Default: nullptr */ + CIMPP::PU ks2; /* Stabilizer Gain 2 (Ks2). Typical Value = 0. Default: nullptr */ + CIMPP::PU smax; /* Stabilizer Limit Output (smax). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tfi; /* Current transducer time constant (Tfi). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tnu; /* Controller reset time constant (Tnu). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds ts1; /* Stabilizer Phase Lag Time Constant (Ts1). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ts2; /* Stabilizer Filter Time Constant (Ts2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tsw; /* Stabilizer parameters (Tsw). Typical Value = 3. Default: nullptr */ + CIMPP::PU vpi; /* Current controller gain (Vpi). Typical Value = 12.45. Default: nullptr */ + CIMPP::PU vpnf; /* Controller follow up gain (Vpnf). Typical Value = 2. Default: nullptr */ + CIMPP::PU vpu; /* Voltage controller proportional gain (Vpu). Typical Value = 34.5. Default: nullptr */ + CIMPP::PU xe; /* Excitation transformer effective reactance (Xe) (>=0). Xe represents the regulation of the transformer/rectifier unit. Typical Value = 0.06. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcELIN1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcELIN2.cpp b/CGMES_2.4.15_16FEB2016/ExcELIN2.cpp index fe3f20f63..c75dd79b5 100644 --- a/CGMES_2.4.15_16FEB2016/ExcELIN2.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcELIN2.cpp @@ -1,11 +1,14 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcELIN2.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -13,19 +16,20 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -33,409 +37,432 @@ using namespace CIMPP; ExcELIN2::ExcELIN2() {}; - ExcELIN2::~ExcELIN2() {}; +bool assign_ExcELIN2_efdbas(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdbas; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_iefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iefmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_iefmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iefmax2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_iefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k1ec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1ec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_kd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ke2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ketb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ketb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_pid1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pid1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_te2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_tr4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_upmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->upmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_upmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->upmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcELIN2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_k1ec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1ec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_kd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_pid1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pid1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_iefmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iefmax2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ketb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ketb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_upmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->upmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_upmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->upmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_te2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ke2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_tr4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_iefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_iefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_efdbas(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdbas; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcELIN2_factory() { - return new ExcELIN2; - } + + + + + + + + + + + + + + + + + + + + + +const char ExcELIN2::debugName[] = "ExcELIN2"; +const char* ExcELIN2::debugString() const +{ + return ExcELIN2::debugName; } -void ExcELIN2::addConstructToMap(std::unordered_map& factory_map) { +void ExcELIN2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcELIN2"), &ExcELIN2_factory)); } -void ExcELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.efdbas"), &assign_ExcELIN2_efdbas)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax"), &assign_ExcELIN2_iefmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax2"), &assign_ExcELIN2_iefmax2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmin"), &assign_ExcELIN2_iefmin)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k1"), &assign_ExcELIN2_k1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k1ec"), &assign_ExcELIN2_k1ec)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k2"), &assign_ExcELIN2_k2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k3"), &assign_ExcELIN2_k3)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k4"), &assign_ExcELIN2_k4)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.kd1"), &assign_ExcELIN2_kd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tb1"), &assign_ExcELIN2_tb1)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ke2"), &assign_ExcELIN2_ke2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ketb"), &assign_ExcELIN2_ketb)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.pid1max"), &assign_ExcELIN2_pid1max)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve1"), &assign_ExcELIN2_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve2"), &assign_ExcELIN2_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tb1"), &assign_ExcELIN2_tb1)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te"), &assign_ExcELIN2_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te2"), &assign_ExcELIN2_te2)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti1"), &assign_ExcELIN2_ti1)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax2"), &assign_ExcELIN2_iefmax2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k2"), &assign_ExcELIN2_k2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ketb"), &assign_ExcELIN2_ketb)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti3"), &assign_ExcELIN2_ti3)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti4"), &assign_ExcELIN2_ti4)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tr4"), &assign_ExcELIN2_tr4)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.upmax"), &assign_ExcELIN2_upmax)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.upmin"), &assign_ExcELIN2_upmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te"), &assign_ExcELIN2_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.xp"), &assign_ExcELIN2_xp)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te2"), &assign_ExcELIN2_te2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ke2"), &assign_ExcELIN2_ke2)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ve1"), &assign_ExcELIN2_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve1"), &assign_ExcELIN2_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ve2"), &assign_ExcELIN2_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve2"), &assign_ExcELIN2_seve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tr4"), &assign_ExcELIN2_tr4)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k3"), &assign_ExcELIN2_k3)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti3"), &assign_ExcELIN2_ti3)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k4"), &assign_ExcELIN2_k4)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti4"), &assign_ExcELIN2_ti4)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax"), &assign_ExcELIN2_iefmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmin"), &assign_ExcELIN2_iefmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.efdbas"), &assign_ExcELIN2_efdbas)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.xp"), &assign_ExcELIN2_xp)); } -void ExcELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcELIN2::debugName[] = "ExcELIN2"; -const char* ExcELIN2::debugString() +void ExcELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcELIN2::debugName; } const BaseClassDefiner ExcELIN2::declare() @@ -443,4 +470,10 @@ const BaseClassDefiner ExcELIN2::declare() return BaseClassDefiner(ExcELIN2::addConstructToMap, ExcELIN2::addPrimitiveAssignFnsToMap, ExcELIN2::addClassAssignFnsToMap, ExcELIN2::debugName); } - +namespace CIMPP +{ + BaseClass* ExcELIN2_factory() + { + return new ExcELIN2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcELIN2.hpp b/CGMES_2.4.15_16FEB2016/ExcELIN2.hpp index 263089f20..d9f1bfd71 100644 --- a/CGMES_2.4.15_16FEB2016/ExcELIN2.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcELIN2.hpp @@ -1,65 +1,66 @@ #ifndef ExcELIN2_H #define ExcELIN2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Detailed Excitation System Model - ELIN (VATECH). This model represents an all-static excitation system. A PI voltage controller establishes a desired field current set point for a proportional current controller. The integrator of the PI controller has a follow-up input to match its signal to the present field current. Power system stabilizer models used in conjunction with this excitation system model: PssELIN2, PssIEEE2B, Pss2B. */ - class ExcELIN2: public ExcitationSystemDynamics + class ExcELIN2 : public ExcitationSystemDynamics { - public: - CIMPP::PU k1; /* Voltage regulator input gain (K1). Typical Value = 0. Default: nullptr */ - CIMPP::PU k1ec; /* Voltage regulator input limit (K1ec). Typical Value = 2. Default: nullptr */ - CIMPP::PU kd1; /* Voltage controller derivative gain (Kd1). Typical Value = 34.5. Default: nullptr */ - CIMPP::Seconds tb1; /* Voltage controller derivative washout time constant (Tb1). Typical Value = 12.45. Default: nullptr */ - CIMPP::PU pid1max; /* Controller follow up gain (PID1max). Typical Value = 2. Default: nullptr */ - CIMPP::PU ti1; /* Controller follow up dead band (Ti1). Typical Value = 0. Default: nullptr */ - CIMPP::PU iefmax2; /* Minimum open circuit excitation voltage (Iefmax2). Typical Value = -5. Default: nullptr */ - CIMPP::PU k2; /* Gain (K2). Typical Value = 5. Default: nullptr */ - CIMPP::PU ketb; /* Gain (Ketb). Typical Value = 0.06. Default: nullptr */ - CIMPP::PU upmax; /* Limiter (Upmax). Typical Value = 3. Default: nullptr */ - CIMPP::PU upmin; /* Limiter (Upmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Time constant (Te). Typical Value = 0. Default: nullptr */ - CIMPP::PU xp; /* Excitation transformer effective reactance (Xp). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te2; /* Time Constant (Te2). Typical Value = 1. Default: nullptr */ - CIMPP::PU ke2; /* Gain (Ke2). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 3. Default: nullptr */ - CIMPP::PU seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 0. Default: nullptr */ - CIMPP::PU seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tr4; /* Time constant (Tr4). Typical Value = 1. Default: nullptr */ - CIMPP::PU k3; /* Gain (K3). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ti3; /* Time constant (Ti3). Typical Value = 3. Default: nullptr */ - CIMPP::PU k4; /* Gain (K4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti4; /* Time constant (Ti4). Typical Value = 0. Default: nullptr */ - CIMPP::PU iefmax; /* Limiter (Iefmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU iefmin; /* Limiter (Iefmin). Typical Value = 1. Default: nullptr */ - CIMPP::PU efdbas; /* Gain (Efdbas). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcELIN2(); - virtual ~ExcELIN2(); - + ~ExcELIN2() override; + + CIMPP::PU efdbas; /* Gain (Efdbas). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU iefmax; /* Limiter (Iefmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU iefmax2; /* Minimum open circuit excitation voltage (Iefmax2). Typical Value = -5. Default: nullptr */ + CIMPP::PU iefmin; /* Limiter (Iefmin). Typical Value = 1. Default: nullptr */ + CIMPP::PU k1; /* Voltage regulator input gain (K1). Typical Value = 0. Default: nullptr */ + CIMPP::PU k1ec; /* Voltage regulator input limit (K1ec). Typical Value = 2. Default: nullptr */ + CIMPP::PU k2; /* Gain (K2). Typical Value = 5. Default: nullptr */ + CIMPP::PU k3; /* Gain (K3). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU k4; /* Gain (K4). Typical Value = 0. Default: nullptr */ + CIMPP::PU kd1; /* Voltage controller derivative gain (Kd1). Typical Value = 34.5. Default: nullptr */ + CIMPP::PU ke2; /* Gain (Ke2). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ketb; /* Gain (Ketb). Typical Value = 0.06. Default: nullptr */ + CIMPP::PU pid1max; /* Controller follow up gain (PID1max). Typical Value = 2. Default: nullptr */ + CIMPP::PU seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0. Default: nullptr */ + CIMPP::PU seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tb1; /* Voltage controller derivative washout time constant (Tb1). Typical Value = 12.45. Default: nullptr */ + CIMPP::Seconds te; /* Time constant (Te). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te2; /* Time Constant (Te2). Typical Value = 1. Default: nullptr */ + CIMPP::PU ti1; /* Controller follow up dead band (Ti1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti3; /* Time constant (Ti3). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ti4; /* Time constant (Ti4). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tr4; /* Time constant (Tr4). Typical Value = 1. Default: nullptr */ + CIMPP::PU upmax; /* Limiter (Upmax). Typical Value = 3. Default: nullptr */ + CIMPP::PU upmin; /* Limiter (Upmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 3. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 0. Default: nullptr */ + CIMPP::PU xp; /* Excitation transformer effective reactance (Xp). Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcELIN2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcHU.cpp b/CGMES_2.4.15_16FEB2016/ExcHU.cpp index c85043c06..0414a2cd4 100644 --- a/CGMES_2.4.15_16FEB2016/ExcHU.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcHU.cpp @@ -1,216 +1,228 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcHU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcHU::ExcHU() {}; - ExcHU::~ExcHU() {}; +bool assign_ExcHU_ae(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ae; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ai(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ai; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_atr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->atr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_imin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcHU_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcHU_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcHU_imin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcHU_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ae(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ae; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ai(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ai; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_atr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->atr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcHU_factory() { - return new ExcHU; - } + + + + + + + + + +const char ExcHU::debugName[] = "ExcHU"; +const char* ExcHU::debugString() const +{ + return ExcHU::debugName; } -void ExcHU::addConstructToMap(std::unordered_map& factory_map) { +void ExcHU::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcHU"), &ExcHU_factory)); } -void ExcHU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcHU.tr"), &assign_ExcHU_tr)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.te"), &assign_ExcHU_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.imin"), &assign_ExcHU_imin)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.imax"), &assign_ExcHU_imax)); +void ExcHU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcHU.ae"), &assign_ExcHU_ae)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.emin"), &assign_ExcHU_emin)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.emax"), &assign_ExcHU_emax)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.ki"), &assign_ExcHU_ki)); assign_map.insert(std::make_pair(std::string("cim:ExcHU.ai"), &assign_ExcHU_ai)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.ti"), &assign_ExcHU_ti)); assign_map.insert(std::make_pair(std::string("cim:ExcHU.atr"), &assign_ExcHU_atr)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.emax"), &assign_ExcHU_emax)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.emin"), &assign_ExcHU_emin)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.imax"), &assign_ExcHU_imax)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.imin"), &assign_ExcHU_imin)); assign_map.insert(std::make_pair(std::string("cim:ExcHU.ke"), &assign_ExcHU_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.ki"), &assign_ExcHU_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.te"), &assign_ExcHU_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.ti"), &assign_ExcHU_ti)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.tr"), &assign_ExcHU_tr)); } -void ExcHU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcHU::debugName[] = "ExcHU"; -const char* ExcHU::debugString() +void ExcHU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcHU::debugName; } const BaseClassDefiner ExcHU::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner ExcHU::declare() return BaseClassDefiner(ExcHU::addConstructToMap, ExcHU::addPrimitiveAssignFnsToMap, ExcHU::addClassAssignFnsToMap, ExcHU::debugName); } - +namespace CIMPP +{ + BaseClass* ExcHU_factory() + { + return new ExcHU; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcHU.hpp b/CGMES_2.4.15_16FEB2016/ExcHU.hpp index 748474e64..ae718ffa4 100644 --- a/CGMES_2.4.15_16FEB2016/ExcHU.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcHU.hpp @@ -1,51 +1,52 @@ #ifndef ExcHU_H #define ExcHU_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Hungarian Excitation System Model, with built-in voltage transducer. */ - class ExcHU: public ExcitationSystemDynamics + class ExcHU : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tr; /* Filter time constant (Tr). If a voltage compensator is used in conjunction with this excitation system model, Tr should be set to 0. Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds te; /* Major loop PI tag integration time constant (Te). Typical Value = 0.154. Default: nullptr */ - CIMPP::PU imin; /* Major loop PI tag output signal lower limit (Imin). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU imax; /* Major loop PI tag output signal upper limit (Imax). Typical Value = 2.19. Default: nullptr */ - CIMPP::PU ae; /* Major loop PI tag gain factor (Ae). Typical Value = 3. Default: nullptr */ - CIMPP::PU emin; /* Field voltage control signal lower limit on AVR base (Emin). Typical Value = -0.866. Default: nullptr */ - CIMPP::PU emax; /* Field voltage control signal upper limit on AVR base (Emax). Typical Value = 0.996. Default: nullptr */ - CIMPP::Simple_Float ki; /* Current base conversion constant (Ki). Typical Value = 0.21428. Default: nullptr */ - CIMPP::PU ai; /* Minor loop PI tag gain factor (Ai). Typical Value = 22. Default: nullptr */ - CIMPP::Seconds ti; /* Minor loop PI control tag integration time constant (Ti). Typical Value = 0.01333. Default: nullptr */ - CIMPP::PU atr; /* AVR constant (Atr). Typical Value = 2.19. Default: nullptr */ - CIMPP::Simple_Float ke; /* Voltage base conversion constant (Ke). Typical Value = 4.666. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcHU(); - virtual ~ExcHU(); - + ~ExcHU() override; + + CIMPP::PU ae; /* Major loop PI tag gain factor (Ae). Typical Value = 3. Default: nullptr */ + CIMPP::PU ai; /* Minor loop PI tag gain factor (Ai). Typical Value = 22. Default: nullptr */ + CIMPP::PU atr; /* AVR constant (Atr). Typical Value = 2.19. Default: nullptr */ + CIMPP::PU emax; /* Field voltage control signal upper limit on AVR base (Emax). Typical Value = 0.996. Default: nullptr */ + CIMPP::PU emin; /* Field voltage control signal lower limit on AVR base (Emin). Typical Value = -0.866. Default: nullptr */ + CIMPP::PU imax; /* Major loop PI tag output signal upper limit (Imax). Typical Value = 2.19. Default: nullptr */ + CIMPP::PU imin; /* Major loop PI tag output signal lower limit (Imin). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float ke; /* Voltage base conversion constant (Ke). Typical Value = 4.666. Default: nullptr */ + CIMPP::Simple_Float ki; /* Current base conversion constant (Ki). Typical Value = 0.21428. Default: nullptr */ + CIMPP::Seconds te; /* Major loop PI tag integration time constant (Te). Typical Value = 0.154. Default: nullptr */ + CIMPP::Seconds ti; /* Minor loop PI control tag integration time constant (Ti). Typical Value = 0.01333. Default: nullptr */ + CIMPP::Seconds tr; /* Filter time constant (Tr). If a voltage compensator is used in conjunction with this excitation system model, Tr should be set to 0. Typical Value = 0.01. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcHU_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.cpp index f6a581bb0..c1eb35e8d 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC1A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcIEEEAC1A::ExcIEEEAC1A() {}; - ExcIEEEAC1A::~ExcIEEEAC1A() {}; +bool assign_ExcIEEEAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC1A_factory() { - return new ExcIEEEAC1A; - } +const char ExcIEEEAC1A::debugName[] = "ExcIEEEAC1A"; +const char* ExcIEEEAC1A::debugString() const +{ + return ExcIEEEAC1A::debugName; } -void ExcIEEEAC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A"), &ExcIEEEAC1A_factory)); } -void ExcIEEEAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tb"), &assign_ExcIEEEAC1A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tc"), &assign_ExcIEEEAC1A_tc)); +void ExcIEEEAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ka"), &assign_ExcIEEEAC1A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ta"), &assign_ExcIEEEAC1A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamax"), &assign_ExcIEEEAC1A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamin"), &assign_ExcIEEEAC1A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.te"), &assign_ExcIEEEAC1A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kf"), &assign_ExcIEEEAC1A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tf"), &assign_ExcIEEEAC1A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kc"), &assign_ExcIEEEAC1A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kd"), &assign_ExcIEEEAC1A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ke"), &assign_ExcIEEEAC1A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve1"), &assign_ExcIEEEAC1A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kf"), &assign_ExcIEEEAC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.seve1"), &assign_ExcIEEEAC1A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve2"), &assign_ExcIEEEAC1A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.seve2"), &assign_ExcIEEEAC1A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ta"), &assign_ExcIEEEAC1A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tb"), &assign_ExcIEEEAC1A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tc"), &assign_ExcIEEEAC1A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.te"), &assign_ExcIEEEAC1A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tf"), &assign_ExcIEEEAC1A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamax"), &assign_ExcIEEEAC1A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamin"), &assign_ExcIEEEAC1A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve1"), &assign_ExcIEEEAC1A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve2"), &assign_ExcIEEEAC1A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vrmax"), &assign_ExcIEEEAC1A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vrmin"), &assign_ExcIEEEAC1A_vrmin)); } -void ExcIEEEAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC1A::debugName[] = "ExcIEEEAC1A"; -const char* ExcIEEEAC1A::debugString() +void ExcIEEEAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC1A::debugName; } const BaseClassDefiner ExcIEEEAC1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcIEEEAC1A::declare() return BaseClassDefiner(ExcIEEEAC1A::addConstructToMap, ExcIEEEAC1A::addPrimitiveAssignFnsToMap, ExcIEEEAC1A::addClassAssignFnsToMap, ExcIEEEAC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC1A_factory() + { + return new ExcIEEEAC1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.hpp index b2f9a991d..b00761df6 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC1A.hpp @@ -1,57 +1,58 @@ #ifndef ExcIEEEAC1A_H #define ExcIEEEAC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC1A model. The model represents the field-controlled alternator-rectifier excitation systems designated Type AC1A. These excitation systems consist of an alternator main exciter with non-controlled rectifiers. Reference: IEEE Standard 421.5-2005 Section 6.1. */ - class ExcIEEEAC1A: public ExcitationSystemDynamics + class ExcIEEEAC1A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.38. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 6.03. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -5.43. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC1A(); - virtual ~ExcIEEEAC1A(); - + ~ExcIEEEAC1A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.38. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.14. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 6.03. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -5.43. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.cpp index 787826963..e544a1fe1 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.cpp @@ -1,351 +1,372 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC2A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC2A::ExcIEEEAC2A() {}; - ExcIEEEAC2A::~ExcIEEEAC2A() {}; +bool assign_ExcIEEEAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC2A_factory() { - return new ExcIEEEAC2A; - } +const char ExcIEEEAC2A::debugName[] = "ExcIEEEAC2A"; +const char* ExcIEEEAC2A::debugString() const +{ + return ExcIEEEAC2A::debugName; } -void ExcIEEEAC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A"), &ExcIEEEAC2A_factory)); } -void ExcIEEEAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tb"), &assign_ExcIEEEAC2A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tc"), &assign_ExcIEEEAC2A_tc)); +void ExcIEEEAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ka"), &assign_ExcIEEEAC2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ta"), &assign_ExcIEEEAC2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamax"), &assign_ExcIEEEAC2A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamin"), &assign_ExcIEEEAC2A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kb"), &assign_ExcIEEEAC2A_kb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmax"), &assign_ExcIEEEAC2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmin"), &assign_ExcIEEEAC2A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.te"), &assign_ExcIEEEAC2A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vfemax"), &assign_ExcIEEEAC2A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kh"), &assign_ExcIEEEAC2A_kh)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kf"), &assign_ExcIEEEAC2A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tf"), &assign_ExcIEEEAC2A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kc"), &assign_ExcIEEEAC2A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kd"), &assign_ExcIEEEAC2A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ke"), &assign_ExcIEEEAC2A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve1"), &assign_ExcIEEEAC2A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kf"), &assign_ExcIEEEAC2A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kh"), &assign_ExcIEEEAC2A_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.seve1"), &assign_ExcIEEEAC2A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve2"), &assign_ExcIEEEAC2A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.seve2"), &assign_ExcIEEEAC2A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ta"), &assign_ExcIEEEAC2A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tb"), &assign_ExcIEEEAC2A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tc"), &assign_ExcIEEEAC2A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.te"), &assign_ExcIEEEAC2A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tf"), &assign_ExcIEEEAC2A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamax"), &assign_ExcIEEEAC2A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamin"), &assign_ExcIEEEAC2A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve1"), &assign_ExcIEEEAC2A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve2"), &assign_ExcIEEEAC2A_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vfemax"), &assign_ExcIEEEAC2A_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmax"), &assign_ExcIEEEAC2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmin"), &assign_ExcIEEEAC2A_vrmin)); } -void ExcIEEEAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC2A::debugName[] = "ExcIEEEAC2A"; -const char* ExcIEEEAC2A::debugString() +void ExcIEEEAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC2A::debugName; } const BaseClassDefiner ExcIEEEAC2A::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner ExcIEEEAC2A::declare() return BaseClassDefiner(ExcIEEEAC2A::addConstructToMap, ExcIEEEAC2A::addPrimitiveAssignFnsToMap, ExcIEEEAC2A::addClassAssignFnsToMap, ExcIEEEAC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC2A_factory() + { + return new ExcIEEEAC2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.hpp index f6d137939..d2217767f 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC2A.hpp @@ -1,60 +1,61 @@ #ifndef ExcIEEEAC2A_H #define ExcIEEEAC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC2A model. The model represents a high initial response field-controlled alternator-rectifier excitation system. The alternator main exciter is used with non-controlled rectifiers. The Type AC2A model is similar to that of Type AC1A except for the inclusion of exciter time constant compensation and exciter field current limiting elements. Reference: IEEE Standard 421.5-2005 Section 6.2. */ - class ExcIEEEAC2A: public ExcitationSystemDynamics + class ExcIEEEAC2A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ - CIMPP::PU kb; /* Second stage regulator gain (K). Typical Value = 25. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 105. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 4.4. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current feedback gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.28. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.35. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.037. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.3. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.012. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC2A(); - virtual ~ExcIEEEAC2A(); - + ~ExcIEEEAC2A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ + CIMPP::PU kb; /* Second stage regulator gain (K). Typical Value = 25. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.28. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.35. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current feedback gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.037. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.6. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.3. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 105. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -95. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.cpp index 6d4c2cc44..e70a624f8 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.cpp @@ -1,351 +1,372 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC3A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC3A::ExcIEEEAC3A() {}; - ExcIEEEAC3A::~ExcIEEEAC3A() {}; +bool assign_ExcIEEEAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC3A_factory() { - return new ExcIEEEAC3A; - } +const char ExcIEEEAC3A::debugName[] = "ExcIEEEAC3A"; +const char* ExcIEEEAC3A::debugString() const +{ + return ExcIEEEAC3A::debugName; } -void ExcIEEEAC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A"), &ExcIEEEAC3A_factory)); } -void ExcIEEEAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tb"), &assign_ExcIEEEAC3A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tc"), &assign_ExcIEEEAC3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ka"), &assign_ExcIEEEAC3A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ta"), &assign_ExcIEEEAC3A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamax"), &assign_ExcIEEEAC3A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamin"), &assign_ExcIEEEAC3A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.te"), &assign_ExcIEEEAC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vemin"), &assign_ExcIEEEAC3A_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kr"), &assign_ExcIEEEAC3A_kr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kf"), &assign_ExcIEEEAC3A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tf"), &assign_ExcIEEEAC3A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kn"), &assign_ExcIEEEAC3A_kn)); +void ExcIEEEAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.efdn"), &assign_ExcIEEEAC3A_efdn)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ka"), &assign_ExcIEEEAC3A_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kc"), &assign_ExcIEEEAC3A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kd"), &assign_ExcIEEEAC3A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ke"), &assign_ExcIEEEAC3A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vfemax"), &assign_ExcIEEEAC3A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve1"), &assign_ExcIEEEAC3A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kf"), &assign_ExcIEEEAC3A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kn"), &assign_ExcIEEEAC3A_kn)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kr"), &assign_ExcIEEEAC3A_kr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.seve1"), &assign_ExcIEEEAC3A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve2"), &assign_ExcIEEEAC3A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.seve2"), &assign_ExcIEEEAC3A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ta"), &assign_ExcIEEEAC3A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tb"), &assign_ExcIEEEAC3A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tc"), &assign_ExcIEEEAC3A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.te"), &assign_ExcIEEEAC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tf"), &assign_ExcIEEEAC3A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamax"), &assign_ExcIEEEAC3A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamin"), &assign_ExcIEEEAC3A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve1"), &assign_ExcIEEEAC3A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve2"), &assign_ExcIEEEAC3A_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vemin"), &assign_ExcIEEEAC3A_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vfemax"), &assign_ExcIEEEAC3A_vfemax)); } -void ExcIEEEAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC3A::debugName[] = "ExcIEEEAC3A"; -const char* ExcIEEEAC3A::debugString() +void ExcIEEEAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC3A::debugName; } const BaseClassDefiner ExcIEEEAC3A::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner ExcIEEEAC3A::declare() return BaseClassDefiner(ExcIEEEAC3A::addConstructToMap, ExcIEEEAC3A::addPrimitiveAssignFnsToMap, ExcIEEEAC3A::addClassAssignFnsToMap, ExcIEEEAC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC3A_factory() + { + return new ExcIEEEAC3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.hpp index 617e39760..0508e8329 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC3A.hpp @@ -1,60 +1,61 @@ #ifndef ExcIEEEAC3A_H #define ExcIEEEAC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC3A model. The model represents the field-controlled alternator-rectifier excitation systems designated Type AC3A. These excitation systems include an alternator main exciter with non-controlled rectifiers. The exciter employs self-excitation, and the voltage regulator power is derived from the exciter output voltage. Therefore, this system has an additional nonlinearity, simulated by the use of a multiplier whose inputs are the voltage regulator command signal, , and the exciter output voltage, , times . This model is applicable to excitation systems employing static voltage regulators. Reference: IEEE Standard 421.5-2005 Section 6.3. */ - class ExcIEEEAC3A: public ExcitationSystemDynamics + class ExcIEEEAC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 45.62. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.013. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.17. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (K). Typical Value = 3.77. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.143. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kn; /* Excitation control system stabilizer gain (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU efdn; /* Value of at which feedback gain changes (E). Typical Value = 2.36. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.104. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.499. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 16. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 6.24. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 1.143. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.68. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC3A(); - virtual ~ExcIEEEAC3A(); - + ~ExcIEEEAC3A() override; + + CIMPP::PU efdn; /* Value of at which feedback gain changes (E). Typical Value = 2.36. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 45.62. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.104. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.499. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.143. Default: nullptr */ + CIMPP::PU kn; /* Excitation control system stabilizer gain (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (K). Typical Value = 3.77. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 1.143. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.013. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.17. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 6.24. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.68. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 16. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.cpp index 79c73f1f1..54c509ac0 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.cpp @@ -1,171 +1,180 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC4A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEAC4A::ExcIEEEAC4A() {}; - ExcIEEEAC4A::~ExcIEEEAC4A() {}; +bool assign_ExcIEEEAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC4A_factory() { - return new ExcIEEEAC4A; - } +const char ExcIEEEAC4A::debugName[] = "ExcIEEEAC4A"; +const char* ExcIEEEAC4A::debugString() const +{ + return ExcIEEEAC4A::debugName; } -void ExcIEEEAC4A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC4A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A"), &ExcIEEEAC4A_factory)); } -void ExcIEEEAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimax"), &assign_ExcIEEEAC4A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimin"), &assign_ExcIEEEAC4A_vimin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tc"), &assign_ExcIEEEAC4A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tb"), &assign_ExcIEEEAC4A_tb)); +void ExcIEEEAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.ka"), &assign_ExcIEEEAC4A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.kc"), &assign_ExcIEEEAC4A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.ta"), &assign_ExcIEEEAC4A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tb"), &assign_ExcIEEEAC4A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tc"), &assign_ExcIEEEAC4A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimax"), &assign_ExcIEEEAC4A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimin"), &assign_ExcIEEEAC4A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vrmax"), &assign_ExcIEEEAC4A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vrmin"), &assign_ExcIEEEAC4A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.kc"), &assign_ExcIEEEAC4A_kc)); } -void ExcIEEEAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC4A::debugName[] = "ExcIEEEAC4A"; -const char* ExcIEEEAC4A::debugString() +void ExcIEEEAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC4A::debugName; } const BaseClassDefiner ExcIEEEAC4A::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner ExcIEEEAC4A::declare() return BaseClassDefiner(ExcIEEEAC4A::addConstructToMap, ExcIEEEAC4A::addPrimitiveAssignFnsToMap, ExcIEEEAC4A::addClassAssignFnsToMap, ExcIEEEAC4A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC4A_factory() + { + return new ExcIEEEAC4A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.hpp index 9cbfe93b6..884938057 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC4A.hpp @@ -1,47 +1,48 @@ #ifndef ExcIEEEAC4A_H #define ExcIEEEAC4A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC4A model. The model represents type AC4A alternator-supplied controlled-rectifier excitation system which is quite different from the other type ac systems. This high initial response excitation system utilizes a full thyristor bridge in the exciter output circuit. The voltage regulator controls the firing of the thyristor bridges. The exciter alternator uses an independent voltage regulator to control its output voltage to a constant value. These effects are not modeled; however, transient loading effects on the exciter alternator are included. Reference: IEEE Standard 421.5-2005 Section 6.4. */ - class ExcIEEEAC4A: public ExcitationSystemDynamics + class ExcIEEEAC4A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 10. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -10. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.015. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.64. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.53. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC4A(); - virtual ~ExcIEEEAC4A(); - + ~ExcIEEEAC4A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 200. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.015. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 10. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -10. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.64. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.53. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC4A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.cpp index 107bf8bf8..691cba77a 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC5A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC5A::ExcIEEEAC5A() {}; - ExcIEEEAC5A::~ExcIEEEAC5A() {}; +bool assign_ExcIEEEAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEAC5A_factory() { - return new ExcIEEEAC5A; - } + + + + + + + + + + +const char ExcIEEEAC5A::debugName[] = "ExcIEEEAC5A"; +const char* ExcIEEEAC5A::debugString() const +{ + return ExcIEEEAC5A::debugName; } -void ExcIEEEAC5A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC5A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A"), &ExcIEEEAC5A_factory)); } -void ExcIEEEAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd1"), &assign_ExcIEEEAC5A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd2"), &assign_ExcIEEEAC5A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ka"), &assign_ExcIEEEAC5A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ta"), &assign_ExcIEEEAC5A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmax"), &assign_ExcIEEEAC5A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmin"), &assign_ExcIEEEAC5A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ke"), &assign_ExcIEEEAC5A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.te"), &assign_ExcIEEEAC5A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.kf"), &assign_ExcIEEEAC5A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd1"), &assign_ExcIEEEAC5A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd2"), &assign_ExcIEEEAC5A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ta"), &assign_ExcIEEEAC5A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.te"), &assign_ExcIEEEAC5A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.tf1"), &assign_ExcIEEEAC5A_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.tf2"), &assign_ExcIEEEAC5A_tf2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.tf3"), &assign_ExcIEEEAC5A_tf3)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd1"), &assign_ExcIEEEAC5A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd1"), &assign_ExcIEEEAC5A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd2"), &assign_ExcIEEEAC5A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd2"), &assign_ExcIEEEAC5A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmax"), &assign_ExcIEEEAC5A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmin"), &assign_ExcIEEEAC5A_vrmin)); } -void ExcIEEEAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC5A::debugName[] = "ExcIEEEAC5A"; -const char* ExcIEEEAC5A::debugString() +void ExcIEEEAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC5A::debugName; } const BaseClassDefiner ExcIEEEAC5A::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcIEEEAC5A::declare() return BaseClassDefiner(ExcIEEEAC5A::addConstructToMap, ExcIEEEAC5A::addPrimitiveAssignFnsToMap, ExcIEEEAC5A::addClassAssignFnsToMap, ExcIEEEAC5A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC5A_factory() + { + return new ExcIEEEAC5A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.hpp index c3e1bc531..dfe6bad93 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC5A.hpp @@ -1,53 +1,54 @@ #ifndef ExcIEEEAC5A_H #define ExcIEEEAC5A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC5A model. The model represents a simplified model for brushless excitation systems. The regulator is supplied from a source, such as a permanent magnet generator, which is not affected by system disturbances. Unlike other ac models, this model uses loaded rather than open circuit exciter saturation data in the same way as it is used for the dc models. Because the model has been widely implemented by the industry, it is sometimes used to represent other types of systems when either detailed data for them are not available or simplified models are required. Reference: IEEE Standard 421.5-2005 Section 6.5. */ - class ExcIEEEAC5A: public ExcitationSystemDynamics + class ExcIEEEAC5A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 7.3. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -7.3. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 5.6. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.86. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 4.2. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC5A(); - virtual ~ExcIEEEAC5A(); - + ~ExcIEEEAC5A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 5.6. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 4.2. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.86. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 7.3. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -7.3. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC5A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.cpp index 59e7e7af0..241e30969 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.cpp @@ -1,18 +1,23 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC6A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -21,346 +26,363 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEAC6A::ExcIEEEAC6A() {}; - ExcIEEEAC6A::~ExcIEEEAC6A() {}; +bool assign_ExcIEEEAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tj; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfelim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tj; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfelim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC6A_factory() { - return new ExcIEEEAC6A; - } +const char ExcIEEEAC6A::debugName[] = "ExcIEEEAC6A"; +const char* ExcIEEEAC6A::debugString() const +{ + return ExcIEEEAC6A::debugName; } -void ExcIEEEAC6A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC6A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A"), &ExcIEEEAC6A_factory)); } -void ExcIEEEAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ka"), &assign_ExcIEEEAC6A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kc"), &assign_ExcIEEEAC6A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kd"), &assign_ExcIEEEAC6A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ke"), &assign_ExcIEEEAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kh"), &assign_ExcIEEEAC6A_kh)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve1"), &assign_ExcIEEEAC6A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve2"), &assign_ExcIEEEAC6A_seve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ta"), &assign_ExcIEEEAC6A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tk"), &assign_ExcIEEEAC6A_tk)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tb"), &assign_ExcIEEEAC6A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tc"), &assign_ExcIEEEAC6A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamax"), &assign_ExcIEEEAC6A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamin"), &assign_ExcIEEEAC6A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmax"), &assign_ExcIEEEAC6A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmin"), &assign_ExcIEEEAC6A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.te"), &assign_ExcIEEEAC6A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kh"), &assign_ExcIEEEAC6A_kh)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tj"), &assign_ExcIEEEAC6A_tj)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.th"), &assign_ExcIEEEAC6A_th)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vfelim"), &assign_ExcIEEEAC6A_vfelim)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vhmax"), &assign_ExcIEEEAC6A_vhmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kc"), &assign_ExcIEEEAC6A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kd"), &assign_ExcIEEEAC6A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ke"), &assign_ExcIEEEAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tj"), &assign_ExcIEEEAC6A_tj)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tk"), &assign_ExcIEEEAC6A_tk)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamax"), &assign_ExcIEEEAC6A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamin"), &assign_ExcIEEEAC6A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ve1"), &assign_ExcIEEEAC6A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve1"), &assign_ExcIEEEAC6A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ve2"), &assign_ExcIEEEAC6A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve2"), &assign_ExcIEEEAC6A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vfelim"), &assign_ExcIEEEAC6A_vfelim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vhmax"), &assign_ExcIEEEAC6A_vhmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmax"), &assign_ExcIEEEAC6A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmin"), &assign_ExcIEEEAC6A_vrmin)); } -void ExcIEEEAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC6A::debugName[] = "ExcIEEEAC6A"; -const char* ExcIEEEAC6A::debugString() +void ExcIEEEAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC6A::debugName; } const BaseClassDefiner ExcIEEEAC6A::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner ExcIEEEAC6A::declare() return BaseClassDefiner(ExcIEEEAC6A::addConstructToMap, ExcIEEEAC6A::addPrimitiveAssignFnsToMap, ExcIEEEAC6A::addClassAssignFnsToMap, ExcIEEEAC6A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC6A_factory() + { + return new ExcIEEEAC6A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.hpp index 8b6c46dcc..d41b29933 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC6A.hpp @@ -1,61 +1,62 @@ #ifndef ExcIEEEAC6A_H #define ExcIEEEAC6A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC6A model. The model represents field-controlled alternator-rectifier excitation systems with system-supplied electronic voltage regulators. The maximum output of the regulator, , is a function of terminal voltage, . The field current limiter included in the original model AC6A remains in the 2005 update. Reference: IEEE Standard 421.5-2005 Section 6.6. */ - class ExcIEEEAC6A: public ExcitationSystemDynamics + class ExcIEEEAC6A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 536. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.086. Default: nullptr */ - CIMPP::Seconds tk; /* Voltage regulator time constant (T). Typical Value = 0.18. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 3. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 75. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -75. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 44. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -36. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current limiter gain (K). Typical Value = 92. Default: nullptr */ - CIMPP::Seconds tj; /* Exciter field current limiter time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds th; /* Exciter field current limiter time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU vfelim; /* Exciter field current limit reference (V). Typical Value = 19. Default: nullptr */ - CIMPP::PU vhmax; /* Maximum field current limiter signal reference (V). Typical Value = 75. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.173. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.91. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1.6. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 7.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.214. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 5.55. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.044. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC6A(); - virtual ~ExcIEEEAC6A(); - + ~ExcIEEEAC6A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 536. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.173. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.91. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1.6. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current limiter gain (K). Typical Value = 92. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.214. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.044. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.086. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 9. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds th; /* Exciter field current limiter time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tj; /* Exciter field current limiter time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tk; /* Voltage regulator time constant (T). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 75. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -75. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 7.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 5.55. Default: nullptr */ + CIMPP::PU vfelim; /* Exciter field current limit reference (V). Typical Value = 19. Default: nullptr */ + CIMPP::PU vhmax; /* Maximum field current limiter signal reference (V). Typical Value = 75. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 44. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -36. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC6A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.cpp index 51bda42ba..f4c5ba1bb 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.cpp @@ -1,11 +1,14 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC7B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -14,413 +17,436 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC7B::ExcIEEEAC7B() {}; - ExcIEEEAC7B::~ExcIEEEAC7B() {}; +bool assign_ExcIEEEAC7B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC7B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEAC7B_factory() { - return new ExcIEEEAC7B; - } + + + + + + + + + + + + + + + + + + + + +const char ExcIEEEAC7B::debugName[] = "ExcIEEEAC7B"; +const char* ExcIEEEAC7B::debugString() const +{ + return ExcIEEEAC7B::debugName; } -void ExcIEEEAC7B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC7B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B"), &ExcIEEEAC7B_factory)); } -void ExcIEEEAC7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpr"), &assign_ExcIEEEAC7B_kpr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kir"), &assign_ExcIEEEAC7B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kdr"), &assign_ExcIEEEAC7B_kdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.tdr"), &assign_ExcIEEEAC7B_tdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmax"), &assign_ExcIEEEAC7B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmin"), &assign_ExcIEEEAC7B_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpa"), &assign_ExcIEEEAC7B_kpa)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kia"), &assign_ExcIEEEAC7B_kia)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamax"), &assign_ExcIEEEAC7B_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamin"), &assign_ExcIEEEAC7B_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kp"), &assign_ExcIEEEAC7B_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kl"), &assign_ExcIEEEAC7B_kl)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.te"), &assign_ExcIEEEAC7B_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vfemax"), &assign_ExcIEEEAC7B_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vemin"), &assign_ExcIEEEAC7B_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ke"), &assign_ExcIEEEAC7B_ke)); +void ExcIEEEAC7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kc"), &assign_ExcIEEEAC7B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kd"), &assign_ExcIEEEAC7B_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kdr"), &assign_ExcIEEEAC7B_kdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ke"), &assign_ExcIEEEAC7B_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kf1"), &assign_ExcIEEEAC7B_kf1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kf2"), &assign_ExcIEEEAC7B_kf2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kf3"), &assign_ExcIEEEAC7B_kf3)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kia"), &assign_ExcIEEEAC7B_kia)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kir"), &assign_ExcIEEEAC7B_kir)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kl"), &assign_ExcIEEEAC7B_kl)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kp"), &assign_ExcIEEEAC7B_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpa"), &assign_ExcIEEEAC7B_kpa)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpr"), &assign_ExcIEEEAC7B_kpr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve1"), &assign_ExcIEEEAC7B_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve2"), &assign_ExcIEEEAC7B_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.tdr"), &assign_ExcIEEEAC7B_tdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.te"), &assign_ExcIEEEAC7B_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.tf"), &assign_ExcIEEEAC7B_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamax"), &assign_ExcIEEEAC7B_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamin"), &assign_ExcIEEEAC7B_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ve1"), &assign_ExcIEEEAC7B_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve1"), &assign_ExcIEEEAC7B_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ve2"), &assign_ExcIEEEAC7B_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve2"), &assign_ExcIEEEAC7B_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vemin"), &assign_ExcIEEEAC7B_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vfemax"), &assign_ExcIEEEAC7B_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmax"), &assign_ExcIEEEAC7B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmin"), &assign_ExcIEEEAC7B_vrmin)); } -void ExcIEEEAC7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC7B::debugName[] = "ExcIEEEAC7B"; -const char* ExcIEEEAC7B::debugString() +void ExcIEEEAC7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC7B::debugName; } const BaseClassDefiner ExcIEEEAC7B::declare() @@ -428,4 +454,10 @@ const BaseClassDefiner ExcIEEEAC7B::declare() return BaseClassDefiner(ExcIEEEAC7B::addConstructToMap, ExcIEEEAC7B::addPrimitiveAssignFnsToMap, ExcIEEEAC7B::addClassAssignFnsToMap, ExcIEEEAC7B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC7B_factory() + { + return new ExcIEEEAC7B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.hpp index a91fbc510..3eda15144 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC7B.hpp @@ -1,65 +1,66 @@ #ifndef ExcIEEEAC7B_H #define ExcIEEEAC7B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC7B model. The model represents excitation systems which consist of an ac alternator with either stationary or rotating rectifiers to produce the dc field requirements. It is an upgrade to earlier ac excitation systems, which replace only the controls but retain the ac alternator and diode rectifier bridge. Reference: IEEE Standard 421.5-2005 Section 6.7. In the IEEE Standard 421.5 - 2005, the [1 / sT] block is shown as [1 / (1 + sT)], which is incorrect. */ - class ExcIEEEAC7B: public ExcitationSystemDynamics + class ExcIEEEAC7B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 4.24. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 4.24. Default: nullptr */ - CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.79. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -5.79. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 65.36. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 59.69. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.96. Default: nullptr */ - CIMPP::PU kl; /* Exciter field voltage lower limit parameter (K). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6.9. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.18. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU kf1; /* Excitation control system stabilizer gain (K). Typical Value = 0.212. Default: nullptr */ - CIMPP::PU kf2; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kf3; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.3. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.44. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.02. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.075. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC7B(); - virtual ~ExcIEEEAC7B(); - + ~ExcIEEEAC7B() override; + + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf1; /* Excitation control system stabilizer gain (K). Typical Value = 0.212. Default: nullptr */ + CIMPP::PU kf2; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf3; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 59.69. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 4.24. Default: nullptr */ + CIMPP::PU kl; /* Exciter field voltage lower limit parameter (K). Typical Value = 10. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.96. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 65.36. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 4.24. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.44. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.075. Default: nullptr */ + CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.1. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.3. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.02. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6.9. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.79. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -5.79. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC7B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.cpp index 46e1f1861..ec5301141 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.cpp @@ -1,14 +1,21 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC8B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -17,290 +24,301 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC8B::ExcIEEEAC8B() {}; - ExcIEEEAC8B::~ExcIEEEAC8B() {}; +bool assign_ExcIEEEAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC8B_factory() { - return new ExcIEEEAC8B; - } +const char ExcIEEEAC8B::debugName[] = "ExcIEEEAC8B"; +const char* ExcIEEEAC8B::debugString() const +{ + return ExcIEEEAC8B::debugName; } -void ExcIEEEAC8B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC8B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B"), &ExcIEEEAC8B_factory)); } -void ExcIEEEAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kpr"), &assign_ExcIEEEAC8B_kpr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kir"), &assign_ExcIEEEAC8B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kdr"), &assign_ExcIEEEAC8B_kdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.tdr"), &assign_ExcIEEEAC8B_tdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmax"), &assign_ExcIEEEAC8B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmin"), &assign_ExcIEEEAC8B_vrmin)); +void ExcIEEEAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ka"), &assign_ExcIEEEAC8B_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ta"), &assign_ExcIEEEAC8B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.te"), &assign_ExcIEEEAC8B_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vfemax"), &assign_ExcIEEEAC8B_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vemin"), &assign_ExcIEEEAC8B_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ke"), &assign_ExcIEEEAC8B_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kc"), &assign_ExcIEEEAC8B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kd"), &assign_ExcIEEEAC8B_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve1"), &assign_ExcIEEEAC8B_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kdr"), &assign_ExcIEEEAC8B_kdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ke"), &assign_ExcIEEEAC8B_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kir"), &assign_ExcIEEEAC8B_kir)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kpr"), &assign_ExcIEEEAC8B_kpr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.seve1"), &assign_ExcIEEEAC8B_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve2"), &assign_ExcIEEEAC8B_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.seve2"), &assign_ExcIEEEAC8B_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ta"), &assign_ExcIEEEAC8B_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.tdr"), &assign_ExcIEEEAC8B_tdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.te"), &assign_ExcIEEEAC8B_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve1"), &assign_ExcIEEEAC8B_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve2"), &assign_ExcIEEEAC8B_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vemin"), &assign_ExcIEEEAC8B_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vfemax"), &assign_ExcIEEEAC8B_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmax"), &assign_ExcIEEEAC8B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmin"), &assign_ExcIEEEAC8B_vrmin)); } -void ExcIEEEAC8B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC8B::debugName[] = "ExcIEEEAC8B"; -const char* ExcIEEEAC8B::debugString() +void ExcIEEEAC8B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC8B::debugName; } const BaseClassDefiner ExcIEEEAC8B::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcIEEEAC8B::declare() return BaseClassDefiner(ExcIEEEAC8B::addConstructToMap, ExcIEEEAC8B::addPrimitiveAssignFnsToMap, ExcIEEEAC8B::addClassAssignFnsToMap, ExcIEEEAC8B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC8B_factory() + { + return new ExcIEEEAC8B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.hpp index 52fdd9dda..e3597ea8e 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEAC8B.hpp @@ -1,57 +1,58 @@ #ifndef ExcIEEEAC8B_H #define ExcIEEEAC8B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC8B model. This model represents a PID voltage regulator with either a brushless exciter or dc exciter. The AVR in this model consists of PID control, with separate constants for the proportional (), integral (), and derivative () gains. The representation of the brushless exciter (, , , , ) is similar to the model Type AC2A. The Type AC8B model can be used to represent static voltage regulators applied to brushless excitation systems. Digitally based voltage regulators feeding dc rotating main exciters can be represented with the AC Type AC8B model with the parameters and set to 0. For thyristor power stages fed from the generator terminals, the limits and should be a function of terminal voltage: * and * . Reference: IEEE Standard 421.5-2005 Section 6.8. */ - class ExcIEEEAC8B: public ExcitationSystemDynamics + class ExcIEEEAC8B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 80. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 5. Default: nullptr */ - CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 35. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.55. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.5. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 9. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 3. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC8B(); - virtual ~ExcIEEEAC8B(); - + ~ExcIEEEAC8B() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.55. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 10. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 5. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 80. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.5. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 9. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 35. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC8B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.cpp index 1e4c6a4e9..a48495089 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.cpp @@ -1,276 +1,292 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC1A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Boolean.hpp" -#include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEDC1A::ExcIEEEDC1A() {}; - ExcIEEEDC1A::~ExcIEEEDC1A() {}; +bool assign_ExcIEEEDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEDC1A_factory() { - return new ExcIEEEDC1A; - } +const char ExcIEEEDC1A::debugName[] = "ExcIEEEDC1A"; +const char* ExcIEEEDC1A::debugString() const +{ + return ExcIEEEDC1A::debugName; } -void ExcIEEEDC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A"), &ExcIEEEDC1A_factory)); } -void ExcIEEEDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd1"), &assign_ExcIEEEDC1A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd2"), &assign_ExcIEEEDC1A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.exclim"), &assign_ExcIEEEDC1A_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ka"), &assign_ExcIEEEDC1A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ke"), &assign_ExcIEEEDC1A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.kf"), &assign_ExcIEEEDC1A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd1"), &assign_ExcIEEEDC1A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd2"), &assign_ExcIEEEDC1A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ta"), &assign_ExcIEEEDC1A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.tb"), &assign_ExcIEEEDC1A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.tc"), &assign_ExcIEEEDC1A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmax"), &assign_ExcIEEEDC1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmin"), &assign_ExcIEEEDC1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ke"), &assign_ExcIEEEDC1A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.te"), &assign_ExcIEEEDC1A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.kf"), &assign_ExcIEEEDC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.tf"), &assign_ExcIEEEDC1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd1"), &assign_ExcIEEEDC1A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd1"), &assign_ExcIEEEDC1A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd2"), &assign_ExcIEEEDC1A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd2"), &assign_ExcIEEEDC1A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.uelin"), &assign_ExcIEEEDC1A_uelin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.exclim"), &assign_ExcIEEEDC1A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmax"), &assign_ExcIEEEDC1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmin"), &assign_ExcIEEEDC1A_vrmin)); } -void ExcIEEEDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC1A::debugName[] = "ExcIEEEDC1A"; -const char* ExcIEEEDC1A::debugString() +void ExcIEEEDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC1A::debugName; } const BaseClassDefiner ExcIEEEDC1A::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcIEEEDC1A::declare() return BaseClassDefiner(ExcIEEEDC1A::addConstructToMap, ExcIEEEDC1A::addPrimitiveAssignFnsToMap, ExcIEEEDC1A::addClassAssignFnsToMap, ExcIEEEDC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC1A_factory() + { + return new ExcIEEEDC1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.hpp index 02b382b84..bc0f8df03 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC1A.hpp @@ -1,56 +1,57 @@ #ifndef ExcIEEEDC1A_H #define ExcIEEEDC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC1A model. This model represents field-controlled dc commutator exciters with continuously acting voltage regulators (especially the direct-acting rheostatic, rotating amplifier, and magnetic amplifier types). Because this model has been widely implemented by the industry, it is sometimes used to represent other types of systems when detailed data for them are not available or when a simplified model is required. Reference: IEEE Standard 421.5-2005 Section 5.1. */ - class ExcIEEEDC1A: public ExcitationSystemDynamics + class ExcIEEEDC1A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 46. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.06. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.46. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.1. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.33. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.3. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.1. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC1A(); - virtual ~ExcIEEEDC1A(); - + ~ExcIEEEDC1A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.1. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.3. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 46. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.33. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.06. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.46. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.cpp index 022c95124..49e329c32 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC2A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -22,230 +26,247 @@ using namespace CIMPP; ExcIEEEDC2A::ExcIEEEDC2A() {}; - ExcIEEEDC2A::~ExcIEEEDC2A() {}; +bool assign_ExcIEEEDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEDC2A_factory() { - return new ExcIEEEDC2A; - } +const char ExcIEEEDC2A::debugName[] = "ExcIEEEDC2A"; +const char* ExcIEEEDC2A::debugString() const +{ + return ExcIEEEDC2A::debugName; } -void ExcIEEEDC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A"), &ExcIEEEDC2A_factory)); } -void ExcIEEEDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A.efd1"), &assign_ExcIEEEDC2A_efd1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A.efd2"), &assign_ExcIEEEDC2A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A.exclim"), &assign_ExcIEEEDC2A_exclim)); @@ -264,13 +285,8 @@ void ExcIEEEDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC2A::debugName[] = "ExcIEEEDC2A"; -const char* ExcIEEEDC2A::debugString() +void ExcIEEEDC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC2A::debugName; } const BaseClassDefiner ExcIEEEDC2A::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcIEEEDC2A::declare() return BaseClassDefiner(ExcIEEEDC2A::addConstructToMap, ExcIEEEDC2A::addPrimitiveAssignFnsToMap, ExcIEEEDC2A::addClassAssignFnsToMap, ExcIEEEDC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC2A_factory() + { + return new ExcIEEEDC2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.hpp index 554a6ba47..2656d284d 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC2A.hpp @@ -1,56 +1,57 @@ #ifndef ExcIEEEDC2A_H #define ExcIEEEDC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "Simple_Float.hpp" +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC2A model. This model represents represent field-controlled dc commutator exciters with continuously acting voltage regulators having supplies obtained from the generator or auxiliary bus. It differs from the Type DC1A model only in the voltage regulator output limits, which are now proportional to terminal voltage . It is representative of solid-state replacements for various forms of older mechanical and rotating amplifier regulating equipment connected to dc commutator exciters. Reference: IEEE Standard 421.5-2005 Section 5.2. */ - class ExcIEEEDC2A: public ExcitationSystemDynamics + class ExcIEEEDC2A : public ExcitationSystemDynamics { - public: - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.05. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.29. Default: nullptr */ - CIMPP::PU exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. Typical Value = - 999 which means that there is no limit applied. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 300. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.279. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.117. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.33. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 0.675. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.95. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.9. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC2A(); - virtual ~ExcIEEEDC2A(); - + ~ExcIEEEDC2A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.05. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.29. Default: nullptr */ + CIMPP::PU exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. Typical Value = - 999 which means that there is no limit applied. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 300. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.279. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.117. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.33. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 0.675. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.95. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.cpp index 3069c7e30..116d404a9 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.cpp @@ -1,201 +1,212 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC3A.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEDC3A::ExcIEEEDC3A() {}; - ExcIEEEDC3A::~ExcIEEEDC3A() {}; +bool assign_ExcIEEEDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEDC3A_factory() { - return new ExcIEEEDC3A; - } + + + + + + + + + +const char ExcIEEEDC3A::debugName[] = "ExcIEEEDC3A"; +const char* ExcIEEEDC3A::debugString() const +{ + return ExcIEEEDC3A::debugName; } -void ExcIEEEDC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A"), &ExcIEEEDC3A_factory)); } -void ExcIEEEDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.trh"), &assign_ExcIEEEDC3A_trh)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.kv"), &assign_ExcIEEEDC3A_kv)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmax"), &assign_ExcIEEEDC3A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmin"), &assign_ExcIEEEDC3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.te"), &assign_ExcIEEEDC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.ke"), &assign_ExcIEEEDC3A_ke)); +void ExcIEEEDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.efd1"), &assign_ExcIEEEDC3A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd1"), &assign_ExcIEEEDC3A_seefd1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.efd2"), &assign_ExcIEEEDC3A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd2"), &assign_ExcIEEEDC3A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.exclim"), &assign_ExcIEEEDC3A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.ke"), &assign_ExcIEEEDC3A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.kv"), &assign_ExcIEEEDC3A_kv)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd1"), &assign_ExcIEEEDC3A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd2"), &assign_ExcIEEEDC3A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.te"), &assign_ExcIEEEDC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.trh"), &assign_ExcIEEEDC3A_trh)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmax"), &assign_ExcIEEEDC3A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmin"), &assign_ExcIEEEDC3A_vrmin)); } -void ExcIEEEDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC3A::debugName[] = "ExcIEEEDC3A"; -const char* ExcIEEEDC3A::debugString() +void ExcIEEEDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC3A::debugName; } const BaseClassDefiner ExcIEEEDC3A::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner ExcIEEEDC3A::declare() return BaseClassDefiner(ExcIEEEDC3A::addConstructToMap, ExcIEEEDC3A::addPrimitiveAssignFnsToMap, ExcIEEEDC3A::addClassAssignFnsToMap, ExcIEEEDC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC3A_factory() + { + return new ExcIEEEDC3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.hpp index 41575683a..49c988e59 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC3A.hpp @@ -1,51 +1,52 @@ #ifndef ExcIEEEDC3A_H #define ExcIEEEDC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC3A model. This model represents represent older systems, in particular those dc commutator exciters with non-continuously acting regulators that were commonly used before the development of the continuously acting varieties. These systems respond at basically two different rates, depending upon the magnitude of voltage error. For small errors, adjustment is made periodically with a signal to a motor-operated rheostat. Larger errors cause resistors to be quickly shorted or inserted and a strong forcing signal applied to the exciter. Continuous motion of the motor-operated rheostat occurs for these larger error signals, even though it is bypassed by contactor action. Reference: IEEE Standard 421.5-2005 Section 5.3. */ - class ExcIEEEDC3A: public ExcitationSystemDynamics + class ExcIEEEDC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds trh; /* Rheostat travel time (T). Typical Value = 20. Default: nullptr */ - CIMPP::PU kv; /* Fast raise/lower contact setting (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.375. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.267. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.15. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.068. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC3A(); - virtual ~ExcIEEEDC3A(); - + ~ExcIEEEDC3A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.375. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.15. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kv; /* Fast raise/lower contact setting (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.267. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.068. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds trh; /* Rheostat travel time (T). Typical Value = 20. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.cpp index d9da2e70d..9c83746f6 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.cpp @@ -1,321 +1,340 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC4B.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcIEEEDC4B::ExcIEEEDC4B() {}; - ExcIEEEDC4B::~ExcIEEEDC4B() {}; +bool assign_ExcIEEEDC4B_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC4B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEDC4B_factory() { - return new ExcIEEEDC4B; - } +const char ExcIEEEDC4B::debugName[] = "ExcIEEEDC4B"; +const char* ExcIEEEDC4B::debugString() const +{ + return ExcIEEEDC4B::debugName; } -void ExcIEEEDC4B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B"), &ExcIEEEDC4B_factory)); } -void ExcIEEEDC4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEDC4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd1"), &assign_ExcIEEEDC4B_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd2"), &assign_ExcIEEEDC4B_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ka"), &assign_ExcIEEEDC4B_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ta"), &assign_ExcIEEEDC4B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kp"), &assign_ExcIEEEDC4B_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ki"), &assign_ExcIEEEDC4B_ki)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kd"), &assign_ExcIEEEDC4B_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.td"), &assign_ExcIEEEDC4B_td)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmax"), &assign_ExcIEEEDC4B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmin"), &assign_ExcIEEEDC4B_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ke"), &assign_ExcIEEEDC4B_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.te"), &assign_ExcIEEEDC4B_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kf"), &assign_ExcIEEEDC4B_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.tf"), &assign_ExcIEEEDC4B_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd1"), &assign_ExcIEEEDC4B_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ki"), &assign_ExcIEEEDC4B_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kp"), &assign_ExcIEEEDC4B_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.oelin"), &assign_ExcIEEEDC4B_oelin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.seefd1"), &assign_ExcIEEEDC4B_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd2"), &assign_ExcIEEEDC4B_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.seefd2"), &assign_ExcIEEEDC4B_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vemin"), &assign_ExcIEEEDC4B_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.oelin"), &assign_ExcIEEEDC4B_oelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ta"), &assign_ExcIEEEDC4B_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.td"), &assign_ExcIEEEDC4B_td)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.te"), &assign_ExcIEEEDC4B_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.tf"), &assign_ExcIEEEDC4B_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.uelin"), &assign_ExcIEEEDC4B_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vemin"), &assign_ExcIEEEDC4B_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmax"), &assign_ExcIEEEDC4B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmin"), &assign_ExcIEEEDC4B_vrmin)); } -void ExcIEEEDC4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC4B::debugName[] = "ExcIEEEDC4B"; -const char* ExcIEEEDC4B::debugString() +void ExcIEEEDC4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC4B::debugName; } const BaseClassDefiner ExcIEEEDC4B::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcIEEEDC4B::declare() return BaseClassDefiner(ExcIEEEDC4B::addConstructToMap, ExcIEEEDC4B::addPrimitiveAssignFnsToMap, ExcIEEEDC4B::addClassAssignFnsToMap, ExcIEEEDC4B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC4B_factory() + { + return new ExcIEEEDC4B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.hpp index cbb1cf6a8..f5ea5c20a 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEDC4B.hpp @@ -1,59 +1,60 @@ #ifndef ExcIEEEDC4B_H #define ExcIEEEDC4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC4B model. These excitation systems utilize a field-controlled dc commutator exciter with a continuously acting voltage regulator having supplies obtained from the generator or auxiliary bus. Reference: IEEE Standard 421.5-2005 Section 5.4. */ - class ExcIEEEDC4B: public ExcitationSystemDynamics + class ExcIEEEDC4B : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU kp; /* Regulator proportional gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::PU ki; /* Regulator integral gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::PU kd; /* Regulator derivative gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::Seconds td; /* Regulator derivative filter time constant(T). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 2.7. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 1.75. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.33. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.27. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output(V). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean oelin; /* OEL input (OELin). true = LV gate false = subtract from error signal. Typical Value = true. Default: false */ - CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC4B(); - virtual ~ExcIEEEDC4B(); - + ~ExcIEEEDC4B() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 1.75. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.33. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kd; /* Regulator derivative gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Regulator integral gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU kp; /* Regulator proportional gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::Boolean oelin; /* OEL input (OELin). true = LV gate false = subtract from error signal. Typical Value = true. Default: false */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.08. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.27. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds td; /* Regulator derivative filter time constant(T). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ + CIMPP::PU vemin; /* Minimum exciter voltage output(V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 2.7. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC4B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.cpp index 137e3cc50..48a92f05e 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -25,269 +29,289 @@ using namespace CIMPP; ExcIEEEST1A::ExcIEEEST1A() {}; - ExcIEEEST1A::~ExcIEEEST1A() {}; +bool assign_ExcIEEEST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_pssin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pssin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_pssin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pssin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST1A_factory() { - return new ExcIEEEST1A; - } +const char ExcIEEEST1A::debugName[] = "ExcIEEEST1A"; +const char* ExcIEEEST1A::debugString() const +{ + return ExcIEEEST1A::debugName; } -void ExcIEEEST1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A"), &ExcIEEEST1A_factory)); } -void ExcIEEEST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A.ilr"), &assign_ExcIEEEST1A_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A.ka"), &assign_ExcIEEEST1A_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A.kc"), &assign_ExcIEEEST1A_kc)); @@ -309,13 +333,8 @@ void ExcIEEEST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST1A::debugName[] = "ExcIEEEST1A"; -const char* ExcIEEEST1A::debugString() +void ExcIEEEST1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST1A::debugName; } const BaseClassDefiner ExcIEEEST1A::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcIEEEST1A::declare() return BaseClassDefiner(ExcIEEEST1A::addConstructToMap, ExcIEEEST1A::addPrimitiveAssignFnsToMap, ExcIEEEST1A::addClassAssignFnsToMap, ExcIEEEST1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST1A_factory() + { + return new ExcIEEEST1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.hpp index c45173769..c59603d1c 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST1A.hpp @@ -1,59 +1,60 @@ #ifndef ExcIEEEST1A_H #define ExcIEEEST1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Seconds.hpp" #include "ExcIEEEST1AUELselectorKind.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST1A model. This model represents systems in which excitation power is supplied through a transformer from the generator terminals (or the unit's auxiliary bus) and is regulated by a controlled rectifier. The maximum exciter voltage available from such systems is directly related to the generator terminal voltage. Reference: IEEE Standard 421.5-2005 Section 7.1. */ - class ExcIEEEST1A: public ExcitationSystemDynamics + class ExcIEEEST1A : public ExcitationSystemDynamics { - public: - CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 190. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean pssin; /* Selector of the Power System Stabilizer (PSS) input (PSSin). true = PSS input (Vs) added to error signal false = PSS input (Vs) added to voltage regulator output. Typical Value = true. Default: false */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tb1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tc1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::ExcIEEEST1AUELselectorKind uelin; /* Selector of the connection of the UEL input (UELin). Typical Value = ignoreUELsignal. Default: 0 */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ - CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 999. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -999. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 7.8. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -6.7. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST1A(); - virtual ~ExcIEEEST1A(); - + ~ExcIEEEST1A() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 190. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean pssin; /* Selector of the Power System Stabilizer (PSS) input (PSSin). true = PSS input (Vs) added to error signal false = PSS input (Vs) added to voltage regulator output. Typical Value = true. Default: false */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tb1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tc1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::ExcIEEEST1AUELselectorKind uelin; /* Selector of the connection of the UEL input (UELin). Typical Value = ignoreUELsignal. Default: 0 */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 999. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -999. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 7.8. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -6.7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.cpp index 6060c0dd5..cac712136 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST1AUELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcIEEEST1AUELselectorKind& rop) +ExcIEEEST1AUELselectorKind& ExcIEEEST1AUELselectorKind::operator=(ExcIEEEST1AUELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcIEEEST1AUELselectorKind::operator ExcIEEEST1AUELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcIEEEST1AUELselectorKind::debugName[] = "ExcIEEEST1AUELselectorKind"; +const char* ExcIEEEST1AUELselectorKind::debugString() const +{ + return ExcIEEEST1AUELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcIEEEST1AUELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcIEEEST1AUELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcIEEEST1AUELselectorKind::ignoreUELsignal) + { + EnumSymbol = "ignoreUELsignal"; + } + if (obj.value == ExcIEEEST1AUELselectorKind::inputHVgateVoltageOutput) + { + EnumSymbol = "inputHVgateVoltageOutput"; + } + if (obj.value == ExcIEEEST1AUELselectorKind::inputHVgateErrorSignal) + { + EnumSymbol = "inputHVgateErrorSignal"; + } + if (obj.value == ExcIEEEST1AUELselectorKind::inputAddedToErrorSignal) + { + EnumSymbol = "inputAddedToErrorSignal"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcIEEEST1AUELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.hpp index 3f420426b..62cd07318 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST1AUELselectorKind.hpp @@ -1,29 +1,54 @@ #ifndef ExcIEEEST1AUELselectorKind_H #define ExcIEEEST1AUELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the UEL input used in ExcIEEEST1A. */ - enum class ExcIEEEST1AUELselectorKind + class ExcIEEEST1AUELselectorKind { - /** - * Ignore UEL signal. - */ - ignoreUELsignal, - /** - * UEL input HV gate with voltage regulator output. - */ - inputHVgateVoltageOutput, - /** - * UEL input HV gate with error signal. - */ - inputHVgateErrorSignal, - /** - * UEL input added to error signal. - */ - inputAddedToErrorSignal, + public: + enum ExcIEEEST1AUELselectorKind_ENUM + { + /** + * Ignore UEL signal. + */ + ignoreUELsignal, + /** + * UEL input HV gate with voltage regulator output. + */ + inputHVgateVoltageOutput, + /** + * UEL input HV gate with error signal. + */ + inputHVgateErrorSignal, + /** + * UEL input added to error signal. + */ + inputAddedToErrorSignal, + }; + + ExcIEEEST1AUELselectorKind() : value(), initialized(false) {} + ExcIEEEST1AUELselectorKind(ExcIEEEST1AUELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcIEEEST1AUELselectorKind& operator=(ExcIEEEST1AUELselectorKind_ENUM rop); + operator ExcIEEEST1AUELselectorKind_ENUM() const; + + ExcIEEEST1AUELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcIEEEST1AUELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcIEEEST1AUELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcIEEEST1AUELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.cpp index 4ac35b2ef..def7e0e1c 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.cpp @@ -1,30 +1,199 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST2A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcIEEEST2A::ExcIEEEST2A() {}; - ExcIEEEST2A::~ExcIEEEST2A() {}; +bool assign_ExcIEEEST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +206,39 @@ ExcIEEEST2A::~ExcIEEEST2A() {}; -bool assign_ExcIEEEST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEST2A_factory() { - return new ExcIEEEST2A; - } +const char ExcIEEEST2A::debugName[] = "ExcIEEEST2A"; +const char* ExcIEEEST2A::debugString() const +{ + return ExcIEEEST2A::debugName; } -void ExcIEEEST2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A"), &ExcIEEEST2A_factory)); } -void ExcIEEEST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.efdmax"), &assign_ExcIEEEST2A_efdmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ka"), &assign_ExcIEEEST2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ta"), &assign_ExcIEEEST2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmax"), &assign_ExcIEEEST2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmin"), &assign_ExcIEEEST2A_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kc"), &assign_ExcIEEEST2A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ke"), &assign_ExcIEEEST2A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.te"), &assign_ExcIEEEST2A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kf"), &assign_ExcIEEEST2A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.tf"), &assign_ExcIEEEST2A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kp"), &assign_ExcIEEEST2A_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ki"), &assign_ExcIEEEST2A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kc"), &assign_ExcIEEEST2A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.efdmax"), &assign_ExcIEEEST2A_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kp"), &assign_ExcIEEEST2A_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ta"), &assign_ExcIEEEST2A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.te"), &assign_ExcIEEEST2A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.tf"), &assign_ExcIEEEST2A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.uelin"), &assign_ExcIEEEST2A_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmax"), &assign_ExcIEEEST2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmin"), &assign_ExcIEEEST2A_vrmin)); } -void ExcIEEEST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST2A::debugName[] = "ExcIEEEST2A"; -const char* ExcIEEEST2A::debugString() +void ExcIEEEST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST2A::debugName; } const BaseClassDefiner ExcIEEEST2A::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner ExcIEEEST2A::declare() return BaseClassDefiner(ExcIEEEST2A::addConstructToMap, ExcIEEEST2A::addPrimitiveAssignFnsToMap, ExcIEEEST2A::addClassAssignFnsToMap, ExcIEEEST2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST2A_factory() + { + return new ExcIEEEST2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.hpp index 912aa6548..817ffedb7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST2A.hpp @@ -1,52 +1,53 @@ #ifndef ExcIEEEST2A_H #define ExcIEEEST2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST2A model. Some static systems utilize both current and voltage sources (generator terminal quantities) to comprise the power source. The regulator controls the exciter output through controlled saturation of the power transformer components. These compound-source rectifier excitation systems are designated Type ST2A and are represented by ExcIEEEST2A. Reference: IEEE Standard 421.5-2005 Section 7.2. */ - class ExcIEEEST2A: public ExcitationSystemDynamics + class ExcIEEEST2A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 120. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.88. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 8. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 1.82. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum field voltage (E). Typical Value = 99. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST2A(); - virtual ~ExcIEEEST2A(); - + ~ExcIEEEST2A() override; + + CIMPP::PU efdmax; /* Maximum field voltage (E). Typical Value = 99. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 120. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 1.82. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 8. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.88. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.cpp index 4c4f03a47..63b81a0cb 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.cpp @@ -1,22 +1,26 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST3A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "AngleDegrees.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -26,311 +30,327 @@ using namespace CIMPP; ExcIEEEST3A::ExcIEEEST3A() {}; - ExcIEEEST3A::~ExcIEEEST3A() {}; +bool assign_ExcIEEEST3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vgmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vgmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST3A_factory() { - return new ExcIEEEST3A; - } +const char ExcIEEEST3A::debugName[] = "ExcIEEEST3A"; +const char* ExcIEEEST3A::debugString() const +{ + return ExcIEEEST3A::debugName; } -void ExcIEEEST3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A"), &ExcIEEEST3A_factory)); } -void ExcIEEEST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimax"), &assign_ExcIEEEST3A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimin"), &assign_ExcIEEEST3A_vimin)); +void ExcIEEEST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ka"), &assign_ExcIEEEST3A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kc"), &assign_ExcIEEEST3A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kg"), &assign_ExcIEEEST3A_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ki"), &assign_ExcIEEEST3A_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.km"), &assign_ExcIEEEST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kp"), &assign_ExcIEEEST3A_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ta"), &assign_ExcIEEEST3A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.tb"), &assign_ExcIEEEST3A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.tc"), &assign_ExcIEEEST3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmax"), &assign_ExcIEEEST3A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmin"), &assign_ExcIEEEST3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.km"), &assign_ExcIEEEST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.thetap"), &assign_ExcIEEEST3A_thetap)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.tm"), &assign_ExcIEEEST3A_tm)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vbmax"), &assign_ExcIEEEST3A_vbmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vgmax"), &assign_ExcIEEEST3A_vgmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimax"), &assign_ExcIEEEST3A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimin"), &assign_ExcIEEEST3A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vmmax"), &assign_ExcIEEEST3A_vmmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vmmin"), &assign_ExcIEEEST3A_vmmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kg"), &assign_ExcIEEEST3A_kg)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kp"), &assign_ExcIEEEST3A_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.thetap"), &assign_ExcIEEEST3A_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ki"), &assign_ExcIEEEST3A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kc"), &assign_ExcIEEEST3A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmax"), &assign_ExcIEEEST3A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmin"), &assign_ExcIEEEST3A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.xl"), &assign_ExcIEEEST3A_xl)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vbmax"), &assign_ExcIEEEST3A_vbmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vgmax"), &assign_ExcIEEEST3A_vgmax)); } -void ExcIEEEST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST3A::debugName[] = "ExcIEEEST3A"; -const char* ExcIEEEST3A::debugString() +void ExcIEEEST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST3A::debugName; } const BaseClassDefiner ExcIEEEST3A::declare() @@ -338,4 +358,10 @@ const BaseClassDefiner ExcIEEEST3A::declare() return BaseClassDefiner(ExcIEEEST3A::addConstructToMap, ExcIEEEST3A::addPrimitiveAssignFnsToMap, ExcIEEEST3A::addClassAssignFnsToMap, ExcIEEEST3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST3A_factory() + { + return new ExcIEEEST3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.hpp index dc1e98f9f..9497c70c7 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST3A.hpp @@ -1,59 +1,60 @@ #ifndef ExcIEEEST3A_H #define ExcIEEEST3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST3A model. Some static systems utilize a field voltage control loop to linearize the exciter control characteristic. This also makes the output independent of supply source variations until supply limitations are reached. These systems utilize a variety of controlled-rectifier designs: full thyristor complements or hybrid bridges in either series or shunt configurations. The power source may consist of only a potential source, either fed from the machine terminals or from internal windings. Some designs may have compound power sources utilizing both machine potential and current. These power sources are represented as phasor combinations of machine terminal current and voltage and are accommodated by suitable parameters in model Type ST3A which is represented by ExcIEEEST3A. Reference: IEEE Standard 421.5-2005 Section 7.3. */ - class ExcIEEEST3A: public ExcitationSystemDynamics + class ExcIEEEST3A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -0.2. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). This is parameter K in the IEEE Std. Typical Value = 200. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 10. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -10. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 7.93. Default: nullptr */ - CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (T). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 6.15. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.081. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 6.9. Default: nullptr */ - CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (V). Typical Value = 5.8. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST3A(); - virtual ~ExcIEEEST3A(); - + ~ExcIEEEST3A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). This is parameter K in the IEEE Std. Typical Value = 200. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 7.93. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 6.15. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (T). Typical Value = 0.4. Default: nullptr */ + CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 6.9. Default: nullptr */ + CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (V). Typical Value = 5.8. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -0.2. Default: nullptr */ + CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 10. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -10. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.081. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.cpp index 738423f7b..7f8bb74f6 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.cpp @@ -1,19 +1,23 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST4B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" -#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -22,255 +26,267 @@ using namespace CIMPP; ExcIEEEST4B::ExcIEEEST4B() {}; - ExcIEEEST4B::~ExcIEEEST4B() {}; +bool assign_ExcIEEEST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST4B_factory() { - return new ExcIEEEST4B; - } +const char ExcIEEEST4B::debugName[] = "ExcIEEEST4B"; +const char* ExcIEEEST4B::debugString() const +{ + return ExcIEEEST4B::debugName; } -void ExcIEEEST4B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B"), &ExcIEEEST4B_factory)); } -void ExcIEEEST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kpr"), &assign_ExcIEEEST4B_kpr)); +void ExcIEEEST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kc"), &assign_ExcIEEEST4B_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kg"), &assign_ExcIEEEST4B_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ki"), &assign_ExcIEEEST4B_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kim"), &assign_ExcIEEEST4B_kim)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kir"), &assign_ExcIEEEST4B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ta"), &assign_ExcIEEEST4B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmax"), &assign_ExcIEEEST4B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmin"), &assign_ExcIEEEST4B_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kp"), &assign_ExcIEEEST4B_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kpm"), &assign_ExcIEEEST4B_kpm)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kim"), &assign_ExcIEEEST4B_kim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kpr"), &assign_ExcIEEEST4B_kpr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ta"), &assign_ExcIEEEST4B_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.thetap"), &assign_ExcIEEEST4B_thetap)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vbmax"), &assign_ExcIEEEST4B_vbmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vmmax"), &assign_ExcIEEEST4B_vmmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vmmin"), &assign_ExcIEEEST4B_vmmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kg"), &assign_ExcIEEEST4B_kg)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kp"), &assign_ExcIEEEST4B_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.thetap"), &assign_ExcIEEEST4B_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ki"), &assign_ExcIEEEST4B_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kc"), &assign_ExcIEEEST4B_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmax"), &assign_ExcIEEEST4B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmin"), &assign_ExcIEEEST4B_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.xl"), &assign_ExcIEEEST4B_xl)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vbmax"), &assign_ExcIEEEST4B_vbmax)); } -void ExcIEEEST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST4B::debugName[] = "ExcIEEEST4B"; -const char* ExcIEEEST4B::debugString() +void ExcIEEEST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST4B::debugName; } const BaseClassDefiner ExcIEEEST4B::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcIEEEST4B::declare() return BaseClassDefiner(ExcIEEEST4B::addConstructToMap, ExcIEEEST4B::addPrimitiveAssignFnsToMap, ExcIEEEST4B::addClassAssignFnsToMap, ExcIEEEST4B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST4B_factory() + { + return new ExcIEEEST4B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.hpp index 9d4f94400..7ddb62e5b 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST4B.hpp @@ -1,55 +1,56 @@ #ifndef ExcIEEEST4B_H #define ExcIEEEST4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST4B model. This model is a variation of the Type ST3A model, with a proportional plus integral (PI) regulator block replacing the lag-lead regulator characteristic that is in the ST3A model. Both potential and compound source rectifier excitation systems are modeled. The PI regulator blocks have non-windup limits that are represented. The voltage regulator of this model is typically implemented digitally. Reference: IEEE Standard 421.5-2005 Section 7.4. */ - class ExcIEEEST4B: public ExcitationSystemDynamics + class ExcIEEEST4B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 10.75. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 10.75. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU kpm; /* Voltage regulator proportional gain output (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kim; /* Voltage regulator integral gain output (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 99. Default: nullptr */ - CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = -99. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 9.3. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.113. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.124. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 11.63. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST4B(); - virtual ~ExcIEEEST4B(); - + ~ExcIEEEST4B() override; + + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.113. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kim; /* Voltage regulator integral gain output (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 10.75. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 9.3. Default: nullptr */ + CIMPP::PU kpm; /* Voltage regulator proportional gain output (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 10.75. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ + CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 11.63. Default: nullptr */ + CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 99. Default: nullptr */ + CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = -99. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.124. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST4B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.cpp index fa855da43..8a63ef0f1 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.cpp @@ -1,10 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST5B.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" @@ -19,273 +20,289 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEST5B::ExcIEEEST5B() {}; - ExcIEEEST5B::~ExcIEEEST5B() {}; +bool assign_ExcIEEEST5B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tob1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tob1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tob2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tob2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_toc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->toc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_toc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->toc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tub1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tub1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tub2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tub2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tuc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tuc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST5B_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_toc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->toc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tob1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tob1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_toc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->toc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tob2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tob2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tuc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tub1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tub1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tuc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tub2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tub2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST5B_factory() { - return new ExcIEEEST5B; - } +const char ExcIEEEST5B::debugName[] = "ExcIEEEST5B"; +const char* ExcIEEEST5B::debugString() const +{ + return ExcIEEEST5B::debugName; } -void ExcIEEEST5B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST5B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B"), &ExcIEEEST5B_factory)); } -void ExcIEEEST5B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST5B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.kc"), &assign_ExcIEEEST5B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.kr"), &assign_ExcIEEEST5B_kr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.t1"), &assign_ExcIEEEST5B_t1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.kc"), &assign_ExcIEEEST5B_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmax"), &assign_ExcIEEEST5B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmin"), &assign_ExcIEEEST5B_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc1"), &assign_ExcIEEEST5B_tc1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tb1"), &assign_ExcIEEEST5B_tb1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc2"), &assign_ExcIEEEST5B_tc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tb2"), &assign_ExcIEEEST5B_tb2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc1"), &assign_ExcIEEEST5B_toc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc1"), &assign_ExcIEEEST5B_tc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc2"), &assign_ExcIEEEST5B_tc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tob1"), &assign_ExcIEEEST5B_tob1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc2"), &assign_ExcIEEEST5B_toc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tob2"), &assign_ExcIEEEST5B_tob2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc1"), &assign_ExcIEEEST5B_tuc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc1"), &assign_ExcIEEEST5B_toc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc2"), &assign_ExcIEEEST5B_toc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tub1"), &assign_ExcIEEEST5B_tub1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc2"), &assign_ExcIEEEST5B_tuc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tub2"), &assign_ExcIEEEST5B_tub2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc1"), &assign_ExcIEEEST5B_tuc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc2"), &assign_ExcIEEEST5B_tuc2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmax"), &assign_ExcIEEEST5B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmin"), &assign_ExcIEEEST5B_vrmin)); } -void ExcIEEEST5B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST5B::debugName[] = "ExcIEEEST5B"; -const char* ExcIEEEST5B::debugString() +void ExcIEEEST5B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST5B::debugName; } const BaseClassDefiner ExcIEEEST5B::declare() @@ -293,4 +310,10 @@ const BaseClassDefiner ExcIEEEST5B::declare() return BaseClassDefiner(ExcIEEEST5B::addConstructToMap, ExcIEEEST5B::addPrimitiveAssignFnsToMap, ExcIEEEST5B::addClassAssignFnsToMap, ExcIEEEST5B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST5B_factory() + { + return new ExcIEEEST5B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.hpp index cbabc34f9..20bc909f1 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST5B.hpp @@ -1,55 +1,56 @@ #ifndef ExcIEEEST5B_H #define ExcIEEEST5B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST5B model. The Type ST5B excitation system is a variation of the Type ST1A model, with alternative overexcitation and underexcitation inputs and additional limits. Reference: IEEE Standard 421.5-2005 Section 7.5. Note: the block diagram in the IEEE 421.5 standard has input signal Vc and does not indicate the summation point with Vref. The implementation of the ExcIEEEST5B shall consider summation point with Vref. */ - class ExcIEEEST5B: public ExcitationSystemDynamics + class ExcIEEEST5B : public ExcitationSystemDynamics { - public: - CIMPP::PU kr; /* Regulator gain (K). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds t1; /* Firing circuit time constant (T1). Typical Value = 0.004. Default: nullptr */ - CIMPP::PU kc; /* Rectifier regulation factor (K). Typical Value = 0.004. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4. Default: nullptr */ - CIMPP::Seconds tc1; /* Regulator lead time constant (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tb1; /* Regulator lag time constant (T). Typical Value = 6. Default: nullptr */ - CIMPP::Seconds tc2; /* Regulator lead time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tb2; /* Regulator lag time constant (T). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds toc1; /* OEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tob1; /* OEL lag time constant (T). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds toc2; /* OEL lead time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tob2; /* OEL lag time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tuc1; /* UEL lead time constant (T). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tub1; /* UEL lag time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tuc2; /* UEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tub2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST5B(); - virtual ~ExcIEEEST5B(); - + ~ExcIEEEST5B() override; + + CIMPP::PU kc; /* Rectifier regulation factor (K). Typical Value = 0.004. Default: nullptr */ + CIMPP::PU kr; /* Regulator gain (K). Typical Value = 200. Default: nullptr */ + CIMPP::Seconds t1; /* Firing circuit time constant (T1). Typical Value = 0.004. Default: nullptr */ + CIMPP::Seconds tb1; /* Regulator lag time constant (T). Typical Value = 6. Default: nullptr */ + CIMPP::Seconds tb2; /* Regulator lag time constant (T). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tc1; /* Regulator lead time constant (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tc2; /* Regulator lead time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tob1; /* OEL lag time constant (T). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tob2; /* OEL lag time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds toc1; /* OEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds toc2; /* OEL lead time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tub1; /* UEL lag time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tub2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tuc1; /* UEL lead time constant (T). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tuc2; /* UEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST5B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.cpp index 19e9d1502..1d19b4998 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST6B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -20,204 +24,219 @@ using namespace CIMPP; ExcIEEEST6B::ExcIEEEST6B() {}; - ExcIEEEST6B::~ExcIEEEST6B() {}; +bool assign_ExcIEEEST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kci(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kci; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kci(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kci; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEST6B_factory() { - return new ExcIEEEST6B; - } + + + + + + + + + + +const char ExcIEEEST6B::debugName[] = "ExcIEEEST6B"; +const char* ExcIEEEST6B::debugString() const +{ + return ExcIEEEST6B::debugName; } -void ExcIEEEST6B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST6B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B"), &ExcIEEEST6B_factory)); } -void ExcIEEEST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B.ilr"), &assign_ExcIEEEST6B_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B.kci"), &assign_ExcIEEEST6B_kci)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B.kff"), &assign_ExcIEEEST6B_kff)); @@ -234,13 +253,8 @@ void ExcIEEEST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST6B::debugName[] = "ExcIEEEST6B"; -const char* ExcIEEEST6B::debugString() +void ExcIEEEST6B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST6B::debugName; } const BaseClassDefiner ExcIEEEST6B::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcIEEEST6B::declare() return BaseClassDefiner(ExcIEEEST6B::addConstructToMap, ExcIEEEST6B::addPrimitiveAssignFnsToMap, ExcIEEEST6B::addClassAssignFnsToMap, ExcIEEEST6B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST6B_factory() + { + return new ExcIEEEST6B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.hpp index dcf0633c3..1c5b7b3c9 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST6B.hpp @@ -1,53 +1,54 @@ #ifndef ExcIEEEST6B_H #define ExcIEEEST6B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcST6BOELselectorKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST6B model. This model consists of a PI voltage regulator with an inner loop field voltage regulator and pre-control. The field voltage regulator implements a proportional control. The pre-control and the delay in the feedback circuit increase the dynamic response. Reference: IEEE Standard 421.5-2005 Section 7.6. */ - class ExcIEEEST6B: public ExcitationSystemDynamics + class ExcIEEEST6B : public ExcitationSystemDynamics { - public: - CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 4.164. Default: nullptr */ - CIMPP::PU kci; /* Exciter output current limit adjustment (K). Typical Value = 1.0577. Default: nullptr */ - CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 45.094. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 17.33. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 18.038. Default: nullptr */ - CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST6B(); - virtual ~ExcIEEEST6B(); - + ~ExcIEEEST6B() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 4.164. Default: nullptr */ + CIMPP::PU kci; /* Exciter output current limit adjustment (K). Typical Value = 1.0577. Default: nullptr */ + CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 45.094. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 17.33. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 18.038. Default: nullptr */ + CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST6B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.cpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.cpp index aa585bfc8..76c7e0260 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST7B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -21,217 +25,233 @@ using namespace CIMPP; ExcIEEEST7B::ExcIEEEST7B() {}; - ExcIEEEST7B::~ExcIEEEST7B() {}; +bool assign_ExcIEEEST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST7B_factory() { - return new ExcIEEEST7B; - } +const char ExcIEEEST7B::debugName[] = "ExcIEEEST7B"; +const char* ExcIEEEST7B::debugString() const +{ + return ExcIEEEST7B::debugName; } -void ExcIEEEST7B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST7B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B"), &ExcIEEEST7B_factory)); } -void ExcIEEEST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B.kh"), &assign_ExcIEEEST7B_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B.kia"), &assign_ExcIEEEST7B_kia)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B.kl"), &assign_ExcIEEEST7B_kl)); @@ -249,13 +269,8 @@ void ExcIEEEST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST7B::debugName[] = "ExcIEEEST7B"; -const char* ExcIEEEST7B::debugString() +void ExcIEEEST7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST7B::debugName; } const BaseClassDefiner ExcIEEEST7B::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner ExcIEEEST7B::declare() return BaseClassDefiner(ExcIEEEST7B::addConstructToMap, ExcIEEEST7B::addPrimitiveAssignFnsToMap, ExcIEEEST7B::addClassAssignFnsToMap, ExcIEEEST7B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST7B_factory() + { + return new ExcIEEEST7B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.hpp b/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.hpp index b09663574..68301f797 100644 --- a/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcIEEEST7B.hpp @@ -1,55 +1,56 @@ #ifndef ExcIEEEST7B_H #define ExcIEEEST7B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcST7BOELselectorKind.hpp" -#include "Seconds.hpp" #include "ExcST7BUELselectorKind.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST7B model. This model is representative of static potential-source excitation systems. In this system, the AVR consists of a PI voltage regulator. A phase lead-lag filter in series allows introduction of a derivative function, typically used with brushless excitation systems. In that case, the regulator is of the PID type. In addition, the terminal voltage channel includes a phase lead-lag filter. The AVR includes the appropriate inputs on its reference for overexcitation limiter (OEL1), underexcitation limiter (UEL), stator current limiter (SCL), and current compensator (DROOP). All these limitations, when they work at voltage reference level, keep the PSS (VS signal from Type PSS1A, PSS2A, or PSS2B) in operation. However, the UEL limitation can also be transferred to the high value (HV) gate acting on the output signal. In addition, the output signal passes through a low value (LV) gate for a ceiling overexcitation limiter (OEL2). Reference: IEEE Standard 421.5-2005 Section 7.7. */ - class ExcIEEEST7B: public ExcitationSystemDynamics + class ExcIEEEST7B : public ExcitationSystemDynamics { - public: - CIMPP::PU kh; /* High-value gate feedback gain (K). Typical Value 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl; /* Low-value gate feedback gain (K). Typical Value 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 40. Default: nullptr */ - CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tb; /* Regulator lag time constant (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tc; /* Regulator lead time constant (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tia; /* Feedback time constant (T). Typical Value = 3. Default: nullptr */ - CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ - CIMPP::PU vmax; /* Maximum voltage reference signal (V). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum voltage reference signal (V). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST7B(); - virtual ~ExcIEEEST7B(); - + ~ExcIEEEST7B() override; + + CIMPP::PU kh; /* High-value gate feedback gain (K). Typical Value 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl; /* Low-value gate feedback gain (K). Typical Value 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 40. Default: nullptr */ + CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tb; /* Regulator lag time constant (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tc; /* Regulator lead time constant (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tia; /* Feedback time constant (T). Typical Value = 3. Default: nullptr */ + CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ + CIMPP::PU vmax; /* Maximum voltage reference signal (V). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum voltage reference signal (V). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST7B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcOEX3T.cpp b/CGMES_2.4.15_16FEB2016/ExcOEX3T.cpp index 79bf9658a..6849a4fed 100644 --- a/CGMES_2.4.15_16FEB2016/ExcOEX3T.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcOEX3T.cpp @@ -1,321 +1,340 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcOEX3T.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcOEX3T::ExcOEX3T() {}; - ExcOEX3T::~ExcOEX3T() {}; +bool assign_ExcOEX3T_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_see1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->see1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_see2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->see2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcOEX3T_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_see1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->see1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_see2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->see2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcOEX3T_factory() { - return new ExcOEX3T; - } +const char ExcOEX3T::debugName[] = "ExcOEX3T"; +const char* ExcOEX3T::debugString() const +{ + return ExcOEX3T::debugName; } -void ExcOEX3T::addConstructToMap(std::unordered_map& factory_map) { +void ExcOEX3T::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcOEX3T"), &ExcOEX3T_factory)); } -void ExcOEX3T::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcOEX3T::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e1"), &assign_ExcOEX3T_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e2"), &assign_ExcOEX3T_e2)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ka"), &assign_ExcOEX3T_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kc"), &assign_ExcOEX3T_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kd"), &assign_ExcOEX3T_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ke"), &assign_ExcOEX3T_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kf"), &assign_ExcOEX3T_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see1"), &assign_ExcOEX3T_see1)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see2"), &assign_ExcOEX3T_see2)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t1"), &assign_ExcOEX3T_t1)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t2"), &assign_ExcOEX3T_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t3"), &assign_ExcOEX3T_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t4"), &assign_ExcOEX3T_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ka"), &assign_ExcOEX3T_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t5"), &assign_ExcOEX3T_t5)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t6"), &assign_ExcOEX3T_t6)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmax"), &assign_ExcOEX3T_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmin"), &assign_ExcOEX3T_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.te"), &assign_ExcOEX3T_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kf"), &assign_ExcOEX3T_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.tf"), &assign_ExcOEX3T_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kc"), &assign_ExcOEX3T_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kd"), &assign_ExcOEX3T_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ke"), &assign_ExcOEX3T_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e1"), &assign_ExcOEX3T_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see1"), &assign_ExcOEX3T_see1)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e2"), &assign_ExcOEX3T_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see2"), &assign_ExcOEX3T_see2)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmax"), &assign_ExcOEX3T_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmin"), &assign_ExcOEX3T_vrmin)); } -void ExcOEX3T::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcOEX3T::debugName[] = "ExcOEX3T"; -const char* ExcOEX3T::debugString() +void ExcOEX3T::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcOEX3T::debugName; } const BaseClassDefiner ExcOEX3T::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcOEX3T::declare() return BaseClassDefiner(ExcOEX3T::addConstructToMap, ExcOEX3T::addPrimitiveAssignFnsToMap, ExcOEX3T::addClassAssignFnsToMap, ExcOEX3T::debugName); } - +namespace CIMPP +{ + BaseClass* ExcOEX3T_factory() + { + return new ExcOEX3T; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcOEX3T.hpp b/CGMES_2.4.15_16FEB2016/ExcOEX3T.hpp index d89680ab6..8ee520293 100644 --- a/CGMES_2.4.15_16FEB2016/ExcOEX3T.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcOEX3T.hpp @@ -1,57 +1,58 @@ #ifndef ExcOEX3T_H #define ExcOEX3T_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE Type ST1 Excitation System with semi-continuous and acting terminal voltage limiter. */ - class ExcOEX3T: public ExcitationSystemDynamics + class ExcOEX3T : public ExcitationSystemDynamics { - public: - CIMPP::Seconds t1; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T). Default: nullptr */ - CIMPP::PU ka; /* Gain (K). Default: nullptr */ - CIMPP::Seconds t5; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t6; /* Time constant (T). Default: nullptr */ - CIMPP::PU vrmax; /* Limiter (V). Default: nullptr */ - CIMPP::PU vrmin; /* Limiter (V). Default: nullptr */ - CIMPP::Seconds te; /* Time constant (T). Default: nullptr */ - CIMPP::PU kf; /* Gain (K). Default: nullptr */ - CIMPP::Seconds tf; /* Time constant (T). Default: nullptr */ - CIMPP::PU kc; /* Gain (K). Default: nullptr */ - CIMPP::PU kd; /* Gain (K). Default: nullptr */ - CIMPP::PU ke; /* Gain (K). Default: nullptr */ - CIMPP::PU e1; /* Saturation parameter (E). Default: nullptr */ - CIMPP::PU see1; /* Saturation parameter (S(E)). Default: nullptr */ - CIMPP::PU e2; /* Saturation parameter (E). Default: nullptr */ - CIMPP::PU see2; /* Saturation parameter (S(E)). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcOEX3T(); - virtual ~ExcOEX3T(); - + ~ExcOEX3T() override; + + CIMPP::PU e1; /* Saturation parameter (E). Default: nullptr */ + CIMPP::PU e2; /* Saturation parameter (E). Default: nullptr */ + CIMPP::PU ka; /* Gain (K). Default: nullptr */ + CIMPP::PU kc; /* Gain (K). Default: nullptr */ + CIMPP::PU kd; /* Gain (K). Default: nullptr */ + CIMPP::PU ke; /* Gain (K). Default: nullptr */ + CIMPP::PU kf; /* Gain (K). Default: nullptr */ + CIMPP::PU see1; /* Saturation parameter (S(E)). Default: nullptr */ + CIMPP::PU see2; /* Saturation parameter (S(E)). Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t5; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t6; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds te; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds tf; /* Time constant (T). Default: nullptr */ + CIMPP::PU vrmax; /* Limiter (V). Default: nullptr */ + CIMPP::PU vrmin; /* Limiter (V). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcOEX3T_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcPIC.cpp b/CGMES_2.4.15_16FEB2016/ExcPIC.cpp index b62a9a96b..4e7434109 100644 --- a/CGMES_2.4.15_16FEB2016/ExcPIC.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcPIC.cpp @@ -1,26 +1,30 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcPIC.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -29,353 +33,372 @@ using namespace CIMPP; ExcPIC::ExcPIC() {}; - ExcPIC::~ExcPIC() {}; +bool assign_ExcPIC_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcPIC_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcPIC_factory() { - return new ExcPIC; - } +const char ExcPIC::debugName[] = "ExcPIC"; +const char* ExcPIC::debugString() const +{ + return ExcPIC::debugName; } -void ExcPIC::addConstructToMap(std::unordered_map& factory_map) { +void ExcPIC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcPIC"), &ExcPIC_factory)); } -void ExcPIC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcPIC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e1"), &assign_ExcPIC_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e2"), &assign_ExcPIC_e2)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmax"), &assign_ExcPIC_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmin"), &assign_ExcPIC_efdmin)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ka"), &assign_ExcPIC_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kc"), &assign_ExcPIC_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ke"), &assign_ExcPIC_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kf"), &assign_ExcPIC_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ki"), &assign_ExcPIC_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kp"), &assign_ExcPIC_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se1"), &assign_ExcPIC_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se2"), &assign_ExcPIC_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta1"), &assign_ExcPIC_ta1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr1"), &assign_ExcPIC_vr1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr2"), &assign_ExcPIC_vr2)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta2"), &assign_ExcPIC_ta2)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta3"), &assign_ExcPIC_ta3)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta4"), &assign_ExcPIC_ta4)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmax"), &assign_ExcPIC_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmin"), &assign_ExcPIC_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kf"), &assign_ExcPIC_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.te"), &assign_ExcPIC_te)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.tf1"), &assign_ExcPIC_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.tf2"), &assign_ExcPIC_tf2)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmax"), &assign_ExcPIC_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmin"), &assign_ExcPIC_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ke"), &assign_ExcPIC_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.te"), &assign_ExcPIC_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e1"), &assign_ExcPIC_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se1"), &assign_ExcPIC_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e2"), &assign_ExcPIC_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se2"), &assign_ExcPIC_se2)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kp"), &assign_ExcPIC_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ki"), &assign_ExcPIC_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kc"), &assign_ExcPIC_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr1"), &assign_ExcPIC_vr1)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr2"), &assign_ExcPIC_vr2)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmax"), &assign_ExcPIC_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmin"), &assign_ExcPIC_vrmin)); } -void ExcPIC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcPIC::debugName[] = "ExcPIC"; -const char* ExcPIC::debugString() +void ExcPIC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcPIC::debugName; } const BaseClassDefiner ExcPIC::declare() @@ -383,4 +406,10 @@ const BaseClassDefiner ExcPIC::declare() return BaseClassDefiner(ExcPIC::addConstructToMap, ExcPIC::addPrimitiveAssignFnsToMap, ExcPIC::addClassAssignFnsToMap, ExcPIC::debugName); } - +namespace CIMPP +{ + BaseClass* ExcPIC_factory() + { + return new ExcPIC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcPIC.hpp b/CGMES_2.4.15_16FEB2016/ExcPIC.hpp index 411e21612..29379a6fa 100644 --- a/CGMES_2.4.15_16FEB2016/ExcPIC.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcPIC.hpp @@ -1,61 +1,62 @@ #ifndef ExcPIC_H #define ExcPIC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Proportional/Integral Regulator Excitation System Model. This model can be used to represent excitation systems with a proportional-integral (PI) voltage regulator controller. */ - class ExcPIC: public ExcitationSystemDynamics + class ExcPIC : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* PI controller gain (Ka). Typical Value = 3.15. Default: nullptr */ - CIMPP::Seconds ta1; /* PI controller time constant (Ta1). Typical Value = 1. Default: nullptr */ - CIMPP::PU vr1; /* PI maximum limit (Vr1). Typical Value = 1. Default: nullptr */ - CIMPP::PU vr2; /* PI minimum limit (Vr2). Typical Value = -0.87. Default: nullptr */ - CIMPP::Seconds ta2; /* Voltage regulator time constant (Ta2). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds ta3; /* Lead time constant (Ta3). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta4; /* Lag time constant (Ta4). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU kf; /* Rate feedback gain (Kf). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf1; /* Rate feedback time constant (Tf1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf2; /* Rate feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ - CIMPP::PU efdmax; /* Exciter maximum limit (Efdmax). Typical Value = 8. Default: nullptr */ - CIMPP::PU efdmin; /* Exciter minimum limit (Efdmin). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant (Ke). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (Te). Typical Value = 0. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 0. Default: nullptr */ - CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 0. Default: nullptr */ - CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Potential source gain (Kp). Typical Value = 6.5. Default: nullptr */ - CIMPP::PU ki; /* Current source gain (Ki). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Exciter regulation factor (Kc). Typical Value = 0.08. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcPIC(); - virtual ~ExcPIC(); - + ~ExcPIC() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 0. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 0. Default: nullptr */ + CIMPP::PU efdmax; /* Exciter maximum limit (Efdmax). Typical Value = 8. Default: nullptr */ + CIMPP::PU efdmin; /* Exciter minimum limit (Efdmin). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU ka; /* PI controller gain (Ka). Typical Value = 3.15. Default: nullptr */ + CIMPP::PU kc; /* Exciter regulation factor (Kc). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant (Ke). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf; /* Rate feedback gain (Kf). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Current source gain (Ki). Typical Value = 0. Default: nullptr */ + CIMPP::PU kp; /* Potential source gain (Kp). Typical Value = 6.5. Default: nullptr */ + CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0. Default: nullptr */ + CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta1; /* PI controller time constant (Ta1). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ta2; /* Voltage regulator time constant (Ta2). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds ta3; /* Lead time constant (Ta3). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta4; /* Lag time constant (Ta4). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (Te). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf1; /* Rate feedback time constant (Tf1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf2; /* Rate feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ + CIMPP::PU vr1; /* PI maximum limit (Vr1). Typical Value = 1. Default: nullptr */ + CIMPP::PU vr2; /* PI minimum limit (Vr2). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Typical Value = -0.87. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcPIC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcREXS.cpp b/CGMES_2.4.15_16FEB2016/ExcREXS.cpp index 0b586cbc4..29f89ca72 100644 --- a/CGMES_2.4.15_16FEB2016/ExcREXS.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcREXS.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcREXS.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "ExcREXSFeedbackSignalKind.hpp" @@ -42,490 +46,527 @@ using namespace CIMPP; ExcREXS::ExcREXS() {}; - ExcREXS::~ExcREXS() {}; +bool assign_ExcREXS_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_flimf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flimf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kefd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kefd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kii(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kii; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kvi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kvp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvphz; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_nvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nvphz; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vcmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcREXS_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_flimf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flimf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kefd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kefd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kii(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kii; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kvi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kvp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvphz; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_nvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nvphz; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vcmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcREXS_factory() { - return new ExcREXS; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char ExcREXS::debugName[] = "ExcREXS"; +const char* ExcREXS::debugString() const +{ + return ExcREXS::debugName; } -void ExcREXS::addConstructToMap(std::unordered_map& factory_map) { +void ExcREXS::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcREXS"), &ExcREXS_factory)); } -void ExcREXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcREXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcREXS.e1"), &assign_ExcREXS_e1)); assign_map.insert(std::make_pair(std::string("cim:ExcREXS.e2"), &assign_ExcREXS_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcREXS.fbf"), &assign_ExcREXS_fbf)); @@ -564,13 +605,8 @@ void ExcREXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcREXS::debugName[] = "ExcREXS"; -const char* ExcREXS::debugString() +void ExcREXS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcREXS::debugName; } const BaseClassDefiner ExcREXS::declare() @@ -578,4 +614,10 @@ const BaseClassDefiner ExcREXS::declare() return BaseClassDefiner(ExcREXS::addConstructToMap, ExcREXS::addPrimitiveAssignFnsToMap, ExcREXS::addClassAssignFnsToMap, ExcREXS::debugName); } - +namespace CIMPP +{ + BaseClass* ExcREXS_factory() + { + return new ExcREXS; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcREXS.hpp b/CGMES_2.4.15_16FEB2016/ExcREXS.hpp index 067bce3bf..bb6ea0147 100644 --- a/CGMES_2.4.15_16FEB2016/ExcREXS.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcREXS.hpp @@ -1,75 +1,76 @@ #ifndef ExcREXS_H #define ExcREXS_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcREXSFeedbackSignalKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* General Purpose Rotating Excitation System Model. This model can be used to represent a wide range of excitation systems whose DC power source is an AC or DC generator. It encompasses IEEE type AC1, AC2, DC1, and DC2 excitation system models. */ - class ExcREXS: public ExcitationSystemDynamics + class ExcREXS : public ExcitationSystemDynamics { - public: - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 3. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 4. Default: nullptr */ - CIMPP::ExcREXSFeedbackSignalKind fbf; /* Rate feedback signal flag (Fbf). Typical Value = fieldCurrent. Default: 0 */ - CIMPP::PU flimf; /* Limit type flag (Flimf). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier regulation factor (Kc). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU kd; /* Exciter regulation factor (Kd). Typical Value = 2. Default: nullptr */ - CIMPP::PU ke; /* Exciter field proportional constant (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU kefd; /* Field voltage feedback gain (Kefd). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds kf; /* Rate feedback gain (Kf). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU kh; /* Field voltage controller feedback gain (Kh). Typical Value = 0. Default: nullptr */ - CIMPP::PU kii; /* Field Current Regulator Integral Gain (Kii). Typical Value = 0. Default: nullptr */ - CIMPP::PU kip; /* Field Current Regulator Proportional Gain (Kip). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU kvi; /* Voltage Regulator Integral Gain (Kvi). Typical Value = 0. Default: nullptr */ - CIMPP::PU kvp; /* Voltage Regulator Proportional Gain (Kvp). Typical Value = 2800. Default: nullptr */ - CIMPP::PU kvphz; /* V/Hz limiter gain (Kvphz). Typical Value = 0. Default: nullptr */ - CIMPP::PU nvphz; /* Pickup speed of V/Hz limiter (Nvphz). Typical Value = 0. Default: nullptr */ - CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0.0001. Default: nullptr */ - CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0.001. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage Regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds tb1; /* Lag time constant (Tb1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb2; /* Lag time constant (Tb2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc1; /* Lead time constant (Tc1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc2; /* Lead time constant (Tc2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter field time constant (Te). Typical Value = 1.2. Default: nullptr */ - CIMPP::Seconds tf; /* Rate feedback time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf1; /* Feedback lead time constant (Tf1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf2; /* Feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tp; /* Field current Bridge time constant (Tp). Typical Value = 0. Default: nullptr */ - CIMPP::PU vcmax; /* Maximum compounding voltage (Vcmax). Typical Value = 0. Default: nullptr */ - CIMPP::PU vfmax; /* Maximum Exciter Field Current (Vfmax). Typical Value = 47. Default: nullptr */ - CIMPP::PU vfmin; /* Minimum Exciter Field Current (Vfmin). Typical Value = -20. Default: nullptr */ - CIMPP::PU vimax; /* Voltage Regulator Input Limit (Vimax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum controller output (Vrmax). Typical Value = 47. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum controller output (Vrmin). Typical Value = -20. Default: nullptr */ - CIMPP::PU xc; /* Exciter compounding reactance (Xc). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcREXS(); - virtual ~ExcREXS(); - + ~ExcREXS() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 3. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 4. Default: nullptr */ + CIMPP::ExcREXSFeedbackSignalKind fbf; /* Rate feedback signal flag (Fbf). Typical Value = fieldCurrent. Default: 0 */ + CIMPP::PU flimf; /* Limit type flag (Flimf). Typical Value = 0. Default: nullptr */ + CIMPP::PU kc; /* Rectifier regulation factor (Kc). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kd; /* Exciter regulation factor (Kd). Typical Value = 2. Default: nullptr */ + CIMPP::PU ke; /* Exciter field proportional constant (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kefd; /* Field voltage feedback gain (Kefd). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds kf; /* Rate feedback gain (Kf). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kh; /* Field voltage controller feedback gain (Kh). Typical Value = 0. Default: nullptr */ + CIMPP::PU kii; /* Field Current Regulator Integral Gain (Kii). Typical Value = 0. Default: nullptr */ + CIMPP::PU kip; /* Field Current Regulator Proportional Gain (Kip). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::PU kvi; /* Voltage Regulator Integral Gain (Kvi). Typical Value = 0. Default: nullptr */ + CIMPP::PU kvp; /* Voltage Regulator Proportional Gain (Kvp). Typical Value = 2800. Default: nullptr */ + CIMPP::PU kvphz; /* V/Hz limiter gain (Kvphz). Typical Value = 0. Default: nullptr */ + CIMPP::PU nvphz; /* Pickup speed of V/Hz limiter (Nvphz). Typical Value = 0. Default: nullptr */ + CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0.0001. Default: nullptr */ + CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0.001. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage Regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tb1; /* Lag time constant (Tb1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb2; /* Lag time constant (Tb2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc1; /* Lead time constant (Tc1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc2; /* Lead time constant (Tc2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter field time constant (Te). Typical Value = 1.2. Default: nullptr */ + CIMPP::Seconds tf; /* Rate feedback time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf1; /* Feedback lead time constant (Tf1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf2; /* Feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tp; /* Field current Bridge time constant (Tp). Typical Value = 0. Default: nullptr */ + CIMPP::PU vcmax; /* Maximum compounding voltage (Vcmax). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfmax; /* Maximum Exciter Field Current (Vfmax). Typical Value = 47. Default: nullptr */ + CIMPP::PU vfmin; /* Minimum Exciter Field Current (Vfmin). Typical Value = -20. Default: nullptr */ + CIMPP::PU vimax; /* Voltage Regulator Input Limit (Vimax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum controller output (Vrmax). Typical Value = 47. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum controller output (Vrmin). Typical Value = -20. Default: nullptr */ + CIMPP::PU xc; /* Exciter compounding reactance (Xc). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcREXS_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.cpp b/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.cpp index 9f24a10b7..de55c6691 100644 --- a/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcREXSFeedbackSignalKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcREXSFeedbackSignalKind& rop) +ExcREXSFeedbackSignalKind& ExcREXSFeedbackSignalKind::operator=(ExcREXSFeedbackSignalKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcREXSFeedbackSignalKind::operator ExcREXSFeedbackSignalKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcREXSFeedbackSignalKind::debugName[] = "ExcREXSFeedbackSignalKind"; +const char* ExcREXSFeedbackSignalKind::debugString() const +{ + return ExcREXSFeedbackSignalKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcREXSFeedbackSignalKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcREXSFeedbackSignalKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcREXSFeedbackSignalKind::fieldVoltage) + { + EnumSymbol = "fieldVoltage"; + } + if (obj.value == ExcREXSFeedbackSignalKind::fieldCurrent) + { + EnumSymbol = "fieldCurrent"; + } + if (obj.value == ExcREXSFeedbackSignalKind::outputVoltage) + { + EnumSymbol = "outputVoltage"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcREXSFeedbackSignalKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.hpp b/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.hpp index 40c3b7e29..2ca199680 100644 --- a/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcREXSFeedbackSignalKind.hpp @@ -1,25 +1,50 @@ #ifndef ExcREXSFeedbackSignalKind_H #define ExcREXSFeedbackSignalKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of rate feedback signals. */ - enum class ExcREXSFeedbackSignalKind + class ExcREXSFeedbackSignalKind { - /** - * The voltage regulator output voltage is used. It is the same as exciter field voltage. - */ - fieldVoltage, - /** - * The exciter field current is used. - */ - fieldCurrent, - /** - * The output voltage of the exciter is used. - */ - outputVoltage, + public: + enum ExcREXSFeedbackSignalKind_ENUM + { + /** + * The voltage regulator output voltage is used. It is the same as exciter field voltage. + */ + fieldVoltage, + /** + * The exciter field current is used. + */ + fieldCurrent, + /** + * The output voltage of the exciter is used. + */ + outputVoltage, + }; + + ExcREXSFeedbackSignalKind() : value(), initialized(false) {} + ExcREXSFeedbackSignalKind(ExcREXSFeedbackSignalKind_ENUM value) : value(value), initialized(true) {} + + ExcREXSFeedbackSignalKind& operator=(ExcREXSFeedbackSignalKind_ENUM rop); + operator ExcREXSFeedbackSignalKind_ENUM() const; + + ExcREXSFeedbackSignalKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcREXSFeedbackSignalKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcREXSFeedbackSignalKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcREXSFeedbackSignalKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ExcSCRX.cpp b/CGMES_2.4.15_16FEB2016/ExcSCRX.cpp index 705acd366..7f086d80e 100644 --- a/CGMES_2.4.15_16FEB2016/ExcSCRX.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcSCRX.cpp @@ -1,156 +1,164 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcSCRX.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcSCRX::ExcSCRX() {}; - ExcSCRX::~ExcSCRX() {}; +bool assign_ExcSCRX_cswitch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cswitch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_rcrfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcrfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tatb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcSCRX_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tatb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_cswitch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cswitch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_rcrfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcrfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcSCRX_factory() { - return new ExcSCRX; - } +const char ExcSCRX::debugName[] = "ExcSCRX"; +const char* ExcSCRX::debugString() const +{ + return ExcSCRX::debugName; } -void ExcSCRX::addConstructToMap(std::unordered_map& factory_map) { +void ExcSCRX::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcSCRX"), &ExcSCRX_factory)); } -void ExcSCRX::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcSCRX::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.cswitch"), &assign_ExcSCRX_cswitch)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emax"), &assign_ExcSCRX_emax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emin"), &assign_ExcSCRX_emin)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.k"), &assign_ExcSCRX_k)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.rcrfd"), &assign_ExcSCRX_rcrfd)); assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.tatb"), &assign_ExcSCRX_tatb)); assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.tb"), &assign_ExcSCRX_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.k"), &assign_ExcSCRX_k)); assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.te"), &assign_ExcSCRX_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emin"), &assign_ExcSCRX_emin)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emax"), &assign_ExcSCRX_emax)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.cswitch"), &assign_ExcSCRX_cswitch)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.rcrfd"), &assign_ExcSCRX_rcrfd)); } -void ExcSCRX::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcSCRX::debugName[] = "ExcSCRX"; -const char* ExcSCRX::debugString() +void ExcSCRX::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcSCRX::debugName; } const BaseClassDefiner ExcSCRX::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner ExcSCRX::declare() return BaseClassDefiner(ExcSCRX::addConstructToMap, ExcSCRX::addPrimitiveAssignFnsToMap, ExcSCRX::addClassAssignFnsToMap, ExcSCRX::debugName); } - +namespace CIMPP +{ + BaseClass* ExcSCRX_factory() + { + return new ExcSCRX; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcSCRX.hpp b/CGMES_2.4.15_16FEB2016/ExcSCRX.hpp index f3e9799fd..af289a605 100644 --- a/CGMES_2.4.15_16FEB2016/ExcSCRX.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcSCRX.hpp @@ -1,48 +1,49 @@ #ifndef ExcSCRX_H #define ExcSCRX_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simple excitation system model representing generic characteristics of many excitation systems; intended for use where negative field current may be a problem. */ - class ExcSCRX: public ExcitationSystemDynamics + class ExcSCRX : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). The parameter Ta is not defined explicitly. Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU k; /* Gain (K) (>0). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds te; /* Time constant of gain block (Te) (>0). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = 0. Default: nullptr */ - CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ - CIMPP::Boolean cswitch; /* Power source switch (Cswitch). true = fixed voltage of 1.0 PU false = generator terminal voltage. Default: false */ - CIMPP::Simple_Float rcrfd; /* Rc/Rfd - ratio of field discharge resistance to field winding resistance (RcRfd). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcSCRX(); - virtual ~ExcSCRX(); - + ~ExcSCRX() override; + + CIMPP::Boolean cswitch; /* Power source switch (Cswitch). true = fixed voltage of 1.0 PU false = generator terminal voltage. Default: false */ + CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ + CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = 0. Default: nullptr */ + CIMPP::PU k; /* Gain (K) (>0). Typical Value = 200. Default: nullptr */ + CIMPP::Simple_Float rcrfd; /* Rc/Rfd - ratio of field discharge resistance to field winding resistance (RcRfd). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). The parameter Ta is not defined explicitly. Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds te; /* Time constant of gain block (Te) (>0). Typical Value = 0.02. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcSCRX_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcSEXS.cpp b/CGMES_2.4.15_16FEB2016/ExcSEXS.cpp index 61ad50b9e..0877745ba 100644 --- a/CGMES_2.4.15_16FEB2016/ExcSEXS.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcSEXS.cpp @@ -1,186 +1,196 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcSEXS.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcSEXS::ExcSEXS() {}; - ExcSEXS::~ExcSEXS() {}; +bool assign_ExcSEXS_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tatb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcSEXS_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tatb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSEXS_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSEXS_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcSEXS_factory() { - return new ExcSEXS; - } + + + +const char ExcSEXS::debugName[] = "ExcSEXS"; +const char* ExcSEXS::debugString() const +{ + return ExcSEXS::debugName; } -void ExcSEXS::addConstructToMap(std::unordered_map& factory_map) { +void ExcSEXS::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcSEXS"), &ExcSEXS_factory)); } -void ExcSEXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tatb"), &assign_ExcSEXS_tatb)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tb"), &assign_ExcSEXS_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.k"), &assign_ExcSEXS_k)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.te"), &assign_ExcSEXS_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.emin"), &assign_ExcSEXS_emin)); +void ExcSEXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmax"), &assign_ExcSEXS_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmin"), &assign_ExcSEXS_efdmin)); assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.emax"), &assign_ExcSEXS_emax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.emin"), &assign_ExcSEXS_emin)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.k"), &assign_ExcSEXS_k)); assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.kc"), &assign_ExcSEXS_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tatb"), &assign_ExcSEXS_tatb)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tb"), &assign_ExcSEXS_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tc"), &assign_ExcSEXS_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmin"), &assign_ExcSEXS_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmax"), &assign_ExcSEXS_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.te"), &assign_ExcSEXS_te)); } -void ExcSEXS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcSEXS::debugName[] = "ExcSEXS"; -const char* ExcSEXS::debugString() +void ExcSEXS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcSEXS::debugName; } const BaseClassDefiner ExcSEXS::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner ExcSEXS::declare() return BaseClassDefiner(ExcSEXS::addConstructToMap, ExcSEXS::addPrimitiveAssignFnsToMap, ExcSEXS::addClassAssignFnsToMap, ExcSEXS::debugName); } - +namespace CIMPP +{ + BaseClass* ExcSEXS_factory() + { + return new ExcSEXS; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcSEXS.hpp b/CGMES_2.4.15_16FEB2016/ExcSEXS.hpp index 451a2b99a..cda7c72b1 100644 --- a/CGMES_2.4.15_16FEB2016/ExcSEXS.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcSEXS.hpp @@ -1,49 +1,50 @@ #ifndef ExcSEXS_H #define ExcSEXS_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified Excitation System Model. */ - class ExcSEXS: public ExcitationSystemDynamics + class ExcSEXS : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU k; /* Gain (K) (>0). Typical Value = 100. Default: nullptr */ - CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -5. Default: nullptr */ - CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ - CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::PU efdmin; /* Field voltage clipping minimum limit (Efdmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU efdmax; /* Field voltage clipping maximum limit (Efdmax). Typical Value = 5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcSEXS(); - virtual ~ExcSEXS(); - + ~ExcSEXS() override; + + CIMPP::PU efdmax; /* Field voltage clipping maximum limit (Efdmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU efdmin; /* Field voltage clipping minimum limit (Efdmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ + CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -5. Default: nullptr */ + CIMPP::PU k; /* Gain (K) (>0). Typical Value = 100. Default: nullptr */ + CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 0.08. Default: nullptr */ + CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcSEXS_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcSK.cpp b/CGMES_2.4.15_16FEB2016/ExcSK.cpp index a3a3b9fd3..8c9d63df5 100644 --- a/CGMES_2.4.15_16FEB2016/ExcSK.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcSK.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcSK.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -38,438 +42,471 @@ using namespace CIMPP; ExcSK::ExcSK() {}; - ExcSK::~ExcSK() {}; +bool assign_ExcSK_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kgob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kgob; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kqi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kqob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqob; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kqp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_nq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_qconoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qconoff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_qz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qz; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_remote(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->remote; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_sbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_uimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_uimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_urmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->urmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_urmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->urmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_vtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_yp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcSK_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kgob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kgob; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kqi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kqob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqob; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kqp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_nq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_qconoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qconoff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_qz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qz; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_remote(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->remote; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_sbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_uimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_uimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_urmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->urmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_urmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->urmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_vtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_yp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcSK_factory() { - return new ExcSK; - } + + + + + + + + + + + + + + + + + + + + + + + + + + +const char ExcSK::debugName[] = "ExcSK"; +const char* ExcSK::debugString() const +{ + return ExcSK::debugName; } -void ExcSK::addConstructToMap(std::unordered_map& factory_map) { +void ExcSK::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcSK"), &ExcSK_factory)); } -void ExcSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcSK.efdmax"), &assign_ExcSK_efdmax)); assign_map.insert(std::make_pair(std::string("cim:ExcSK.efdmin"), &assign_ExcSK_efdmin)); assign_map.insert(std::make_pair(std::string("cim:ExcSK.emax"), &assign_ExcSK_emax)); @@ -504,13 +541,8 @@ void ExcSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcSK::debugName[] = "ExcSK"; -const char* ExcSK::debugString() +void ExcSK::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcSK::debugName; } const BaseClassDefiner ExcSK::declare() @@ -518,4 +550,10 @@ const BaseClassDefiner ExcSK::declare() return BaseClassDefiner(ExcSK::addConstructToMap, ExcSK::addPrimitiveAssignFnsToMap, ExcSK::addClassAssignFnsToMap, ExcSK::debugName); } - +namespace CIMPP +{ + BaseClass* ExcSK_factory() + { + return new ExcSK; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcSK.hpp b/CGMES_2.4.15_16FEB2016/ExcSK.hpp index 6595ff1c7..663fb7330 100644 --- a/CGMES_2.4.15_16FEB2016/ExcSK.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcSK.hpp @@ -1,72 +1,73 @@ #ifndef ExcSK_H #define ExcSK_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" -#include "Boolean.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ApparentPower.hpp" +#include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Slovakian Excitation System Model. UEL and secondary voltage control are included in this model. When this model is used, there cannot be a separate underexcitation limiter or VAr controller model. */ - class ExcSK: public ExcitationSystemDynamics + class ExcSK : public ExcitationSystemDynamics { - public: - CIMPP::PU efdmax; /* Field voltage clipping limit (Efdmax). Default: nullptr */ - CIMPP::PU efdmin; /* Field voltage clipping limit (Efdmin). Default: nullptr */ - CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 20. Default: nullptr */ - CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -20. Default: nullptr */ - CIMPP::PU k; /* Gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU k1; /* Parameter of underexcitation limit (K1). Typical Value = 0.1364. Default: nullptr */ - CIMPP::PU k2; /* Parameter of underexcitation limit (K2). Typical Value = -0.3861. Default: nullptr */ - CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 70. Default: nullptr */ - CIMPP::PU kce; /* Rectifier regulation factor (Kce). Typical Value = 0. Default: nullptr */ - CIMPP::PU kd; /* Exciter internal reactance (Kd). Typical Value = 0. Default: nullptr */ - CIMPP::PU kgob; /* P controller gain (Kgob). Typical Value = 10. Default: nullptr */ - CIMPP::PU kp; /* PI controller gain (Kp). Typical Value = 1. Default: nullptr */ - CIMPP::PU kqi; /* PI controller gain of integral component (Kqi). Typical Value = 0. Default: nullptr */ - CIMPP::PU kqob; /* Rate of rise of the reactive power (Kqob). Default: nullptr */ - CIMPP::PU kqp; /* PI controller gain (Kqp). Typical Value = 0. Default: nullptr */ - CIMPP::PU nq; /* Dead band of reactive power (nq). Determines the range of sensitivity. Typical Value = 0.001. Default: nullptr */ - CIMPP::Boolean qconoff; /* Secondary voltage control state (Qc_on_off). true = secondary voltage control is ON false = secondary voltage control is OFF. Typical Value = false. Default: false */ - CIMPP::PU qz; /* Desired value (setpoint) of reactive power, manual setting (Qz). Default: nullptr */ - CIMPP::Boolean remote; /* Selector to apply automatic calculation in secondary controller model. true = automatic calculation is activated false = manual set is active; the use of desired value of reactive power (Qz) is required. Typical Value = true. Default: false */ - CIMPP::ApparentPower sbase; /* Apparent power of the unit (Sbase). Unit = MVA. Typical Value = 259. Default: nullptr */ - CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 8. Default: nullptr */ - CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ti; /* PI controller phase lead time constant (Ti). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tr; /* Voltage transducer time constant (Tr). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU uimax; /* Maximum error (Uimax). Typical Value = 10. Default: nullptr */ - CIMPP::PU uimin; /* Minimum error (UImin). Typical Value = -10. Default: nullptr */ - CIMPP::PU urmax; /* Maximum controller output (URmax). Typical Value = 10. Default: nullptr */ - CIMPP::PU urmin; /* Minimum controller output (URmin). Typical Value = -10. Default: nullptr */ - CIMPP::PU vtmax; /* Maximum terminal voltage input (Vtmax). Determines the range of voltage dead band. Typical Value = 1.05. Default: nullptr */ - CIMPP::PU vtmin; /* Minimum terminal voltage input (Vtmin). Determines the range of voltage dead band. Typical Value = 0.95. Default: nullptr */ - CIMPP::PU yp; /* Maximum output (Yp). Minimum output = 0. Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcSK(); - virtual ~ExcSK(); - + ~ExcSK() override; + + CIMPP::PU efdmax; /* Field voltage clipping limit (Efdmax). Default: nullptr */ + CIMPP::PU efdmin; /* Field voltage clipping limit (Efdmin). Default: nullptr */ + CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 20. Default: nullptr */ + CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -20. Default: nullptr */ + CIMPP::PU k; /* Gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU k1; /* Parameter of underexcitation limit (K1). Typical Value = 0.1364. Default: nullptr */ + CIMPP::PU k2; /* Parameter of underexcitation limit (K2). Typical Value = -0.3861. Default: nullptr */ + CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 70. Default: nullptr */ + CIMPP::PU kce; /* Rectifier regulation factor (Kce). Typical Value = 0. Default: nullptr */ + CIMPP::PU kd; /* Exciter internal reactance (Kd). Typical Value = 0. Default: nullptr */ + CIMPP::PU kgob; /* P controller gain (Kgob). Typical Value = 10. Default: nullptr */ + CIMPP::PU kp; /* PI controller gain (Kp). Typical Value = 1. Default: nullptr */ + CIMPP::PU kqi; /* PI controller gain of integral component (Kqi). Typical Value = 0. Default: nullptr */ + CIMPP::PU kqob; /* Rate of rise of the reactive power (Kqob). Default: nullptr */ + CIMPP::PU kqp; /* PI controller gain (Kqp). Typical Value = 0. Default: nullptr */ + CIMPP::PU nq; /* Dead band of reactive power (nq). Determines the range of sensitivity. Typical Value = 0.001. Default: nullptr */ + CIMPP::Boolean qconoff; /* Secondary voltage control state (Qc_on_off). true = secondary voltage control is ON false = secondary voltage control is OFF. Typical Value = false. Default: false */ + CIMPP::PU qz; /* Desired value (setpoint) of reactive power, manual setting (Qz). Default: nullptr */ + CIMPP::Boolean remote; /* Selector to apply automatic calculation in secondary controller model. true = automatic calculation is activated false = manual set is active; the use of desired value of reactive power (Qz) is required. Typical Value = true. Default: false */ + CIMPP::ApparentPower sbase; /* Apparent power of the unit (Sbase). Unit = MVA. Typical Value = 259. Default: nullptr */ + CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 8. Default: nullptr */ + CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ti; /* PI controller phase lead time constant (Ti). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tr; /* Voltage transducer time constant (Tr). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU uimax; /* Maximum error (Uimax). Typical Value = 10. Default: nullptr */ + CIMPP::PU uimin; /* Minimum error (UImin). Typical Value = -10. Default: nullptr */ + CIMPP::PU urmax; /* Maximum controller output (URmax). Typical Value = 10. Default: nullptr */ + CIMPP::PU urmin; /* Minimum controller output (URmin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vtmax; /* Maximum terminal voltage input (Vtmax). Determines the range of voltage dead band. Typical Value = 1.05. Default: nullptr */ + CIMPP::PU vtmin; /* Minimum terminal voltage input (Vtmin). Determines the range of voltage dead band. Typical Value = 0.95. Default: nullptr */ + CIMPP::PU yp; /* Maximum output (Yp). Minimum output = 0. Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcSK_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST1A.cpp b/CGMES_2.4.15_16FEB2016/ExcST1A.cpp index deae1a179..cfc5dfec5 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST1A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST1A.cpp @@ -1,20 +1,24 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -24,283 +28,297 @@ using namespace CIMPP; ExcST1A::ExcST1A() {}; - ExcST1A::~ExcST1A() {}; +bool assign_ExcST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST1A_factory() { - return new ExcST1A; - } +const char ExcST1A::debugName[] = "ExcST1A"; +const char* ExcST1A::debugString() const +{ + return ExcST1A::debugName; } -void ExcST1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcST1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST1A"), &ExcST1A_factory)); } -void ExcST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimax"), &assign_ExcST1A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimin"), &assign_ExcST1A_vimin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc"), &assign_ExcST1A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tb"), &assign_ExcST1A_tb)); +void ExcST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ilr"), &assign_ExcST1A_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ka"), &assign_ExcST1A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ta"), &assign_ExcST1A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmax"), &assign_ExcST1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmin"), &assign_ExcST1A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.kc"), &assign_ExcST1A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.kf"), &assign_ExcST1A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tf"), &assign_ExcST1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc1"), &assign_ExcST1A_tc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.klr"), &assign_ExcST1A_klr)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ta"), &assign_ExcST1A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tb"), &assign_ExcST1A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tb1"), &assign_ExcST1A_tb1)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc"), &assign_ExcST1A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc1"), &assign_ExcST1A_tc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tf"), &assign_ExcST1A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vamax"), &assign_ExcST1A_vamax)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vamin"), &assign_ExcST1A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ilr"), &assign_ExcST1A_ilr)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.klr"), &assign_ExcST1A_klr)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimax"), &assign_ExcST1A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimin"), &assign_ExcST1A_vimin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmax"), &assign_ExcST1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmin"), &assign_ExcST1A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.xe"), &assign_ExcST1A_xe)); } -void ExcST1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST1A::debugName[] = "ExcST1A"; -const char* ExcST1A::debugString() +void ExcST1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST1A::debugName; } const BaseClassDefiner ExcST1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcST1A::declare() return BaseClassDefiner(ExcST1A::addConstructToMap, ExcST1A::addPrimitiveAssignFnsToMap, ExcST1A::addClassAssignFnsToMap, ExcST1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST1A_factory() + { + return new ExcST1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST1A.hpp b/CGMES_2.4.15_16FEB2016/ExcST1A.hpp index af4b3396c..f1d6e87f1 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST1A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST1A.hpp @@ -1,56 +1,57 @@ #ifndef ExcST1A_H #define ExcST1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modification of an old IEEE ST1A static excitation system without overexcitation limiter (OEL) and underexcitation limiter (UEL). */ - class ExcST1A: public ExcitationSystemDynamics + class ExcST1A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 999. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -999. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 190. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 7.8. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -6.7. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tc1; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb1; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 999. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -999. Default: nullptr */ - CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 0. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limiter gain (Klr). Typical Value = 0. Default: nullptr */ - CIMPP::PU xe; /* Excitation xfmr effective reactance (Xe). Typical Value = 0.04. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST1A(); - virtual ~ExcST1A(); - + ~ExcST1A() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 190. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limiter gain (Klr). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tb1; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tc1; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 999. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -999. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 999. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -999. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 7.8. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -6.7. Default: nullptr */ + CIMPP::PU xe; /* Excitation xfmr effective reactance (Xe). Typical Value = 0.04. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST2A.cpp b/CGMES_2.4.15_16FEB2016/ExcST2A.cpp index 28477a5d5..8ca08167e 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST2A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST2A.cpp @@ -1,261 +1,276 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST2A.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcST2A::ExcST2A() {}; - ExcST2A::~ExcST2A() {}; +bool assign_ExcST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST2A_factory() { - return new ExcST2A; - } +const char ExcST2A::debugName[] = "ExcST2A"; +const char* ExcST2A::debugString() const +{ + return ExcST2A::debugName; } -void ExcST2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcST2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST2A"), &ExcST2A_factory)); } -void ExcST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.efdmax"), &assign_ExcST2A_efdmax)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ka"), &assign_ExcST2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ta"), &assign_ExcST2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmax"), &assign_ExcST2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmin"), &assign_ExcST2A_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kc"), &assign_ExcST2A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ke"), &assign_ExcST2A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.te"), &assign_ExcST2A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kf"), &assign_ExcST2A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tf"), &assign_ExcST2A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kp"), &assign_ExcST2A_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ki"), &assign_ExcST2A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kc"), &assign_ExcST2A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.efdmax"), &assign_ExcST2A_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.uelin"), &assign_ExcST2A_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kp"), &assign_ExcST2A_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ta"), &assign_ExcST2A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tb"), &assign_ExcST2A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tc"), &assign_ExcST2A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.te"), &assign_ExcST2A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tf"), &assign_ExcST2A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.uelin"), &assign_ExcST2A_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmax"), &assign_ExcST2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmin"), &assign_ExcST2A_vrmin)); } -void ExcST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST2A::debugName[] = "ExcST2A"; -const char* ExcST2A::debugString() +void ExcST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST2A::debugName; } const BaseClassDefiner ExcST2A::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner ExcST2A::declare() return BaseClassDefiner(ExcST2A::addConstructToMap, ExcST2A::addPrimitiveAssignFnsToMap, ExcST2A::addClassAssignFnsToMap, ExcST2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST2A_factory() + { + return new ExcST2A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST2A.hpp b/CGMES_2.4.15_16FEB2016/ExcST2A.hpp index 35be34d96..6b8f5aa82 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST2A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST2A.hpp @@ -1,54 +1,55 @@ #ifndef ExcST2A_H #define ExcST2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE ST2A static excitation system - another lead-lag block added to match the model defined by WECC. */ - class ExcST2A: public ExcitationSystemDynamics + class ExcST2A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 120. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -1. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.7. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.88. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 8. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.82. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum field voltage (Efdmax). Typical Value = 99. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = false. Default: false */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST2A(); - virtual ~ExcST2A(); - + ~ExcST2A() override; + + CIMPP::PU efdmax; /* Maximum field voltage (Efdmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 120. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.82. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 8. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.88. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.7. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = false. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST2A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST3A.cpp b/CGMES_2.4.15_16FEB2016/ExcST3A.cpp index a343ec35e..3c0cddb9b 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST3A.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST3A.cpp @@ -1,20 +1,24 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST3A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "AngleDegrees.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -26,311 +30,327 @@ using namespace CIMPP; ExcST3A::ExcST3A() {}; - ExcST3A::~ExcST3A() {}; +bool assign_ExcST3A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kj; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vgmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kj; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vgmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST3A_factory() { - return new ExcST3A; - } +const char ExcST3A::debugName[] = "ExcST3A"; +const char* ExcST3A::debugString() const +{ + return ExcST3A::debugName; } -void ExcST3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcST3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST3A"), &ExcST3A_factory)); } -void ExcST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimax"), &assign_ExcST3A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimin"), &assign_ExcST3A_vimin)); +void ExcST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.efdmax"), &assign_ExcST3A_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kc"), &assign_ExcST3A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kg"), &assign_ExcST3A_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ki"), &assign_ExcST3A_ki)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kj"), &assign_ExcST3A_kj)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.km"), &assign_ExcST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kp"), &assign_ExcST3A_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks"), &assign_ExcST3A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks1"), &assign_ExcST3A_ks1)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.tb"), &assign_ExcST3A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.tc"), &assign_ExcST3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.efdmax"), &assign_ExcST3A_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.km"), &assign_ExcST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.thetap"), &assign_ExcST3A_thetap)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.tm"), &assign_ExcST3A_tm)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vbmax"), &assign_ExcST3A_vbmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vgmax"), &assign_ExcST3A_vgmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimax"), &assign_ExcST3A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimin"), &assign_ExcST3A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vrmax"), &assign_ExcST3A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vrmin"), &assign_ExcST3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kg"), &assign_ExcST3A_kg)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kp"), &assign_ExcST3A_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.thetap"), &assign_ExcST3A_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ki"), &assign_ExcST3A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kc"), &assign_ExcST3A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.xl"), &assign_ExcST3A_xl)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vbmax"), &assign_ExcST3A_vbmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vgmax"), &assign_ExcST3A_vgmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks"), &assign_ExcST3A_ks)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks1"), &assign_ExcST3A_ks1)); } -void ExcST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST3A::debugName[] = "ExcST3A"; -const char* ExcST3A::debugString() +void ExcST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST3A::debugName; } const BaseClassDefiner ExcST3A::declare() @@ -338,4 +358,10 @@ const BaseClassDefiner ExcST3A::declare() return BaseClassDefiner(ExcST3A::addConstructToMap, ExcST3A::addPrimitiveAssignFnsToMap, ExcST3A::addClassAssignFnsToMap, ExcST3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST3A_factory() + { + return new ExcST3A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST3A.hpp b/CGMES_2.4.15_16FEB2016/ExcST3A.hpp index e239148d3..23856c5c5 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST3A.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST3A.hpp @@ -1,59 +1,60 @@ #ifndef ExcST3A_H #define ExcST3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE ST3A static excitation system with added speed multiplier. */ - class ExcST3A: public ExcitationSystemDynamics + class ExcST3A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -0.2. Default: nullptr */ - CIMPP::PU kj; /* AVR gain (Kj). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 6.67. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum AVR output (Efdmax). Typical Value = 6.9. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 7.04. Default: nullptr */ - CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (Tm). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ - CIMPP::PU kp; /* Potential source gain (Kp) (>0). Typical Value = 4.37. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 20. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.09. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 8.63. Default: nullptr */ - CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 6.53. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks1; /* Coefficient to allow different usage of the model-speed coefficient (Ks1). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST3A(); - virtual ~ExcST3A(); - + ~ExcST3A() override; + + CIMPP::PU efdmax; /* Maximum AVR output (Efdmax). Typical Value = 6.9. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ + CIMPP::PU kj; /* AVR gain (Kj). Typical Value = 200. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 7.04. Default: nullptr */ + CIMPP::PU kp; /* Potential source gain (Kp) (>0). Typical Value = 4.37. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::PU ks1; /* Coefficient to allow different usage of the model-speed coefficient (Ks1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 6.67. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 20. Default: nullptr */ + CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (Tm). Typical Value = 1. Default: nullptr */ + CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 8.63. Default: nullptr */ + CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 6.53. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -0.2. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.09. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST3A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST4B.cpp b/CGMES_2.4.15_16FEB2016/ExcST4B.cpp index 4a148e627..ad7d7540d 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST4B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST4B.cpp @@ -1,321 +1,340 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST4B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Seconds.hpp" +#include "AngleDegrees.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcST4B::ExcST4B() {}; - ExcST4B::~ExcST4B() {}; +bool assign_ExcST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lvgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_uel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uel; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vgmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vgmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_uel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uel; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lvgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST4B_factory() { - return new ExcST4B; - } +const char ExcST4B::debugName[] = "ExcST4B"; +const char* ExcST4B::debugString() const +{ + return ExcST4B::debugName; } -void ExcST4B::addConstructToMap(std::unordered_map& factory_map) { +void ExcST4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST4B"), &ExcST4B_factory)); } -void ExcST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpr"), &assign_ExcST4B_kpr)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kir"), &assign_ExcST4B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ta"), &assign_ExcST4B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmax"), &assign_ExcST4B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmin"), &assign_ExcST4B_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpm"), &assign_ExcST4B_kpm)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kim"), &assign_ExcST4B_kim)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmax"), &assign_ExcST4B_vmmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmin"), &assign_ExcST4B_vmmin)); +void ExcST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kc"), &assign_ExcST4B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kg"), &assign_ExcST4B_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ki"), &assign_ExcST4B_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kim"), &assign_ExcST4B_kim)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kir"), &assign_ExcST4B_kir)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kp"), &assign_ExcST4B_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpm"), &assign_ExcST4B_kpm)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpr"), &assign_ExcST4B_kpr)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.lvgate"), &assign_ExcST4B_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ta"), &assign_ExcST4B_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.thetap"), &assign_ExcST4B_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ki"), &assign_ExcST4B_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kc"), &assign_ExcST4B_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.xl"), &assign_ExcST4B_xl)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.uel"), &assign_ExcST4B_uel)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vbmax"), &assign_ExcST4B_vbmax)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vgmax"), &assign_ExcST4B_vgmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.uel"), &assign_ExcST4B_uel)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.lvgate"), &assign_ExcST4B_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmax"), &assign_ExcST4B_vmmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmin"), &assign_ExcST4B_vmmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmax"), &assign_ExcST4B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmin"), &assign_ExcST4B_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.xl"), &assign_ExcST4B_xl)); } -void ExcST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST4B::debugName[] = "ExcST4B"; -const char* ExcST4B::debugString() +void ExcST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST4B::debugName; } const BaseClassDefiner ExcST4B::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcST4B::declare() return BaseClassDefiner(ExcST4B::addConstructToMap, ExcST4B::addPrimitiveAssignFnsToMap, ExcST4B::addClassAssignFnsToMap, ExcST4B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST4B_factory() + { + return new ExcST4B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST4B.hpp b/CGMES_2.4.15_16FEB2016/ExcST4B.hpp index 77de87f47..a1f945fde 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST4B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST4B.hpp @@ -1,59 +1,60 @@ #ifndef ExcST4B_H #define ExcST4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE ST4B static excitation system with maximum inner loop feedback gain . */ - class ExcST4B: public ExcitationSystemDynamics + class ExcST4B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 10.75. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 10.75. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU kpm; /* Voltage regulator proportional gain output (Kpm). Typical Value = 1. Default: nullptr */ - CIMPP::PU kim; /* Voltage regulator integral gain output (Kim). Typical Value = 0. Default: nullptr */ - CIMPP::PU vmmax; /* Maximum inner loop output (Vmmax). Typical Value = 99. Default: nullptr */ - CIMPP::PU vmmin; /* Minimum inner loop output (Vmmin). Typical Value = -99. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 9.3. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.113. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.124. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 11.63. Default: nullptr */ - CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 5.8. Default: nullptr */ - CIMPP::Boolean uel; /* Selector (Uel). true = UEL is part of block diagram false = UEL is not part of block diagram. Typical Value = false. Default: false */ - CIMPP::Boolean lvgate; /* Selector (LVgate). true = LVgate is part of the block diagram false = LVgate is not part of the block diagram. Typical Value = false. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST4B(); - virtual ~ExcST4B(); - + ~ExcST4B() override; + + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.113. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 0. Default: nullptr */ + CIMPP::PU kim; /* Voltage regulator integral gain output (Kim). Typical Value = 0. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 10.75. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 9.3. Default: nullptr */ + CIMPP::PU kpm; /* Voltage regulator proportional gain output (Kpm). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 10.75. Default: nullptr */ + CIMPP::Boolean lvgate; /* Selector (LVgate). true = LVgate is part of the block diagram false = LVgate is not part of the block diagram. Typical Value = false. Default: false */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean uel; /* Selector (Uel). true = UEL is part of block diagram false = UEL is not part of block diagram. Typical Value = false. Default: false */ + CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 11.63. Default: nullptr */ + CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 5.8. Default: nullptr */ + CIMPP::PU vmmax; /* Maximum inner loop output (Vmmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU vmmin; /* Minimum inner loop output (Vmmin). Typical Value = -99. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.124. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST4B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST6B.cpp b/CGMES_2.4.15_16FEB2016/ExcST6B.cpp index 8cc7852af..29ef119cf 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST6B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST6B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST6B.hpp" +#include +#include + #include "PU.hpp" #include "Boolean.hpp" #include "PU.hpp" @@ -29,321 +33,345 @@ using namespace CIMPP; ExcST6B::ExcST6B() {}; - ExcST6B::~ExcST6B() {}; +bool assign_ExcST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_tvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vilim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vilim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmult; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_tvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vilim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vilim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmult; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST6B_factory() { - return new ExcST6B; - } +const char ExcST6B::debugName[] = "ExcST6B"; +const char* ExcST6B::debugString() const +{ + return ExcST6B::debugName; } -void ExcST6B::addConstructToMap(std::unordered_map& factory_map) { +void ExcST6B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST6B"), &ExcST6B_factory)); } -void ExcST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcST6B.ilr"), &assign_ExcST6B_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcST6B.k1"), &assign_ExcST6B_k1)); assign_map.insert(std::make_pair(std::string("cim:ExcST6B.kcl"), &assign_ExcST6B_kcl)); @@ -369,13 +397,8 @@ void ExcST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST6B::debugName[] = "ExcST6B"; -const char* ExcST6B::debugString() +void ExcST6B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST6B::debugName; } const BaseClassDefiner ExcST6B::declare() @@ -383,4 +406,10 @@ const BaseClassDefiner ExcST6B::declare() return BaseClassDefiner(ExcST6B::addConstructToMap, ExcST6B::addPrimitiveAssignFnsToMap, ExcST6B::addClassAssignFnsToMap, ExcST6B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST6B_factory() + { + return new ExcST6B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST6B.hpp b/CGMES_2.4.15_16FEB2016/ExcST6B.hpp index e7c799981..2f218adba 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST6B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST6B.hpp @@ -1,63 +1,64 @@ #ifndef ExcST6B_H #define ExcST6B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "ExcST6BOELselectorKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE ST6B static excitation system with PID controller and optional inner feedbacks loop. */ - class ExcST6B: public ExcitationSystemDynamics + class ExcST6B : public ExcitationSystemDynamics { - public: - CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 4.164. Default: nullptr */ - CIMPP::Boolean k1; /* Selector (K1). true = feedback is from Ifd false = feedback is not from Ifd. Typical Value = true. Default: false */ - CIMPP::PU kcl; /* Exciter output current limit adjustment (Kcl). Typical Value = 1.0577. Default: nullptr */ - CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (Kff). Typical Value = 1. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 45.094. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limit adjustment (Kcl). Typical Value = 17.33. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 18.038. Default: nullptr */ - CIMPP::PU kvd; /* Voltage regulator derivative gain (Kvd). Typical Value = 0. Default: nullptr */ - CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tvd; /* Voltage regulator derivative gain (Tvd). Typical Value = 0. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -3.85. Default: nullptr */ - CIMPP::Boolean vilim; /* Selector (Vilim). true = Vimin-Vimax limiter is active false = Vimin-Vimax limiter is not active. Typical Value = true. Default: false */ - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ - CIMPP::Boolean vmult; /* Selector (Vmult). true = multiply regulator output by terminal voltage false = do not multiply regulator output by terminal voltage. Typical Value = true. Default: false */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -3.85. Default: nullptr */ - CIMPP::PU xc; /* Excitation source reactance (Xc). Typical Value = 0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST6B(); - virtual ~ExcST6B(); - + ~ExcST6B() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 4.164. Default: nullptr */ + CIMPP::Boolean k1; /* Selector (K1). true = feedback is from Ifd false = feedback is not from Ifd. Typical Value = true. Default: false */ + CIMPP::PU kcl; /* Exciter output current limit adjustment (Kcl). Typical Value = 1.0577. Default: nullptr */ + CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (Kff). Typical Value = 1. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 45.094. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limit adjustment (Kcl). Typical Value = 17.33. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 18.038. Default: nullptr */ + CIMPP::PU kvd; /* Voltage regulator derivative gain (Kvd). Typical Value = 0. Default: nullptr */ + CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tvd; /* Voltage regulator derivative gain (Tvd). Typical Value = 0. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -3.85. Default: nullptr */ + CIMPP::Boolean vilim; /* Selector (Vilim). true = Vimin-Vimax limiter is active false = Vimin-Vimax limiter is not active. Typical Value = true. Default: false */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ + CIMPP::Boolean vmult; /* Selector (Vmult). true = multiply regulator output by terminal voltage false = do not multiply regulator output by terminal voltage. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -3.85. Default: nullptr */ + CIMPP::PU xc; /* Excitation source reactance (Xc). Typical Value = 0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST6B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.cpp b/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.cpp index ed4095208..4a1e0d921 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST6BOELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcST6BOELselectorKind& rop) +ExcST6BOELselectorKind& ExcST6BOELselectorKind::operator=(ExcST6BOELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcST6BOELselectorKind::operator ExcST6BOELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcST6BOELselectorKind::debugName[] = "ExcST6BOELselectorKind"; +const char* ExcST6BOELselectorKind::debugString() const +{ + return ExcST6BOELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcST6BOELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcST6BOELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcST6BOELselectorKind::noOELinput) + { + EnumSymbol = "noOELinput"; + } + if (obj.value == ExcST6BOELselectorKind::beforeUEL) + { + EnumSymbol = "beforeUEL"; + } + if (obj.value == ExcST6BOELselectorKind::afterUEL) + { + EnumSymbol = "afterUEL"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcST6BOELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.hpp b/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.hpp index 0b6f498ff..b30b3b8df 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST6BOELselectorKind.hpp @@ -1,25 +1,50 @@ #ifndef ExcST6BOELselectorKind_H #define ExcST6BOELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the OEL input used for static excitation systems type 6B. */ - enum class ExcST6BOELselectorKind + class ExcST6BOELselectorKind { - /** - * No OEL input is used. - */ - noOELinput, - /** - * The connection is before UEL. - */ - beforeUEL, - /** - * The connection is after UEL. - */ - afterUEL, + public: + enum ExcST6BOELselectorKind_ENUM + { + /** + * No OEL input is used. + */ + noOELinput, + /** + * The connection is before UEL. + */ + beforeUEL, + /** + * The connection is after UEL. + */ + afterUEL, + }; + + ExcST6BOELselectorKind() : value(), initialized(false) {} + ExcST6BOELselectorKind(ExcST6BOELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcST6BOELselectorKind& operator=(ExcST6BOELselectorKind_ENUM rop); + operator ExcST6BOELselectorKind_ENUM() const; + + ExcST6BOELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcST6BOELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcST6BOELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcST6BOELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ExcST7B.cpp b/CGMES_2.4.15_16FEB2016/ExcST7B.cpp index 81e1a08cf..37e50539b 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST7B.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST7B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST7B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -22,230 +26,247 @@ using namespace CIMPP; ExcST7B::ExcST7B() {}; - ExcST7B::~ExcST7B() {}; +bool assign_ExcST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST7B_factory() { - return new ExcST7B; - } +const char ExcST7B::debugName[] = "ExcST7B"; +const char* ExcST7B::debugString() const +{ + return ExcST7B::debugName; } -void ExcST7B::addConstructToMap(std::unordered_map& factory_map) { +void ExcST7B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST7B"), &ExcST7B_factory)); } -void ExcST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcST7B.kh"), &assign_ExcST7B_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcST7B.kia"), &assign_ExcST7B_kia)); assign_map.insert(std::make_pair(std::string("cim:ExcST7B.kl"), &assign_ExcST7B_kl)); @@ -264,13 +285,8 @@ void ExcST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST7B::debugName[] = "ExcST7B"; -const char* ExcST7B::debugString() +void ExcST7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST7B::debugName; } const BaseClassDefiner ExcST7B::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcST7B::declare() return BaseClassDefiner(ExcST7B::addConstructToMap, ExcST7B::addPrimitiveAssignFnsToMap, ExcST7B::addClassAssignFnsToMap, ExcST7B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST7B_factory() + { + return new ExcST7B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST7B.hpp b/CGMES_2.4.15_16FEB2016/ExcST7B.hpp index 143a34cc1..50f30bca5 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST7B.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST7B.hpp @@ -1,56 +1,57 @@ #ifndef ExcST7B_H #define ExcST7B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcST7BOELselectorKind.hpp" -#include "Seconds.hpp" #include "ExcST7BUELselectorKind.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE ST7B static excitation system without stator current limiter (SCL) and current compensator (DROOP) inputs. */ - class ExcST7B: public ExcitationSystemDynamics + class ExcST7B : public ExcitationSystemDynamics { - public: - CIMPP::PU kh; /* High-value gate feedback gain (Kh). Typical Value = 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl; /* Low-value gate feedback gain (Kl). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 40. Default: nullptr */ - CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tb; /* Regulator lag time constant (Tb). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tc; /* Regulator lead time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tia; /* Feedback time constant (Tia). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ - CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ - CIMPP::PU vmax; /* Maximum voltage reference signal (Vmax). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum voltage reference signal (Vmin). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST7B(); - virtual ~ExcST7B(); - + ~ExcST7B() override; + + CIMPP::PU kh; /* High-value gate feedback gain (Kh). Typical Value = 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl; /* Low-value gate feedback gain (Kl). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 40. Default: nullptr */ + CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tb; /* Regulator lag time constant (Tb). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tc; /* Regulator lead time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tia; /* Feedback time constant (Tia). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ + CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ + CIMPP::PU vmax; /* Maximum voltage reference signal (Vmax). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum voltage reference signal (Vmin). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST7B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.cpp b/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.cpp index c0dac0ada..d400a7859 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST7BOELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BOELselectorKind& rop) +ExcST7BOELselectorKind& ExcST7BOELselectorKind::operator=(ExcST7BOELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcST7BOELselectorKind::operator ExcST7BOELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcST7BOELselectorKind::debugName[] = "ExcST7BOELselectorKind"; +const char* ExcST7BOELselectorKind::debugString() const +{ + return ExcST7BOELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcST7BOELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcST7BOELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcST7BOELselectorKind::noOELinput) + { + EnumSymbol = "noOELinput"; + } + if (obj.value == ExcST7BOELselectorKind::addVref) + { + EnumSymbol = "addVref"; + } + if (obj.value == ExcST7BOELselectorKind::inputLVgate) + { + EnumSymbol = "inputLVgate"; + } + if (obj.value == ExcST7BOELselectorKind::outputLVgate) + { + EnumSymbol = "outputLVgate"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcST7BOELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.hpp b/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.hpp index 24b2f3c6f..66d97cdae 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST7BOELselectorKind.hpp @@ -1,29 +1,54 @@ #ifndef ExcST7BOELselectorKind_H #define ExcST7BOELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the OEL input used for static excitation systems type 7B. */ - enum class ExcST7BOELselectorKind + class ExcST7BOELselectorKind { - /** - * No OEL input is used. - */ - noOELinput, - /** - * The signal is added to Vref. - */ - addVref, - /** - * The signal is connected in the input of the LV gate. - */ - inputLVgate, - /** - * The signal is connected in the output of the LV gate. - */ - outputLVgate, + public: + enum ExcST7BOELselectorKind_ENUM + { + /** + * No OEL input is used. + */ + noOELinput, + /** + * The signal is added to Vref. + */ + addVref, + /** + * The signal is connected in the input of the LV gate. + */ + inputLVgate, + /** + * The signal is connected in the output of the LV gate. + */ + outputLVgate, + }; + + ExcST7BOELselectorKind() : value(), initialized(false) {} + ExcST7BOELselectorKind(ExcST7BOELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcST7BOELselectorKind& operator=(ExcST7BOELselectorKind_ENUM rop); + operator ExcST7BOELselectorKind_ENUM() const; + + ExcST7BOELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcST7BOELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcST7BOELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BOELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.cpp b/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.cpp index a49cd137b..2260a4e4d 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST7BUELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BUELselectorKind& rop) +ExcST7BUELselectorKind& ExcST7BUELselectorKind::operator=(ExcST7BUELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcST7BUELselectorKind::operator ExcST7BUELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcST7BUELselectorKind::debugName[] = "ExcST7BUELselectorKind"; +const char* ExcST7BUELselectorKind::debugString() const +{ + return ExcST7BUELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcST7BUELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcST7BUELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcST7BUELselectorKind::noUELinput) + { + EnumSymbol = "noUELinput"; + } + if (obj.value == ExcST7BUELselectorKind::addVref) + { + EnumSymbol = "addVref"; + } + if (obj.value == ExcST7BUELselectorKind::inputHVgate) + { + EnumSymbol = "inputHVgate"; + } + if (obj.value == ExcST7BUELselectorKind::outputHVgate) + { + EnumSymbol = "outputHVgate"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcST7BUELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.hpp b/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.hpp index a00014985..b509d7dad 100644 --- a/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcST7BUELselectorKind.hpp @@ -1,29 +1,54 @@ #ifndef ExcST7BUELselectorKind_H #define ExcST7BUELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the UEL input used for static excitation systems type 7B. */ - enum class ExcST7BUELselectorKind + class ExcST7BUELselectorKind { - /** - * No UEL input is used. - */ - noUELinput, - /** - * The signal is added to Vref. - */ - addVref, - /** - * The signal is connected in the input of the HV gate. - */ - inputHVgate, - /** - * The signal is connected in the output of the HV gate. - */ - outputHVgate, + public: + enum ExcST7BUELselectorKind_ENUM + { + /** + * No UEL input is used. + */ + noUELinput, + /** + * The signal is added to Vref. + */ + addVref, + /** + * The signal is connected in the input of the HV gate. + */ + inputHVgate, + /** + * The signal is connected in the output of the HV gate. + */ + outputHVgate, + }; + + ExcST7BUELselectorKind() : value(), initialized(false) {} + ExcST7BUELselectorKind(ExcST7BUELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcST7BUELselectorKind& operator=(ExcST7BUELselectorKind_ENUM rop); + operator ExcST7BUELselectorKind_ENUM() const; + + ExcST7BUELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcST7BUELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcST7BUELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BUELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.cpp b/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.cpp index 9abe66f1b..806190c25 100644 --- a/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.cpp @@ -1,133 +1,196 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcitationSystemDynamics.hpp" -#include "SynchronousMachineDynamics.hpp" -#include "PowerSystemStabilizerDynamics.hpp" -#include "PFVArControllerType1Dynamics.hpp" -#include "VoltageCompensatorDynamics.hpp" +#include +#include + #include "DiscontinuousExcitationControlDynamics.hpp" -#include "UnderexcitationLimiterDynamics.hpp" -#include "PFVArControllerType2Dynamics.hpp" #include "OverexcitationLimiterDynamics.hpp" +#include "PFVArControllerType1Dynamics.hpp" +#include "PFVArControllerType2Dynamics.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "SynchronousMachineDynamics.hpp" +#include "UnderexcitationLimiterDynamics.hpp" +#include "VoltageCompensatorDynamics.hpp" using namespace CIMPP; -ExcitationSystemDynamics::ExcitationSystemDynamics(): SynchronousMachineDynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), PFVArControllerType1Dynamics(nullptr), VoltageCompensatorDynamics(nullptr), DiscontinuousExcitationControlDynamics(nullptr), UnderexcitationLimiterDynamics(nullptr), PFVArControllerType2Dynamics(nullptr), OverexcitationLimiterDynamics(nullptr) {}; - +ExcitationSystemDynamics::ExcitationSystemDynamics() : DiscontinuousExcitationControlDynamics(nullptr), OverexcitationLimiterDynamics(nullptr), PFVArControllerType1Dynamics(nullptr), PFVArControllerType2Dynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), SynchronousMachineDynamics(nullptr), UnderexcitationLimiterDynamics(nullptr), VoltageCompensatorDynamics(nullptr) {}; ExcitationSystemDynamics::~ExcitationSystemDynamics() {}; -bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); -bool assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemStabilizerDynamics = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemStabilizerDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1Dynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageCompensatorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->VoltageCompensatorDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscontinuousExcitationControlDynamics = dynamic_cast(BaseClass_ptr2); - if(element->DiscontinuousExcitationControlDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->UnderexcitationLimiterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->UnderexcitationLimiterDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType2Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType2Dynamics != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->OverexcitationLimiterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->OverexcitationLimiterDynamics != nullptr) - return true; - } - return false; -} +bool assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + DiscontinuousExcitationControlDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscontinuousExcitationControlDynamics != element2) + { + element->DiscontinuousExcitationControlDynamics = element2; + return assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + OverexcitationLimiterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OverexcitationLimiterDynamics != element2) + { + element->OverexcitationLimiterDynamics = element2; + return assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1Dynamics != element2) + { + element->PFVArControllerType1Dynamics = element2; + return assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType2Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType2Dynamics != element2) + { + element->PFVArControllerType2Dynamics = element2; + return assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + PowerSystemStabilizerDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemStabilizerDynamics != element2) + { + element->PowerSystemStabilizerDynamics = element2; + return assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + UnderexcitationLimiterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->UnderexcitationLimiterDynamics != element2) + { + element->UnderexcitationLimiterDynamics = element2; + return assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* ExcitationSystemDynamics_factory() { - return new ExcitationSystemDynamics; +bool assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageCompensatorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageCompensatorDynamics != element2) + { + element->VoltageCompensatorDynamics = element2; + return assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ExcitationSystemDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics"), &ExcitationSystemDynamics_factory)); +const char ExcitationSystemDynamics::debugName[] = "ExcitationSystemDynamics"; +const char* ExcitationSystemDynamics::debugString() const +{ + return ExcitationSystemDynamics::debugName; } -void ExcitationSystemDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ExcitationSystemDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics"), &ExcitationSystemDynamics_factory)); +} -void ExcitationSystemDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.SynchronousMachineDynamics"), &assign_ExcitationSystemDynamics_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PowerSystemStabilizerDynamics"), &assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType1Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.VoltageCompensatorDynamics"), &assign_ExcitationSystemDynamics_VoltageCompensatorDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.DiscontinuousExcitationControlDynamics"), &assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.UnderexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType2Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.OverexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics)); +void ExcitationSystemDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ExcitationSystemDynamics::debugName[] = "ExcitationSystemDynamics"; -const char* ExcitationSystemDynamics::debugString() +void ExcitationSystemDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcitationSystemDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.DiscontinuousExcitationControlDynamics"), &assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.OverexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType1Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType2Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PowerSystemStabilizerDynamics"), &assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.SynchronousMachineDynamics"), &assign_ExcitationSystemDynamics_SynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.UnderexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.VoltageCompensatorDynamics"), &assign_ExcitationSystemDynamics_VoltageCompensatorDynamics)); } const BaseClassDefiner ExcitationSystemDynamics::declare() @@ -135,4 +198,10 @@ const BaseClassDefiner ExcitationSystemDynamics::declare() return BaseClassDefiner(ExcitationSystemDynamics::addConstructToMap, ExcitationSystemDynamics::addPrimitiveAssignFnsToMap, ExcitationSystemDynamics::addClassAssignFnsToMap, ExcitationSystemDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* ExcitationSystemDynamics_factory() + { + return new ExcitationSystemDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.hpp b/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.hpp index 2a08820cf..c4896aed2 100644 --- a/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcitationSystemDynamics.hpp @@ -1,52 +1,53 @@ #ifndef ExcitationSystemDynamics_H #define ExcitationSystemDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { +#include +#include +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" + +namespace CIMPP +{ + class DiscontinuousExcitationControlDynamics; + class OverexcitationLimiterDynamics; + class PFVArControllerType1Dynamics; + class PFVArControllerType2Dynamics; + class PowerSystemStabilizerDynamics; + class SynchronousMachineDynamics; + class UnderexcitationLimiterDynamics; + class VoltageCompensatorDynamics; -class SynchronousMachineDynamics; -class PowerSystemStabilizerDynamics; -class PFVArControllerType1Dynamics; -class VoltageCompensatorDynamics; -class DiscontinuousExcitationControlDynamics; -class UnderexcitationLimiterDynamics; -class PFVArControllerType2Dynamics; -class OverexcitationLimiterDynamics; /* Excitation system function block whose behavior is described by reference to a standard model */ - class ExcitationSystemDynamics: public DynamicsFunctionBlock + class ExcitationSystemDynamics : public DynamicsFunctionBlock { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this excitation system model is associated. Default: 0 */ - CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model associated with this excitation system model. Default: 0 */ - CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model associated with this excitation system model. Default: 0 */ - CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model associated with this excitation system model. Default: 0 */ - CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model associated with this excitation system model. Default: 0 */ - CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Undrexcitation limiter model associated with this excitation system model. Default: 0 */ - CIMPP::PFVArControllerType2Dynamics* PFVArControllerType2Dynamics; /* Power Factor or VAr controller Type II model associated with this excitation system model. Default: 0 */ - CIMPP::OverexcitationLimiterDynamics* OverexcitationLimiterDynamics; /* Overexcitation limiter model associated with this excitation system model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcitationSystemDynamics(); - virtual ~ExcitationSystemDynamics(); - + ~ExcitationSystemDynamics() override; + + CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model associated with this excitation system model. Default: 0 */ + CIMPP::OverexcitationLimiterDynamics* OverexcitationLimiterDynamics; /* Overexcitation limiter model associated with this excitation system model. Default: 0 */ + CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model associated with this excitation system model. Default: 0 */ + CIMPP::PFVArControllerType2Dynamics* PFVArControllerType2Dynamics; /* Power Factor or VAr controller Type II model associated with this excitation system model. Default: 0 */ + CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model associated with this excitation system model. Default: 0 */ + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this excitation system model is associated. Default: 0 */ + CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Undrexcitation limiter model associated with this excitation system model. Default: 0 */ + CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model associated with this excitation system model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcitationSystemDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.cpp b/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.cpp index 43d197da0..463b994b9 100644 --- a/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcitationSystemUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; ExcitationSystemUserDefined::ExcitationSystemUserDefined() {}; - ExcitationSystemUserDefined::~ExcitationSystemUserDefined() {}; -bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ExcitationSystemUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_ExcitationSystemUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass*, BaseClass*); +bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ExcitationSystemUserDefined_factory() { - return new ExcitationSystemUserDefined; - } +const char ExcitationSystemUserDefined::debugName[] = "ExcitationSystemUserDefined"; +const char* ExcitationSystemUserDefined::debugString() const +{ + return ExcitationSystemUserDefined::debugName; } -void ExcitationSystemUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void ExcitationSystemUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined"), &ExcitationSystemUserDefined_factory)); } -void ExcitationSystemUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcitationSystemUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined.proprietary"), &assign_ExcitationSystemUserDefined_proprietary)); - } - -void ExcitationSystemUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined.ProprietaryParameterDynamics"), &assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics)); } -const char ExcitationSystemUserDefined::debugName[] = "ExcitationSystemUserDefined"; -const char* ExcitationSystemUserDefined::debugString() +void ExcitationSystemUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcitationSystemUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined.ProprietaryParameterDynamics"), &assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner ExcitationSystemUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner ExcitationSystemUserDefined::declare() return BaseClassDefiner(ExcitationSystemUserDefined::addConstructToMap, ExcitationSystemUserDefined::addPrimitiveAssignFnsToMap, ExcitationSystemUserDefined::addClassAssignFnsToMap, ExcitationSystemUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* ExcitationSystemUserDefined_factory() + { + return new ExcitationSystemUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.hpp b/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.hpp index 9340f681e..ed84868ea 100644 --- a/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/ExcitationSystemUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef ExcitationSystemUserDefined_H #define ExcitationSystemUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Excitation system function block whose dynamic behaviour is described by */ - class ExcitationSystemUserDefined: public ExcitationSystemDynamics + class ExcitationSystemUserDefined : public ExcitationSystemDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcitationSystemUserDefined(); - virtual ~ExcitationSystemUserDefined(); - + ~ExcitationSystemUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcitationSystemUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.cpp b/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.cpp index 477a7c2c4..52ba55b11 100644 --- a/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.cpp +++ b/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.cpp @@ -1,303 +1,324 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExternalNetworkInjection.hpp" +#include +#include + #include "ActivePowerPerFrequency.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "CurrentFlow.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "Integer.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" +#include "Integer.hpp" +#include "PU.hpp" using namespace CIMPP; -ExternalNetworkInjection::ExternalNetworkInjection(): governorSCD(nullptr) {}; - +ExternalNetworkInjection::ExternalNetworkInjection() {}; ExternalNetworkInjection::~ExternalNetworkInjection() {}; -bool assign_ExternalNetworkInjection_governorSCD(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - element->governorSCD = dynamic_cast(BaseClass_ptr2); - if(element->governorSCD != nullptr) - return true; - } - return false; +bool assign_ExternalNetworkInjection_governorSCD(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorSCD; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ExternalNetworkInjection_ikSecond(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ikSecond; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxInitialSymShCCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxR0ToX0Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxR1ToX1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxZ0ToZ1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minInitialSymShCCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minR0ToX0Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minR1ToX1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minZ0ToZ1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->referencePriority; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_voltageFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageFactor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExternalNetworkInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_ikSecond(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ikSecond; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxInitialSymShCCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxR0ToX0Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxR1ToX1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxZ0ToZ1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minInitialSymShCCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minR0ToX0Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minR1ToX1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minZ0ToZ1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_voltageFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageFactor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->referencePriority; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExternalNetworkInjection_factory() { - return new ExternalNetworkInjection; - } +const char ExternalNetworkInjection::debugName[] = "ExternalNetworkInjection"; +const char* ExternalNetworkInjection::debugString() const +{ + return ExternalNetworkInjection::debugName; } -void ExternalNetworkInjection::addConstructToMap(std::unordered_map& factory_map) { +void ExternalNetworkInjection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection"), &ExternalNetworkInjection_factory)); } -void ExternalNetworkInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxP"), &assign_ExternalNetworkInjection_maxP)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxQ"), &assign_ExternalNetworkInjection_maxQ)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minP"), &assign_ExternalNetworkInjection_minP)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minQ"), &assign_ExternalNetworkInjection_minQ)); +void ExternalNetworkInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.governorSCD"), &assign_ExternalNetworkInjection_governorSCD)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.ikSecond"), &assign_ExternalNetworkInjection_ikSecond)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxInitialSymShCCurrent"), &assign_ExternalNetworkInjection_maxInitialSymShCCurrent)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxP"), &assign_ExternalNetworkInjection_maxP)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxQ"), &assign_ExternalNetworkInjection_maxQ)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxR0ToX0Ratio"), &assign_ExternalNetworkInjection_maxR0ToX0Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxR1ToX1Ratio"), &assign_ExternalNetworkInjection_maxR1ToX1Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxZ0ToZ1Ratio"), &assign_ExternalNetworkInjection_maxZ0ToZ1Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minInitialSymShCCurrent"), &assign_ExternalNetworkInjection_minInitialSymShCCurrent)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minP"), &assign_ExternalNetworkInjection_minP)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minQ"), &assign_ExternalNetworkInjection_minQ)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minR0ToX0Ratio"), &assign_ExternalNetworkInjection_minR0ToX0Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minR1ToX1Ratio"), &assign_ExternalNetworkInjection_minR1ToX1Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minZ0ToZ1Ratio"), &assign_ExternalNetworkInjection_minZ0ToZ1Ratio)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.voltageFactor"), &assign_ExternalNetworkInjection_voltageFactor)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.referencePriority"), &assign_ExternalNetworkInjection_referencePriority)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.p"), &assign_ExternalNetworkInjection_p)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.q"), &assign_ExternalNetworkInjection_q)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.referencePriority"), &assign_ExternalNetworkInjection_referencePriority)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.voltageFactor"), &assign_ExternalNetworkInjection_voltageFactor)); } -void ExternalNetworkInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.governorSCD"), &assign_ExternalNetworkInjection_governorSCD)); - } - -const char ExternalNetworkInjection::debugName[] = "ExternalNetworkInjection"; -const char* ExternalNetworkInjection::debugString() +void ExternalNetworkInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExternalNetworkInjection::debugName; } const BaseClassDefiner ExternalNetworkInjection::declare() @@ -305,4 +326,10 @@ const BaseClassDefiner ExternalNetworkInjection::declare() return BaseClassDefiner(ExternalNetworkInjection::addConstructToMap, ExternalNetworkInjection::addPrimitiveAssignFnsToMap, ExternalNetworkInjection::addClassAssignFnsToMap, ExternalNetworkInjection::debugName); } - +namespace CIMPP +{ + BaseClass* ExternalNetworkInjection_factory() + { + return new ExternalNetworkInjection; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.hpp b/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.hpp index 7f8cf11c3..8fc781a70 100644 --- a/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.hpp +++ b/CGMES_2.4.15_16FEB2016/ExternalNetworkInjection.hpp @@ -1,62 +1,63 @@ #ifndef ExternalNetworkInjection_H #define ExternalNetworkInjection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "ReactivePower.hpp" +#include "ActivePowerPerFrequency.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" #include "Integer.hpp" +#include "PU.hpp" +#include "ReactivePower.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ -class ActivePowerPerFrequency; /* This class represents external network and it is used for IEC 60909 calculations. */ - class ExternalNetworkInjection: public RegulatingCondEq + class ExternalNetworkInjection : public RegulatingCondEq { - public: - CIMPP::ActivePowerPerFrequency* governorSCD; /* Power Frequency Bias. This is the change in power injection divided by the change in frequency and negated. A positive value of the power frequency bias provides additional power injection upon a drop in frequency. Default: nullptr */ - CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower maxQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ - CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower minQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ - CIMPP::Boolean ikSecond; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Default: false */ - CIMPP::CurrentFlow maxInitialSymShCCurrent; /* Maximum initial symmetrical short-circuit currents (Ik` max) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float maxR0ToX0Ratio; /* Maximum ratio of zero sequence resistance of Network Feeder to its zero sequence reactance (R(0)/X(0) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float maxR1ToX1Ratio; /* Maximum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float maxZ0ToZ1Ratio; /* Maximum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::CurrentFlow minInitialSymShCCurrent; /* Minimum initial symmetrical short-circuit currents (Ik` min) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float minR0ToX0Ratio; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Used for short circuit data exchange according to IEC 6090 Default: nullptr */ - CIMPP::Simple_Float minR1ToX1Ratio; /* Minimum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float minZ0ToZ1Ratio; /* Minimum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::PU voltageFactor; /* Voltage factor in pu, which was used to calculate short-circuit current Ik` and power Sk`. Default: nullptr */ - CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ - CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExternalNetworkInjection(); - virtual ~ExternalNetworkInjection(); - + ~ExternalNetworkInjection() override; + + CIMPP::ActivePowerPerFrequency governorSCD; /* Power Frequency Bias. This is the change in power injection divided by the change in frequency and negated. A positive value of the power frequency bias provides additional power injection upon a drop in frequency. Default: nullptr */ + CIMPP::Boolean ikSecond; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Default: false */ + CIMPP::CurrentFlow maxInitialSymShCCurrent; /* Maximum initial symmetrical short-circuit currents (Ik` max) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower maxQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ + CIMPP::Simple_Float maxR0ToX0Ratio; /* Maximum ratio of zero sequence resistance of Network Feeder to its zero sequence reactance (R(0)/X(0) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float maxR1ToX1Ratio; /* Maximum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float maxZ0ToZ1Ratio; /* Maximum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::CurrentFlow minInitialSymShCCurrent; /* Minimum initial symmetrical short-circuit currents (Ik` min) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower minQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ + CIMPP::Simple_Float minR0ToX0Ratio; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Used for short circuit data exchange according to IEC 6090 Default: nullptr */ + CIMPP::Simple_Float minR1ToX1Ratio; /* Minimum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float minZ0ToZ1Ratio; /* Minimum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ + CIMPP::PU voltageFactor; /* Voltage factor in pu, which was used to calculate short-circuit current Ik` and power Sk`. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExternalNetworkInjection_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Float.cpp b/CGMES_2.4.15_16FEB2016/Float.cpp new file mode 100644 index 000000000..04c13ae6e --- /dev/null +++ b/CGMES_2.4.15_16FEB2016/Float.cpp @@ -0,0 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ +#include "Float.hpp" + +#include + +#include "../src/CIMExceptions.hpp" + +using namespace CIMPP; + +Float& Float::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} + +Float::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Float::debugName[] = "Float"; +const char* Float::debugString() const +{ + return Float::debugName; +} + +Float& Float::operator+=(const Float& rhs) +{ + value += rhs.value; + return *this; +} + +Float& Float::operator-=(const Float& rhs) +{ + value -= rhs.value; + return *this; +} + +Float& Float::operator*=(const Float& rhs) +{ + value *= rhs.value; + return *this; +} + +Float& Float::operator/=(const Float& rhs) +{ + value /= rhs.value; + return *this; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Float& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + + std::ostream& operator<<(std::ostream& os, const Float& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Float.hpp b/CGMES_2.4.15_16FEB2016/Float.hpp new file mode 100644 index 000000000..ede68d395 --- /dev/null +++ b/CGMES_2.4.15_16FEB2016/Float.hpp @@ -0,0 +1,39 @@ +#ifndef Float_H +#define Float_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + +#include +#include + +namespace CIMPP +{ + /* + A floating point number. The range is unspecified and not limited. + */ + class Float + { + public: + Float() : value(0.0), initialized(false) {} + Float(long double value) : value(value), initialized(true) {} + + Float& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + Float& operator+=(const Float& rhs); + Float& operator-=(const Float& rhs); + Float& operator*=(const Float& rhs); + Float& operator/=(const Float& rhs); + + friend std::istream& operator>>(std::istream& lop, Float& rop); + friend std::ostream& operator<<(std::ostream& os, const Float& obj); + }; +} +#endif diff --git a/CGMES_2.4.15_16FEB2016/FossilFuel.cpp b/CGMES_2.4.15_16FEB2016/FossilFuel.cpp index de2cd0ae7..cead5d6ea 100644 --- a/CGMES_2.4.15_16FEB2016/FossilFuel.cpp +++ b/CGMES_2.4.15_16FEB2016/FossilFuel.cpp @@ -1,64 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "FossilFuel.hpp" -#include "FuelType.hpp" +#include +#include + #include "ThermalGeneratingUnit.hpp" +#include "FuelType.hpp" using namespace CIMPP; -FossilFuel::FossilFuel(): ThermalGeneratingUnit(nullptr) {}; - +FossilFuel::FossilFuel() : ThermalGeneratingUnit(nullptr) {}; FossilFuel::~FossilFuel() {}; -bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass*, BaseClass*); -bool assign_FossilFuel_ThermalGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(FossilFuel* element = dynamic_cast(BaseClass_ptr1)) { - element->ThermalGeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->ThermalGeneratingUnit != nullptr) - return assign_ThermalGeneratingUnit_FossilFuels(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_FossilFuel_fossilFuelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (FossilFuel* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fossilFuelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_FossilFuel_fossilFuelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(FossilFuel* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fossilFuelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass*, BaseClass*); +bool assign_FossilFuel_ThermalGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + FossilFuel* element = dynamic_cast(BaseClass_ptr1); + ThermalGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ThermalGeneratingUnit != element2) + { + element->ThermalGeneratingUnit = element2; + return assign_ThermalGeneratingUnit_FossilFuels(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* FossilFuel_factory() { - return new FossilFuel; - } +const char FossilFuel::debugName[] = "FossilFuel"; +const char* FossilFuel::debugString() const +{ + return FossilFuel::debugName; } -void FossilFuel::addConstructToMap(std::unordered_map& factory_map) { +void FossilFuel::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:FossilFuel"), &FossilFuel_factory)); } -void FossilFuel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void FossilFuel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:FossilFuel.fossilFuelType"), &assign_FossilFuel_fossilFuelType)); - } - -void FossilFuel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:FossilFuel.ThermalGeneratingUnit"), &assign_FossilFuel_ThermalGeneratingUnit)); } -const char FossilFuel::debugName[] = "FossilFuel"; -const char* FossilFuel::debugString() +void FossilFuel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return FossilFuel::debugName; + assign_map.insert(std::make_pair(std::string("cim:FossilFuel.ThermalGeneratingUnit"), &assign_FossilFuel_ThermalGeneratingUnit)); } const BaseClassDefiner FossilFuel::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner FossilFuel::declare() return BaseClassDefiner(FossilFuel::addConstructToMap, FossilFuel::addPrimitiveAssignFnsToMap, FossilFuel::addClassAssignFnsToMap, FossilFuel::debugName); } - +namespace CIMPP +{ + BaseClass* FossilFuel_factory() + { + return new FossilFuel; + } +} diff --git a/CGMES_2.4.15_16FEB2016/FossilFuel.hpp b/CGMES_2.4.15_16FEB2016/FossilFuel.hpp index b11d3b781..2c683ecd5 100644 --- a/CGMES_2.4.15_16FEB2016/FossilFuel.hpp +++ b/CGMES_2.4.15_16FEB2016/FossilFuel.hpp @@ -1,40 +1,41 @@ #ifndef FossilFuel_H #define FossilFuel_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "FuelType.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ThermalGeneratingUnit; - -class ThermalGeneratingUnit; /* The fossil fuel consumed by the non-nuclear thermal generating unit. For example, coal, oil, gas, etc. This a the specific fuels that the generating unit can consume. */ - class FossilFuel: public IdentifiedObject + class FossilFuel : public IdentifiedObject { - public: - CIMPP::FuelType fossilFuelType; /* The type of fossil fuel, such as coal, oil, or gas. Default: 0 */ - CIMPP::ThermalGeneratingUnit* ThermalGeneratingUnit; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ FossilFuel(); - virtual ~FossilFuel(); - + ~FossilFuel() override; + + CIMPP::ThermalGeneratingUnit* ThermalGeneratingUnit; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ + CIMPP::FuelType fossilFuelType; /* The type of fossil fuel, such as coal, oil, or gas. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* FossilFuel_factory(); diff --git a/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.cpp b/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.cpp index 4a69509a8..dd419372c 100644 --- a/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.cpp +++ b/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "FrancisGovernorControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::FrancisGovernorControlKind& rop) +FrancisGovernorControlKind& FrancisGovernorControlKind::operator=(FrancisGovernorControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +FrancisGovernorControlKind::operator FrancisGovernorControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char FrancisGovernorControlKind::debugName[] = "FrancisGovernorControlKind"; +const char* FrancisGovernorControlKind::debugString() const +{ + return FrancisGovernorControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, FrancisGovernorControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const FrancisGovernorControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == FrancisGovernorControlKind::mechanicHydrolicTachoAccelerator) + { + EnumSymbol = "mechanicHydrolicTachoAccelerator"; + } + if (obj.value == FrancisGovernorControlKind::mechanicHydraulicTransientFeedback) + { + EnumSymbol = "mechanicHydraulicTransientFeedback"; + } + if (obj.value == FrancisGovernorControlKind::electromechanicalElectrohydraulic) + { + EnumSymbol = "electromechanicalElectrohydraulic"; + } + + if (!EnumSymbol.empty()) + { + os << "FrancisGovernorControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.hpp b/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.hpp index 64f948396..a694f5429 100644 --- a/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.hpp +++ b/CGMES_2.4.15_16FEB2016/FrancisGovernorControlKind.hpp @@ -1,25 +1,50 @@ #ifndef FrancisGovernorControlKind_H #define FrancisGovernorControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Governor control flag for Francis hydro model. */ - enum class FrancisGovernorControlKind + class FrancisGovernorControlKind { - /** - * Mechanic-hydraulic regulator with tacho-accelerometer (Cflag = 1). - */ - mechanicHydrolicTachoAccelerator, - /** - * Mechanic-hydraulic regulator with transient feedback (Cflag=2). - */ - mechanicHydraulicTransientFeedback, - /** - * Electromechanical and electrohydraulic regulator (Cflag=3). - */ - electromechanicalElectrohydraulic, + public: + enum FrancisGovernorControlKind_ENUM + { + /** + * Mechanic-hydraulic regulator with tacho-accelerometer (Cflag = 1). + */ + mechanicHydrolicTachoAccelerator, + /** + * Mechanic-hydraulic regulator with transient feedback (Cflag=2). + */ + mechanicHydraulicTransientFeedback, + /** + * Electromechanical and electrohydraulic regulator (Cflag=3). + */ + electromechanicalElectrohydraulic, + }; + + FrancisGovernorControlKind() : value(), initialized(false) {} + FrancisGovernorControlKind(FrancisGovernorControlKind_ENUM value) : value(value), initialized(true) {} + + FrancisGovernorControlKind& operator=(FrancisGovernorControlKind_ENUM rop); + operator FrancisGovernorControlKind_ENUM() const; + + FrancisGovernorControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, FrancisGovernorControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const FrancisGovernorControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::FrancisGovernorControlKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/Frequency.cpp b/CGMES_2.4.15_16FEB2016/Frequency.cpp index 438b4caff..1809ef8c4 100644 --- a/CGMES_2.4.15_16FEB2016/Frequency.cpp +++ b/CGMES_2.4.15_16FEB2016/Frequency.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Frequency.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Frequency::Frequency() {} -Frequency::~Frequency(){} +#include -Frequency::Frequency(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Frequency::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Frequency::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Frequency& Frequency::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Frequency::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Frequency::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Frequency::debugName[] = "Frequency"; -const char* Frequency::debugString() { +const char* Frequency::debugString() const +{ return Frequency::debugName; } - -const BaseClassDefiner Frequency::declare() { - return BaseClassDefiner(Frequency::addConstructToMap, Frequency::addPrimitiveAssignFnsToMap, Frequency::addClassAssignFnsToMap, Frequency::debugName); +Frequency& Frequency::operator+=(const Frequency& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Frequency& Frequency::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Frequency& Frequency::operator-=(const Frequency& rhs) { - value -= rhs.value; - return *this; - } - - Frequency& Frequency::operator*=(const Frequency& rhs) { - value *= rhs.value; - return *this; - } - - Frequency& Frequency::operator/=(const Frequency& rhs) { - value /= rhs.value; - return *this; - } +Frequency& Frequency::operator-=(const Frequency& rhs) +{ + value -= rhs.value; + return *this; +} - Frequency& Frequency::operator+=(const Frequency& rhs) { - value += rhs.value; - return *this; - } +Frequency& Frequency::operator*=(const Frequency& rhs) +{ + value *= rhs.value; + return *this; +} - Frequency::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Frequency& Frequency::operator/=(const Frequency& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Frequency& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Frequency& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Frequency& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Frequency.hpp b/CGMES_2.4.15_16FEB2016/Frequency.hpp index 87cdc33c2..28f5a1022 100644 --- a/CGMES_2.4.15_16FEB2016/Frequency.hpp +++ b/CGMES_2.4.15_16FEB2016/Frequency.hpp @@ -1,38 +1,39 @@ #ifndef Frequency_H #define Frequency_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Frequency : public BaseClass + /* + Cycles per second. + */ + class Frequency { - public: - Frequency(); - virtual ~Frequency(); - Frequency(long double value); - static const BaseClassDefiner declare(); - Frequency& operator=(long double &rop); + Frequency() : value(0.0), initialized(false) {} + Frequency(long double value) : value(value), initialized(true) {} + + Frequency& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Frequency& operator+=(const Frequency& rhs); Frequency& operator-=(const Frequency& rhs); Frequency& operator*=(const Frequency& rhs); Frequency& operator/=(const Frequency& rhs); + friend std::istream& operator>>(std::istream& lop, Frequency& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Frequency& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/FuelType.cpp b/CGMES_2.4.15_16FEB2016/FuelType.cpp index 88f0d85ff..e59bf1fd4 100644 --- a/CGMES_2.4.15_16FEB2016/FuelType.cpp +++ b/CGMES_2.4.15_16FEB2016/FuelType.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "FuelType.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::FuelType& rop) +FuelType& FuelType::operator=(FuelType_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +FuelType::operator FuelType_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char FuelType::debugName[] = "FuelType"; +const char* FuelType::debugString() const +{ + return FuelType::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, FuelType& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -53,5 +84,43 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const FuelType& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == FuelType::coal) + { + EnumSymbol = "coal"; + } + if (obj.value == FuelType::oil) + { + EnumSymbol = "oil"; + } + if (obj.value == FuelType::gas) + { + EnumSymbol = "gas"; + } + if (obj.value == FuelType::lignite) + { + EnumSymbol = "lignite"; + } + if (obj.value == FuelType::hardCoal) + { + EnumSymbol = "hardCoal"; + } + if (obj.value == FuelType::oilShale) + { + EnumSymbol = "oilShale"; + } + + if (!EnumSymbol.empty()) + { + os << "FuelType." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/FuelType.hpp b/CGMES_2.4.15_16FEB2016/FuelType.hpp index e16c3d7f0..452590f12 100644 --- a/CGMES_2.4.15_16FEB2016/FuelType.hpp +++ b/CGMES_2.4.15_16FEB2016/FuelType.hpp @@ -1,37 +1,62 @@ #ifndef FuelType_H #define FuelType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of fuel. */ - enum class FuelType + class FuelType { - /** - * Generic coal, not including lignite type. - */ - coal, - /** - * Oil. - */ - oil, - /** - * Natural gas. - */ - gas, - /** - * The fuel is lignite coal. Note that this is a special type of coal, so the other enum of coal is reserved for hard coal types or if the exact type of coal is not known. - */ - lignite, - /** - * Hard coal - */ - hardCoal, - /** - * Oil Shale - */ - oilShale, + public: + enum FuelType_ENUM + { + /** + * Generic coal, not including lignite type. + */ + coal, + /** + * Oil. + */ + oil, + /** + * Natural gas. + */ + gas, + /** + * The fuel is lignite coal. Note that this is a special type of coal, so the other enum of coal is reserved for hard coal types or if the exact type of coal is not known. + */ + lignite, + /** + * Hard coal + */ + hardCoal, + /** + * Oil Shale + */ + oilShale, + }; + + FuelType() : value(), initialized(false) {} + FuelType(FuelType_ENUM value) : value(value), initialized(true) {} + + FuelType& operator=(FuelType_ENUM rop); + operator FuelType_ENUM() const; + + FuelType_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, FuelType& rop); + friend std::ostream& operator<<(std::ostream& os, const FuelType& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::FuelType& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.cpp b/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.cpp index af0535fe0..c78172e82 100644 --- a/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.cpp +++ b/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GenICompensationForGenJ.hpp" +#include +#include + #include "SynchronousMachineDynamics.hpp" #include "VCompIEEEType2.hpp" #include "PU.hpp" @@ -9,84 +13,96 @@ using namespace CIMPP; -GenICompensationForGenJ::GenICompensationForGenJ(): SynchronousMachineDynamics(nullptr), VcompIEEEType2(nullptr) {}; - +GenICompensationForGenJ::GenICompensationForGenJ() : SynchronousMachineDynamics(nullptr), VcompIEEEType2(nullptr) {}; GenICompensationForGenJ::~GenICompensationForGenJ() {}; -bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass*, BaseClass*); -bool assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass*, BaseClass*); -bool assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - element->VcompIEEEType2 = dynamic_cast(BaseClass_ptr2); - if(element->VcompIEEEType2 != nullptr) - return assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_GenICompensationForGenJ_rcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcij; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GenICompensationForGenJ_xcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xcij; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GenICompensationForGenJ_rcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcij; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass*, BaseClass*); +bool assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GenICompensationForGenJ_xcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xcij; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass*, BaseClass*); +bool assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1); + VCompIEEEType2* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VcompIEEEType2 != element2) + { + element->VcompIEEEType2 = element2; + return assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* GenICompensationForGenJ_factory() { - return new GenICompensationForGenJ; - } + + +const char GenICompensationForGenJ::debugName[] = "GenICompensationForGenJ"; +const char* GenICompensationForGenJ::debugString() const +{ + return GenICompensationForGenJ::debugName; } -void GenICompensationForGenJ::addConstructToMap(std::unordered_map& factory_map) { +void GenICompensationForGenJ::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ"), &GenICompensationForGenJ_factory)); } -void GenICompensationForGenJ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.rcij"), &assign_GenICompensationForGenJ_rcij)); +void GenICompensationForGenJ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.rcij"), &assign_GenICompensationForGenJ_rcij)); assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.xcij"), &assign_GenICompensationForGenJ_xcij)); } -void GenICompensationForGenJ::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void GenICompensationForGenJ::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.SynchronousMachineDynamics"), &assign_GenICompensationForGenJ_SynchronousMachineDynamics)); assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.VcompIEEEType2"), &assign_GenICompensationForGenJ_VcompIEEEType2)); - } - -const char GenICompensationForGenJ::debugName[] = "GenICompensationForGenJ"; -const char* GenICompensationForGenJ::debugString() -{ - return GenICompensationForGenJ::debugName; } const BaseClassDefiner GenICompensationForGenJ::declare() @@ -94,4 +110,10 @@ const BaseClassDefiner GenICompensationForGenJ::declare() return BaseClassDefiner(GenICompensationForGenJ::addConstructToMap, GenICompensationForGenJ::addPrimitiveAssignFnsToMap, GenICompensationForGenJ::addClassAssignFnsToMap, GenICompensationForGenJ::debugName); } - +namespace CIMPP +{ + BaseClass* GenICompensationForGenJ_factory() + { + return new GenICompensationForGenJ; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.hpp b/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.hpp index 46d1a5cbf..80b337103 100644 --- a/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.hpp +++ b/CGMES_2.4.15_16FEB2016/GenICompensationForGenJ.hpp @@ -1,43 +1,44 @@ #ifndef GenICompensationForGenJ_H #define GenICompensationForGenJ_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { +namespace CIMPP +{ + class SynchronousMachineDynamics; + class VCompIEEEType2; - -class SynchronousMachineDynamics; -class VCompIEEEType2; /* This class provides the resistive and reactive components of compensation for the generator associated with the IEEE Type 2 voltage compensator for current flow out of one of the other generators in the interconnection. */ - class GenICompensationForGenJ: public IdentifiedObject + class GenICompensationForGenJ : public IdentifiedObject { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Standard synchronous machine out of which current flow is being compensated for. Default: 0 */ - CIMPP::VCompIEEEType2* VcompIEEEType2; /* The standard IEEE Type 2 voltage compensator of this compensation. Default: 0 */ - CIMPP::PU rcij; /* Default: nullptr */ - CIMPP::PU xcij; /* Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GenICompensationForGenJ(); - virtual ~GenICompensationForGenJ(); - + ~GenICompensationForGenJ() override; + + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Standard synchronous machine out of which current flow is being compensated for. Default: 0 */ + CIMPP::VCompIEEEType2* VcompIEEEType2; /* The standard IEEE Type 2 voltage compensator of this compensation. Default: 0 */ + CIMPP::PU rcij; /* Default: nullptr */ + CIMPP::PU xcij; /* Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GenICompensationForGenJ_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/GeneratingUnit.cpp index e5db482f4..b89e20d52 100644 --- a/CGMES_2.4.15_16FEB2016/GeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/GeneratingUnit.cpp @@ -1,7 +1,14 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeneratingUnit.hpp" +#include +#include + +#include "ControlAreaGeneratingUnit.hpp" +#include "GrossToNetActivePowerCurve.hpp" +#include "RotatingMachine.hpp" #include "GeneratorControlSource.hpp" #include "PerCent.hpp" #include "ActivePower.hpp" @@ -10,306 +17,336 @@ #include "ActivePower.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" +#include "Simple_Float.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" #include "Simple_Float.hpp" #include "Money.hpp" -#include "Money.hpp" #include "PerCent.hpp" -#include "GrossToNetActivePowerCurve.hpp" -#include "ControlAreaGeneratingUnit.hpp" -#include "RotatingMachine.hpp" -#include "Simple_Float.hpp" +#include "Money.hpp" using namespace CIMPP; GeneratingUnit::GeneratingUnit() {}; - GeneratingUnit::~GeneratingUnit() {}; +bool assign_GeneratingUnit_genControlSource(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->genControlSource; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_governorSCD(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorSCD; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_initialP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->initialP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_longPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->longPF; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_maxOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxOperatingP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_maximumAllowableSpinningReserve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maximumAllowableSpinningReserve; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_minOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minOperatingP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_nominalP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_normalPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalPF; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_ratedGrossMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedGrossMaxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_ratedGrossMinP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedGrossMinP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_ratedNetMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedNetMaxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->GrossToNetActivePowerCurves.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_GeneratingUnit_shortPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->shortPF; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ControlAreaGeneratingUnit.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_GeneratingUnit_startupCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->startupCost; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_GeneratingUnit_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RotatingMachine.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_GeneratingUnit_totalEfficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->totalEfficiency; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_GeneratingUnit_variableCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->variableCost; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeneratingUnit_genControlSource(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->genControlSource; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass*, BaseClass*); +bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + ControlAreaGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ControlAreaGeneratingUnit.begin(), element->ControlAreaGeneratingUnit.end(), element2) == element->ControlAreaGeneratingUnit.end()) + { + element->ControlAreaGeneratingUnit.push_back(element2); + return assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GeneratingUnit_governorSCD(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->governorSCD; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass*, BaseClass*); +bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + GrossToNetActivePowerCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->GrossToNetActivePowerCurves.begin(), element->GrossToNetActivePowerCurves.end(), element2) == element->GrossToNetActivePowerCurves.end()) + { + element->GrossToNetActivePowerCurves.push_back(element2); + return assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GeneratingUnit_initialP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->initialP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RotatingMachine_GeneratingUnit(BaseClass*, BaseClass*); +bool assign_GeneratingUnit_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + RotatingMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RotatingMachine.begin(), element->RotatingMachine.end(), element2) == element->RotatingMachine.end()) + { + element->RotatingMachine.push_back(element2); + return assign_RotatingMachine_GeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GeneratingUnit_longPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->longPF; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_maximumAllowableSpinningReserve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maximumAllowableSpinningReserve; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_maxOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxOperatingP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_minOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minOperatingP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_nominalP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_ratedGrossMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedGrossMaxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_ratedGrossMinP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedGrossMinP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_ratedNetMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedNetMaxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_shortPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->shortPF; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_startupCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->startupCost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_variableCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->variableCost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_totalEfficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->totalEfficiency; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_normalPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalPF; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GeneratingUnit_factory() { - return new GeneratingUnit; - } +const char GeneratingUnit::debugName[] = "GeneratingUnit"; +const char* GeneratingUnit::debugString() const +{ + return GeneratingUnit::debugName; } -void GeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void GeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GeneratingUnit"), &GeneratingUnit_factory)); } -void GeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.genControlSource"), &assign_GeneratingUnit_genControlSource)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.governorSCD"), &assign_GeneratingUnit_governorSCD)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.initialP"), &assign_GeneratingUnit_initialP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.longPF"), &assign_GeneratingUnit_longPF)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.maximumAllowableSpinningReserve"), &assign_GeneratingUnit_maximumAllowableSpinningReserve)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.maxOperatingP"), &assign_GeneratingUnit_maxOperatingP)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.maximumAllowableSpinningReserve"), &assign_GeneratingUnit_maximumAllowableSpinningReserve)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.minOperatingP"), &assign_GeneratingUnit_minOperatingP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.nominalP"), &assign_GeneratingUnit_nominalP)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.normalPF"), &assign_GeneratingUnit_normalPF)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ratedGrossMaxP"), &assign_GeneratingUnit_ratedGrossMaxP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ratedGrossMinP"), &assign_GeneratingUnit_ratedGrossMinP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ratedNetMaxP"), &assign_GeneratingUnit_ratedNetMaxP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.shortPF"), &assign_GeneratingUnit_shortPF)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.startupCost"), &assign_GeneratingUnit_startupCost)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.variableCost"), &assign_GeneratingUnit_variableCost)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.totalEfficiency"), &assign_GeneratingUnit_totalEfficiency)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.normalPF"), &assign_GeneratingUnit_normalPF)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.variableCost"), &assign_GeneratingUnit_variableCost)); } -void GeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.GrossToNetActivePowerCurves"), &assign_GeneratingUnit_GrossToNetActivePowerCurves)); +void GeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ControlAreaGeneratingUnit"), &assign_GeneratingUnit_ControlAreaGeneratingUnit)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.GrossToNetActivePowerCurves"), &assign_GeneratingUnit_GrossToNetActivePowerCurves)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.RotatingMachine"), &assign_GeneratingUnit_RotatingMachine)); - } - -const char GeneratingUnit::debugName[] = "GeneratingUnit"; -const char* GeneratingUnit::debugString() -{ - return GeneratingUnit::debugName; } const BaseClassDefiner GeneratingUnit::declare() @@ -317,4 +354,10 @@ const BaseClassDefiner GeneratingUnit::declare() return BaseClassDefiner(GeneratingUnit::addConstructToMap, GeneratingUnit::addPrimitiveAssignFnsToMap, GeneratingUnit::addClassAssignFnsToMap, GeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* GeneratingUnit_factory() + { + return new GeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/GeneratingUnit.hpp index b4aabe4e5..b2e844024 100644 --- a/CGMES_2.4.15_16FEB2016/GeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/GeneratingUnit.hpp @@ -1,63 +1,64 @@ #ifndef GeneratingUnit_H #define GeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +#include "ActivePower.hpp" #include "GeneratorControlSource.hpp" +#include "Money.hpp" #include "PerCent.hpp" -#include "ActivePower.hpp" #include "Simple_Float.hpp" -#include "Money.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class ControlAreaGeneratingUnit; + class GrossToNetActivePowerCurve; + class RotatingMachine; -class GrossToNetActivePowerCurve; -class ControlAreaGeneratingUnit; -class RotatingMachine; /* A single or set of synchronous machines for converting mechanical power into alternating-current power. For example, individual machines within a set may be defined for scheduling purposes while a single control signal is derived for the set. In this case there would be a GeneratingUnit for each member of the set and an additional GeneratingUnit corresponding to the set. */ - class GeneratingUnit: public Equipment + class GeneratingUnit : public Equipment { - public: - CIMPP::GeneratorControlSource genControlSource; /* The source of controls for a generating unit. Default: 0 */ - CIMPP::PerCent governorSCD; /* Governor Speed Changer Droop. This is the change in generator power output divided by the change in frequency normalized by the nominal power of the generator and the nominal frequency and expressed in percent and negated. A positive value of speed change droop provides additional generator output upon a drop in frequency. Default: nullptr */ - CIMPP::ActivePower initialP; /* Default initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration. Default: nullptr */ - CIMPP::Simple_Float longPF; /* Generating unit long term economic participation factor. Default: nullptr */ - CIMPP::ActivePower maximumAllowableSpinningReserve; /* Maximum allowable spinning reserve. Spinning reserve will never be considered greater than this value regardless of the current operating point. Default: nullptr */ - CIMPP::ActivePower maxOperatingP; /* This is the maximum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ - CIMPP::ActivePower minOperatingP; /* This is the minimum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ - CIMPP::ActivePower nominalP; /* The nominal power of the generating unit. Used to give precise meaning to percentage based attributes such as the governor speed change droop (governorSCD attribute). The attribute shall be a positive value equal or less than RotatingMachine.ratedS. Default: nullptr */ - CIMPP::ActivePower ratedGrossMaxP; /* The unit`s gross rated maximum capacity (book value). Default: nullptr */ - CIMPP::ActivePower ratedGrossMinP; /* The gross rated minimum generation level which the unit can safely operate at while delivering power to the transmission grid. Default: nullptr */ - CIMPP::ActivePower ratedNetMaxP; /* The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity. Default: nullptr */ - CIMPP::Simple_Float shortPF; /* Generating unit short term economic participation factor. Default: nullptr */ - CIMPP::Money startupCost; /* The initial startup cost incurred for each start of the GeneratingUnit. Default: nullptr */ - CIMPP::Money variableCost; /* The variable cost component of production per unit of ActivePower. Default: nullptr */ - CIMPP::PerCent totalEfficiency; /* The efficiency of the unit in converting the fuel into electrical energy. Default: nullptr */ - std::list GrossToNetActivePowerCurves; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ - std::list ControlAreaGeneratingUnit; /* ControlArea specifications for this generating unit. Default: 0 */ - std::list RotatingMachine; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ - CIMPP::Simple_Float normalPF; /* Generating unit economic participation factor. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GeneratingUnit(); - virtual ~GeneratingUnit(); - + ~GeneratingUnit() override; + + std::list ControlAreaGeneratingUnit; /* ControlArea specifications for this generating unit. Default: 0 */ + std::list GrossToNetActivePowerCurves; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ + std::list RotatingMachine; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ + CIMPP::GeneratorControlSource genControlSource; /* The source of controls for a generating unit. Default: 0 */ + CIMPP::PerCent governorSCD; /* Governor Speed Changer Droop. This is the change in generator power output divided by the change in frequency normalized by the nominal power of the generator and the nominal frequency and expressed in percent and negated. A positive value of speed change droop provides additional generator output upon a drop in frequency. Default: nullptr */ + CIMPP::ActivePower initialP; /* Default initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration. Default: nullptr */ + CIMPP::Simple_Float longPF; /* Generating unit long term economic participation factor. Default: nullptr */ + CIMPP::ActivePower maxOperatingP; /* This is the maximum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ + CIMPP::ActivePower maximumAllowableSpinningReserve; /* Maximum allowable spinning reserve. Spinning reserve will never be considered greater than this value regardless of the current operating point. Default: nullptr */ + CIMPP::ActivePower minOperatingP; /* This is the minimum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ + CIMPP::ActivePower nominalP; /* The nominal power of the generating unit. Used to give precise meaning to percentage based attributes such as the governor speed change droop (governorSCD attribute). The attribute shall be a positive value equal or less than RotatingMachine.ratedS. Default: nullptr */ + CIMPP::Simple_Float normalPF; /* Generating unit economic participation factor. Default: nullptr */ + CIMPP::ActivePower ratedGrossMaxP; /* The unit`s gross rated maximum capacity (book value). Default: nullptr */ + CIMPP::ActivePower ratedGrossMinP; /* The gross rated minimum generation level which the unit can safely operate at while delivering power to the transmission grid. Default: nullptr */ + CIMPP::ActivePower ratedNetMaxP; /* The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity. Default: nullptr */ + CIMPP::Simple_Float shortPF; /* Generating unit short term economic participation factor. Default: nullptr */ + CIMPP::Money startupCost; /* The initial startup cost incurred for each start of the GeneratingUnit. Default: nullptr */ + CIMPP::PerCent totalEfficiency; /* The efficiency of the unit in converting the fuel into electrical energy. Default: nullptr */ + CIMPP::Money variableCost; /* The variable cost component of production per unit of ActivePower. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GeneratorControlSource.cpp b/CGMES_2.4.15_16FEB2016/GeneratorControlSource.cpp index 2b7450967..1850d2514 100644 --- a/CGMES_2.4.15_16FEB2016/GeneratorControlSource.cpp +++ b/CGMES_2.4.15_16FEB2016/GeneratorControlSource.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeneratorControlSource.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::GeneratorControlSource& rop) +GeneratorControlSource& GeneratorControlSource::operator=(GeneratorControlSource_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +GeneratorControlSource::operator GeneratorControlSource_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char GeneratorControlSource::debugName[] = "GeneratorControlSource"; +const char* GeneratorControlSource::debugString() const +{ + return GeneratorControlSource::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, GeneratorControlSource& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const GeneratorControlSource& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == GeneratorControlSource::unavailable) + { + EnumSymbol = "unavailable"; + } + if (obj.value == GeneratorControlSource::offAGC) + { + EnumSymbol = "offAGC"; + } + if (obj.value == GeneratorControlSource::onAGC) + { + EnumSymbol = "onAGC"; + } + if (obj.value == GeneratorControlSource::plantControl) + { + EnumSymbol = "plantControl"; + } + + if (!EnumSymbol.empty()) + { + os << "GeneratorControlSource." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GeneratorControlSource.hpp b/CGMES_2.4.15_16FEB2016/GeneratorControlSource.hpp index 55e1fbf59..463a53ab3 100644 --- a/CGMES_2.4.15_16FEB2016/GeneratorControlSource.hpp +++ b/CGMES_2.4.15_16FEB2016/GeneratorControlSource.hpp @@ -1,29 +1,54 @@ #ifndef GeneratorControlSource_H #define GeneratorControlSource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The source of controls for a generating unit. */ - enum class GeneratorControlSource + class GeneratorControlSource { - /** - * Not available. - */ - unavailable, - /** - * Off of automatic generation control (AGC). - */ - offAGC, - /** - * On automatic generation control (AGC). - */ - onAGC, - /** - * Plant is controlling. - */ - plantControl, + public: + enum GeneratorControlSource_ENUM + { + /** + * Not available. + */ + unavailable, + /** + * Off of automatic generation control (AGC). + */ + offAGC, + /** + * On automatic generation control (AGC). + */ + onAGC, + /** + * Plant is controlling. + */ + plantControl, + }; + + GeneratorControlSource() : value(), initialized(false) {} + GeneratorControlSource(GeneratorControlSource_ENUM value) : value(value), initialized(true) {} + + GeneratorControlSource& operator=(GeneratorControlSource_ENUM rop); + operator GeneratorControlSource_ENUM() const; + + GeneratorControlSource_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, GeneratorControlSource& rop); + friend std::ostream& operator<<(std::ostream& os, const GeneratorControlSource& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::GeneratorControlSource& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.cpp b/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.cpp index e07e1f5f4..2d1052ed1 100644 --- a/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.cpp +++ b/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GenericNonLinearLoadModelKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::GenericNonLinearLoadModelKind& rop) +GenericNonLinearLoadModelKind& GenericNonLinearLoadModelKind::operator=(GenericNonLinearLoadModelKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +GenericNonLinearLoadModelKind::operator GenericNonLinearLoadModelKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char GenericNonLinearLoadModelKind::debugName[] = "GenericNonLinearLoadModelKind"; +const char* GenericNonLinearLoadModelKind::debugString() const +{ + return GenericNonLinearLoadModelKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, GenericNonLinearLoadModelKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const GenericNonLinearLoadModelKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == GenericNonLinearLoadModelKind::exponentialRecovery) + { + EnumSymbol = "exponentialRecovery"; + } + if (obj.value == GenericNonLinearLoadModelKind::loadAdaptive) + { + EnumSymbol = "loadAdaptive"; + } + + if (!EnumSymbol.empty()) + { + os << "GenericNonLinearLoadModelKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.hpp b/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.hpp index 2ed30c2dd..7b6aa0c38 100644 --- a/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.hpp +++ b/CGMES_2.4.15_16FEB2016/GenericNonLinearLoadModelKind.hpp @@ -1,21 +1,46 @@ #ifndef GenericNonLinearLoadModelKind_H #define GenericNonLinearLoadModelKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of generic non-linear load model. */ - enum class GenericNonLinearLoadModelKind + class GenericNonLinearLoadModelKind { - /** - * Exponential recovery model. - */ - exponentialRecovery, - /** - * Load adaptive model. - */ - loadAdaptive, + public: + enum GenericNonLinearLoadModelKind_ENUM + { + /** + * Exponential recovery model. + */ + exponentialRecovery, + /** + * Load adaptive model. + */ + loadAdaptive, + }; + + GenericNonLinearLoadModelKind() : value(), initialized(false) {} + GenericNonLinearLoadModelKind(GenericNonLinearLoadModelKind_ENUM value) : value(value), initialized(true) {} + + GenericNonLinearLoadModelKind& operator=(GenericNonLinearLoadModelKind_ENUM rop); + operator GenericNonLinearLoadModelKind_ENUM() const; + + GenericNonLinearLoadModelKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, GenericNonLinearLoadModelKind& rop); + friend std::ostream& operator<<(std::ostream& os, const GenericNonLinearLoadModelKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::GenericNonLinearLoadModelKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.cpp b/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.cpp index a09c6546f..b23c584fe 100644 --- a/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeographicalLocationVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -GeographicalLocationVersion::GeographicalLocationVersion(): date(nullptr) {}; - +GeographicalLocationVersion::GeographicalLocationVersion() {}; GeographicalLocationVersion::~GeographicalLocationVersion() {}; - - -bool assign_GeographicalLocationVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_GeographicalLocationVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_GeographicalLocationVersion_baseUML(std::stringstream &buffer, BaseC return false; } -bool assign_GeographicalLocationVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_GeographicalLocationVersion_baseURI(std::stringstream &buffer, BaseC return false; } +bool assign_GeographicalLocationVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeographicalLocationVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_GeographicalLocationVersion_differenceModelURI(std::stringstream &bu return false; } -bool assign_GeographicalLocationVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_GeographicalLocationVersion_entsoeUML(std::stringstream &buffer, Bas return false; } -bool assign_GeographicalLocationVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_GeographicalLocationVersion_entsoeURI(std::stringstream &buffer, Bas return false; } -bool assign_GeographicalLocationVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_GeographicalLocationVersion_modelDescriptionURI(std::stringstream &b return false; } -bool assign_GeographicalLocationVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_GeographicalLocationVersion_namespaceRDF(std::stringstream &buffer, return false; } -bool assign_GeographicalLocationVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_GeographicalLocationVersion_namespaceUML(std::stringstream &buffer, return false; } -bool assign_GeographicalLocationVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_GeographicalLocationVersion_shortName(std::stringstream &buffer, Bas return false; } -namespace CIMPP { - BaseClass* GeographicalLocationVersion_factory() { - return new GeographicalLocationVersion; - } + + + + + + + + + + + +const char GeographicalLocationVersion::debugName[] = "GeographicalLocationVersion"; +const char* GeographicalLocationVersion::debugString() const +{ + return GeographicalLocationVersion::debugName; } -void GeographicalLocationVersion::addConstructToMap(std::unordered_map& factory_map) { +void GeographicalLocationVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion"), &GeographicalLocationVersion_factory)); } -void GeographicalLocationVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GeographicalLocationVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.baseUML"), &assign_GeographicalLocationVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.baseURI"), &assign_GeographicalLocationVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.differenceModelURI"), &assign_GeographicalLocationVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.date"), &assign_GeographicalLocationVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.differenceModelURI"), &assign_GeographicalLocationVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.entsoeUML"), &assign_GeographicalLocationVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.entsoeURI"), &assign_GeographicalLocationVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.modelDescriptionURI"), &assign_GeographicalLocationVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void GeographicalLocationVersion::addPrimitiveAssignFnsToMap(std::unordered_map< assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.shortName"), &assign_GeographicalLocationVersion_shortName)); } -void GeographicalLocationVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.date"), &assign_GeographicalLocationVersion_date)); - } - -const char GeographicalLocationVersion::debugName[] = "GeographicalLocationVersion"; -const char* GeographicalLocationVersion::debugString() +void GeographicalLocationVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GeographicalLocationVersion::debugName; } const BaseClassDefiner GeographicalLocationVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner GeographicalLocationVersion::declare() return BaseClassDefiner(GeographicalLocationVersion::addConstructToMap, GeographicalLocationVersion::addPrimitiveAssignFnsToMap, GeographicalLocationVersion::addClassAssignFnsToMap, GeographicalLocationVersion::debugName); } - +namespace CIMPP +{ + BaseClass* GeographicalLocationVersion_factory() + { + return new GeographicalLocationVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.hpp b/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.hpp index e3a11025a..46e7a6d4e 100644 --- a/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/GeographicalLocationVersion.hpp @@ -1,48 +1,49 @@ #ifndef GeographicalLocationVersion_H #define GeographicalLocationVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class GeographicalLocationVersion: public BaseClass + class GeographicalLocationVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/GeographicalLocation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GeographicalLocationVersion(); - virtual ~GeographicalLocationVersion(); - + ~GeographicalLocationVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/GeographicalLocation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GeographicalLocationVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GeographicalRegion.cpp b/CGMES_2.4.15_16FEB2016/GeographicalRegion.cpp index 56f4ef7db..e2c0faf26 100644 --- a/CGMES_2.4.15_16FEB2016/GeographicalRegion.cpp +++ b/CGMES_2.4.15_16FEB2016/GeographicalRegion.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeographicalRegion.hpp" +#include +#include + #include "SubGeographicalRegion.hpp" using namespace CIMPP; GeographicalRegion::GeographicalRegion() {}; - GeographicalRegion::~GeographicalRegion() {}; -bool assign_GeographicalRegion_Regions(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Regions.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_SubGeographicalRegion_Region(BaseClass*, BaseClass*); +bool assign_GeographicalRegion_Regions(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Regions.begin(), element->Regions.end(), element2) == element->Regions.end()) + { + element->Regions.push_back(element2); + return assign_SubGeographicalRegion_Region(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* GeographicalRegion_factory() { - return new GeographicalRegion; - } +const char GeographicalRegion::debugName[] = "GeographicalRegion"; +const char* GeographicalRegion::debugString() const +{ + return GeographicalRegion::debugName; } -void GeographicalRegion::addConstructToMap(std::unordered_map& factory_map) { +void GeographicalRegion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GeographicalRegion"), &GeographicalRegion_factory)); } -void GeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void GeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GeographicalRegion.Regions"), &assign_GeographicalRegion_Regions)); +void GeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char GeographicalRegion::debugName[] = "GeographicalRegion"; -const char* GeographicalRegion::debugString() +void GeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GeographicalRegion::debugName; + assign_map.insert(std::make_pair(std::string("cim:GeographicalRegion.Regions"), &assign_GeographicalRegion_Regions)); } const BaseClassDefiner GeographicalRegion::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner GeographicalRegion::declare() return BaseClassDefiner(GeographicalRegion::addConstructToMap, GeographicalRegion::addPrimitiveAssignFnsToMap, GeographicalRegion::addClassAssignFnsToMap, GeographicalRegion::debugName); } - +namespace CIMPP +{ + BaseClass* GeographicalRegion_factory() + { + return new GeographicalRegion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GeographicalRegion.hpp b/CGMES_2.4.15_16FEB2016/GeographicalRegion.hpp index d6e1dbe42..a629c89ff 100644 --- a/CGMES_2.4.15_16FEB2016/GeographicalRegion.hpp +++ b/CGMES_2.4.15_16FEB2016/GeographicalRegion.hpp @@ -1,38 +1,39 @@ #ifndef GeographicalRegion_H #define GeographicalRegion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubGeographicalRegion; -class SubGeographicalRegion; /* A geographical region of a power system network model. */ - class GeographicalRegion: public IdentifiedObject + class GeographicalRegion : public IdentifiedObject { - public: - std::list Regions; /* All sub-geograhpical regions within this geographical region. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GeographicalRegion(); - virtual ~GeographicalRegion(); - + ~GeographicalRegion() override; + + std::list Regions; /* All sub-geograhpical regions within this geographical region. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GeographicalRegion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovCT1.cpp b/CGMES_2.4.15_16FEB2016/GovCT1.cpp index 499d6749a..844c5138e 100644 --- a/CGMES_2.4.15_16FEB2016/GovCT1.cpp +++ b/CGMES_2.4.15_16FEB2016/GovCT1.cpp @@ -1,561 +1,596 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovCT1.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "DroopSignalFeedbackKind.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Simple_Float.hpp" +#include "DroopSignalFeedbackKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovCT1::GovCT1() {}; - GovCT1::~GovCT1() {}; +bool assign_GovCT1_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kigov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kimw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ldref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rclose; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rdown; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ropen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rselect; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rup; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tact; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->teng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpelec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfspd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovCT1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rselect; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpelec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kigov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tact; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfspd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->teng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ldref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ropen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rclose; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kimw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rup; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rdown; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovCT1_factory() { - return new GovCT1; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovCT1::debugName[] = "GovCT1"; +const char* GovCT1::debugString() const +{ + return GovCT1::debugName; } -void GovCT1::addConstructToMap(std::unordered_map& factory_map) { +void GovCT1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovCT1"), &GovCT1_factory)); } -void GovCT1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovCT1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovCT1.aset"), &assign_GovCT1_aset)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.db"), &assign_GovCT1_db)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.dm"), &assign_GovCT1_dm)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ka"), &assign_GovCT1_ka)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kdgov"), &assign_GovCT1_kdgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kigov"), &assign_GovCT1_kigov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kiload"), &assign_GovCT1_kiload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kimw"), &assign_GovCT1_kimw)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpgov"), &assign_GovCT1_kpgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpload"), &assign_GovCT1_kpload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kturb"), &assign_GovCT1_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ldref"), &assign_GovCT1_ldref)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.maxerr"), &assign_GovCT1_maxerr)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.minerr"), &assign_GovCT1_minerr)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.mwbase"), &assign_GovCT1_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.r"), &assign_GovCT1_r)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.rclose"), &assign_GovCT1_rclose)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.rdown"), &assign_GovCT1_rdown)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ropen"), &assign_GovCT1_ropen)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.rselect"), &assign_GovCT1_rselect)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.tpelec"), &assign_GovCT1_tpelec)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.maxerr"), &assign_GovCT1_maxerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.minerr"), &assign_GovCT1_minerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpgov"), &assign_GovCT1_kpgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kigov"), &assign_GovCT1_kigov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kdgov"), &assign_GovCT1_kdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.tdgov"), &assign_GovCT1_tdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmax"), &assign_GovCT1_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmin"), &assign_GovCT1_vmin)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.rup"), &assign_GovCT1_rup)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ta"), &assign_GovCT1_ta)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tact"), &assign_GovCT1_tact)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kturb"), &assign_GovCT1_kturb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfnl"), &assign_GovCT1_wfnl)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tb"), &assign_GovCT1_tb)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tc"), &assign_GovCT1_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfspd"), &assign_GovCT1_wfspd)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.tdgov"), &assign_GovCT1_tdgov)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.teng"), &assign_GovCT1_teng)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tfload"), &assign_GovCT1_tfload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpload"), &assign_GovCT1_kpload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kiload"), &assign_GovCT1_kiload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ldref"), &assign_GovCT1_ldref)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.dm"), &assign_GovCT1_dm)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ropen"), &assign_GovCT1_ropen)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.rclose"), &assign_GovCT1_rclose)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kimw"), &assign_GovCT1_kimw)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.aset"), &assign_GovCT1_aset)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ka"), &assign_GovCT1_ka)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ta"), &assign_GovCT1_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.db"), &assign_GovCT1_db)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.tpelec"), &assign_GovCT1_tpelec)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tsa"), &assign_GovCT1_tsa)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tsb"), &assign_GovCT1_tsb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.rup"), &assign_GovCT1_rup)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.rdown"), &assign_GovCT1_rdown)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmax"), &assign_GovCT1_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmin"), &assign_GovCT1_vmin)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfnl"), &assign_GovCT1_wfnl)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfspd"), &assign_GovCT1_wfspd)); } -void GovCT1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovCT1::debugName[] = "GovCT1"; -const char* GovCT1::debugString() +void GovCT1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovCT1::debugName; } const BaseClassDefiner GovCT1::declare() @@ -563,4 +598,10 @@ const BaseClassDefiner GovCT1::declare() return BaseClassDefiner(GovCT1::addConstructToMap, GovCT1::addPrimitiveAssignFnsToMap, GovCT1::addClassAssignFnsToMap, GovCT1::debugName); } - +namespace CIMPP +{ + BaseClass* GovCT1_factory() + { + return new GovCT1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovCT1.hpp b/CGMES_2.4.15_16FEB2016/GovCT1.hpp index 7269f5817..6af926720 100644 --- a/CGMES_2.4.15_16FEB2016/GovCT1.hpp +++ b/CGMES_2.4.15_16FEB2016/GovCT1.hpp @@ -1,77 +1,78 @@ #ifndef GovCT1_H #define GovCT1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "PU.hpp" +#include "Boolean.hpp" #include "DroopSignalFeedbackKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* General model for any prime mover with a PID governor, used primarily for combustion turbine and combined cycle units. This model can be used to represent a variety of prime movers controlled by PID governors. It is suitable, for example, for representation of Additional information on this model is available in the 2012 IEEE report, , section 3.1.2.3 page 3-4 (GGOV1). */ - class GovCT1: public TurbineGovernorDynamics + class GovCT1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ - CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ - CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU maxerr; /* Maximum value for speed error signal (maxerr). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU minerr; /* Minimum value for speed error signal (minerr). Typical Value = -0.05. Default: nullptr */ - CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 10. Default: nullptr */ - CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 2. Default: nullptr */ - CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.15. Default: nullptr */ - CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb) (>0). Typical Value = 1.5. Default: nullptr */ - CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tb; /* Turbine lag time constant (Tb) (>0). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = true. Default: false */ - CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload) (>0). Typical Value = 3. Default: nullptr */ - CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 2. Default: nullptr */ - CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 0.67. Default: nullptr */ - CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ - CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 0.10. Default: nullptr */ - CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ - CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0.01. Default: nullptr */ - CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 0.01. Default: nullptr */ - CIMPP::PU ka; /* Acceleration limiter gain (Ka). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta) (>0). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 4. Default: nullptr */ - CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 5. Default: nullptr */ - CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ - CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovCT1(); - virtual ~GovCT1(); - + ~GovCT1() override; + + CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 0.01. Default: nullptr */ + CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ + CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Acceleration limiter gain (Ka). Typical Value = 10. Default: nullptr */ + CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ + CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 2. Default: nullptr */ + CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 0.67. Default: nullptr */ + CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0.01. Default: nullptr */ + CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 10. Default: nullptr */ + CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 2. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb) (>0). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ + CIMPP::PU maxerr; /* Maximum value for speed error signal (maxerr). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU minerr; /* Minimum value for speed error signal (minerr). Typical Value = -0.05. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ + CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ + CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ + CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 0.10. Default: nullptr */ + CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ + CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ + CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta) (>0). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tb; /* Turbine lag time constant (Tb) (>0). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload) (>0). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 4. Default: nullptr */ + CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.2. Default: nullptr */ + CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = true. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovCT1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovCT2.cpp b/CGMES_2.4.15_16FEB2016/GovCT2.cpp index bbaaf297b..3ff7364a2 100644 --- a/CGMES_2.4.15_16FEB2016/GovCT2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovCT2.cpp @@ -1,118 +1,801 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovCT2.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "DroopSignalFeedbackKind.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "Simple_Float.hpp" +#include "DroopSignalFeedbackKind.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovCT2::GovCT2() {}; - GovCT2::~GovCT2() {}; +bool assign_GovCT2_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kigov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kimw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ldref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_prate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rclose; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rdown; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ropen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rselect; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rup; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tact; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->teng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpelec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfspd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -123,754 +806,127 @@ GovCT2::~GovCT2() {}; -bool assign_GovCT2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rselect; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpelec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kigov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tact; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfspd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->teng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ldref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ropen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rclose; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kimw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rup; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rdown; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_prate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovCT2_factory() { - return new GovCT2; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovCT2::debugName[] = "GovCT2"; +const char* GovCT2::debugString() const +{ + return GovCT2::debugName; } -void GovCT2::addConstructToMap(std::unordered_map& factory_map) { +void GovCT2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovCT2"), &GovCT2_factory)); } -void GovCT2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovCT2.mwbase"), &assign_GovCT2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.r"), &assign_GovCT2_r)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rselect"), &assign_GovCT2_rselect)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tpelec"), &assign_GovCT2_tpelec)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.maxerr"), &assign_GovCT2_maxerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.minerr"), &assign_GovCT2_minerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpgov"), &assign_GovCT2_kpgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kigov"), &assign_GovCT2_kigov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kdgov"), &assign_GovCT2_kdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tdgov"), &assign_GovCT2_tdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmax"), &assign_GovCT2_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmin"), &assign_GovCT2_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tact"), &assign_GovCT2_tact)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kturb"), &assign_GovCT2_kturb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfnl"), &assign_GovCT2_wfnl)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tb"), &assign_GovCT2_tb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tc"), &assign_GovCT2_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfspd"), &assign_GovCT2_wfspd)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.teng"), &assign_GovCT2_teng)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tfload"), &assign_GovCT2_tfload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpload"), &assign_GovCT2_kpload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kiload"), &assign_GovCT2_kiload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ldref"), &assign_GovCT2_ldref)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.dm"), &assign_GovCT2_dm)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ropen"), &assign_GovCT2_ropen)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rclose"), &assign_GovCT2_rclose)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kimw"), &assign_GovCT2_kimw)); +void GovCT2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovCT2.aset"), &assign_GovCT2_aset)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ka"), &assign_GovCT2_ka)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ta"), &assign_GovCT2_ta)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.db"), &assign_GovCT2_db)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsa"), &assign_GovCT2_tsa)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsb"), &assign_GovCT2_tsb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rup"), &assign_GovCT2_rup)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rdown"), &assign_GovCT2_rdown)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.prate"), &assign_GovCT2_prate)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.dm"), &assign_GovCT2_dm)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim1"), &assign_GovCT2_flim1)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim1"), &assign_GovCT2_plim1)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim10"), &assign_GovCT2_flim10)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim2"), &assign_GovCT2_flim2)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim2"), &assign_GovCT2_plim2)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim3"), &assign_GovCT2_flim3)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim3"), &assign_GovCT2_plim3)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim4"), &assign_GovCT2_flim4)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim4"), &assign_GovCT2_plim4)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim5"), &assign_GovCT2_flim5)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim5"), &assign_GovCT2_plim5)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim6"), &assign_GovCT2_flim6)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim6"), &assign_GovCT2_plim6)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim7"), &assign_GovCT2_flim7)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim7"), &assign_GovCT2_plim7)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim8"), &assign_GovCT2_flim8)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim8"), &assign_GovCT2_plim8)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim9"), &assign_GovCT2_flim9)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim9"), &assign_GovCT2_plim9)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim10"), &assign_GovCT2_flim10)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ka"), &assign_GovCT2_ka)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kdgov"), &assign_GovCT2_kdgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kigov"), &assign_GovCT2_kigov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kiload"), &assign_GovCT2_kiload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kimw"), &assign_GovCT2_kimw)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpgov"), &assign_GovCT2_kpgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpload"), &assign_GovCT2_kpload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kturb"), &assign_GovCT2_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ldref"), &assign_GovCT2_ldref)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.maxerr"), &assign_GovCT2_maxerr)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.minerr"), &assign_GovCT2_minerr)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.mwbase"), &assign_GovCT2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim1"), &assign_GovCT2_plim1)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim10"), &assign_GovCT2_plim10)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim2"), &assign_GovCT2_plim2)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim3"), &assign_GovCT2_plim3)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim4"), &assign_GovCT2_plim4)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim5"), &assign_GovCT2_plim5)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim6"), &assign_GovCT2_plim6)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim7"), &assign_GovCT2_plim7)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim8"), &assign_GovCT2_plim8)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim9"), &assign_GovCT2_plim9)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.prate"), &assign_GovCT2_prate)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.r"), &assign_GovCT2_r)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rclose"), &assign_GovCT2_rclose)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rdown"), &assign_GovCT2_rdown)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ropen"), &assign_GovCT2_ropen)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rselect"), &assign_GovCT2_rselect)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rup"), &assign_GovCT2_rup)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ta"), &assign_GovCT2_ta)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tact"), &assign_GovCT2_tact)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tb"), &assign_GovCT2_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tc"), &assign_GovCT2_tc)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tdgov"), &assign_GovCT2_tdgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.teng"), &assign_GovCT2_teng)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tfload"), &assign_GovCT2_tfload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tpelec"), &assign_GovCT2_tpelec)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsa"), &assign_GovCT2_tsa)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsb"), &assign_GovCT2_tsb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmax"), &assign_GovCT2_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmin"), &assign_GovCT2_vmin)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfnl"), &assign_GovCT2_wfnl)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfspd"), &assign_GovCT2_wfspd)); } -void GovCT2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovCT2::debugName[] = "GovCT2"; -const char* GovCT2::debugString() +void GovCT2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovCT2::debugName; } const BaseClassDefiner GovCT2::declare() @@ -878,4 +934,10 @@ const BaseClassDefiner GovCT2::declare() return BaseClassDefiner(GovCT2::addConstructToMap, GovCT2::addPrimitiveAssignFnsToMap, GovCT2::addClassAssignFnsToMap, GovCT2::debugName); } - +namespace CIMPP +{ + BaseClass* GovCT2_factory() + { + return new GovCT2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovCT2.hpp b/CGMES_2.4.15_16FEB2016/GovCT2.hpp index 0bfa7aba8..3e610e4c3 100644 --- a/CGMES_2.4.15_16FEB2016/GovCT2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovCT2.hpp @@ -1,99 +1,100 @@ #ifndef GovCT2_H #define GovCT2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "PU.hpp" +#include "Boolean.hpp" #include "DroopSignalFeedbackKind.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* General governor model with frequency-dependent fuel flow limit. This model is a modification of the GovCT1model in order to represent the frequency-dependent fuel flow limit of a specific gas turbine manufacturer. */ - class GovCT2: public TurbineGovernorDynamics + class GovCT2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ - CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec). Typical Value = 2.5. Default: nullptr */ - CIMPP::PU maxerr; /* Maximum value for speed error signal (Maxerr). Typical Value = 1. Default: nullptr */ - CIMPP::PU minerr; /* Minimum value for speed error signal (Minerr). Typical Value = -1. Default: nullptr */ - CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 4. Default: nullptr */ - CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 0.45. Default: nullptr */ - CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.175. Default: nullptr */ - CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1.9168. Default: nullptr */ - CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.187. Default: nullptr */ - CIMPP::Seconds tb; /* Turbine lag time constant (Tb). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = false. Default: false */ - CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload). Typical Value = 3. Default: nullptr */ - CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 1. Default: nullptr */ - CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 1. Default: nullptr */ - CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ - CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 99. Default: nullptr */ - CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -99. Default: nullptr */ - CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Acceleration limiter Gain (Ka). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta). Typical Value = 1. Default: nullptr */ - CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 50. Default: nullptr */ - CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ - CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ - CIMPP::PU prate; /* Ramp rate for frequency-dependent power limit (Prate). Typical Value = 0.017. Default: nullptr */ - CIMPP::Frequency flim1; /* Frequency threshold 1 (Flim1). Unit = Hz. Typical Value = 59. Default: nullptr */ - CIMPP::PU plim1; /* Power limit 1 (Plim1). Typical Value = 0.8325. Default: nullptr */ - CIMPP::Frequency flim2; /* Frequency threshold 2 (Flim2). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim2; /* Power limit 2 (Plim2). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim3; /* Frequency threshold 3 (Flim3). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim3; /* Power limit 3 (Plim3). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim4; /* Frequency threshold 4 (Flim4). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim4; /* Power limit 4 (Plim4). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim5; /* Frequency threshold 5 (Flim5). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim5; /* Power limit 5 (Plim5). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim6; /* Frequency threshold 6 (Flim6). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim6; /* Power limit 6 (Plim6). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim7; /* Frequency threshold 7 (Flim7). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim7; /* Power limit 7 (Plim7). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim8; /* Frequency threshold 8 (Flim8). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim8; /* Power limit 8 (Plim8). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim9; /* Frequency threshold 9 (Flim9). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim9; /* Power Limit 9 (Plim9). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim10; /* Frequency threshold 10 (Flim10). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim10; /* Power limit 10 (Plim10). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovCT2(); - virtual ~GovCT2(); - + ~GovCT2() override; + + CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 10. Default: nullptr */ + CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ + CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim1; /* Frequency threshold 1 (Flim1). Unit = Hz. Typical Value = 59. Default: nullptr */ + CIMPP::Frequency flim10; /* Frequency threshold 10 (Flim10). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim2; /* Frequency threshold 2 (Flim2). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim3; /* Frequency threshold 3 (Flim3). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim4; /* Frequency threshold 4 (Flim4). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim5; /* Frequency threshold 5 (Flim5). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim6; /* Frequency threshold 6 (Flim6). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim7; /* Frequency threshold 7 (Flim7). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim8; /* Frequency threshold 8 (Flim8). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim9; /* Frequency threshold 9 (Flim9). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Acceleration limiter Gain (Ka). Typical Value = 10. Default: nullptr */ + CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ + CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 0.45. Default: nullptr */ + CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 1. Default: nullptr */ + CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0. Default: nullptr */ + CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 4. Default: nullptr */ + CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 1. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1.9168. Default: nullptr */ + CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ + CIMPP::PU maxerr; /* Maximum value for speed error signal (Maxerr). Typical Value = 1. Default: nullptr */ + CIMPP::PU minerr; /* Minimum value for speed error signal (Minerr). Typical Value = -1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU plim1; /* Power limit 1 (Plim1). Typical Value = 0.8325. Default: nullptr */ + CIMPP::PU plim10; /* Power limit 10 (Plim10). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim2; /* Power limit 2 (Plim2). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim3; /* Power limit 3 (Plim3). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim4; /* Power limit 4 (Plim4). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim5; /* Power limit 5 (Plim5). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim6; /* Power limit 6 (Plim6). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim7; /* Power limit 7 (Plim7). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim8; /* Power limit 8 (Plim8). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim9; /* Power Limit 9 (Plim9). Typical Value = 0. Default: nullptr */ + CIMPP::PU prate; /* Ramp rate for frequency-dependent power limit (Prate). Typical Value = 0.017. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -99. Default: nullptr */ + CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ + CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 99. Default: nullptr */ + CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ + CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ + CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.4. Default: nullptr */ + CIMPP::Seconds tb; /* Turbine lag time constant (Tb). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec). Typical Value = 2.5. Default: nullptr */ + CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 50. Default: nullptr */ + CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.175. Default: nullptr */ + CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.187. Default: nullptr */ + CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = false. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovCT2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovGAST.cpp b/CGMES_2.4.15_16FEB2016/GovGAST.cpp index d4e3d20cc..0f657d21e 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST.cpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST.cpp @@ -1,7 +1,14 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" @@ -9,178 +16,181 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; GovGAST::GovGAST() {}; - GovGAST::~GovGAST() {}; +bool assign_GovGAST_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST_factory() { - return new GovGAST; - } + + + +const char GovGAST::debugName[] = "GovGAST"; +const char* GovGAST::debugString() const +{ + return GovGAST::debugName; } -void GovGAST::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST"), &GovGAST_factory)); } -void GovGAST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovGAST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovGAST.at"), &assign_GovGAST_at)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST.dturb"), &assign_GovGAST_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST.kt"), &assign_GovGAST_kt)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.mwbase"), &assign_GovGAST_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.r"), &assign_GovGAST_r)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.t1"), &assign_GovGAST_t1)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.t2"), &assign_GovGAST_t2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.t3"), &assign_GovGAST_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST.at"), &assign_GovGAST_at)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST.kt"), &assign_GovGAST_kt)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.vmax"), &assign_GovGAST_vmax)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.vmin"), &assign_GovGAST_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST.dturb"), &assign_GovGAST_dturb)); } -void GovGAST::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST::debugName[] = "GovGAST"; -const char* GovGAST::debugString() +void GovGAST::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST::debugName; } const BaseClassDefiner GovGAST::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner GovGAST::declare() return BaseClassDefiner(GovGAST::addConstructToMap, GovGAST::addPrimitiveAssignFnsToMap, GovGAST::addClassAssignFnsToMap, GovGAST::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST_factory() + { + return new GovGAST; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovGAST.hpp b/CGMES_2.4.15_16FEB2016/GovGAST.hpp index 133dca546..e0b807a03 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST.hpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST.hpp @@ -1,49 +1,50 @@ #ifndef GovGAST_H #define GovGAST_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Single shaft gas turbine. */ - class GovGAST: public TurbineGovernorDynamics + class GovGAST : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ - CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of a the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). Typical Value = 3. Default: nullptr */ - CIMPP::PU at; /* Ambient temperature load limit (Load Limit). Typical Value = 1. Default: nullptr */ - CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ - CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.18. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST(); - virtual ~GovGAST(); - + ~GovGAST() override; + + CIMPP::PU at; /* Ambient temperature load limit (Load Limit). Typical Value = 1. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ + CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of a the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). Typical Value = 3. Default: nullptr */ + CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovGAST1.cpp b/CGMES_2.4.15_16FEB2016/GovGAST1.cpp index 9408d556e..260daa6e7 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST1.cpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST1.cpp @@ -1,32 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST1.hpp" +#include +#include + +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Frequency.hpp" #include "ActivePower.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -34,513 +31,550 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovGAST1::GovGAST1() {}; - GovGAST1::~GovGAST1() {}; +bool assign_GovGAST1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_fidle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fidle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_lmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_loadinc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->loadinc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_ltrate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ltrate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_tltr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tltr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_lmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_fidle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fidle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_loadinc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->loadinc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_tltr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tltr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_ltrate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ltrate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST1_factory() { - return new GovGAST1; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovGAST1::debugName[] = "GovGAST1"; +const char* GovGAST1::debugString() const +{ + return GovGAST1::debugName; } -void GovGAST1::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST1"), &GovGAST1_factory)); } -void GovGAST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.mwbase"), &assign_GovGAST1_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.r"), &assign_GovGAST1_r)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t1"), &assign_GovGAST1_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t2"), &assign_GovGAST1_t2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t3"), &assign_GovGAST1_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.lmax"), &assign_GovGAST1_lmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.kt"), &assign_GovGAST1_kt)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmax"), &assign_GovGAST1_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmin"), &assign_GovGAST1_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.fidle"), &assign_GovGAST1_fidle)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.rmax"), &assign_GovGAST1_rmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.loadinc"), &assign_GovGAST1_loadinc)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.tltr"), &assign_GovGAST1_tltr)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.ltrate"), &assign_GovGAST1_ltrate)); +void GovGAST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST1.a"), &assign_GovGAST1_a)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.b"), &assign_GovGAST1_b)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.db1"), &assign_GovGAST1_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.eps"), &assign_GovGAST1_eps)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.db2"), &assign_GovGAST1_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.eps"), &assign_GovGAST1_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.fidle"), &assign_GovGAST1_fidle)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv1"), &assign_GovGAST1_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv1"), &assign_GovGAST1_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv2"), &assign_GovGAST1_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv2"), &assign_GovGAST1_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv3"), &assign_GovGAST1_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv3"), &assign_GovGAST1_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv4"), &assign_GovGAST1_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv4"), &assign_GovGAST1_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv5"), &assign_GovGAST1_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv5"), &assign_GovGAST1_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv6"), &assign_GovGAST1_gv6)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv6"), &assign_GovGAST1_pgv6)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.ka"), &assign_GovGAST1_ka)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.kt"), &assign_GovGAST1_kt)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.lmax"), &assign_GovGAST1_lmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.loadinc"), &assign_GovGAST1_loadinc)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.ltrate"), &assign_GovGAST1_ltrate)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.mwbase"), &assign_GovGAST1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv1"), &assign_GovGAST1_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv2"), &assign_GovGAST1_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv3"), &assign_GovGAST1_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv4"), &assign_GovGAST1_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv5"), &assign_GovGAST1_pgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv6"), &assign_GovGAST1_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.r"), &assign_GovGAST1_r)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.rmax"), &assign_GovGAST1_rmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t1"), &assign_GovGAST1_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t2"), &assign_GovGAST1_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t3"), &assign_GovGAST1_t3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t4"), &assign_GovGAST1_t4)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t5"), &assign_GovGAST1_t5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.tltr"), &assign_GovGAST1_tltr)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmax"), &assign_GovGAST1_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmin"), &assign_GovGAST1_vmin)); } -void GovGAST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST1::debugName[] = "GovGAST1"; -const char* GovGAST1::debugString() +void GovGAST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST1::debugName; } const BaseClassDefiner GovGAST1::declare() @@ -548,4 +582,10 @@ const BaseClassDefiner GovGAST1::declare() return BaseClassDefiner(GovGAST1::addConstructToMap, GovGAST1::addPrimitiveAssignFnsToMap, GovGAST1::addClassAssignFnsToMap, GovGAST1::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST1_factory() + { + return new GovGAST1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovGAST1.hpp b/CGMES_2.4.15_16FEB2016/GovGAST1.hpp index c5655d7a1..cd37a1798 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST1.hpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST1.hpp @@ -1,75 +1,76 @@ #ifndef GovGAST1_H #define GovGAST1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified single shaft gas turbine. */ - class GovGAST1: public TurbineGovernorDynamics + class GovGAST1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ - CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). T3 represents delay in the exhaust temperature and load limiting system. Typical Value = 3. Default: nullptr */ - CIMPP::PU lmax; /* Ambient temperature load limit (Lmax). Lmax is the turbine power output corresponding to the limiting exhaust gas temperature. Typical Value = 1. Default: nullptr */ - CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ - CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU fidle; /* Fuel flow at zero power output (Fidle). Typical Value = 0.18. Default: nullptr */ - CIMPP::Simple_Float rmax; /* Maximum fuel valve opening rate (Rmax). Unit = PU/sec. Typical Value = 1. Default: nullptr */ - CIMPP::PU loadinc; /* Valve position change allowed at fast rate (Loadinc). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tltr; /* Valve position averaging time constant (Tltr). Typical Value = 10. Default: nullptr */ - CIMPP::Simple_Float ltrate; /* Maximum long term fuel valve opening rate (Ltrate). Typical Value = 0.02. Default: nullptr */ - CIMPP::Simple_Float a; /* Turbine power time constant numerator scale factor (a). Typical Value = 0.8. Default: nullptr */ - CIMPP::Simple_Float b; /* Turbine power time constant denominator scale factor (b). Typical Value = 1. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2,PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Governor gain (Ka). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Governor lead time constant (T4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t5; /* Governor lag time constant (T5). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST1(); - virtual ~GovGAST1(); - + ~GovGAST1() override; + + CIMPP::Simple_Float a; /* Turbine power time constant numerator scale factor (a). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float b; /* Turbine power time constant denominator scale factor (b). Typical Value = 1. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU fidle; /* Fuel flow at zero power output (Fidle). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2,PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Governor gain (Ka). Typical Value = 0. Default: nullptr */ + CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ + CIMPP::PU lmax; /* Ambient temperature load limit (Lmax). Lmax is the turbine power output corresponding to the limiting exhaust gas temperature. Typical Value = 1. Default: nullptr */ + CIMPP::PU loadinc; /* Valve position change allowed at fast rate (Loadinc). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float ltrate; /* Maximum long term fuel valve opening rate (Ltrate). Typical Value = 0.02. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ + CIMPP::Simple_Float rmax; /* Maximum fuel valve opening rate (Rmax). Unit = PU/sec. Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). T3 represents delay in the exhaust temperature and load limiting system. Typical Value = 3. Default: nullptr */ + CIMPP::Seconds t4; /* Governor lead time constant (T4). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t5; /* Governor lag time constant (T5). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tltr; /* Valve position averaging time constant (Tltr). Typical Value = 10. Default: nullptr */ + CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovGAST2.cpp b/CGMES_2.4.15_16FEB2016/GovGAST2.cpp index a68ea44b1..d800dff6c 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST2.cpp @@ -1,516 +1,548 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST2.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "ActivePower.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include "Temperature.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "Temperature.hpp" +#include "ActivePower.hpp" +#include "Seconds.hpp" #include "PU.hpp" -#include "Temperature.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovGAST2::GovGAST2() {}; - GovGAST2::~GovGAST2() {}; +bool assign_GovGAST2_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->c; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ecr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->etd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGAST2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGAST2_w(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->w; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGAST2_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_z(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->z; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_w(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->w; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_z(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->z; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->etd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ecr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->c; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST2_factory() { - return new GovGAST2; - } + + + + + + + + + + + + + + + + + + + + + + + +const char GovGAST2::debugName[] = "GovGAST2"; +const char* GovGAST2::debugString() const +{ + return GovGAST2::debugName; } -void GovGAST2::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST2"), &GovGAST2_factory)); } -void GovGAST2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.mwbase"), &assign_GovGAST2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.w"), &assign_GovGAST2_w)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.x"), &assign_GovGAST2_x)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.y"), &assign_GovGAST2_y)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.z"), &assign_GovGAST2_z)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.etd"), &assign_GovGAST2_etd)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tcd"), &assign_GovGAST2_tcd)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.trate"), &assign_GovGAST2_trate)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t"), &assign_GovGAST2_t)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmax"), &assign_GovGAST2_tmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmin"), &assign_GovGAST2_tmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.ecr"), &assign_GovGAST2_ecr)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k3"), &assign_GovGAST2_k3)); +void GovGAST2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST2.a"), &assign_GovGAST2_a)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af1"), &assign_GovGAST2_af1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af2"), &assign_GovGAST2_af2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.b"), &assign_GovGAST2_b)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf1"), &assign_GovGAST2_bf1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf2"), &assign_GovGAST2_bf2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.c"), &assign_GovGAST2_c)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tf"), &assign_GovGAST2_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.kf"), &assign_GovGAST2_kf)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k5"), &assign_GovGAST2_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.cf2"), &assign_GovGAST2_cf2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.ecr"), &assign_GovGAST2_ecr)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.etd"), &assign_GovGAST2_etd)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k3"), &assign_GovGAST2_k3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k4"), &assign_GovGAST2_k4)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k5"), &assign_GovGAST2_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k6"), &assign_GovGAST2_k6)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.kf"), &assign_GovGAST2_kf)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.mwbase"), &assign_GovGAST2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t"), &assign_GovGAST2_t)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t3"), &assign_GovGAST2_t3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t4"), &assign_GovGAST2_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tt"), &assign_GovGAST2_tt)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t5"), &assign_GovGAST2_t5)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af1"), &assign_GovGAST2_af1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf1"), &assign_GovGAST2_bf1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af2"), &assign_GovGAST2_af2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf2"), &assign_GovGAST2_bf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.cf2"), &assign_GovGAST2_cf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tr"), &assign_GovGAST2_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k6"), &assign_GovGAST2_k6)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tc"), &assign_GovGAST2_tc)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tcd"), &assign_GovGAST2_tcd)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tf"), &assign_GovGAST2_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmax"), &assign_GovGAST2_tmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmin"), &assign_GovGAST2_tmin)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tr"), &assign_GovGAST2_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.trate"), &assign_GovGAST2_trate)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tt"), &assign_GovGAST2_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.w"), &assign_GovGAST2_w)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.x"), &assign_GovGAST2_x)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.y"), &assign_GovGAST2_y)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.z"), &assign_GovGAST2_z)); } -void GovGAST2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST2::debugName[] = "GovGAST2"; -const char* GovGAST2::debugString() +void GovGAST2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST2::debugName; } const BaseClassDefiner GovGAST2::declare() @@ -518,4 +550,10 @@ const BaseClassDefiner GovGAST2::declare() return BaseClassDefiner(GovGAST2::addConstructToMap, GovGAST2::addPrimitiveAssignFnsToMap, GovGAST2::addClassAssignFnsToMap, GovGAST2::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST2_factory() + { + return new GovGAST2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovGAST2.hpp b/CGMES_2.4.15_16FEB2016/GovGAST2.hpp index 514013ea0..dd07400d5 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST2.hpp @@ -1,74 +1,75 @@ #ifndef GovGAST2_H #define GovGAST2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Gas turbine model. */ - class GovGAST2: public TurbineGovernorDynamics + class GovGAST2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU w; /* Governor gain (1/droop) on turbine rating (W). Default: nullptr */ - CIMPP::Seconds x; /* Governor lead time constant (X). Default: nullptr */ - CIMPP::Seconds y; /* Governor lag time constant (Y) (>0). Default: nullptr */ - CIMPP::Boolean z; /* Governor mode (Z). true = Droop false = ISO. Default: false */ - CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ - CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ - CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ - CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ - CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ - CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ - CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ - CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ - CIMPP::Simple_Float a; /* Valve positioner (A). Default: nullptr */ - CIMPP::Simple_Float b; /* Valve positioner (B). Default: nullptr */ - CIMPP::Simple_Float c; /* Valve positioner (C). Default: nullptr */ - CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ - CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ - CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ - CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ - CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ - CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ - CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ - CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ - CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ - CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ - CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ - CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K (23% fuel flow). Default: nullptr */ - CIMPP::Temperature tr; /* Rated temperature (Tr). Unit = [SYMBOL REMOVED]C depending on parameters Af1 and Bf1. Default: nullptr */ - CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ - CIMPP::Temperature tc; /* Temperature control (Tc). Unit = [SYMBOL REMOVED]F or [SYMBOL REMOVED]C depending on constants Af1 and Bf1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST2(); - virtual ~GovGAST2(); - + ~GovGAST2() override; + + CIMPP::Simple_Float a; /* Valve positioner (A). Default: nullptr */ + CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ + CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ + CIMPP::Simple_Float b; /* Valve positioner (B). Default: nullptr */ + CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ + CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ + CIMPP::Simple_Float c; /* Valve positioner (C). Default: nullptr */ + CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K (23% fuel flow). Default: nullptr */ + CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ + CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ + CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ + CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ + CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ + CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ + CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ + CIMPP::Temperature tc; /* Temperature control (Tc). Unit = [SYMBOL REMOVED]F or [SYMBOL REMOVED]C depending on constants Af1 and Bf1. Default: nullptr */ + CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ + CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ + CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ + CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ + CIMPP::Temperature tr; /* Rated temperature (Tr). Unit = [SYMBOL REMOVED]C depending on parameters Af1 and Bf1. Default: nullptr */ + CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ + CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ + CIMPP::PU w; /* Governor gain (1/droop) on turbine rating (W). Default: nullptr */ + CIMPP::Seconds x; /* Governor lead time constant (X). Default: nullptr */ + CIMPP::Seconds y; /* Governor lag time constant (Y) (>0). Default: nullptr */ + CIMPP::Boolean z; /* Governor mode (Z). true = Droop false = ISO. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovGAST3.cpp b/CGMES_2.4.15_16FEB2016/GovGAST3.cpp index bbb3afc72..cc6585f6e 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST3.cpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST3.cpp @@ -1,351 +1,372 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST3.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include "Temperature.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Temperature.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Temperature.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" #include "Temperature.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovGAST3::GovGAST3() {}; - GovGAST3::~GovGAST3() {}; +bool assign_GovGAST3_bca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bca; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_kac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_kca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kca; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ksi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ksi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ky(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ky; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_rcmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_rcmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tfen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tsi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ttc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ttc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ty; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST3_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_rcmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_rcmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ky(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ky; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ty; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_kac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_bca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bca; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_kca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kca; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tsi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ksi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ksi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ttc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ttc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tfen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovGAST3_factory() { - return new GovGAST3; - } +const char GovGAST3::debugName[] = "GovGAST3"; +const char* GovGAST3::debugString() const +{ + return GovGAST3::debugName; } -void GovGAST3::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST3"), &GovGAST3_factory)); } -void GovGAST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.bp"), &assign_GovGAST3_bp)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tg"), &assign_GovGAST3_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmx"), &assign_GovGAST3_rcmx)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmn"), &assign_GovGAST3_rcmn)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ky"), &assign_GovGAST3_ky)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ty"), &assign_GovGAST3_ty)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tac"), &assign_GovGAST3_tac)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kac"), &assign_GovGAST3_kac)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tc"), &assign_GovGAST3_tc)); +void GovGAST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST3.bca"), &assign_GovGAST3_bca)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kca"), &assign_GovGAST3_kca)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.bp"), &assign_GovGAST3_bp)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.dtc"), &assign_GovGAST3_dtc)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ka"), &assign_GovGAST3_ka)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tsi"), &assign_GovGAST3_tsi)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kac"), &assign_GovGAST3_kac)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kca"), &assign_GovGAST3_kca)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ksi"), &assign_GovGAST3_ksi)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ttc"), &assign_GovGAST3_ttc)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tfen"), &assign_GovGAST3_tfen)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ky"), &assign_GovGAST3_ky)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mnef"), &assign_GovGAST3_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mxef"), &assign_GovGAST3_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmn"), &assign_GovGAST3_rcmn)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmx"), &assign_GovGAST3_rcmx)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tac"), &assign_GovGAST3_tac)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tc"), &assign_GovGAST3_tc)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.td"), &assign_GovGAST3_td)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tfen"), &assign_GovGAST3_tfen)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tg"), &assign_GovGAST3_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tsi"), &assign_GovGAST3_tsi)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tt"), &assign_GovGAST3_tt)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mxef"), &assign_GovGAST3_mxef)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mnef"), &assign_GovGAST3_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ttc"), &assign_GovGAST3_ttc)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ty"), &assign_GovGAST3_ty)); } -void GovGAST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST3::debugName[] = "GovGAST3"; -const char* GovGAST3::debugString() +void GovGAST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST3::debugName; } const BaseClassDefiner GovGAST3::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner GovGAST3::declare() return BaseClassDefiner(GovGAST3::addConstructToMap, GovGAST3::addPrimitiveAssignFnsToMap, GovGAST3::addClassAssignFnsToMap, GovGAST3::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST3_factory() + { + return new GovGAST3; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovGAST3.hpp b/CGMES_2.4.15_16FEB2016/GovGAST3.hpp index d97568171..dad20cfc8 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST3.hpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST3.hpp @@ -1,61 +1,62 @@ #ifndef GovGAST3_H #define GovGAST3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Generic turbogas with acceleration and temperature controller. */ - class GovGAST3: public TurbineGovernorDynamics + class GovGAST3 : public TurbineGovernorDynamics { - public: - CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tg; /* Time constant of speed governor (Tg). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU rcmx; /* Maximum fuel flow (RCMX). Typical Value = 1. Default: nullptr */ - CIMPP::PU rcmn; /* Minimum fuel flow (RCMN). Typical Value = -0.1. Default: nullptr */ - CIMPP::Simple_Float ky; /* Coefficient of transfer function of fuel valve positioner (Ky). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ty; /* Time constant of fuel valve positioner (Ty). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tac; /* Fuel control time constant (Tac). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float kac; /* Fuel system feedback (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Compressor discharge volume time constant (Tc). Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float bca; /* Acceleration limit set-point (Bca). Unit = 1/s. Typical Value = 0.01. Default: nullptr */ - CIMPP::Simple_Float kca; /* Acceleration control integral gain (Kca). Unit = 1/s. Typical Value = 100. Default: nullptr */ - CIMPP::Temperature dtc; /* Exhaust temperature variation due to fuel flow increasing from 0 to 1 PU (deltaTc). Typical Value = 390. Default: nullptr */ - CIMPP::PU ka; /* Minimum fuel flow (Ka). Typical Value = 0.23. Default: nullptr */ - CIMPP::Seconds tsi; /* Time constant of radiation shield (Tsi). Typical Value = 15. Default: nullptr */ - CIMPP::Simple_Float ksi; /* Gain of radiation shield (Ksi). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds ttc; /* Time constant of thermocouple (Ttc). Typical Value = 2.5. Default: nullptr */ - CIMPP::Temperature tfen; /* Turbine rated exhaust temperature correspondent to Pm=1 PU (Tfen). Typical Value = 540. Default: nullptr */ - CIMPP::Seconds td; /* Temperature controller derivative gain (Td). Typical Value = 3.3. Default: nullptr */ - CIMPP::Temperature tt; /* Temperature controller integration rate (Tt). Typical Value = 250. Default: nullptr */ - CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST3(); - virtual ~GovGAST3(); - + ~GovGAST3() override; + + CIMPP::Simple_Float bca; /* Acceleration limit set-point (Bca). Unit = 1/s. Typical Value = 0.01. Default: nullptr */ + CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Temperature dtc; /* Exhaust temperature variation due to fuel flow increasing from 0 to 1 PU (deltaTc). Typical Value = 390. Default: nullptr */ + CIMPP::PU ka; /* Minimum fuel flow (Ka). Typical Value = 0.23. Default: nullptr */ + CIMPP::Simple_Float kac; /* Fuel system feedback (K). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float kca; /* Acceleration control integral gain (Kca). Unit = 1/s. Typical Value = 100. Default: nullptr */ + CIMPP::Simple_Float ksi; /* Gain of radiation shield (Ksi). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float ky; /* Coefficient of transfer function of fuel valve positioner (Ky). Typical Value = 1. Default: nullptr */ + CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rcmn; /* Minimum fuel flow (RCMN). Typical Value = -0.1. Default: nullptr */ + CIMPP::PU rcmx; /* Maximum fuel flow (RCMX). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tac; /* Fuel control time constant (Tac). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tc; /* Compressor discharge volume time constant (Tc). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds td; /* Temperature controller derivative gain (Td). Typical Value = 3.3. Default: nullptr */ + CIMPP::Temperature tfen; /* Turbine rated exhaust temperature correspondent to Pm=1 PU (Tfen). Typical Value = 540. Default: nullptr */ + CIMPP::Seconds tg; /* Time constant of speed governor (Tg). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tsi; /* Time constant of radiation shield (Tsi). Typical Value = 15. Default: nullptr */ + CIMPP::Temperature tt; /* Temperature controller integration rate (Tt). Typical Value = 250. Default: nullptr */ + CIMPP::Seconds ttc; /* Time constant of thermocouple (Ttc). Typical Value = 2.5. Default: nullptr */ + CIMPP::Seconds ty; /* Time constant of fuel valve positioner (Ty). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST3_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovGAST4.cpp b/CGMES_2.4.15_16FEB2016/GovGAST4.cpp index ba189ce50..5d9f66540 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST4.cpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST4.cpp @@ -1,201 +1,212 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST4.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovGAST4::GovGAST4() {}; - GovGAST4::~GovGAST4() {}; +bool assign_GovGAST4_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_ktm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ktm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_rymn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rymn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_rymx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rymx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST4_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_ktm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ktm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_rymx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rymx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_rymn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rymn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST4_factory() { - return new GovGAST4; - } + + + + + + + + + +const char GovGAST4::debugName[] = "GovGAST4"; +const char* GovGAST4::debugString() const +{ + return GovGAST4::debugName; } -void GovGAST4::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST4"), &GovGAST4_factory)); } -void GovGAST4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovGAST4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST4.bp"), &assign_GovGAST4_bp)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tv"), &assign_GovGAST4_tv)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.ktm"), &assign_GovGAST4_ktm)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mnef"), &assign_GovGAST4_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mxef"), &assign_GovGAST4_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymn"), &assign_GovGAST4_rymn)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymx"), &assign_GovGAST4_rymx)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.ta"), &assign_GovGAST4_ta)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tc"), &assign_GovGAST4_tc)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tcm"), &assign_GovGAST4_tcm)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.ktm"), &assign_GovGAST4_ktm)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tm"), &assign_GovGAST4_tm)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymx"), &assign_GovGAST4_rymx)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymn"), &assign_GovGAST4_rymn)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mxef"), &assign_GovGAST4_mxef)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mnef"), &assign_GovGAST4_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tv"), &assign_GovGAST4_tv)); } -void GovGAST4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST4::debugName[] = "GovGAST4"; -const char* GovGAST4::debugString() +void GovGAST4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST4::debugName; } const BaseClassDefiner GovGAST4::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner GovGAST4::declare() return BaseClassDefiner(GovGAST4::addConstructToMap, GovGAST4::addPrimitiveAssignFnsToMap, GovGAST4::addClassAssignFnsToMap, GovGAST4::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST4_factory() + { + return new GovGAST4; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovGAST4.hpp b/CGMES_2.4.15_16FEB2016/GovGAST4.hpp index fdcc4c47f..db6a06980 100644 --- a/CGMES_2.4.15_16FEB2016/GovGAST4.hpp +++ b/CGMES_2.4.15_16FEB2016/GovGAST4.hpp @@ -1,49 +1,50 @@ #ifndef GovGAST4_H #define GovGAST4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Generic turbogas. */ - class GovGAST4: public TurbineGovernorDynamics + class GovGAST4 : public TurbineGovernorDynamics { - public: - CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tv; /* Time constant of fuel valve positioner (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ta; /* Maximum gate opening velocity (T). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tc; /* Maximum gate closing velocity (T). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tcm; /* Fuel control time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ktm; /* Compressor gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tm; /* Compressor discharge volume time constant (T). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU rymx; /* Maximum valve opening (RYMX). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU rymn; /* Minimum valve opening (RYMN). Typical Value = 0. Default: nullptr */ - CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST4(); - virtual ~GovGAST4(); - + ~GovGAST4() override; + + CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ktm; /* Compressor gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rymn; /* Minimum valve opening (RYMN). Typical Value = 0. Default: nullptr */ + CIMPP::PU rymx; /* Maximum valve opening (RYMX). Typical Value = 1.1. Default: nullptr */ + CIMPP::Seconds ta; /* Maximum gate opening velocity (T). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tc; /* Maximum gate closing velocity (T). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tcm; /* Fuel control time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tm; /* Compressor discharge volume time constant (T). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tv; /* Time constant of fuel valve positioner (T). Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST4_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovGASTWD.cpp b/CGMES_2.4.15_16FEB2016/GovGASTWD.cpp index 1d48d82fc..553f65613 100644 --- a/CGMES_2.4.15_16FEB2016/GovGASTWD.cpp +++ b/CGMES_2.4.15_16FEB2016/GovGASTWD.cpp @@ -1,531 +1,564 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGASTWD.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "ActivePower.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Temperature.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" #include "PU.hpp" #include "Temperature.hpp" +#include "ActivePower.hpp" #include "Seconds.hpp" using namespace CIMPP; GovGASTWD::GovGASTWD() {}; - GovGASTWD::~GovGASTWD() {}; +bool assign_GovGASTWD_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->c; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ecr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->etd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGASTWD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->etd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ecr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->c; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGASTWD_factory() { - return new GovGASTWD; - } + + + + + + + + + + + + + + + + + + + + + + + +const char GovGASTWD::debugName[] = "GovGASTWD"; +const char* GovGASTWD::debugString() const +{ + return GovGASTWD::debugName; } -void GovGASTWD::addConstructToMap(std::unordered_map& factory_map) { +void GovGASTWD::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGASTWD"), &GovGASTWD_factory)); } -void GovGASTWD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.mwbase"), &assign_GovGASTWD_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kdroop"), &assign_GovGASTWD_kdroop)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kp"), &assign_GovGASTWD_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ki"), &assign_GovGASTWD_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kd"), &assign_GovGASTWD_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.etd"), &assign_GovGASTWD_etd)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tcd"), &assign_GovGASTWD_tcd)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.trate"), &assign_GovGASTWD_trate)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t"), &assign_GovGASTWD_t)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmax"), &assign_GovGASTWD_tmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmin"), &assign_GovGASTWD_tmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ecr"), &assign_GovGASTWD_ecr)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k3"), &assign_GovGASTWD_k3)); +void GovGASTWD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.a"), &assign_GovGASTWD_a)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af1"), &assign_GovGASTWD_af1)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af2"), &assign_GovGASTWD_af2)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.b"), &assign_GovGASTWD_b)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf1"), &assign_GovGASTWD_bf1)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf2"), &assign_GovGASTWD_bf2)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.c"), &assign_GovGASTWD_c)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tf"), &assign_GovGASTWD_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kf"), &assign_GovGASTWD_kf)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k5"), &assign_GovGASTWD_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.cf2"), &assign_GovGASTWD_cf2)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ecr"), &assign_GovGASTWD_ecr)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.etd"), &assign_GovGASTWD_etd)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k3"), &assign_GovGASTWD_k3)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k4"), &assign_GovGASTWD_k4)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k5"), &assign_GovGASTWD_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k6"), &assign_GovGASTWD_k6)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kd"), &assign_GovGASTWD_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kdroop"), &assign_GovGASTWD_kdroop)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kf"), &assign_GovGASTWD_kf)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ki"), &assign_GovGASTWD_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kp"), &assign_GovGASTWD_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.mwbase"), &assign_GovGASTWD_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t"), &assign_GovGASTWD_t)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t3"), &assign_GovGASTWD_t3)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t4"), &assign_GovGASTWD_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tt"), &assign_GovGASTWD_tt)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t5"), &assign_GovGASTWD_t5)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af1"), &assign_GovGASTWD_af1)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf1"), &assign_GovGASTWD_bf1)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af2"), &assign_GovGASTWD_af2)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf2"), &assign_GovGASTWD_bf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.cf2"), &assign_GovGASTWD_cf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tr"), &assign_GovGASTWD_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k6"), &assign_GovGASTWD_k6)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tc"), &assign_GovGASTWD_tc)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tcd"), &assign_GovGASTWD_tcd)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.td"), &assign_GovGASTWD_td)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tf"), &assign_GovGASTWD_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmax"), &assign_GovGASTWD_tmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmin"), &assign_GovGASTWD_tmin)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tr"), &assign_GovGASTWD_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.trate"), &assign_GovGASTWD_trate)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tt"), &assign_GovGASTWD_tt)); } -void GovGASTWD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGASTWD::debugName[] = "GovGASTWD"; -const char* GovGASTWD::debugString() +void GovGASTWD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGASTWD::debugName; } const BaseClassDefiner GovGASTWD::declare() @@ -533,4 +566,10 @@ const BaseClassDefiner GovGASTWD::declare() return BaseClassDefiner(GovGASTWD::addConstructToMap, GovGASTWD::addPrimitiveAssignFnsToMap, GovGASTWD::addClassAssignFnsToMap, GovGASTWD::debugName); } - +namespace CIMPP +{ + BaseClass* GovGASTWD_factory() + { + return new GovGASTWD; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovGASTWD.hpp b/CGMES_2.4.15_16FEB2016/GovGASTWD.hpp index d159b76c0..f37266ee1 100644 --- a/CGMES_2.4.15_16FEB2016/GovGASTWD.hpp +++ b/CGMES_2.4.15_16FEB2016/GovGASTWD.hpp @@ -1,74 +1,75 @@ #ifndef GovGASTWD_H #define GovGASTWD_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Woodward Gas turbine governor model. */ - class GovGASTWD: public TurbineGovernorDynamics + class GovGASTWD : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU kdroop; /* (Kdroop). Default: nullptr */ - CIMPP::PU kp; /* PID Proportional gain (Kp). Default: nullptr */ - CIMPP::PU ki; /* Isochronous Governor Gain (Ki). Default: nullptr */ - CIMPP::PU kd; /* Drop Governor Gain (Kd). Default: nullptr */ - CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ - CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ - CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ - CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ - CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ - CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ - CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ - CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ - CIMPP::Simple_Float a; /* Valve positioner (). Default: nullptr */ - CIMPP::Simple_Float b; /* Valve positioner (). Default: nullptr */ - CIMPP::Simple_Float c; /* Valve positioner (). Default: nullptr */ - CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ - CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ - CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ - CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ - CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ - CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ - CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ - CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Default: nullptr */ - CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Default: nullptr */ - CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ - CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ - CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K(23% fuel flow). Default: nullptr */ - CIMPP::Temperature tr; /* Rated temperature (Tr). Default: nullptr */ - CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ - CIMPP::Temperature tc; /* Temperature control (Tc). Default: nullptr */ - CIMPP::Seconds td; /* Power transducer time constant (Td). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGASTWD(); - virtual ~GovGASTWD(); - + ~GovGASTWD() override; + + CIMPP::Simple_Float a; /* Valve positioner (). Default: nullptr */ + CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Default: nullptr */ + CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ + CIMPP::Simple_Float b; /* Valve positioner (). Default: nullptr */ + CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Default: nullptr */ + CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ + CIMPP::Simple_Float c; /* Valve positioner (). Default: nullptr */ + CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K(23% fuel flow). Default: nullptr */ + CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ + CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ + CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ + CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ + CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ + CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ + CIMPP::PU kd; /* Drop Governor Gain (Kd). Default: nullptr */ + CIMPP::PU kdroop; /* (Kdroop). Default: nullptr */ + CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ + CIMPP::PU ki; /* Isochronous Governor Gain (Ki). Default: nullptr */ + CIMPP::PU kp; /* PID Proportional gain (Kp). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ + CIMPP::Temperature tc; /* Temperature control (Tc). Default: nullptr */ + CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ + CIMPP::Seconds td; /* Power transducer time constant (Td). Default: nullptr */ + CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ + CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ + CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ + CIMPP::Temperature tr; /* Rated temperature (Tr). Default: nullptr */ + CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ + CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGASTWD_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydro1.cpp b/CGMES_2.4.15_16FEB2016/GovHydro1.cpp index 3c59a34c4..5905eed08 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro1.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro1.cpp @@ -1,246 +1,260 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro1.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro1::GovHydro1() {}; - GovHydro1::~GovHydro1() {}; +bool assign_GovHydro1_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hdam; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_velm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_velm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hdam; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro1_factory() { - return new GovHydro1; - } + + + + + + + + + + +const char GovHydro1::debugName[] = "GovHydro1"; +const char* GovHydro1::debugString() const +{ + return GovHydro1::debugName; } -void GovHydro1::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro1"), &GovHydro1_factory)); } -void GovHydro1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydro1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.at"), &assign_GovHydro1_at)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.dturb"), &assign_GovHydro1_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmax"), &assign_GovHydro1_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmin"), &assign_GovHydro1_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.hdam"), &assign_GovHydro1_hdam)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.mwbase"), &assign_GovHydro1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.qnl"), &assign_GovHydro1_qnl)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.rperm"), &assign_GovHydro1_rperm)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.rtemp"), &assign_GovHydro1_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tr"), &assign_GovHydro1_tr)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tf"), &assign_GovHydro1_tf)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tg"), &assign_GovHydro1_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.velm"), &assign_GovHydro1_velm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmax"), &assign_GovHydro1_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmin"), &assign_GovHydro1_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tr"), &assign_GovHydro1_tr)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tw"), &assign_GovHydro1_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.at"), &assign_GovHydro1_at)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.dturb"), &assign_GovHydro1_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.qnl"), &assign_GovHydro1_qnl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.hdam"), &assign_GovHydro1_hdam)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.velm"), &assign_GovHydro1_velm)); } -void GovHydro1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro1::debugName[] = "GovHydro1"; -const char* GovHydro1::debugString() +void GovHydro1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro1::debugName; } const BaseClassDefiner GovHydro1::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner GovHydro1::declare() return BaseClassDefiner(GovHydro1::addConstructToMap, GovHydro1::addPrimitiveAssignFnsToMap, GovHydro1::addClassAssignFnsToMap, GovHydro1::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro1_factory() + { + return new GovHydro1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydro1.hpp b/CGMES_2.4.15_16FEB2016/GovHydro1.hpp index f69867144..cb56f9b66 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro1.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro1.hpp @@ -1,54 +1,55 @@ #ifndef GovHydro1_H #define GovHydro1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Basic Hydro turbine governor model. */ - class GovHydro1: public TurbineGovernorDynamics + class GovHydro1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU rperm; /* Permanent droop (R) (>0). Typical Value = 0.04. Default: nullptr */ - CIMPP::PU rtemp; /* Temporary droop (r) (>R). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tr; /* Washout time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tf; /* Filter time constant () (>0). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float velm; /* Maximum gate velocity (Vlem) (>0). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening (Gmax) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening (Gmin) (>=0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At) (>0). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb) (>=0). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU qnl; /* No-load flow at nominal head (qnl) (>=0). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU hdam; /* Turbine nominal head (hdam). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro1(); - virtual ~GovHydro1(); - + ~GovHydro1() override; + + CIMPP::PU at; /* Turbine gain (At) (>0). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb) (>=0). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening (Gmax) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening (Gmin) (>=0). Typical Value = 0. Default: nullptr */ + CIMPP::PU hdam; /* Turbine nominal head (hdam). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU qnl; /* No-load flow at nominal head (qnl) (>=0). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU rperm; /* Permanent droop (R) (>0). Typical Value = 0.04. Default: nullptr */ + CIMPP::PU rtemp; /* Temporary droop (r) (>R). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tf; /* Filter time constant () (>0). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tr; /* Washout time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float velm; /* Maximum gate velocity (Vlem) (>0). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydro2.cpp b/CGMES_2.4.15_16FEB2016/GovHydro2.cpp index 7bbc244c5..5ce722b05 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro2.cpp @@ -1,26 +1,24 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro2.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -31,441 +29,472 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro2::GovHydro2() {}; - GovHydro2::~GovHydro2() {}; +bool assign_GovHydro2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro2_factory() { - return new GovHydro2; - } + + + + + + + + + + + + + + + + + + + + + + +const char GovHydro2::debugName[] = "GovHydro2"; +const char* GovHydro2::debugString() const +{ + return GovHydro2::debugName; } -void GovHydro2::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro2"), &GovHydro2_factory)); } -void GovHydro2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.mwbase"), &assign_GovHydro2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tg"), &assign_GovHydro2_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tp"), &assign_GovHydro2_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uo"), &assign_GovHydro2_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uc"), &assign_GovHydro2_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmax"), &assign_GovHydro2_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmin"), &assign_GovHydro2_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rperm"), &assign_GovHydro2_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rtemp"), &assign_GovHydro2_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tr"), &assign_GovHydro2_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tw"), &assign_GovHydro2_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.kturb"), &assign_GovHydro2_kturb)); +void GovHydro2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydro2.aturb"), &assign_GovHydro2_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.bturb"), &assign_GovHydro2_bturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.db1"), &assign_GovHydro2_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.eps"), &assign_GovHydro2_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.db2"), &assign_GovHydro2_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.eps"), &assign_GovHydro2_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv1"), &assign_GovHydro2_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv1"), &assign_GovHydro2_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv2"), &assign_GovHydro2_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv2"), &assign_GovHydro2_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv3"), &assign_GovHydro2_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv3"), &assign_GovHydro2_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv4"), &assign_GovHydro2_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv4"), &assign_GovHydro2_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv5"), &assign_GovHydro2_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv5"), &assign_GovHydro2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv6"), &assign_GovHydro2_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.kturb"), &assign_GovHydro2_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.mwbase"), &assign_GovHydro2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv1"), &assign_GovHydro2_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv2"), &assign_GovHydro2_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv3"), &assign_GovHydro2_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv4"), &assign_GovHydro2_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv5"), &assign_GovHydro2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv6"), &assign_GovHydro2_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmax"), &assign_GovHydro2_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmin"), &assign_GovHydro2_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rperm"), &assign_GovHydro2_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rtemp"), &assign_GovHydro2_rtemp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tg"), &assign_GovHydro2_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tp"), &assign_GovHydro2_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tr"), &assign_GovHydro2_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tw"), &assign_GovHydro2_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uc"), &assign_GovHydro2_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uo"), &assign_GovHydro2_uo)); } -void GovHydro2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro2::debugName[] = "GovHydro2"; -const char* GovHydro2::debugString() +void GovHydro2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro2::debugName; } const BaseClassDefiner GovHydro2::declare() @@ -473,4 +502,10 @@ const BaseClassDefiner GovHydro2::declare() return BaseClassDefiner(GovHydro2::addConstructToMap, GovHydro2::addPrimitiveAssignFnsToMap, GovHydro2::addClassAssignFnsToMap, GovHydro2::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro2_factory() + { + return new GovHydro2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydro2.hpp b/CGMES_2.4.15_16FEB2016/GovHydro2.hpp index 0b0ccddef..551e5adfb 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro2.hpp @@ -1,70 +1,71 @@ #ifndef GovHydro2_H #define GovHydro2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* IEEE hydro turbine governor model represents plants with straightforward penstock configurations and hydraulic-dashpot governors. */ - class GovHydro2: public TurbineGovernorDynamics + class GovHydro2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening; (). Typical Value = 0. Default: nullptr */ - CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro2(); - virtual ~GovHydro2(); - + ~GovHydro2() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening; (). Typical Value = 0. Default: nullptr */ + CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydro3.cpp b/CGMES_2.4.15_16FEB2016/GovHydro3.cpp index fa1c1c461..e14871a36 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro3.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro3.cpp @@ -1,32 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro3.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" #include "PU.hpp" +#include "Frequency.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -38,539 +35,578 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro3::GovHydro3() {}; - GovHydro3::~GovHydro3() {}; +bool assign_GovHydro3_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_relec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->relec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_rgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro3_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro3_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->governorControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_rgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_relec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->relec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro3_factory() { - return new GovHydro3; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydro3::debugName[] = "GovHydro3"; +const char* GovHydro3::debugString() const +{ + return GovHydro3::debugName; } -void GovHydro3::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro3"), &GovHydro3_factory)); } -void GovHydro3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.mwbase"), &assign_GovHydro3_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmax"), &assign_GovHydro3_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmin"), &assign_GovHydro3_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.governorControl"), &assign_GovHydro3_governorControl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.rgate"), &assign_GovHydro3_rgate)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.relec"), &assign_GovHydro3_relec)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.td"), &assign_GovHydro3_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tf"), &assign_GovHydro3_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tp"), &assign_GovHydro3_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velop"), &assign_GovHydro3_velop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velcl"), &assign_GovHydro3_velcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k1"), &assign_GovHydro3_k1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k2"), &assign_GovHydro3_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.ki"), &assign_GovHydro3_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.kg"), &assign_GovHydro3_kg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tt"), &assign_GovHydro3_tt)); +void GovHydro3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.at"), &assign_GovHydro3_at)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.db1"), &assign_GovHydro3_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.eps"), &assign_GovHydro3_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.db2"), &assign_GovHydro3_db2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tw"), &assign_GovHydro3_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.at"), &assign_GovHydro3_at)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.dturb"), &assign_GovHydro3_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.qnl"), &assign_GovHydro3_qnl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.h0"), &assign_GovHydro3_h0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.eps"), &assign_GovHydro3_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.governorControl"), &assign_GovHydro3_governorControl)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv1"), &assign_GovHydro3_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv1"), &assign_GovHydro3_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv2"), &assign_GovHydro3_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv2"), &assign_GovHydro3_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv3"), &assign_GovHydro3_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv3"), &assign_GovHydro3_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv4"), &assign_GovHydro3_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv4"), &assign_GovHydro3_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv5"), &assign_GovHydro3_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv5"), &assign_GovHydro3_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv6"), &assign_GovHydro3_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.h0"), &assign_GovHydro3_h0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k1"), &assign_GovHydro3_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k2"), &assign_GovHydro3_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.kg"), &assign_GovHydro3_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.ki"), &assign_GovHydro3_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.mwbase"), &assign_GovHydro3_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv1"), &assign_GovHydro3_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv2"), &assign_GovHydro3_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv3"), &assign_GovHydro3_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv4"), &assign_GovHydro3_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv5"), &assign_GovHydro3_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv6"), &assign_GovHydro3_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmax"), &assign_GovHydro3_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmin"), &assign_GovHydro3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.qnl"), &assign_GovHydro3_qnl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.relec"), &assign_GovHydro3_relec)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.rgate"), &assign_GovHydro3_rgate)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.td"), &assign_GovHydro3_td)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tf"), &assign_GovHydro3_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tp"), &assign_GovHydro3_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tt"), &assign_GovHydro3_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tw"), &assign_GovHydro3_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velcl"), &assign_GovHydro3_velcl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velop"), &assign_GovHydro3_velop)); } -void GovHydro3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro3::debugName[] = "GovHydro3"; -const char* GovHydro3::debugString() +void GovHydro3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro3::debugName; } const BaseClassDefiner GovHydro3::declare() @@ -578,4 +614,10 @@ const BaseClassDefiner GovHydro3::declare() return BaseClassDefiner(GovHydro3::addConstructToMap, GovHydro3::addPrimitiveAssignFnsToMap, GovHydro3::addClassAssignFnsToMap, GovHydro3::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro3_factory() + { + return new GovHydro3; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydro3.hpp b/CGMES_2.4.15_16FEB2016/GovHydro3.hpp index 24d55981e..833479d65 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro3.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro3.hpp @@ -1,78 +1,79 @@ #ifndef GovHydro3_H #define GovHydro3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "PU.hpp" #include "Boolean.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE Hydro Governor-Turbine Model. This model differs from that defined in the IEEE modeling guideline paper in that the limits on gate position and velocity do not permit "wind up" of the upstream signals. */ - class GovHydro3: public TurbineGovernorDynamics + class GovHydro3 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean governorControl; /* Governor control flag (Cflag). true = PID control is active false = double derivative control is active. Typical Value = true. Default: false */ - CIMPP::PU rgate; /* Steady-state droop, PU, for governor output feedback (Rgate). Typical Value = 0. Default: nullptr */ - CIMPP::PU relec; /* Steady-state droop, PU, for electrical power feedback (Relec). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ - CIMPP::PU k1; /* Derivative gain (K1). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU k2; /* Double derivative gain, if Cflag = -1 (K2). Typical Value = 2.5. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.2. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro3(); - virtual ~GovHydro3(); - + ~GovHydro3() override; + + CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Boolean governorControl; /* Governor control flag (Cflag). true = PID control is active false = double derivative control is active. Typical Value = true. Default: false */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ + CIMPP::PU k1; /* Derivative gain (K1). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU k2; /* Double derivative gain, if Cflag = -1 (K2). Typical Value = 2.5. Default: nullptr */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU relec; /* Steady-state droop, PU, for electrical power feedback (Relec). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rgate; /* Steady-state droop, PU, for governor output feedback (Rgate). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro3_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydro4.cpp b/CGMES_2.4.15_16FEB2016/GovHydro4.cpp index c53c0b5e1..fd340cff5 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro4.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro4.cpp @@ -1,26 +1,23 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro4.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "PU.hpp" +#include "Simple_Float.hpp" #include "Frequency.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -30,6 +27,7 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -37,570 +35,610 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro4::GovHydro4() {}; - GovHydro4::~GovHydro4() {}; +bool assign_GovHydro4_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hdam; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_qn1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qn1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tblade(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tblade; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro4_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hdam; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_qn1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qn1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_tblade(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tblade; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro4_factory() { - return new GovHydro4; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydro4::debugName[] = "GovHydro4"; +const char* GovHydro4::debugString() const +{ + return GovHydro4::debugName; } -void GovHydro4::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro4"), &GovHydro4_factory)); } -void GovHydro4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.mwbase"), &assign_GovHydro4_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tg"), &assign_GovHydro4_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tp"), &assign_GovHydro4_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uo"), &assign_GovHydro4_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uc"), &assign_GovHydro4_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmax"), &assign_GovHydro4_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmin"), &assign_GovHydro4_gmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rperm"), &assign_GovHydro4_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rtemp"), &assign_GovHydro4_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tr"), &assign_GovHydro4_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tw"), &assign_GovHydro4_tw)); +void GovHydro4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydro4.at"), &assign_GovHydro4_at)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.dturb"), &assign_GovHydro4_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.hdam"), &assign_GovHydro4_hdam)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.qn1"), &assign_GovHydro4_qn1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv0"), &assign_GovHydro4_bgv0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv1"), &assign_GovHydro4_bgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv2"), &assign_GovHydro4_bgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv3"), &assign_GovHydro4_bgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv4"), &assign_GovHydro4_bgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv5"), &assign_GovHydro4_bgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bmax"), &assign_GovHydro4_bmax)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.db1"), &assign_GovHydro4_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.eps"), &assign_GovHydro4_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.db2"), &assign_GovHydro4_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.dturb"), &assign_GovHydro4_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.eps"), &assign_GovHydro4_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmax"), &assign_GovHydro4_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmin"), &assign_GovHydro4_gmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv0"), &assign_GovHydro4_gv0)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv0"), &assign_GovHydro4_pgv0)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv1"), &assign_GovHydro4_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv1"), &assign_GovHydro4_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv2"), &assign_GovHydro4_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv2"), &assign_GovHydro4_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv3"), &assign_GovHydro4_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv3"), &assign_GovHydro4_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv4"), &assign_GovHydro4_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv4"), &assign_GovHydro4_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv5"), &assign_GovHydro4_gv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.hdam"), &assign_GovHydro4_hdam)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.mwbase"), &assign_GovHydro4_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv0"), &assign_GovHydro4_pgv0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv1"), &assign_GovHydro4_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv2"), &assign_GovHydro4_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv3"), &assign_GovHydro4_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv4"), &assign_GovHydro4_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv5"), &assign_GovHydro4_pgv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv0"), &assign_GovHydro4_bgv0)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv1"), &assign_GovHydro4_bgv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv2"), &assign_GovHydro4_bgv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv3"), &assign_GovHydro4_bgv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv4"), &assign_GovHydro4_bgv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv5"), &assign_GovHydro4_bgv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bmax"), &assign_GovHydro4_bmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.qn1"), &assign_GovHydro4_qn1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rperm"), &assign_GovHydro4_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rtemp"), &assign_GovHydro4_rtemp)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tblade"), &assign_GovHydro4_tblade)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tg"), &assign_GovHydro4_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tp"), &assign_GovHydro4_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tr"), &assign_GovHydro4_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tw"), &assign_GovHydro4_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uc"), &assign_GovHydro4_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uo"), &assign_GovHydro4_uo)); } -void GovHydro4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro4::debugName[] = "GovHydro4"; -const char* GovHydro4::debugString() +void GovHydro4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro4::debugName; } const BaseClassDefiner GovHydro4::declare() @@ -608,4 +646,10 @@ const BaseClassDefiner GovHydro4::declare() return BaseClassDefiner(GovHydro4::addConstructToMap, GovHydro4::addPrimitiveAssignFnsToMap, GovHydro4::addClassAssignFnsToMap, GovHydro4::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro4_factory() + { + return new GovHydro4; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydro4.hpp b/CGMES_2.4.15_16FEB2016/GovHydro4.hpp index 947e2a6fa..f91554cfd 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydro4.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydro4.hpp @@ -1,79 +1,80 @@ #ifndef GovHydro4_H #define GovHydro4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Hydro turbine and governor. Represents plants with straight-forward penstock configurations and hydraulic governors of traditional 'dashpot' type. This model can be used to represent simple, Francis, Pelton or Kaplan turbines. */ - class GovHydro4: public TurbineGovernorDynamics + class GovHydro4 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tp; /* Pilot servo time constant (Tp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uo; /* Max gate opening velocity (Uo). Typical Vlaue = 0.2. Default: nullptr */ - CIMPP::Simple_Float uc; /* Max gate closing velocity (Uc). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening, PU of MWbase (Gmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening, PU of MWbase (Gmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds rtemp; /* Temporary droop (Rtemp). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tr; /* Dashpot time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Typical Value = 0.5. Typical Value Francis = 1.1, Kaplan = 1.1. Default: nullptr */ - CIMPP::PU hdam; /* Head available at dam (hdam). Typical Value = 1. Default: nullptr */ - CIMPP::PU qn1; /* No-load flow at nominal head (Qnl). Typical Value = 0.08. Typical Value Francis = 0, Kaplan = 0. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv0; /* Nonlinear gain point 0, PU gv (Gv0). Typical Value = 0. Typical Value Francis = 0.1, Kaplan = 0.1. Default: nullptr */ - CIMPP::PU pgv0; /* Nonlinear gain point 0, PU power (Pgv0). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Typical Value Francis = 0.4, Kaplan = 0.4. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Typical Value Francis = 0.42, Kaplan = 0.35. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Typical Value Francis = 0.5, Kaplan = 0.5. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Typical Value Francis = 0.56, Kaplan = 0.468. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Typical Value Francis = 0.7, Kaplan = 0.7. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.796. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.8. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.917. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.9. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Typical Value Francis = 0.97, Kaplan = 0.99. Default: nullptr */ - CIMPP::PU bgv0; /* Kaplan blade servo point 0 (Bgv0). Typical Value = 0. Default: nullptr */ - CIMPP::PU bgv1; /* Kaplan blade servo point 1 (Bgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU bgv2; /* Kaplan blade servo point 2 (Bgv2). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.1. Default: nullptr */ - CIMPP::PU bgv3; /* Kaplan blade servo point 3 (Bgv3). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.667. Default: nullptr */ - CIMPP::PU bgv4; /* Kaplan blade servo point 4 (Bgv4). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.9. Default: nullptr */ - CIMPP::PU bgv5; /* Kaplan blade servo point 5 (Bgv5). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1. Default: nullptr */ - CIMPP::Simple_Float bmax; /* Maximum blade adjustment factor (Bmax). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1.1276. Default: nullptr */ - CIMPP::Seconds tblade; /* Blade servo time constant (Tblade). Typical Value = 100. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro4(); - virtual ~GovHydro4(); - + ~GovHydro4() override; + + CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU bgv0; /* Kaplan blade servo point 0 (Bgv0). Typical Value = 0. Default: nullptr */ + CIMPP::PU bgv1; /* Kaplan blade servo point 1 (Bgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU bgv2; /* Kaplan blade servo point 2 (Bgv2). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.1. Default: nullptr */ + CIMPP::PU bgv3; /* Kaplan blade servo point 3 (Bgv3). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.667. Default: nullptr */ + CIMPP::PU bgv4; /* Kaplan blade servo point 4 (Bgv4). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.9. Default: nullptr */ + CIMPP::PU bgv5; /* Kaplan blade servo point 5 (Bgv5). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1. Default: nullptr */ + CIMPP::Simple_Float bmax; /* Maximum blade adjustment factor (Bmax). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1.1276. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Typical Value = 0.5. Typical Value Francis = 1.1, Kaplan = 1.1. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening, PU of MWbase (Gmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening, PU of MWbase (Gmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv0; /* Nonlinear gain point 0, PU gv (Gv0). Typical Value = 0. Typical Value Francis = 0.1, Kaplan = 0.1. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Typical Value Francis = 0.4, Kaplan = 0.4. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Typical Value Francis = 0.5, Kaplan = 0.5. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Typical Value Francis = 0.7, Kaplan = 0.7. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.8. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.9. Default: nullptr */ + CIMPP::PU hdam; /* Head available at dam (hdam). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv0; /* Nonlinear gain point 0, PU power (Pgv0). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Typical Value Francis = 0.42, Kaplan = 0.35. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Typical Value Francis = 0.56, Kaplan = 0.468. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.796. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.917. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Typical Value Francis = 0.97, Kaplan = 0.99. Default: nullptr */ + CIMPP::PU qn1; /* No-load flow at nominal head (Qnl). Typical Value = 0.08. Typical Value Francis = 0, Kaplan = 0. Default: nullptr */ + CIMPP::Seconds rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds rtemp; /* Temporary droop (Rtemp). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tblade; /* Blade servo time constant (Tblade). Typical Value = 100. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tp; /* Pilot servo time constant (Tp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tr; /* Dashpot time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float uc; /* Max gate closing velocity (Uc). Typical Value = 0.2. Default: nullptr */ + CIMPP::Simple_Float uo; /* Max gate opening velocity (Uo). Typical Vlaue = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro4_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroDD.cpp b/CGMES_2.4.15_16FEB2016/GovHydroDD.cpp index 99cdbbd9b..af9c6f749 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroDD.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroDD.cpp @@ -1,32 +1,30 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroDD.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -36,526 +34,563 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroDD::GovHydroDD() {}; - GovHydroDD::~GovHydroDD() {}; +bool assign_GovHydroDD_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroDD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroDD_factory() { - return new GovHydroDD; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroDD::debugName[] = "GovHydroDD"; +const char* GovHydroDD::debugString() const +{ + return GovHydroDD::debugName; } -void GovHydroDD::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroDD::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroDD"), &GovHydroDD_factory)); } -void GovHydroDD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.mwbase"), &assign_GovHydroDD_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmax"), &assign_GovHydroDD_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmin"), &assign_GovHydroDD_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.r"), &assign_GovHydroDD_r)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.td"), &assign_GovHydroDD_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tf"), &assign_GovHydroDD_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tp"), &assign_GovHydroDD_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velop"), &assign_GovHydroDD_velop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velcl"), &assign_GovHydroDD_velcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k1"), &assign_GovHydroDD_k1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k2"), &assign_GovHydroDD_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.ki"), &assign_GovHydroDD_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.kg"), &assign_GovHydroDD_kg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tturb"), &assign_GovHydroDD_tturb)); +void GovHydroDD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.aturb"), &assign_GovHydroDD_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.bturb"), &assign_GovHydroDD_bturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tt"), &assign_GovHydroDD_tt)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.db1"), &assign_GovHydroDD_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.eps"), &assign_GovHydroDD_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.db2"), &assign_GovHydroDD_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.eps"), &assign_GovHydroDD_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmax"), &assign_GovHydroDD_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmin"), &assign_GovHydroDD_gmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv1"), &assign_GovHydroDD_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv1"), &assign_GovHydroDD_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv2"), &assign_GovHydroDD_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv2"), &assign_GovHydroDD_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv3"), &assign_GovHydroDD_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv3"), &assign_GovHydroDD_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv4"), &assign_GovHydroDD_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv4"), &assign_GovHydroDD_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv5"), &assign_GovHydroDD_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv5"), &assign_GovHydroDD_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv6"), &assign_GovHydroDD_gv6)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv6"), &assign_GovHydroDD_pgv6)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmax"), &assign_GovHydroDD_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmin"), &assign_GovHydroDD_gmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.inputSignal"), &assign_GovHydroDD_inputSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k1"), &assign_GovHydroDD_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k2"), &assign_GovHydroDD_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.kg"), &assign_GovHydroDD_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.ki"), &assign_GovHydroDD_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.mwbase"), &assign_GovHydroDD_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv1"), &assign_GovHydroDD_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv2"), &assign_GovHydroDD_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv3"), &assign_GovHydroDD_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv4"), &assign_GovHydroDD_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv5"), &assign_GovHydroDD_pgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv6"), &assign_GovHydroDD_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmax"), &assign_GovHydroDD_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmin"), &assign_GovHydroDD_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.r"), &assign_GovHydroDD_r)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.td"), &assign_GovHydroDD_td)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tf"), &assign_GovHydroDD_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tp"), &assign_GovHydroDD_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tt"), &assign_GovHydroDD_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tturb"), &assign_GovHydroDD_tturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velcl"), &assign_GovHydroDD_velcl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velop"), &assign_GovHydroDD_velop)); } -void GovHydroDD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroDD::debugName[] = "GovHydroDD"; -const char* GovHydroDD::debugString() +void GovHydroDD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroDD::debugName; } const BaseClassDefiner GovHydroDD::declare() @@ -563,4 +598,10 @@ const BaseClassDefiner GovHydroDD::declare() return BaseClassDefiner(GovHydroDD::addConstructToMap, GovHydroDD::addPrimitiveAssignFnsToMap, GovHydroDD::addClassAssignFnsToMap, GovHydroDD::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroDD_factory() + { + return new GovHydroDD; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroDD.hpp b/CGMES_2.4.15_16FEB2016/GovHydroDD.hpp index 5d2377df0..66448cd4e 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroDD.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroDD.hpp @@ -1,77 +1,78 @@ #ifndef GovHydroDD_H #define GovHydroDD_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Double derivative hydro governor and turbine. */ - class GovHydroDD: public TurbineGovernorDynamics + class GovHydroDD : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ - CIMPP::PU k1; /* Single derivative gain (K1). Typical Value = 3.6. Default: nullptr */ - CIMPP::PU k2; /* Double derivative gain (K2). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 1. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value = -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroDD(); - virtual ~GovHydroDD(); - + ~GovHydroDD() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value = -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ + CIMPP::PU k1; /* Single derivative gain (K1). Typical Value = 3.6. Default: nullptr */ + CIMPP::PU k2; /* Double derivative gain (K2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 3. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroDD_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroFrancis.cpp b/CGMES_2.4.15_16FEB2016/GovHydroFrancis.cpp index 168b227f5..69a4aec31 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroFrancis.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroFrancis.cpp @@ -1,7 +1,11 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroFrancis.hpp" +#include +#include + #include "PU.hpp" #include "Area.hpp" #include "Area.hpp" @@ -32,32 +36,359 @@ using namespace CIMPP; -GovHydroFrancis::GovHydroFrancis(): qn(nullptr) {}; - +GovHydroFrancis::GovHydroFrancis() {}; GovHydroFrancis::~GovHydroFrancis() {}; +bool assign_GovHydroFrancis_am(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->am; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_etamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->etamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qc0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_qn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twnc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->va; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->waterTunnelSurgeChamberSimulation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroFrancis_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - element->qn = dynamic_cast(BaseClass_ptr2); - if(element->qn != nullptr) - return true; - } - return false; +bool assign_GovHydroFrancis_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zsfc; + if (buffer.fail()) + return false; + else + return true; + } + return false; } @@ -73,330 +404,34 @@ bool assign_GovHydroFrancis_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_p -bool assign_GovHydroFrancis_am(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->am; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_etamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->etamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->governorControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qc0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_GovHydroFrancis_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twnc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->va; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->waterTunnelSurgeChamberSimulation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zsfc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroFrancis_factory() { - return new GovHydroFrancis; - } + + + + + + + + + +const char GovHydroFrancis::debugName[] = "GovHydroFrancis"; +const char* GovHydroFrancis::debugString() const +{ + return GovHydroFrancis::debugName; } -void GovHydroFrancis::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroFrancis::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroFrancis"), &GovHydroFrancis_factory)); } -void GovHydroFrancis::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydroFrancis::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.am"), &assign_GovHydroFrancis_am)); assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.av0"), &assign_GovHydroFrancis_av0)); assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.av1"), &assign_GovHydroFrancis_av1)); @@ -411,7 +446,8 @@ void GovHydroFrancis::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.qn"), &assign_GovHydroFrancis_qn)); - } - -const char GovHydroFrancis::debugName[] = "GovHydroFrancis"; -const char* GovHydroFrancis::debugString() +void GovHydroFrancis::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroFrancis::debugName; } const BaseClassDefiner GovHydroFrancis::declare() @@ -440,4 +470,10 @@ const BaseClassDefiner GovHydroFrancis::declare() return BaseClassDefiner(GovHydroFrancis::addConstructToMap, GovHydroFrancis::addPrimitiveAssignFnsToMap, GovHydroFrancis::addClassAssignFnsToMap, GovHydroFrancis::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroFrancis_factory() + { + return new GovHydroFrancis; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroFrancis.hpp b/CGMES_2.4.15_16FEB2016/GovHydroFrancis.hpp index 8a5077ada..82318836e 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroFrancis.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroFrancis.hpp @@ -1,72 +1,73 @@ #ifndef GovHydroFrancis_H #define GovHydroFrancis_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Area.hpp" -#include "Frequency.hpp" +#include "Boolean.hpp" #include "FrancisGovernorControlKind.hpp" +#include "Frequency.hpp" #include "Length.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "VolumeFlowRate.hpp" +namespace CIMPP +{ -class VolumeFlowRate; /* Detailed hydro unit - Francis model. This model can be used to represent three types of governors. A schematic of the hydraulic system of detailed hydro unit models, like Francis and Pelton, is provided in the DetailedHydroModelHydraulicSystem diagram. */ - class GovHydroFrancis: public TurbineGovernorDynamics + class GovHydroFrancis : public TurbineGovernorDynamics { - public: - CIMPP::PU am; /* Opening section S at the maximum efficiency (Am). Typical Value = 0.7. Default: nullptr */ - CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ - CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ - CIMPP::PU bp; /* Droop (Bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU etamax; /* Maximum efficiency (EtaMax). Typical Value = 1.05. Default: nullptr */ - CIMPP::FrancisGovernorControlKind governorControl; /* Governor control flag (Cflag). Typical Value = mechanicHydrolicTachoAccelerator. Default: 0 */ - CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ - CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ - CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ - CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ - CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = 0.025. Default: nullptr */ - CIMPP::PU kt; /* Washout gain (Kt). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.21. Default: nullptr */ - CIMPP::VolumeFlowRate* qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ - CIMPP::Seconds ta; /* Derivative gain (Ta). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds td; /* Washout time constant (Td). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tx; /* Derivative feedback gain (Tx). Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.011. Default: nullptr */ - CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ - CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.011. Default: nullptr */ - CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ - CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroFrancis(); - virtual ~GovHydroFrancis(); - + ~GovHydroFrancis() override; + + CIMPP::PU am; /* Opening section S at the maximum efficiency (Am). Typical Value = 0.7. Default: nullptr */ + CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ + CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ + CIMPP::PU bp; /* Droop (Bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU etamax; /* Maximum efficiency (EtaMax). Typical Value = 1.05. Default: nullptr */ + CIMPP::FrancisGovernorControlKind governorControl; /* Governor control flag (Cflag). Typical Value = mechanicHydrolicTachoAccelerator. Default: 0 */ + CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ + CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ + CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ + CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ + CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = 0.025. Default: nullptr */ + CIMPP::PU kt; /* Washout gain (Kt). Typical Value = 0.25. Default: nullptr */ + CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.21. Default: nullptr */ + CIMPP::VolumeFlowRate qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ + CIMPP::Seconds ta; /* Derivative gain (Ta). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds td; /* Washout time constant (Td). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tx; /* Derivative feedback gain (Tx). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.011. Default: nullptr */ + CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ + CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.011. Default: nullptr */ + CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ + CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroFrancis_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.cpp b/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.cpp index dcb491f86..282e23474 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.cpp @@ -1,156 +1,164 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroIEEE0.hpp" +#include +#include + +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; GovHydroIEEE0::GovHydroIEEE0() {}; - GovHydroIEEE0::~GovHydroIEEE0() {}; +bool assign_GovHydroIEEE0_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroIEEE0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovHydroIEEE0_factory() { - return new GovHydroIEEE0; - } +const char GovHydroIEEE0::debugName[] = "GovHydroIEEE0"; +const char* GovHydroIEEE0::debugString() const +{ + return GovHydroIEEE0::debugName; } -void GovHydroIEEE0::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroIEEE0::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0"), &GovHydroIEEE0_factory)); } -void GovHydroIEEE0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.mwbase"), &assign_GovHydroIEEE0_mwbase)); +void GovHydroIEEE0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.k"), &assign_GovHydroIEEE0_k)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.mwbase"), &assign_GovHydroIEEE0_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmax"), &assign_GovHydroIEEE0_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmin"), &assign_GovHydroIEEE0_pmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t1"), &assign_GovHydroIEEE0_t1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t2"), &assign_GovHydroIEEE0_t2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t3"), &assign_GovHydroIEEE0_t3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t4"), &assign_GovHydroIEEE0_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmax"), &assign_GovHydroIEEE0_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmin"), &assign_GovHydroIEEE0_pmin)); } -void GovHydroIEEE0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroIEEE0::debugName[] = "GovHydroIEEE0"; -const char* GovHydroIEEE0::debugString() +void GovHydroIEEE0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroIEEE0::debugName; } const BaseClassDefiner GovHydroIEEE0::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner GovHydroIEEE0::declare() return BaseClassDefiner(GovHydroIEEE0::addConstructToMap, GovHydroIEEE0::addPrimitiveAssignFnsToMap, GovHydroIEEE0::addClassAssignFnsToMap, GovHydroIEEE0::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroIEEE0_factory() + { + return new GovHydroIEEE0; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.hpp b/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.hpp index 070477617..f7ce7aa7d 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroIEEE0.hpp @@ -1,47 +1,48 @@ #ifndef GovHydroIEEE0_H #define GovHydroIEEE0_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEEE Simplified Hydro Governor-Turbine Model. Used for Mechanical-Hydraulic and Electro-Hydraulic turbine governors, with our without steam feedback. Typical values given are for Mechanical-Hydraulic. Ref */ - class GovHydroIEEE0: public TurbineGovernorDynamics + class GovHydroIEEE0 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU k; /* Governor gain (K. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0.25. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T2. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Gate actuator time constant (T3). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4; /* Water starting time (T4). Default: nullptr */ - CIMPP::PU pmax; /* Gate maximum (Pmax). Default: nullptr */ - CIMPP::PU pmin; /* Gate minimum (Pmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroIEEE0(); - virtual ~GovHydroIEEE0(); - + ~GovHydroIEEE0() override; + + CIMPP::PU k; /* Governor gain (K. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Gate maximum (Pmax). Default: nullptr */ + CIMPP::PU pmin; /* Gate minimum (Pmin). Default: nullptr */ + CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0.25. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T2. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Gate actuator time constant (T3). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Water starting time (T4). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroIEEE0_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.cpp b/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.cpp index 1cc29756a..7eba81a7d 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.cpp @@ -1,23 +1,21 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroIEEE2.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -28,399 +26,427 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroIEEE2::GovHydroIEEE2() {}; - GovHydroIEEE2::~GovHydroIEEE2() {}; +bool assign_GovHydroIEEE2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroIEEE2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroIEEE2_factory() { - return new GovHydroIEEE2; - } + + + + + + + + + + + + + + + + + + + + +const char GovHydroIEEE2::debugName[] = "GovHydroIEEE2"; +const char* GovHydroIEEE2::debugString() const +{ + return GovHydroIEEE2::debugName; } -void GovHydroIEEE2::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroIEEE2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2"), &GovHydroIEEE2_factory)); } -void GovHydroIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.mwbase"), &assign_GovHydroIEEE2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tg"), &assign_GovHydroIEEE2_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tp"), &assign_GovHydroIEEE2_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uo"), &assign_GovHydroIEEE2_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uc"), &assign_GovHydroIEEE2_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmax"), &assign_GovHydroIEEE2_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmin"), &assign_GovHydroIEEE2_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rperm"), &assign_GovHydroIEEE2_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rtemp"), &assign_GovHydroIEEE2_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tr"), &assign_GovHydroIEEE2_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tw"), &assign_GovHydroIEEE2_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.kturb"), &assign_GovHydroIEEE2_kturb)); +void GovHydroIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.aturb"), &assign_GovHydroIEEE2_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.bturb"), &assign_GovHydroIEEE2_bturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv1"), &assign_GovHydroIEEE2_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv1"), &assign_GovHydroIEEE2_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv2"), &assign_GovHydroIEEE2_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv2"), &assign_GovHydroIEEE2_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv3"), &assign_GovHydroIEEE2_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv3"), &assign_GovHydroIEEE2_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv4"), &assign_GovHydroIEEE2_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv4"), &assign_GovHydroIEEE2_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv5"), &assign_GovHydroIEEE2_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv5"), &assign_GovHydroIEEE2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv6"), &assign_GovHydroIEEE2_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.kturb"), &assign_GovHydroIEEE2_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.mwbase"), &assign_GovHydroIEEE2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv1"), &assign_GovHydroIEEE2_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv2"), &assign_GovHydroIEEE2_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv3"), &assign_GovHydroIEEE2_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv4"), &assign_GovHydroIEEE2_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv5"), &assign_GovHydroIEEE2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv6"), &assign_GovHydroIEEE2_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmax"), &assign_GovHydroIEEE2_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmin"), &assign_GovHydroIEEE2_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rperm"), &assign_GovHydroIEEE2_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rtemp"), &assign_GovHydroIEEE2_rtemp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tg"), &assign_GovHydroIEEE2_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tp"), &assign_GovHydroIEEE2_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tr"), &assign_GovHydroIEEE2_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tw"), &assign_GovHydroIEEE2_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uc"), &assign_GovHydroIEEE2_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uo"), &assign_GovHydroIEEE2_uo)); } -void GovHydroIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroIEEE2::debugName[] = "GovHydroIEEE2"; -const char* GovHydroIEEE2::debugString() +void GovHydroIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroIEEE2::debugName; } const BaseClassDefiner GovHydroIEEE2::declare() @@ -428,4 +454,10 @@ const BaseClassDefiner GovHydroIEEE2::declare() return BaseClassDefiner(GovHydroIEEE2::addConstructToMap, GovHydroIEEE2::addPrimitiveAssignFnsToMap, GovHydroIEEE2::addClassAssignFnsToMap, GovHydroIEEE2::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroIEEE2_factory() + { + return new GovHydroIEEE2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.hpp b/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.hpp index c26fd2f36..db7fb4c8f 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroIEEE2.hpp @@ -1,66 +1,67 @@ #ifndef GovHydroIEEE2_H #define GovHydroIEEE2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* IEEE hydro turbine governor model represents plants with straightforward penstock configurations and hydraulic-dashpot governors. Ref */ - class GovHydroIEEE2: public TurbineGovernorDynamics + class GovHydroIEEE2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Typical Value = -0.1. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroIEEE2(); - virtual ~GovHydroIEEE2(); - + ~GovHydroIEEE2() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Typical Value = -0.1. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroIEEE2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroPID.cpp b/CGMES_2.4.15_16FEB2016/GovHydroPID.cpp index 13df5253d..a6e48d00d 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroPID.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroPID.cpp @@ -1,32 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroPID.hpp" -#include "ActivePower.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Frequency.hpp" #include "Boolean.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -35,497 +32,533 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroPID::GovHydroPID() {}; - GovHydroPID::~GovHydroPID() {}; +bool assign_GovHydroPID_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPID_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPID_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPID_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroPID_factory() { - return new GovHydroPID; - } + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroPID::debugName[] = "GovHydroPID"; +const char* GovHydroPID::debugString() const +{ + return GovHydroPID::debugName; } -void GovHydroPID::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroPID::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroPID"), &GovHydroPID_factory)); } -void GovHydroPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.mwbase"), &assign_GovHydroPID_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmax"), &assign_GovHydroPID_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmin"), &assign_GovHydroPID_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.r"), &assign_GovHydroPID_r)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.td"), &assign_GovHydroPID_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tf"), &assign_GovHydroPID_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tp"), &assign_GovHydroPID_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velop"), &assign_GovHydroPID_velop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velcl"), &assign_GovHydroPID_velcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kd"), &assign_GovHydroPID_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kp"), &assign_GovHydroPID_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.ki"), &assign_GovHydroPID_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kg"), &assign_GovHydroPID_kg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tturb"), &assign_GovHydroPID_tturb)); +void GovHydroPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.aturb"), &assign_GovHydroPID_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.bturb"), &assign_GovHydroPID_bturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tt"), &assign_GovHydroPID_tt)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.db1"), &assign_GovHydroPID_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.inputSignal"), &assign_GovHydroPID_inputSignal)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.eps"), &assign_GovHydroPID_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.db2"), &assign_GovHydroPID_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.eps"), &assign_GovHydroPID_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv1"), &assign_GovHydroPID_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv1"), &assign_GovHydroPID_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv2"), &assign_GovHydroPID_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv2"), &assign_GovHydroPID_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv3"), &assign_GovHydroPID_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv3"), &assign_GovHydroPID_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv4"), &assign_GovHydroPID_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv4"), &assign_GovHydroPID_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv5"), &assign_GovHydroPID_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv5"), &assign_GovHydroPID_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv6"), &assign_GovHydroPID_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.inputSignal"), &assign_GovHydroPID_inputSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kd"), &assign_GovHydroPID_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kg"), &assign_GovHydroPID_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.ki"), &assign_GovHydroPID_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kp"), &assign_GovHydroPID_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.mwbase"), &assign_GovHydroPID_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv1"), &assign_GovHydroPID_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv2"), &assign_GovHydroPID_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv3"), &assign_GovHydroPID_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv4"), &assign_GovHydroPID_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv5"), &assign_GovHydroPID_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv6"), &assign_GovHydroPID_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmax"), &assign_GovHydroPID_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmin"), &assign_GovHydroPID_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.r"), &assign_GovHydroPID_r)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.td"), &assign_GovHydroPID_td)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tf"), &assign_GovHydroPID_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tp"), &assign_GovHydroPID_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tt"), &assign_GovHydroPID_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tturb"), &assign_GovHydroPID_tturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velcl"), &assign_GovHydroPID_velcl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velop"), &assign_GovHydroPID_velop)); } -void GovHydroPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroPID::debugName[] = "GovHydroPID"; -const char* GovHydroPID::debugString() +void GovHydroPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroPID::debugName; } const BaseClassDefiner GovHydroPID::declare() @@ -533,4 +566,10 @@ const BaseClassDefiner GovHydroPID::declare() return BaseClassDefiner(GovHydroPID::addConstructToMap, GovHydroPID::addPrimitiveAssignFnsToMap, GovHydroPID::addClassAssignFnsToMap, GovHydroPID::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroPID_factory() + { + return new GovHydroPID; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroPID.hpp b/CGMES_2.4.15_16FEB2016/GovHydroPID.hpp index b181c9197..62b09b74c 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroPID.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroPID.hpp @@ -1,75 +1,76 @@ #ifndef GovHydroPID_H #define GovHydroPID_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* PID governor and turbine. */ - class GovHydroPID: public TurbineGovernorDynamics + class GovHydroPID : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ - CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.36. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2.5. Default: nullptr */ - CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroPID(); - virtual ~GovHydroPID(); - + ~GovHydroPID() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ + CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2.5. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.36. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroPID_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroPID2.cpp b/CGMES_2.4.15_16FEB2016/GovHydroPID2.cpp index a6b5ae218..4d1cc7efb 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroPID2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroPID2.cpp @@ -1,366 +1,388 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroPID2.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroPID2::GovHydroPID2() {}; - GovHydroPID2::~GovHydroPID2() {}; +bool assign_GovHydroPID2_atw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->atw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->feedbackSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_g1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_g2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->treg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroPID2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->treg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_g1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_g2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_atw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->atw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->feedbackSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovHydroPID2_factory() { - return new GovHydroPID2; - } +const char GovHydroPID2::debugName[] = "GovHydroPID2"; +const char* GovHydroPID2::debugString() const +{ + return GovHydroPID2::debugName; } -void GovHydroPID2::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroPID2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroPID2"), &GovHydroPID2_factory)); } -void GovHydroPID2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.mwbase"), &assign_GovHydroPID2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.treg"), &assign_GovHydroPID2_treg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.rperm"), &assign_GovHydroPID2_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kp"), &assign_GovHydroPID2_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ki"), &assign_GovHydroPID2_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kd"), &assign_GovHydroPID2_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ta"), &assign_GovHydroPID2_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tb"), &assign_GovHydroPID2_tb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmax"), &assign_GovHydroPID2_velmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmin"), &assign_GovHydroPID2_velmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmax"), &assign_GovHydroPID2_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmin"), &assign_GovHydroPID2_gmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tw"), &assign_GovHydroPID2_tw)); +void GovHydroPID2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.atw"), &assign_GovHydroPID2_atw)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.d"), &assign_GovHydroPID2_d)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.feedbackSignal"), &assign_GovHydroPID2_feedbackSignal)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.g0"), &assign_GovHydroPID2_g0)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.g1"), &assign_GovHydroPID2_g1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p1"), &assign_GovHydroPID2_p1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.g2"), &assign_GovHydroPID2_g2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmax"), &assign_GovHydroPID2_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmin"), &assign_GovHydroPID2_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kd"), &assign_GovHydroPID2_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ki"), &assign_GovHydroPID2_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kp"), &assign_GovHydroPID2_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.mwbase"), &assign_GovHydroPID2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p1"), &assign_GovHydroPID2_p1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p2"), &assign_GovHydroPID2_p2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p3"), &assign_GovHydroPID2_p3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.atw"), &assign_GovHydroPID2_atw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.feedbackSignal"), &assign_GovHydroPID2_feedbackSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.rperm"), &assign_GovHydroPID2_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ta"), &assign_GovHydroPID2_ta)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tb"), &assign_GovHydroPID2_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.treg"), &assign_GovHydroPID2_treg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tw"), &assign_GovHydroPID2_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmax"), &assign_GovHydroPID2_velmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmin"), &assign_GovHydroPID2_velmin)); } -void GovHydroPID2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroPID2::debugName[] = "GovHydroPID2"; -const char* GovHydroPID2::debugString() +void GovHydroPID2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroPID2::debugName; } const BaseClassDefiner GovHydroPID2::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner GovHydroPID2::declare() return BaseClassDefiner(GovHydroPID2::addConstructToMap, GovHydroPID2::addPrimitiveAssignFnsToMap, GovHydroPID2::addClassAssignFnsToMap, GovHydroPID2::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroPID2_factory() + { + return new GovHydroPID2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroPID2.hpp b/CGMES_2.4.15_16FEB2016/GovHydroPID2.hpp index e65ae27f1..4927a18e5 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroPID2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroPID2.hpp @@ -1,63 +1,64 @@ #ifndef GovHydroPID2_H #define GovHydroPID2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Hydro turbine and governor. Represents plants with straight forward penstock configurations and "three term" electro-hydraulic governors (i.e. Woodard electronic). */ - class GovHydroPID2: public TurbineGovernorDynamics + class GovHydroPID2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds treg; /* Speed detector time constant (Treg). Typical Value = 0. Default: nullptr */ - CIMPP::PU rperm; /* Permanent drop (Rperm). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ki; /* Reset gain (Ki). Unit = PU/ sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ - CIMPP::PU g0; /* Gate opening at speed no load (G0). Typical Value = 0. Default: nullptr */ - CIMPP::PU g1; /* Intermediate gate opening (G1). Typical Value = 0. Default: nullptr */ - CIMPP::PU p1; /* Power at gate opening G1 (P1). Typical Value = 0. Default: nullptr */ - CIMPP::PU g2; /* Intermediate gate opening (G2). Typical Value = 0. Default: nullptr */ - CIMPP::PU p2; /* Power at gate opening G2 (P2). Typical Value = 0. Default: nullptr */ - CIMPP::PU p3; /* Power at full opened gate (P3). Typical Value = 0. Default: nullptr */ - CIMPP::PU atw; /* Factor multiplying Tw (Atw). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean feedbackSignal; /* Feedback signal type flag (Flag). true = use gate position feedback signal false = use Pe. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroPID2(); - virtual ~GovHydroPID2(); - + ~GovHydroPID2() override; + + CIMPP::PU atw; /* Factor multiplying Tw (Atw). Typical Value = 0. Default: nullptr */ + CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ + CIMPP::Boolean feedbackSignal; /* Feedback signal type flag (Flag). true = use gate position feedback signal false = use Pe. Default: false */ + CIMPP::PU g0; /* Gate opening at speed no load (G0). Typical Value = 0. Default: nullptr */ + CIMPP::PU g1; /* Intermediate gate opening (G1). Typical Value = 0. Default: nullptr */ + CIMPP::PU g2; /* Intermediate gate opening (G2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float ki; /* Reset gain (Ki). Unit = PU/ sec. Typical Value = 0. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU p1; /* Power at gate opening G1 (P1). Typical Value = 0. Default: nullptr */ + CIMPP::PU p2; /* Power at gate opening G2 (P2). Typical Value = 0. Default: nullptr */ + CIMPP::PU p3; /* Power at full opened gate (P3). Typical Value = 0. Default: nullptr */ + CIMPP::PU rperm; /* Permanent drop (Rperm). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds treg; /* Speed detector time constant (Treg). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroPID2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroPelton.cpp b/CGMES_2.4.15_16FEB2016/GovHydroPelton.cpp index 707d20f93..beecbd3c5 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroPelton.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroPelton.cpp @@ -1,7 +1,11 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroPelton.hpp" +#include +#include + #include "Area.hpp" #include "Area.hpp" #include "PU.hpp" @@ -33,29 +37,372 @@ using namespace CIMPP; -GovHydroPelton::GovHydroPelton(): qn(nullptr) {}; - +GovHydroPelton::GovHydroPelton() {}; GovHydroPelton::~GovHydroPelton() {}; +bool assign_GovHydroPelton_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qc0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_qn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_simplifiedPelton(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->simplifiedPelton; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_staticCompensating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->staticCompensating; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twnc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->va; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_vav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vav; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_vcv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->waterTunnelSurgeChamberSimulation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroPelton_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - element->qn = dynamic_cast(BaseClass_ptr2); - if(element->qn != nullptr) - return true; - } - return false; +bool assign_GovHydroPelton_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zsfc; + if (buffer.fail()) + return false; + else + return true; + } + return false; } @@ -75,342 +422,31 @@ bool assign_GovHydroPelton_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_pt -bool assign_GovHydroPelton_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qc0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_GovHydroPelton_simplifiedPelton(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->simplifiedPelton; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_staticCompensating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->staticCompensating; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twnc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->va; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_vav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vav; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_vcv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->waterTunnelSurgeChamberSimulation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zsfc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroPelton_factory() { - return new GovHydroPelton; - } + + + + + + +const char GovHydroPelton::debugName[] = "GovHydroPelton"; +const char* GovHydroPelton::debugString() const +{ + return GovHydroPelton::debugName; } -void GovHydroPelton::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroPelton::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroPelton"), &GovHydroPelton_factory)); } -void GovHydroPelton::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydroPelton::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.av0"), &assign_GovHydroPelton_av0)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.av1"), &assign_GovHydroPelton_av1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.bp"), &assign_GovHydroPelton_bp)); @@ -422,7 +458,8 @@ void GovHydroPelton::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.qn"), &assign_GovHydroPelton_qn)); - } - -const char GovHydroPelton::debugName[] = "GovHydroPelton"; -const char* GovHydroPelton::debugString() +void GovHydroPelton::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroPelton::debugName; } const BaseClassDefiner GovHydroPelton::declare() @@ -455,4 +486,10 @@ const BaseClassDefiner GovHydroPelton::declare() return BaseClassDefiner(GovHydroPelton::addConstructToMap, GovHydroPelton::addPrimitiveAssignFnsToMap, GovHydroPelton::addClassAssignFnsToMap, GovHydroPelton::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroPelton_factory() + { + return new GovHydroPelton; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroPelton.hpp b/CGMES_2.4.15_16FEB2016/GovHydroPelton.hpp index 1cdd59f95..e891067ca 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroPelton.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroPelton.hpp @@ -1,72 +1,73 @@ #ifndef GovHydroPelton_H #define GovHydroPelton_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Area.hpp" -#include "PU.hpp" +#include "Boolean.hpp" #include "Frequency.hpp" #include "Length.hpp" -#include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" +#include "VolumeFlowRate.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class VolumeFlowRate; /* Detailed hydro unit - Pelton model. This model can be used to represent the dynamic related to water tunnel and surge chamber. A schematic of the hydraulic system of detailed hydro unit models, like Francis and Pelton, is located under the GovHydroFrancis class. */ - class GovHydroPelton: public TurbineGovernorDynamics + class GovHydroPelton : public TurbineGovernorDynamics { - public: - CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ - CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ - CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency db2; /* Intentional dead-band width of valve opening error (DB2). Unit = Hz. Typical Value = 0.01. Default: nullptr */ - CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ - CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ - CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ - CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ - CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = -0.025. Default: nullptr */ - CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.05. Default: nullptr */ - CIMPP::VolumeFlowRate* qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ - CIMPP::Boolean simplifiedPelton; /* Simplified Pelton model simulation (Sflag). true = enable of simplified Pelton model simulation false = enable of complete Pelton model simulation (non linear gain). Typical Value = false. Default: false */ - CIMPP::Boolean staticCompensating; /* Static compensating characteristic (Cflag). true = enable of static compensating characteristic false = inhibit of static compensating characteristic. Typical Value = false. Default: false */ - CIMPP::Seconds ta; /* Derivative gain (accelerometer time constant) (Ta). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.15. Default: nullptr */ - CIMPP::Seconds tv; /* Servomotor integrator time constant (TV). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tx; /* Electronic integrator time constant (Tx). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.016. Default: nullptr */ - CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ - CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ - CIMPP::PU vav; /* Maximum servomotor valve opening velocity (Vav). Typical Value = 0.017. Default: nullptr */ - CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.016. Default: nullptr */ - CIMPP::PU vcv; /* Maximum servomotor valve closing velocity (Vcv). Typical Value = -0.017. Default: nullptr */ - CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ - CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroPelton(); - virtual ~GovHydroPelton(); - + ~GovHydroPelton() override; + + CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ + CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ + CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency db2; /* Intentional dead-band width of valve opening error (DB2). Unit = Hz. Typical Value = 0.01. Default: nullptr */ + CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ + CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ + CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ + CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ + CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = -0.025. Default: nullptr */ + CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.05. Default: nullptr */ + CIMPP::VolumeFlowRate qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ + CIMPP::Boolean simplifiedPelton; /* Simplified Pelton model simulation (Sflag). true = enable of simplified Pelton model simulation false = enable of complete Pelton model simulation (non linear gain). Typical Value = false. Default: false */ + CIMPP::Boolean staticCompensating; /* Static compensating characteristic (Cflag). true = enable of static compensating characteristic false = inhibit of static compensating characteristic. Typical Value = false. Default: false */ + CIMPP::Seconds ta; /* Derivative gain (accelerometer time constant) (Ta). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tv; /* Servomotor integrator time constant (TV). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tx; /* Electronic integrator time constant (Tx). Typical Value = 0.5. Default: nullptr */ + CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.016. Default: nullptr */ + CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ + CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ + CIMPP::PU vav; /* Maximum servomotor valve opening velocity (Vav). Typical Value = 0.017. Default: nullptr */ + CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.016. Default: nullptr */ + CIMPP::PU vcv; /* Maximum servomotor valve closing velocity (Vcv). Typical Value = -0.017. Default: nullptr */ + CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ + CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroPelton_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroR.cpp b/CGMES_2.4.15_16FEB2016/GovHydroR.cpp index 42e1bcc8d..d4491f137 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroR.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroR.cpp @@ -1,39 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroR.hpp" +#include +#include + +#include "PU.hpp" +#include "Frequency.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -44,577 +34,657 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroR::GovHydroR() {}; - GovHydroR::~GovHydroR() {}; +bool assign_GovHydroR_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroR_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroR_factory() { - return new GovHydroR; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroR::debugName[] = "GovHydroR"; +const char* GovHydroR::debugString() const +{ + return GovHydroR::debugName; } -void GovHydroR::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroR::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroR"), &GovHydroR_factory)); } -void GovHydroR::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydroR::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.at"), &assign_GovHydroR_at)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.db1"), &assign_GovHydroR_db1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.db2"), &assign_GovHydroR_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.dturb"), &assign_GovHydroR_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.eps"), &assign_GovHydroR_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gmax"), &assign_GovHydroR_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gmin"), &assign_GovHydroR_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv1"), &assign_GovHydroR_gv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv2"), &assign_GovHydroR_gv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv3"), &assign_GovHydroR_gv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv4"), &assign_GovHydroR_gv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv5"), &assign_GovHydroR_gv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv6"), &assign_GovHydroR_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.h0"), &assign_GovHydroR_h0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.inputSignal"), &assign_GovHydroR_inputSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.kg"), &assign_GovHydroR_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.ki"), &assign_GovHydroR_ki)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.mwbase"), &assign_GovHydroR_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv1"), &assign_GovHydroR_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv2"), &assign_GovHydroR_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv3"), &assign_GovHydroR_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv4"), &assign_GovHydroR_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv5"), &assign_GovHydroR_pgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv6"), &assign_GovHydroR_pgv6)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pmax"), &assign_GovHydroR_pmax)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pmin"), &assign_GovHydroR_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.qnl"), &assign_GovHydroR_qnl)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.r"), &assign_GovHydroR_r)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroR.td"), &assign_GovHydroR_td)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.t1"), &assign_GovHydroR_t1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.t2"), &assign_GovHydroR_t2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.t3"), &assign_GovHydroR_t3)); @@ -623,44 +693,16 @@ void GovHydroR::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroR::debugName[] = "GovHydroR"; -const char* GovHydroR::debugString() +void GovHydroR::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroR::debugName; } const BaseClassDefiner GovHydroR::declare() @@ -668,4 +710,10 @@ const BaseClassDefiner GovHydroR::declare() return BaseClassDefiner(GovHydroR::addConstructToMap, GovHydroR::addPrimitiveAssignFnsToMap, GovHydroR::addClassAssignFnsToMap, GovHydroR::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroR_factory() + { + return new GovHydroR; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroR.hpp b/CGMES_2.4.15_16FEB2016/GovHydroR.hpp index 0a48d42e3..116b646d5 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroR.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroR.hpp @@ -1,84 +1,85 @@ #ifndef GovHydroR_H #define GovHydroR_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Fourth order lead-lag governor and hydro turbine. */ - class GovHydroR: public TurbineGovernorDynamics + class GovHydroR : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU r; /* Steady-state droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1; /* Lead time constant 1 (T1). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t2; /* Lag time constant 1 (T2). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t3; /* Lead time constant 2 (T3). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t4; /* Lag time constant 2 (T4). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t5; /* Lead time constant 3 (T5). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t6; /* Lag time constant 3 (T6). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t7; /* Lead time constant 4 (T7). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t8; /* Lag time constant 4 (T8). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ - CIMPP::PU gmax; /* Maximum governor output (Gmax). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU gmin; /* Minimum governor output (Gmin). Typical Value = -0.05. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroR(); - virtual ~GovHydroR(); - + ~GovHydroR() override; + + CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum governor output (Gmax). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU gmin; /* Minimum governor output (Gmin). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU r; /* Steady-state droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t1; /* Lead time constant 1 (T1). Typical Value = 1.5. Default: nullptr */ + CIMPP::Seconds t2; /* Lag time constant 1 (T2). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3; /* Lead time constant 2 (T3). Typical Value = 1.5. Default: nullptr */ + CIMPP::Seconds t4; /* Lag time constant 2 (T4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t5; /* Lead time constant 3 (T5). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t6; /* Lag time constant 3 (T6). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t7; /* Lead time constant 4 (T7). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t8; /* Lag time constant 4 (T8). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroR_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroWEH.cpp b/CGMES_2.4.15_16FEB2016/GovHydroWEH.cpp index 62f9d50e6..5a81200a1 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroWEH.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroWEH.cpp @@ -1,28 +1,23 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroWEH.hpp" -#include "ActivePower.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -43,6 +38,7 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -53,721 +49,761 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovHydroWEH::GovHydroWEH() {}; - GovHydroWEH::~GovHydroWEH() {}; +bool assign_GovHydroWEH_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_dicn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dicn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_dpv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->feedbackSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gtmxcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gtmxcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gtmxop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gtmxop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_rpg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rpg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_rpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tdv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroWEH_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_rpg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rpg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_rpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tdv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gtmxop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gtmxop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gtmxcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gtmxcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_dpv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_dicn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dicn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->feedbackSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroWEH_factory() { - return new GovHydroWEH; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroWEH::debugName[] = "GovHydroWEH"; +const char* GovHydroWEH::debugString() const +{ + return GovHydroWEH::debugName; } -void GovHydroWEH::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroWEH::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroWEH"), &GovHydroWEH_factory)); } -void GovHydroWEH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.mwbase"), &assign_GovHydroWEH_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.rpg"), &assign_GovHydroWEH_rpg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.rpp"), &assign_GovHydroWEH_rpp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tpe"), &assign_GovHydroWEH_tpe)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.kp"), &assign_GovHydroWEH_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.ki"), &assign_GovHydroWEH_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.kd"), &assign_GovHydroWEH_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.td"), &assign_GovHydroWEH_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tp"), &assign_GovHydroWEH_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tdv"), &assign_GovHydroWEH_tdv)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tg"), &assign_GovHydroWEH_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gtmxop"), &assign_GovHydroWEH_gtmxop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gtmxcl"), &assign_GovHydroWEH_gtmxcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gmax"), &assign_GovHydroWEH_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gmin"), &assign_GovHydroWEH_gmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dturb"), &assign_GovHydroWEH_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tw"), &assign_GovHydroWEH_tw)); +void GovHydroWEH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.db"), &assign_GovHydroWEH_db)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dpv"), &assign_GovHydroWEH_dpv)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dicn"), &assign_GovHydroWEH_dicn)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dpv"), &assign_GovHydroWEH_dpv)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dturb"), &assign_GovHydroWEH_dturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.feedbackSignal"), &assign_GovHydroWEH_feedbackSignal)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv1"), &assign_GovHydroWEH_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv2"), &assign_GovHydroWEH_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv3"), &assign_GovHydroWEH_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv4"), &assign_GovHydroWEH_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv5"), &assign_GovHydroWEH_gv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl1"), &assign_GovHydroWEH_fl1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl2"), &assign_GovHydroWEH_fl2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl3"), &assign_GovHydroWEH_fl3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl4"), &assign_GovHydroWEH_fl4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl5"), &assign_GovHydroWEH_fl5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp1"), &assign_GovHydroWEH_fp1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp10"), &assign_GovHydroWEH_fp10)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp2"), &assign_GovHydroWEH_fp2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp3"), &assign_GovHydroWEH_fp3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp4"), &assign_GovHydroWEH_fp4)); @@ -776,8 +812,21 @@ void GovHydroWEH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroWEH::debugName[] = "GovHydroWEH"; -const char* GovHydroWEH::debugString() +void GovHydroWEH::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroWEH::debugName; } const BaseClassDefiner GovHydroWEH::declare() @@ -803,4 +854,10 @@ const BaseClassDefiner GovHydroWEH::declare() return BaseClassDefiner(GovHydroWEH::addConstructToMap, GovHydroWEH::addPrimitiveAssignFnsToMap, GovHydroWEH::addClassAssignFnsToMap, GovHydroWEH::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroWEH_factory() + { + return new GovHydroWEH; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroWEH.hpp b/CGMES_2.4.15_16FEB2016/GovHydroWEH.hpp index 5836eb6b8..acefea27a 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroWEH.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroWEH.hpp @@ -1,92 +1,93 @@ #ifndef GovHydroWEH_H #define GovHydroWEH_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Woodward Electric Hydro Governor Model. */ - class GovHydroWEH: public TurbineGovernorDynamics + class GovHydroWEH : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Simple_Float rpg; /* Permanent droop for governor output feedback (R-Perm-Gate). Default: nullptr */ - CIMPP::Simple_Float rpp; /* Permanent droop for electrical power feedback (R-Perm-Pe). Default: nullptr */ - CIMPP::Seconds tpe; /* Electrical power droop time constant (Tpe). Default: nullptr */ - CIMPP::PU kp; /* Derivative control gain (Kp). Default: nullptr */ - CIMPP::PU ki; /* Derivative controller Integral gain (Ki). Default: nullptr */ - CIMPP::PU kd; /* Derivative controller derivative gain (Kd). Default: nullptr */ - CIMPP::Seconds td; /* Derivative controller time constant to limit the derivative characteristic beyond a breakdown frequency to avoid amplification of high-frequency noise (Td). Default: nullptr */ - CIMPP::Seconds tp; /* Pilot Valve time lag time constant (Tp). Default: nullptr */ - CIMPP::Seconds tdv; /* Distributive Valve time lag time constant (Tdv). Default: nullptr */ - CIMPP::Seconds tg; /* Value to allow the Distribution valve controller to advance beyond the gate movement rate limit (Tg). Default: nullptr */ - CIMPP::PU gtmxop; /* Maximum gate opening rate (Gtmxop). Default: nullptr */ - CIMPP::PU gtmxcl; /* Maximum gate closing rate (Gtmxcl). Default: nullptr */ - CIMPP::PU gmax; /* Maximum Gate Position (Gmax). Default: nullptr */ - CIMPP::PU gmin; /* Minimum Gate Position (Gmin). Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Default: nullptr */ - CIMPP::PU db; /* Speed Dead Band (db). Default: nullptr */ - CIMPP::PU dpv; /* Value to allow the Pilot valve controller to advance beyond the gate limits (Dpv). Default: nullptr */ - CIMPP::PU dicn; /* Value to allow the integral controller to advance beyond the gate limits (Dicn). Default: nullptr */ - CIMPP::Boolean feedbackSignal; /* Feedback signal selection (Sw). true = PID Output (if R-Perm-Gate=droop and R-Perm-Pe=0) false = Electrical Power (if R-Perm-Gate=0 and R-Perm-Pe=droop) or false = Gate Position (if R-Perm-Gate=droop and R-Perm-Pe=0). Default: false */ - CIMPP::PU gv1; /* Gate 1 (Gv1). Gate Position value for point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv2; /* Gate 2 (Gv2). Gate Position value for point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv3; /* Gate 3 (Gv3). Gate Position value for point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv4; /* Gate 4 (Gv4). Gate Position value for point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv5; /* Gate 5 (Gv5). Gate Position value for point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl1; /* Flow Gate 1 (Fl1). Flow value for gate position point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl2; /* Flow Gate 2 (Fl2). Flow value for gate position point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl3; /* Flow Gate 3 (Fl3). Flow value for gate position point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl4; /* Flow Gate 4 (Fl4). Flow value for gate position point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl5; /* Flow Gate 5 (Fl5). Flow value for gate position point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fp1; /* Flow P1 (Fp1). Turbine Flow value for point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp2; /* Flow P2 (Fp2). Turbine Flow value for point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp3; /* Flow P3 (Fp3). Turbine Flow value for point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp4; /* Flow P4 (Fp4). Turbine Flow value for point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp5; /* Flow P5 (Fp5). Turbine Flow value for point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp6; /* Flow P6 (Fp6). Turbine Flow value for point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp7; /* Flow P7 (Fp7). Turbine Flow value for point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp8; /* Flow P8 (Fp8). Turbine Flow value for point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp9; /* Flow P9 (Fp9). Turbine Flow value for point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp10; /* Flow P10 (Fp10). Turbine Flow value for point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss1; /* Pmss Flow P1 (Pmss1). Mechanical Power output Pmss for Turbine Flow point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss2; /* Pmss Flow P2 (Pmss2). Mechanical Power output Pmss for Turbine Flow point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss3; /* Pmss Flow P3 (Pmss3). Mechanical Power output Pmss for Turbine Flow point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss4; /* Pmss Flow P4 (Pmss4). Mechanical Power output Pmss for Turbine Flow point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss5; /* Pmss Flow P5 (Pmss5). Mechanical Power output Pmss for Turbine Flow point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss6; /* Pmss Flow P6 (Pmss6). Mechanical Power output Pmss for Turbine Flow point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss7; /* Pmss Flow P7 (Pmss7). Mechanical Power output Pmss for Turbine Flow point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss8; /* Pmss Flow P8 (Pmss8). Mechanical Power output Pmss for Turbine Flow point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss9; /* Pmss Flow P9 (Pmss9). Mechanical Power output Pmss for Turbine Flow point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss10; /* Pmss Flow P10 (Pmss10). Mechanical Power output Pmss for Turbine Flow point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroWEH(); - virtual ~GovHydroWEH(); - + ~GovHydroWEH() override; + + CIMPP::PU db; /* Speed Dead Band (db). Default: nullptr */ + CIMPP::PU dicn; /* Value to allow the integral controller to advance beyond the gate limits (Dicn). Default: nullptr */ + CIMPP::PU dpv; /* Value to allow the Pilot valve controller to advance beyond the gate limits (Dpv). Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Default: nullptr */ + CIMPP::Boolean feedbackSignal; /* Feedback signal selection (Sw). true = PID Output (if R-Perm-Gate=droop and R-Perm-Pe=0) false = Electrical Power (if R-Perm-Gate=0 and R-Perm-Pe=droop) or false = Gate Position (if R-Perm-Gate=droop and R-Perm-Pe=0). Default: false */ + CIMPP::PU fl1; /* Flow Gate 1 (Fl1). Flow value for gate position point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl2; /* Flow Gate 2 (Fl2). Flow value for gate position point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl3; /* Flow Gate 3 (Fl3). Flow value for gate position point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl4; /* Flow Gate 4 (Fl4). Flow value for gate position point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl5; /* Flow Gate 5 (Fl5). Flow value for gate position point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fp1; /* Flow P1 (Fp1). Turbine Flow value for point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp10; /* Flow P10 (Fp10). Turbine Flow value for point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp2; /* Flow P2 (Fp2). Turbine Flow value for point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp3; /* Flow P3 (Fp3). Turbine Flow value for point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp4; /* Flow P4 (Fp4). Turbine Flow value for point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp5; /* Flow P5 (Fp5). Turbine Flow value for point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp6; /* Flow P6 (Fp6). Turbine Flow value for point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp7; /* Flow P7 (Fp7). Turbine Flow value for point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp8; /* Flow P8 (Fp8). Turbine Flow value for point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp9; /* Flow P9 (Fp9). Turbine Flow value for point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU gmax; /* Maximum Gate Position (Gmax). Default: nullptr */ + CIMPP::PU gmin; /* Minimum Gate Position (Gmin). Default: nullptr */ + CIMPP::PU gtmxcl; /* Maximum gate closing rate (Gtmxcl). Default: nullptr */ + CIMPP::PU gtmxop; /* Maximum gate opening rate (Gtmxop). Default: nullptr */ + CIMPP::PU gv1; /* Gate 1 (Gv1). Gate Position value for point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv2; /* Gate 2 (Gv2). Gate Position value for point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv3; /* Gate 3 (Gv3). Gate Position value for point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv4; /* Gate 4 (Gv4). Gate Position value for point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv5; /* Gate 5 (Gv5). Gate Position value for point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU kd; /* Derivative controller derivative gain (Kd). Default: nullptr */ + CIMPP::PU ki; /* Derivative controller Integral gain (Ki). Default: nullptr */ + CIMPP::PU kp; /* Derivative control gain (Kp). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmss1; /* Pmss Flow P1 (Pmss1). Mechanical Power output Pmss for Turbine Flow point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss10; /* Pmss Flow P10 (Pmss10). Mechanical Power output Pmss for Turbine Flow point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss2; /* Pmss Flow P2 (Pmss2). Mechanical Power output Pmss for Turbine Flow point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss3; /* Pmss Flow P3 (Pmss3). Mechanical Power output Pmss for Turbine Flow point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss4; /* Pmss Flow P4 (Pmss4). Mechanical Power output Pmss for Turbine Flow point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss5; /* Pmss Flow P5 (Pmss5). Mechanical Power output Pmss for Turbine Flow point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss6; /* Pmss Flow P6 (Pmss6). Mechanical Power output Pmss for Turbine Flow point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss7; /* Pmss Flow P7 (Pmss7). Mechanical Power output Pmss for Turbine Flow point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss8; /* Pmss Flow P8 (Pmss8). Mechanical Power output Pmss for Turbine Flow point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss9; /* Pmss Flow P9 (Pmss9). Mechanical Power output Pmss for Turbine Flow point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::Simple_Float rpg; /* Permanent droop for governor output feedback (R-Perm-Gate). Default: nullptr */ + CIMPP::Simple_Float rpp; /* Permanent droop for electrical power feedback (R-Perm-Pe). Default: nullptr */ + CIMPP::Seconds td; /* Derivative controller time constant to limit the derivative characteristic beyond a breakdown frequency to avoid amplification of high-frequency noise (Td). Default: nullptr */ + CIMPP::Seconds tdv; /* Distributive Valve time lag time constant (Tdv). Default: nullptr */ + CIMPP::Seconds tg; /* Value to allow the Distribution valve controller to advance beyond the gate movement rate limit (Tg). Default: nullptr */ + CIMPP::Seconds tp; /* Pilot Valve time lag time constant (Tp). Default: nullptr */ + CIMPP::Seconds tpe; /* Electrical power droop time constant (Tpe). Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroWEH_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovHydroWPID.cpp b/CGMES_2.4.15_16FEB2016/GovHydroWPID.cpp index 1bc4b1d82..951e73be7 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroWPID.cpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroWPID.cpp @@ -1,366 +1,388 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroWPID.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; GovHydroWPID::GovHydroWPID() {}; - GovHydroWPID::~GovHydroWPID() {}; +bool assign_GovHydroWPID_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gatmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gatmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gatmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gatmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_reg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->reg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->treg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroWPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->treg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_reg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->reg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gatmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gatmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gatmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gatmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovHydroWPID_factory() { - return new GovHydroWPID; - } +const char GovHydroWPID::debugName[] = "GovHydroWPID"; +const char* GovHydroWPID::debugString() const +{ + return GovHydroWPID::debugName; } -void GovHydroWPID::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroWPID::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroWPID"), &GovHydroWPID_factory)); } -void GovHydroWPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.mwbase"), &assign_GovHydroWPID_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.treg"), &assign_GovHydroWPID_treg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.reg"), &assign_GovHydroWPID_reg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kp"), &assign_GovHydroWPID_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ki"), &assign_GovHydroWPID_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kd"), &assign_GovHydroWPID_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ta"), &assign_GovHydroWPID_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tb"), &assign_GovHydroWPID_tb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmax"), &assign_GovHydroWPID_velmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmin"), &assign_GovHydroWPID_velmin)); +void GovHydroWPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.d"), &assign_GovHydroWPID_d)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gatmax"), &assign_GovHydroWPID_gatmax)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gatmin"), &assign_GovHydroWPID_gatmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tw"), &assign_GovHydroWPID_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmax"), &assign_GovHydroWPID_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmin"), &assign_GovHydroWPID_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.d"), &assign_GovHydroWPID_d)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv3"), &assign_GovHydroWPID_gv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv1"), &assign_GovHydroWPID_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv1"), &assign_GovHydroWPID_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv2"), &assign_GovHydroWPID_gv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv3"), &assign_GovHydroWPID_gv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kd"), &assign_GovHydroWPID_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ki"), &assign_GovHydroWPID_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kp"), &assign_GovHydroWPID_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.mwbase"), &assign_GovHydroWPID_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv1"), &assign_GovHydroWPID_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv2"), &assign_GovHydroWPID_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv3"), &assign_GovHydroWPID_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmax"), &assign_GovHydroWPID_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmin"), &assign_GovHydroWPID_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.reg"), &assign_GovHydroWPID_reg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ta"), &assign_GovHydroWPID_ta)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tb"), &assign_GovHydroWPID_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.treg"), &assign_GovHydroWPID_treg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tw"), &assign_GovHydroWPID_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmax"), &assign_GovHydroWPID_velmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmin"), &assign_GovHydroWPID_velmin)); } -void GovHydroWPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroWPID::debugName[] = "GovHydroWPID"; -const char* GovHydroWPID::debugString() +void GovHydroWPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroWPID::debugName; } const BaseClassDefiner GovHydroWPID::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner GovHydroWPID::declare() return BaseClassDefiner(GovHydroWPID::addConstructToMap, GovHydroWPID::addPrimitiveAssignFnsToMap, GovHydroWPID::addClassAssignFnsToMap, GovHydroWPID::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroWPID_factory() + { + return new GovHydroWPID; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovHydroWPID.hpp b/CGMES_2.4.15_16FEB2016/GovHydroWPID.hpp index a9fe2c041..fb769d79e 100644 --- a/CGMES_2.4.15_16FEB2016/GovHydroWPID.hpp +++ b/CGMES_2.4.15_16FEB2016/GovHydroWPID.hpp @@ -1,61 +1,62 @@ #ifndef GovHydroWPID_H #define GovHydroWPID_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Woodward PID Hydro Governor. */ - class GovHydroWPID: public TurbineGovernorDynamics + class GovHydroWPID : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds treg; /* Speed detector time constant (Treg). Default: nullptr */ - CIMPP::PU reg; /* Permanent drop (Reg). Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ki; /* Reset gain (Ki). Typical Value = 0.36. Default: nullptr */ - CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ - CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::PU velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU gatmax; /* Gate opening Limit Maximum (Gatmax). Default: nullptr */ - CIMPP::PU gatmin; /* Gate opening Limit Minimum (Gatmin). Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::PU pmax; /* Maximum Power Output (Pmax). Default: nullptr */ - CIMPP::PU pmin; /* Minimum Power Output (Pmin). Default: nullptr */ - CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Default: nullptr */ - CIMPP::PU gv3; /* Gate position 3 (Gv3). Default: nullptr */ - CIMPP::PU gv1; /* Gate position 1 (Gv1). Default: nullptr */ - CIMPP::PU pgv1; /* Output at Gv1 PU of MWbase (Pgv1). Default: nullptr */ - CIMPP::PU gv2; /* Gate position 2 (Gv2). Default: nullptr */ - CIMPP::PU pgv2; /* Output at Gv2 PU of MWbase (Pgv2). Default: nullptr */ - CIMPP::PU pgv3; /* Output at Gv3 PU of MWbase (Pgv3). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroWPID(); - virtual ~GovHydroWPID(); - + ~GovHydroWPID() override; + + CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Default: nullptr */ + CIMPP::PU gatmax; /* Gate opening Limit Maximum (Gatmax). Default: nullptr */ + CIMPP::PU gatmin; /* Gate opening Limit Minimum (Gatmin). Default: nullptr */ + CIMPP::PU gv1; /* Gate position 1 (Gv1). Default: nullptr */ + CIMPP::PU gv2; /* Gate position 2 (Gv2). Default: nullptr */ + CIMPP::PU gv3; /* Gate position 3 (Gv3). Default: nullptr */ + CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ + CIMPP::PU ki; /* Reset gain (Ki). Typical Value = 0.36. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Output at Gv1 PU of MWbase (Pgv1). Default: nullptr */ + CIMPP::PU pgv2; /* Output at Gv2 PU of MWbase (Pgv2). Default: nullptr */ + CIMPP::PU pgv3; /* Output at Gv3 PU of MWbase (Pgv3). Default: nullptr */ + CIMPP::PU pmax; /* Maximum Power Output (Pmax). Default: nullptr */ + CIMPP::PU pmin; /* Minimum Power Output (Pmin). Default: nullptr */ + CIMPP::PU reg; /* Permanent drop (Reg). Default: nullptr */ + CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds treg; /* Speed detector time constant (Treg). Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::PU velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + CIMPP::PU velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroWPID_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteam0.cpp b/CGMES_2.4.15_16FEB2016/GovSteam0.cpp index 09842372b..a1e1a0254 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteam0.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteam0.cpp @@ -1,156 +1,164 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteam0.hpp" +#include +#include + +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovSteam0::GovSteam0() {}; - GovSteam0::~GovSteam0() {}; +bool assign_GovSteam0_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteam0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteam0_factory() { - return new GovSteam0; - } +const char GovSteam0::debugName[] = "GovSteam0"; +const char* GovSteam0::debugString() const +{ + return GovSteam0::debugName; } -void GovSteam0::addConstructToMap(std::unordered_map& factory_map) { +void GovSteam0::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteam0"), &GovSteam0_factory)); } -void GovSteam0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteam0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteam0.dt"), &assign_GovSteam0_dt)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.mwbase"), &assign_GovSteam0_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.r"), &assign_GovSteam0_r)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.t1"), &assign_GovSteam0_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmax"), &assign_GovSteam0_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmin"), &assign_GovSteam0_vmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.t2"), &assign_GovSteam0_t2)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.t3"), &assign_GovSteam0_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam0.dt"), &assign_GovSteam0_dt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmax"), &assign_GovSteam0_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmin"), &assign_GovSteam0_vmin)); } -void GovSteam0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteam0::debugName[] = "GovSteam0"; -const char* GovSteam0::debugString() +void GovSteam0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteam0::debugName; } const BaseClassDefiner GovSteam0::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner GovSteam0::declare() return BaseClassDefiner(GovSteam0::addConstructToMap, GovSteam0::addPrimitiveAssignFnsToMap, GovSteam0::addClassAssignFnsToMap, GovSteam0::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteam0_factory() + { + return new GovSteam0; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteam0.hpp b/CGMES_2.4.15_16FEB2016/GovSteam0.hpp index d25f0238a..942e644f8 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteam0.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteam0.hpp @@ -1,47 +1,48 @@ #ifndef GovSteam0_H #define GovSteam0_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A simplified steam turbine governor model. */ - class GovSteam0: public TurbineGovernorDynamics + class GovSteam0 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1; /* Steam bowl time constant (T1). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU vmax; /* Maximum valve position, PU of mwcap (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum valve position, PU of mwcap (Vmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Numerator time constant of T2/T3 block (T2). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds t3; /* Reheater time constant (T3). Typical Value = 10. Default: nullptr */ - CIMPP::PU dt; /* Turbine damping coefficient (Dt). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteam0(); - virtual ~GovSteam0(); - + ~GovSteam0() override; + + CIMPP::PU dt; /* Turbine damping coefficient (Dt). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t1; /* Steam bowl time constant (T1). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t2; /* Numerator time constant of T2/T3 block (T2). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds t3; /* Reheater time constant (T3). Typical Value = 10. Default: nullptr */ + CIMPP::PU vmax; /* Maximum valve position, PU of mwcap (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum valve position, PU of mwcap (Vmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteam0_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteam1.cpp b/CGMES_2.4.15_16FEB2016/GovSteam1.cpp index a41c168bc..ef3c598f9 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteam1.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteam1.cpp @@ -1,38 +1,30 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteam1.hpp" +#include +#include + +#include "Frequency.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" #include "ActivePower.hpp" -#include "Boolean.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -41,581 +33,628 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovSteam1::GovSteam1() {}; - GovSteam1::~GovSteam1() {}; +bool assign_GovSteam1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_sdb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sdb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_sdb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sdb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_valve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valve; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteam1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_sdb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sdb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_sdb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sdb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_valve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valve; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteam1_factory() { - return new GovSteam1; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovSteam1::debugName[] = "GovSteam1"; +const char* GovSteam1::debugString() const +{ + return GovSteam1::debugName; } -void GovSteam1::addConstructToMap(std::unordered_map& factory_map) { +void GovSteam1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteam1"), &GovSteam1_factory)); } -void GovSteam1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.mwbase"), &assign_GovSteam1_mwbase)); +void GovSteam1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db1"), &assign_GovSteam1_db1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db2"), &assign_GovSteam1_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.eps"), &assign_GovSteam1_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv1"), &assign_GovSteam1_gv1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv2"), &assign_GovSteam1_gv2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv3"), &assign_GovSteam1_gv3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv4"), &assign_GovSteam1_gv4)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv5"), &assign_GovSteam1_gv5)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv6"), &assign_GovSteam1_gv6)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k"), &assign_GovSteam1_k)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t1"), &assign_GovSteam1_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t2"), &assign_GovSteam1_t2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t3"), &assign_GovSteam1_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uo"), &assign_GovSteam1_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uc"), &assign_GovSteam1_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmax"), &assign_GovSteam1_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmin"), &assign_GovSteam1_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t4"), &assign_GovSteam1_t4)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k1"), &assign_GovSteam1_k1)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k2"), &assign_GovSteam1_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t5"), &assign_GovSteam1_t5)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k3"), &assign_GovSteam1_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k4"), &assign_GovSteam1_k4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t6"), &assign_GovSteam1_t6)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k5"), &assign_GovSteam1_k5)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k6"), &assign_GovSteam1_k6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t7"), &assign_GovSteam1_t7)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k7"), &assign_GovSteam1_k7)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k8"), &assign_GovSteam1_k8)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db1"), &assign_GovSteam1_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.eps"), &assign_GovSteam1_eps)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb1"), &assign_GovSteam1_sdb1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb2"), &assign_GovSteam1_sdb2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db2"), &assign_GovSteam1_db2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.valve"), &assign_GovSteam1_valve)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv1"), &assign_GovSteam1_gv1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.mwbase"), &assign_GovSteam1_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv1"), &assign_GovSteam1_pgv1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv2"), &assign_GovSteam1_gv2)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv2"), &assign_GovSteam1_pgv2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv3"), &assign_GovSteam1_gv3)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv3"), &assign_GovSteam1_pgv3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv4"), &assign_GovSteam1_gv4)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv4"), &assign_GovSteam1_pgv4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv5"), &assign_GovSteam1_gv5)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv5"), &assign_GovSteam1_pgv5)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv6"), &assign_GovSteam1_gv6)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv6"), &assign_GovSteam1_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmax"), &assign_GovSteam1_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmin"), &assign_GovSteam1_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb1"), &assign_GovSteam1_sdb1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb2"), &assign_GovSteam1_sdb2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t1"), &assign_GovSteam1_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t2"), &assign_GovSteam1_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t3"), &assign_GovSteam1_t3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t4"), &assign_GovSteam1_t4)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t5"), &assign_GovSteam1_t5)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t6"), &assign_GovSteam1_t6)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t7"), &assign_GovSteam1_t7)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uc"), &assign_GovSteam1_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uo"), &assign_GovSteam1_uo)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.valve"), &assign_GovSteam1_valve)); } -void GovSteam1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteam1::debugName[] = "GovSteam1"; -const char* GovSteam1::debugString() +void GovSteam1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteam1::debugName; } const BaseClassDefiner GovSteam1::declare() @@ -623,4 +662,10 @@ const BaseClassDefiner GovSteam1::declare() return BaseClassDefiner(GovSteam1::addConstructToMap, GovSteam1::addPrimitiveAssignFnsToMap, GovSteam1::addClassAssignFnsToMap, GovSteam1::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteam1_factory() + { + return new GovSteam1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteam1.hpp b/CGMES_2.4.15_16FEB2016/GovSteam1.hpp index 02b477df4..ee0ccf5fb 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteam1.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteam1.hpp @@ -1,81 +1,82 @@ #ifndef GovSteam1_H #define GovSteam1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Steam turbine governor model, based on the GovSteamIEEE1 model (with optional deadband and nonlinear valve gain added). */ - class GovSteam1: public TurbineGovernorDynamics + class GovSteam1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (>0). Typical Value = 25. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Valve positioner time constant (T3(>0). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (>0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ - CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>=0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ - CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Boolean sdb1; /* Intentional deadband indicator. true = intentional deadband is applied false = intentional deadband is not applied. Typical Value = true. Default: false */ - CIMPP::Boolean sdb2; /* Unintentional deadband location. true = intentional deadband is applied before point `A` false = intentional deadband is applied after point `A`. Typical Value = true. Default: false */ - CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::Boolean valve; /* Nonlinear valve characteristic. true = nonlinear valve characteristic is used false = nonlinear valve characteristic is not used. Typical Value = true. Default: false */ - CIMPP::PU gv1; /* Nonlinear gain valve position point 1 (GV1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain power value point 1 (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain valve position point 2 (GV2). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain power value point 2 (Pgv2). Typical Value = 0.75. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain valve position point 3 (GV3). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain power value point 3 (Pgv3). Typical Value = 0.91. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain valve position point 4 (GV4). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain power value point 4 (Pgv4). Typical Value = 0.98. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain valve position point 5 (GV5). Typical Value = 1. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain power value point 5 (Pgv5). Typical Value = 1. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain valve position point 6 (GV6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain power value point 6 (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteam1(); - virtual ~GovSteam1(); - + ~GovSteam1() override; + + CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain valve position point 1 (GV1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain valve position point 2 (GV2). Typical Value = 0.4. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain valve position point 3 (GV3). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain valve position point 4 (GV4). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain valve position point 5 (GV5). Typical Value = 1. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain valve position point 6 (GV6). Typical Value = 0. Default: nullptr */ + CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (>0). Typical Value = 25. Default: nullptr */ + CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ + CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ + CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain power value point 1 (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain power value point 2 (Pgv2). Typical Value = 0.75. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain power value point 3 (Pgv3). Typical Value = 0.91. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain power value point 4 (Pgv4). Typical Value = 0.98. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain power value point 5 (Pgv5). Typical Value = 1. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain power value point 6 (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>=0). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean sdb1; /* Intentional deadband indicator. true = intentional deadband is applied false = intentional deadband is not applied. Typical Value = true. Default: false */ + CIMPP::Boolean sdb2; /* Unintentional deadband location. true = intentional deadband is applied before point `A` false = intentional deadband is applied after point `A`. Typical Value = true. Default: false */ + CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Valve positioner time constant (T3(>0). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (>0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ + CIMPP::Boolean valve; /* Nonlinear valve characteristic. true = nonlinear valve characteristic is used false = nonlinear valve characteristic is not used. Typical Value = true. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteam1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteam2.cpp b/CGMES_2.4.15_16FEB2016/GovSteam2.cpp index 7fa5c8ba4..dae038a86 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteam2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteam2.cpp @@ -1,156 +1,164 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteam2.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovSteam2::GovSteam2() {}; - GovSteam2::~GovSteam2() {}; +bool assign_GovSteam2_dbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteam2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_dbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteam2_factory() { - return new GovSteam2; - } +const char GovSteam2::debugName[] = "GovSteam2"; +const char* GovSteam2::debugString() const +{ + return GovSteam2::debugName; } -void GovSteam2::addConstructToMap(std::unordered_map& factory_map) { +void GovSteam2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteam2"), &GovSteam2_factory)); } -void GovSteam2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.k"), &assign_GovSteam2_k)); +void GovSteam2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovSteam2.dbf"), &assign_GovSteam2_dbf)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t1"), &assign_GovSteam2_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t2"), &assign_GovSteam2_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.k"), &assign_GovSteam2_k)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mnef"), &assign_GovSteam2_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mxef"), &assign_GovSteam2_mxef)); assign_map.insert(std::make_pair(std::string("cim:GovSteam2.pmax"), &assign_GovSteam2_pmax)); assign_map.insert(std::make_pair(std::string("cim:GovSteam2.pmin"), &assign_GovSteam2_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mxef"), &assign_GovSteam2_mxef)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mnef"), &assign_GovSteam2_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t1"), &assign_GovSteam2_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t2"), &assign_GovSteam2_t2)); } -void GovSteam2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteam2::debugName[] = "GovSteam2"; -const char* GovSteam2::debugString() +void GovSteam2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteam2::debugName; } const BaseClassDefiner GovSteam2::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner GovSteam2::declare() return BaseClassDefiner(GovSteam2::addConstructToMap, GovSteam2::addPrimitiveAssignFnsToMap, GovSteam2::addClassAssignFnsToMap, GovSteam2::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteam2_factory() + { + return new GovSteam2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteam2.hpp b/CGMES_2.4.15_16FEB2016/GovSteam2.hpp index 0bbbead01..855305c31 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteam2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteam2.hpp @@ -1,47 +1,48 @@ #ifndef GovSteam2_H #define GovSteam2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified governor model. */ - class GovSteam2: public TurbineGovernorDynamics + class GovSteam2 : public TurbineGovernorDynamics { - public: - CIMPP::Simple_Float k; /* Governor gain (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ - CIMPP::PU dbf; /* Frequency dead band (DBF). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T) (>0). Typical Value = 0.45. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T) (may be 0). Typical Value = 0. Default: nullptr */ - CIMPP::PU pmax; /* Maximum fuel flow (P). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum fuel flow (P). Typical Value = 0. Default: nullptr */ - CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 1. Default: nullptr */ - CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteam2(); - virtual ~GovSteam2(); - + ~GovSteam2() override; + + CIMPP::PU dbf; /* Frequency dead band (DBF). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k; /* Governor gain (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -1. Default: nullptr */ + CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmax; /* Maximum fuel flow (P). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum fuel flow (P). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t1; /* Governor lag time constant (T) (>0). Typical Value = 0.45. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T) (may be 0). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteam2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamCC.cpp b/CGMES_2.4.15_16FEB2016/GovSteamCC.cpp index eb9bd88ba..b99f888df 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamCC.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamCC.cpp @@ -1,291 +1,308 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamCC.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; GovSteamCC::GovSteamCC() {}; - GovSteamCC::~GovSteamCC() {}; +bool assign_GovSteamCC_dhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_dlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_fhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_flp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_pmaxhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmaxhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_pmaxlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmaxlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_rhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_rlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t1hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t1lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t3hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t3lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t4hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t4lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t5hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t5lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamCC_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_pmaxhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmaxhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_rhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t1hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t3hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t4hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t5hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_fhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_dhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_pmaxlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmaxlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_rlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t1lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t3lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t4lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t5lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_flp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_dlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteamCC_factory() { - return new GovSteamCC; - } +const char GovSteamCC::debugName[] = "GovSteamCC"; +const char* GovSteamCC::debugString() const +{ + return GovSteamCC::debugName; } -void GovSteamCC::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamCC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamCC"), &GovSteamCC_factory)); } -void GovSteamCC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamCC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dhp"), &assign_GovSteamCC_dhp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dlp"), &assign_GovSteamCC_dlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.fhp"), &assign_GovSteamCC_fhp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.flp"), &assign_GovSteamCC_flp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.mwbase"), &assign_GovSteamCC_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.pmaxhp"), &assign_GovSteamCC_pmaxhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.rhp"), &assign_GovSteamCC_rhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t1hp"), &assign_GovSteamCC_t1hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t3hp"), &assign_GovSteamCC_t3hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t4hp"), &assign_GovSteamCC_t4hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t5hp"), &assign_GovSteamCC_t5hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.fhp"), &assign_GovSteamCC_fhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dhp"), &assign_GovSteamCC_dhp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.pmaxlp"), &assign_GovSteamCC_pmaxlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.rhp"), &assign_GovSteamCC_rhp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.rlp"), &assign_GovSteamCC_rlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t1hp"), &assign_GovSteamCC_t1hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t1lp"), &assign_GovSteamCC_t1lp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t3hp"), &assign_GovSteamCC_t3hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t3lp"), &assign_GovSteamCC_t3lp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t4hp"), &assign_GovSteamCC_t4hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t4lp"), &assign_GovSteamCC_t4lp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t5hp"), &assign_GovSteamCC_t5hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t5lp"), &assign_GovSteamCC_t5lp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.flp"), &assign_GovSteamCC_flp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dlp"), &assign_GovSteamCC_dlp)); } -void GovSteamCC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamCC::debugName[] = "GovSteamCC"; -const char* GovSteamCC::debugString() +void GovSteamCC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamCC::debugName; } const BaseClassDefiner GovSteamCC::declare() @@ -293,4 +310,10 @@ const BaseClassDefiner GovSteamCC::declare() return BaseClassDefiner(GovSteamCC::addConstructToMap, GovSteamCC::addPrimitiveAssignFnsToMap, GovSteamCC::addClassAssignFnsToMap, GovSteamCC::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamCC_factory() + { + return new GovSteamCC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamCC.hpp b/CGMES_2.4.15_16FEB2016/GovSteamCC.hpp index 7bb44f76b..72759ea29 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamCC.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamCC.hpp @@ -1,56 +1,57 @@ #ifndef GovSteamCC_H #define GovSteamCC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Cross compound turbine governor model. */ - class GovSteamCC: public TurbineGovernorDynamics + class GovSteamCC : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmaxhp; /* Maximum HP value position (Pmaxhp). Typical Value = 1. Default: nullptr */ - CIMPP::PU rhp; /* HP governor droop (Rhp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1hp; /* HP governor time constant (T1hp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t3hp; /* HP turbine time constant (T3hp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4hp; /* HP turbine time constant (T4hp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t5hp; /* HP reheater time constant (T5hp). Typical Value = 10. Default: nullptr */ - CIMPP::PU fhp; /* Fraction of HP power ahead of reheater (Fhp). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU dhp; /* HP damping factor (Dhp). Typical Value = 0. Default: nullptr */ - CIMPP::PU pmaxlp; /* Maximum LP value position (Pmaxlp). Typical Value = 1. Default: nullptr */ - CIMPP::PU rlp; /* LP governor droop (Rlp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1lp; /* LP governor time constant (T1lp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t3lp; /* LP turbine time constant (T3lp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4lp; /* LP turbine time constant (T4lp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t5lp; /* LP reheater time constant (T5lp). Typical Value = 10. Default: nullptr */ - CIMPP::PU flp; /* Fraction of LP power ahead of reheater (Flp). Typical Value = 0.7. Default: nullptr */ - CIMPP::PU dlp; /* LP damping factor (Dlp). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamCC(); - virtual ~GovSteamCC(); - + ~GovSteamCC() override; + + CIMPP::PU dhp; /* HP damping factor (Dhp). Typical Value = 0. Default: nullptr */ + CIMPP::PU dlp; /* LP damping factor (Dlp). Typical Value = 0. Default: nullptr */ + CIMPP::PU fhp; /* Fraction of HP power ahead of reheater (Fhp). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU flp; /* Fraction of LP power ahead of reheater (Flp). Typical Value = 0.7. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmaxhp; /* Maximum HP value position (Pmaxhp). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmaxlp; /* Maximum LP value position (Pmaxlp). Typical Value = 1. Default: nullptr */ + CIMPP::PU rhp; /* HP governor droop (Rhp). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rlp; /* LP governor droop (Rlp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t1hp; /* HP governor time constant (T1hp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t1lp; /* LP governor time constant (T1lp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3hp; /* HP turbine time constant (T3hp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3lp; /* LP turbine time constant (T3lp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4hp; /* HP turbine time constant (T4hp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4lp; /* LP turbine time constant (T4lp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t5hp; /* HP reheater time constant (T5hp). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds t5lp; /* LP reheater time constant (T5lp). Typical Value = 10. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamCC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamEU.cpp b/CGMES_2.4.15_16FEB2016/GovSteamEU.cpp index d65b3ef66..b5a684c62 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamEU.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamEU.cpp @@ -1,561 +1,596 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamEU.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovSteamEU::GovSteamEU() {}; - GovSteamEU::~GovSteamEU() {}; +bool assign_GovSteamEU_chc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->chc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_cho(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cho; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_cic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_cio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_hhpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hhpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_kfcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kfcor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->khp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_klp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_kwcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kwcor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_prhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_simx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->simx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tdp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_ten(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ten; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tfp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tvhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tvip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wmax1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wmax2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wwmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wwmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wwmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wwmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamEU_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tdp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tfp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_kfcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kfcor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_ten(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ten; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_kwcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kwcor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wwmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wwmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wwmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wwmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wmax1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wmax2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tvhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_cho(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cho; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_chc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->chc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_hhpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hhpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tvip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_cio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_cic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_simx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->simx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_prhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->khp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_klp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamEU_factory() { - return new GovSteamEU; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovSteamEU::debugName[] = "GovSteamEU"; +const char* GovSteamEU::debugString() const +{ + return GovSteamEU::debugName; } -void GovSteamEU::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamEU::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamEU"), &GovSteamEU_factory)); } -void GovSteamEU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.mwbase"), &assign_GovSteamEU_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tp"), &assign_GovSteamEU_tp)); +void GovSteamEU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.chc"), &assign_GovSteamEU_chc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cho"), &assign_GovSteamEU_cho)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cic"), &assign_GovSteamEU_cic)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cio"), &assign_GovSteamEU_cio)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db1"), &assign_GovSteamEU_db1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db2"), &assign_GovSteamEU_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.hhpmax"), &assign_GovSteamEU_hhpmax)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.ke"), &assign_GovSteamEU_ke)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tip"), &assign_GovSteamEU_tip)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tdp"), &assign_GovSteamEU_tdp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tfp"), &assign_GovSteamEU_tfp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tf"), &assign_GovSteamEU_tf)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.kfcor"), &assign_GovSteamEU_kfcor)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db1"), &assign_GovSteamEU_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmax"), &assign_GovSteamEU_wfmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmin"), &assign_GovSteamEU_wfmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.khp"), &assign_GovSteamEU_khp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.klp"), &assign_GovSteamEU_klp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.kwcor"), &assign_GovSteamEU_kwcor)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.mwbase"), &assign_GovSteamEU_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.pmax"), &assign_GovSteamEU_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.prhmax"), &assign_GovSteamEU_prhmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.simx"), &assign_GovSteamEU_simx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tb"), &assign_GovSteamEU_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tdp"), &assign_GovSteamEU_tdp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.ten"), &assign_GovSteamEU_ten)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tf"), &assign_GovSteamEU_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tfp"), &assign_GovSteamEU_tfp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.thp"), &assign_GovSteamEU_thp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tip"), &assign_GovSteamEU_tip)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tlp"), &assign_GovSteamEU_tlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tp"), &assign_GovSteamEU_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.trh"), &assign_GovSteamEU_trh)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvhp"), &assign_GovSteamEU_tvhp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvip"), &assign_GovSteamEU_tvip)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tw"), &assign_GovSteamEU_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.kwcor"), &assign_GovSteamEU_kwcor)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db2"), &assign_GovSteamEU_db2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmax"), &assign_GovSteamEU_wwmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmin"), &assign_GovSteamEU_wwmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmax"), &assign_GovSteamEU_wfmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmin"), &assign_GovSteamEU_wfmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wmax1"), &assign_GovSteamEU_wmax1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wmax2"), &assign_GovSteamEU_wmax2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvhp"), &assign_GovSteamEU_tvhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cho"), &assign_GovSteamEU_cho)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.chc"), &assign_GovSteamEU_chc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.hhpmax"), &assign_GovSteamEU_hhpmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvip"), &assign_GovSteamEU_tvip)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cio"), &assign_GovSteamEU_cio)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cic"), &assign_GovSteamEU_cic)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.simx"), &assign_GovSteamEU_simx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.thp"), &assign_GovSteamEU_thp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.trh"), &assign_GovSteamEU_trh)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tlp"), &assign_GovSteamEU_tlp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.prhmax"), &assign_GovSteamEU_prhmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.khp"), &assign_GovSteamEU_khp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.klp"), &assign_GovSteamEU_klp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tb"), &assign_GovSteamEU_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmax"), &assign_GovSteamEU_wwmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmin"), &assign_GovSteamEU_wwmin)); } -void GovSteamEU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamEU::debugName[] = "GovSteamEU"; -const char* GovSteamEU::debugString() +void GovSteamEU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamEU::debugName; } const BaseClassDefiner GovSteamEU::declare() @@ -563,4 +598,10 @@ const BaseClassDefiner GovSteamEU::declare() return BaseClassDefiner(GovSteamEU::addConstructToMap, GovSteamEU::addPrimitiveAssignFnsToMap, GovSteamEU::addClassAssignFnsToMap, GovSteamEU::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamEU_factory() + { + return new GovSteamEU; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamEU.hpp b/CGMES_2.4.15_16FEB2016/GovSteamEU.hpp index a29f4cbae..11e4f65eb 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamEU.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamEU.hpp @@ -1,75 +1,76 @@ #ifndef GovSteamEU_H #define GovSteamEU_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified model of boiler and steam turbine with PID governor. */ - class GovSteamEU: public TurbineGovernorDynamics + class GovSteamEU : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tp; /* Power transducer time constant (Tp). Typical Value = 0.07. Default: nullptr */ - CIMPP::PU ke; /* Gain of the power controller (Ke). Typical Value = 0.65. Default: nullptr */ - CIMPP::Seconds tip; /* Integral time constant of the power controller (Tip). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tdp; /* Derivative time constant of the power controller (Tdp). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tfp; /* Time constant of the power controller (Tfp). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Frequency transducer time constant (Tf). Typical Value = 0. Default: nullptr */ - CIMPP::PU kfcor; /* Gain of the frequency corrector (Kfcor). Typical Value = 20. Default: nullptr */ - CIMPP::PU db1; /* Dead band of the frequency corrector (db1). Typical Value = 0. Default: nullptr */ - CIMPP::PU wfmax; /* Upper limit for frequency correction (Wfmax). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU wfmin; /* Lower limit for frequency correction (Wfmin). Typical Value = -0.05. Default: nullptr */ - CIMPP::PU pmax; /* Maximal active power of the turbine (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ten; /* Electro hydraulic transducer (Ten). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tw; /* Speed transducer time constant (Tw). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU kwcor; /* Gain of the speed governor (Kwcor). Typical Value = 20. Default: nullptr */ - CIMPP::PU db2; /* Dead band of the speed governor (db2). Typical Value = 0.0004. Default: nullptr */ - CIMPP::PU wwmax; /* Upper limit for the speed governor (Wwmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU wwmin; /* Lower limit for the speed governor frequency correction (Wwmin). Typical Value = -1. Default: nullptr */ - CIMPP::PU wmax1; /* Emergency speed control lower limit (wmax1). Typical Value = 1.025. Default: nullptr */ - CIMPP::PU wmax2; /* Emergency speed control upper limit (wmax2). Typical Value = 1.05. Default: nullptr */ - CIMPP::Seconds tvhp; /* Control valves servo time constant (Tvhp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float cho; /* Control valves rate opening limit (Cho). Unit = PU/sec. Typical Value = 0.17. Default: nullptr */ - CIMPP::Simple_Float chc; /* Control valves rate closing limit (Chc). Unit = PU/sec. Typical Value = -3.3. Default: nullptr */ - CIMPP::PU hhpmax; /* Maximum control valve position (Hhpmax). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tvip; /* Intercept valves servo time constant (Tvip). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU cio; /* Intercept valves rate opening limit (Cio). Typical Value = 0.123. Default: nullptr */ - CIMPP::PU cic; /* Intercept valves rate closing limit (Cic). Typical Value = -2.2. Default: nullptr */ - CIMPP::PU simx; /* Intercept valves transfer limit (Simx). Typical Value = 0.425. Default: nullptr */ - CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.31. Default: nullptr */ - CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 8. Default: nullptr */ - CIMPP::Seconds tlp; /* Low pressure(LP) time constant of the turbine (Tlp). Typical Value = 0.45. Default: nullptr */ - CIMPP::PU prhmax; /* Maximum low pressure limit (Prhmax). Typical Value = 1.4. Default: nullptr */ - CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.277. Default: nullptr */ - CIMPP::PU klp; /* Fraction of total turbine output generated by HP part (Klp). Typical Value = 0.723. Default: nullptr */ - CIMPP::Seconds tb; /* Boiler time constant (Tb). Typical Value = 100. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamEU(); - virtual ~GovSteamEU(); - + ~GovSteamEU() override; + + CIMPP::Simple_Float chc; /* Control valves rate closing limit (Chc). Unit = PU/sec. Typical Value = -3.3. Default: nullptr */ + CIMPP::Simple_Float cho; /* Control valves rate opening limit (Cho). Unit = PU/sec. Typical Value = 0.17. Default: nullptr */ + CIMPP::PU cic; /* Intercept valves rate closing limit (Cic). Typical Value = -2.2. Default: nullptr */ + CIMPP::PU cio; /* Intercept valves rate opening limit (Cio). Typical Value = 0.123. Default: nullptr */ + CIMPP::PU db1; /* Dead band of the frequency corrector (db1). Typical Value = 0. Default: nullptr */ + CIMPP::PU db2; /* Dead band of the speed governor (db2). Typical Value = 0.0004. Default: nullptr */ + CIMPP::PU hhpmax; /* Maximum control valve position (Hhpmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU ke; /* Gain of the power controller (Ke). Typical Value = 0.65. Default: nullptr */ + CIMPP::PU kfcor; /* Gain of the frequency corrector (Kfcor). Typical Value = 20. Default: nullptr */ + CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.277. Default: nullptr */ + CIMPP::PU klp; /* Fraction of total turbine output generated by HP part (Klp). Typical Value = 0.723. Default: nullptr */ + CIMPP::PU kwcor; /* Gain of the speed governor (Kwcor). Typical Value = 20. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Maximal active power of the turbine (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU prhmax; /* Maximum low pressure limit (Prhmax). Typical Value = 1.4. Default: nullptr */ + CIMPP::PU simx; /* Intercept valves transfer limit (Simx). Typical Value = 0.425. Default: nullptr */ + CIMPP::Seconds tb; /* Boiler time constant (Tb). Typical Value = 100. Default: nullptr */ + CIMPP::Seconds tdp; /* Derivative time constant of the power controller (Tdp). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ten; /* Electro hydraulic transducer (Ten). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tf; /* Frequency transducer time constant (Tf). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tfp; /* Time constant of the power controller (Tfp). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.31. Default: nullptr */ + CIMPP::Seconds tip; /* Integral time constant of the power controller (Tip). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tlp; /* Low pressure(LP) time constant of the turbine (Tlp). Typical Value = 0.45. Default: nullptr */ + CIMPP::Seconds tp; /* Power transducer time constant (Tp). Typical Value = 0.07. Default: nullptr */ + CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 8. Default: nullptr */ + CIMPP::Seconds tvhp; /* Control valves servo time constant (Tvhp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tvip; /* Intercept valves servo time constant (Tvip). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tw; /* Speed transducer time constant (Tw). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU wfmax; /* Upper limit for frequency correction (Wfmax). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU wfmin; /* Lower limit for frequency correction (Wfmin). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU wmax1; /* Emergency speed control lower limit (wmax1). Typical Value = 1.025. Default: nullptr */ + CIMPP::PU wmax2; /* Emergency speed control upper limit (wmax2). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU wwmax; /* Upper limit for the speed governor (Wwmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU wwmin; /* Lower limit for the speed governor frequency correction (Wwmin). Typical Value = -1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamEU_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamFV2.cpp b/CGMES_2.4.15_16FEB2016/GovSteamFV2.cpp index c907305f9..6fb69673f 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamFV2.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamFV2.cpp @@ -1,31 +1,199 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamFV2.hpp" -#include "ActivePower.hpp" -#include "PU.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovSteamFV2::GovSteamFV2() {}; - GovSteamFV2::~GovSteamFV2() {}; +bool assign_GovSteamFV2_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +205,40 @@ GovSteamFV2::~GovSteamFV2() {}; -bool assign_GovSteamFV2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamFV2_factory() { - return new GovSteamFV2; - } + +const char GovSteamFV2::debugName[] = "GovSteamFV2"; +const char* GovSteamFV2::debugString() const +{ + return GovSteamFV2::debugName; } -void GovSteamFV2::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamFV2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamFV2"), &GovSteamFV2_factory)); } -void GovSteamFV2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamFV2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.dt"), &assign_GovSteamFV2_dt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.k"), &assign_GovSteamFV2_k)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.mwbase"), &assign_GovSteamFV2_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.r"), &assign_GovSteamFV2_r)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.t1"), &assign_GovSteamFV2_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmax"), &assign_GovSteamFV2_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmin"), &assign_GovSteamFV2_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.k"), &assign_GovSteamFV2_k)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.t3"), &assign_GovSteamFV2_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.dt"), &assign_GovSteamFV2_dt)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tt"), &assign_GovSteamFV2_tt)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.ta"), &assign_GovSteamFV2_ta)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tb"), &assign_GovSteamFV2_tb)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tc"), &assign_GovSteamFV2_tc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.ti"), &assign_GovSteamFV2_ti)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tt"), &assign_GovSteamFV2_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmax"), &assign_GovSteamFV2_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmin"), &assign_GovSteamFV2_vmin)); } -void GovSteamFV2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamFV2::debugName[] = "GovSteamFV2"; -const char* GovSteamFV2::debugString() +void GovSteamFV2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamFV2::debugName; } const BaseClassDefiner GovSteamFV2::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner GovSteamFV2::declare() return BaseClassDefiner(GovSteamFV2::addConstructToMap, GovSteamFV2::addPrimitiveAssignFnsToMap, GovSteamFV2::addClassAssignFnsToMap, GovSteamFV2::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamFV2_factory() + { + return new GovSteamFV2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamFV2.hpp b/CGMES_2.4.15_16FEB2016/GovSteamFV2.hpp index 5346ddee4..6271ab5b3 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamFV2.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamFV2.hpp @@ -1,52 +1,53 @@ #ifndef GovSteamFV2_H #define GovSteamFV2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Steam turbine governor with reheat time constants and modeling of the effects of fast valve closing to reduce mechanical power. */ - class GovSteamFV2: public TurbineGovernorDynamics + class GovSteamFV2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Alternate Base used instead of Machine base in equipment model if necessary (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* (R). Default: nullptr */ - CIMPP::Seconds t1; /* Governor time constant (T1). Default: nullptr */ - CIMPP::PU vmax; /* (Vmax). Default: nullptr */ - CIMPP::PU vmin; /* (Vmin). Default: nullptr */ - CIMPP::PU k; /* Fraction of the turbine power developed by turbine sections not involved in fast valving (K). Default: nullptr */ - CIMPP::Seconds t3; /* Reheater time constant (T3). Default: nullptr */ - CIMPP::PU dt; /* (Dt). Default: nullptr */ - CIMPP::Seconds tt; /* Time constant with which power falls off after intercept valve closure (Tt). Default: nullptr */ - CIMPP::Seconds ta; /* Time after initial time for valve to close (Ta). Default: nullptr */ - CIMPP::Seconds tb; /* Time after initial time for valve to begin opening (Tb). Default: nullptr */ - CIMPP::Seconds tc; /* Time after initial time for valve to become fully open (Tc). Default: nullptr */ - CIMPP::Seconds ti; /* Initial time to begin fast valving (Ti). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamFV2(); - virtual ~GovSteamFV2(); - + ~GovSteamFV2() override; + + CIMPP::PU dt; /* (Dt). Default: nullptr */ + CIMPP::PU k; /* Fraction of the turbine power developed by turbine sections not involved in fast valving (K). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Alternate Base used instead of Machine base in equipment model if necessary (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU r; /* (R). Default: nullptr */ + CIMPP::Seconds t1; /* Governor time constant (T1). Default: nullptr */ + CIMPP::Seconds t3; /* Reheater time constant (T3). Default: nullptr */ + CIMPP::Seconds ta; /* Time after initial time for valve to close (Ta). Default: nullptr */ + CIMPP::Seconds tb; /* Time after initial time for valve to begin opening (Tb). Default: nullptr */ + CIMPP::Seconds tc; /* Time after initial time for valve to become fully open (Tc). Default: nullptr */ + CIMPP::Seconds ti; /* Initial time to begin fast valving (Ti). Default: nullptr */ + CIMPP::Seconds tt; /* Time constant with which power falls off after intercept valve closure (Tt). Default: nullptr */ + CIMPP::PU vmax; /* (Vmax). Default: nullptr */ + CIMPP::PU vmin; /* (Vmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamFV2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamFV3.cpp b/CGMES_2.4.15_16FEB2016/GovSteamFV3.cpp index 8b48f1cb6..3bdf5d1ba 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamFV3.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamFV3.cpp @@ -1,321 +1,340 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamFV3.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovSteamFV3::GovSteamFV3() {}; - GovSteamFV3::~GovSteamFV3() {}; +bool assign_GovSteamFV3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_prmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamFV3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_prmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteamFV3_factory() { - return new GovSteamFV3; - } +const char GovSteamFV3::debugName[] = "GovSteamFV3"; +const char* GovSteamFV3::debugString() const +{ + return GovSteamFV3::debugName; } -void GovSteamFV3::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamFV3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamFV3"), &GovSteamFV3_factory)); } -void GovSteamFV3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.mwbase"), &assign_GovSteamFV3_mwbase)); +void GovSteamFV3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k"), &assign_GovSteamFV3_k)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k1"), &assign_GovSteamFV3_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k2"), &assign_GovSteamFV3_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k3"), &assign_GovSteamFV3_k3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.mwbase"), &assign_GovSteamFV3_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmax"), &assign_GovSteamFV3_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmin"), &assign_GovSteamFV3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.prmax"), &assign_GovSteamFV3_prmax)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t1"), &assign_GovSteamFV3_t1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t2"), &assign_GovSteamFV3_t2)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t3"), &assign_GovSteamFV3_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uo"), &assign_GovSteamFV3_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uc"), &assign_GovSteamFV3_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmax"), &assign_GovSteamFV3_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmin"), &assign_GovSteamFV3_pmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t4"), &assign_GovSteamFV3_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k1"), &assign_GovSteamFV3_k1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t5"), &assign_GovSteamFV3_t5)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k2"), &assign_GovSteamFV3_k2)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t6"), &assign_GovSteamFV3_t6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k3"), &assign_GovSteamFV3_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.ta"), &assign_GovSteamFV3_ta)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.tb"), &assign_GovSteamFV3_tb)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.tc"), &assign_GovSteamFV3_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.prmax"), &assign_GovSteamFV3_prmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uc"), &assign_GovSteamFV3_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uo"), &assign_GovSteamFV3_uo)); } -void GovSteamFV3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamFV3::debugName[] = "GovSteamFV3"; -const char* GovSteamFV3::debugString() +void GovSteamFV3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamFV3::debugName; } const BaseClassDefiner GovSteamFV3::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner GovSteamFV3::declare() return BaseClassDefiner(GovSteamFV3::addConstructToMap, GovSteamFV3::addPrimitiveAssignFnsToMap, GovSteamFV3::addClassAssignFnsToMap, GovSteamFV3::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamFV3_factory() + { + return new GovSteamFV3; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamFV3.hpp b/CGMES_2.4.15_16FEB2016/GovSteamFV3.hpp index fc3650f3f..6a09f094e 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamFV3.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamFV3.hpp @@ -1,59 +1,60 @@ #ifndef GovSteamFV3_H #define GovSteamFV3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified GovSteamIEEE1 Steam turbine governor model with Prmax limit and fast valving. */ - class GovSteamFV3: public TurbineGovernorDynamics + class GovSteamFV3 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU k; /* Governor gain, (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lead time constant (T1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lag time constant (T2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Valve positioner time constant (T3). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc). Unit = PU/sec. Typical Value = -1. Default: nullptr */ - CIMPP::PU pmax; /* Maximum valve opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum valve opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU k1; /* Fraction of turbine power developed after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant of second boiler pass (i.e. reheater) (T5). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU k2; /* Fraction of turbine power developed after second boiler pass (K2). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant of crossover or third boiler pass (T6). Typical Value = 10. Default: nullptr */ - CIMPP::PU k3; /* Fraction of hp turbine power developed after crossover or third boiler pass (K3). Typical Value = 0.6. Default: nullptr */ - CIMPP::Seconds ta; /* Time to close intercept valve (IV) (Ta). Typical Value = 0.97. Default: nullptr */ - CIMPP::Seconds tb; /* Time until IV starts to reopen (Tb). Typical Value = 0.98. Default: nullptr */ - CIMPP::Seconds tc; /* Time until IV is fully open (Tc). Typical Value = 0.99. Default: nullptr */ - CIMPP::PU prmax; /* Max. pressure in reheater (Prmax). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamFV3(); - virtual ~GovSteamFV3(); - + ~GovSteamFV3() override; + + CIMPP::PU k; /* Governor gain, (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU k1; /* Fraction of turbine power developed after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU k2; /* Fraction of turbine power developed after second boiler pass (K2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU k3; /* Fraction of hp turbine power developed after crossover or third boiler pass (K3). Typical Value = 0.6. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Maximum valve opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum valve opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU prmax; /* Max. pressure in reheater (Prmax). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t1; /* Governor lead time constant (T1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lag time constant (T2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Valve positioner time constant (T3). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant of second boiler pass (i.e. reheater) (T5). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant of crossover or third boiler pass (T6). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds ta; /* Time to close intercept valve (IV) (Ta). Typical Value = 0.97. Default: nullptr */ + CIMPP::Seconds tb; /* Time until IV starts to reopen (Tb). Typical Value = 0.98. Default: nullptr */ + CIMPP::Seconds tc; /* Time until IV is fully open (Tc). Typical Value = 0.99. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc). Unit = PU/sec. Typical Value = -1. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamFV3_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamFV4.cpp b/CGMES_2.4.15_16FEB2016/GovSteamFV4.cpp index 98d03a636..3c3628870 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamFV4.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamFV4.cpp @@ -1,7 +1,11 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamFV4.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -14,8 +18,6 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -25,777 +27,826 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" using namespace CIMPP; GovSteamFV4::GovSteamFV4() {}; - GovSteamFV4::~GovSteamFV4() {}; +bool assign_GovSteamFV4_cpsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cpsmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_cpsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cpsmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_crmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->crmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_crmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->crmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->khp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kmp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmp1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kmp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmp2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kpt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_krc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->krc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ksh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ksh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_lpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lpi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_lps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_pr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_pr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_psmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->psmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rsmimn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rsmimn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rsmimx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rsmimx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rvgmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rvgmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rvgmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rvgmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_srmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->srmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_srmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->srmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_srsmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->srsmp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_svmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->svmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_svmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->svmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tam; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ty; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_yhpmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yhpmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_yhpmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yhpmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ympmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ympmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ympmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ympmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamFV4_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_lps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_lpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lpi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_crmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->crmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_crmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->crmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kpt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rvgmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rvgmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rvgmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rvgmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_svmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->svmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_svmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->svmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_srmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->srmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_srmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->srmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rsmimx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rsmimx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rsmimn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rsmimn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kmp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmp1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kmp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmp2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_srsmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->srsmp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ty; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_yhpmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yhpmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_yhpmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yhpmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tam; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ympmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ympmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ympmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ympmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->khp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_pr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_pr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_psmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->psmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_cpsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cpsmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_cpsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cpsmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_krc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->krc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ksh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ksh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamFV4_factory() { - return new GovSteamFV4; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovSteamFV4::debugName[] = "GovSteamFV4"; +const char* GovSteamFV4::debugString() const +{ + return GovSteamFV4::debugName; } -void GovSteamFV4::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamFV4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamFV4"), &GovSteamFV4_factory)); } -void GovSteamFV4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamFV4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmn"), &assign_GovSteamFV4_cpsmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmx"), &assign_GovSteamFV4_cpsmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmn"), &assign_GovSteamFV4_crmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmx"), &assign_GovSteamFV4_crmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kdc"), &assign_GovSteamFV4_kdc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kf1"), &assign_GovSteamFV4_kf1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kf3"), &assign_GovSteamFV4_kf3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.lps"), &assign_GovSteamFV4_lps)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.khp"), &assign_GovSteamFV4_khp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kic"), &assign_GovSteamFV4_kic)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kip"), &assign_GovSteamFV4_kip)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kit"), &assign_GovSteamFV4_kit)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp1"), &assign_GovSteamFV4_kmp1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp2"), &assign_GovSteamFV4_kmp2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpc"), &assign_GovSteamFV4_kpc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpp"), &assign_GovSteamFV4_kpp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpt"), &assign_GovSteamFV4_kpt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.krc"), &assign_GovSteamFV4_krc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ksh"), &assign_GovSteamFV4_ksh)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.lpi"), &assign_GovSteamFV4_lpi)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.mxef"), &assign_GovSteamFV4_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.lps"), &assign_GovSteamFV4_lps)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.mnef"), &assign_GovSteamFV4_mnef)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmx"), &assign_GovSteamFV4_crmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmn"), &assign_GovSteamFV4_crmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpt"), &assign_GovSteamFV4_kpt)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kit"), &assign_GovSteamFV4_kit)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rvgmx"), &assign_GovSteamFV4_rvgmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.mxef"), &assign_GovSteamFV4_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr1"), &assign_GovSteamFV4_pr1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr2"), &assign_GovSteamFV4_pr2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.psmn"), &assign_GovSteamFV4_psmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimn"), &assign_GovSteamFV4_rsmimn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimx"), &assign_GovSteamFV4_rsmimx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rvgmn"), &assign_GovSteamFV4_rvgmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmx"), &assign_GovSteamFV4_svmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmn"), &assign_GovSteamFV4_svmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srmx"), &assign_GovSteamFV4_srmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rvgmx"), &assign_GovSteamFV4_rvgmx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srmn"), &assign_GovSteamFV4_srmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpp"), &assign_GovSteamFV4_kpp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kip"), &assign_GovSteamFV4_kip)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimx"), &assign_GovSteamFV4_rsmimx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimn"), &assign_GovSteamFV4_rsmimn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp1"), &assign_GovSteamFV4_kmp1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp2"), &assign_GovSteamFV4_kmp2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srmx"), &assign_GovSteamFV4_srmx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srsmp"), &assign_GovSteamFV4_srsmp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmn"), &assign_GovSteamFV4_svmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmx"), &assign_GovSteamFV4_svmx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ta"), &assign_GovSteamFV4_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tc"), &assign_GovSteamFV4_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ty"), &assign_GovSteamFV4_ty)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmx"), &assign_GovSteamFV4_yhpmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmn"), &assign_GovSteamFV4_yhpmn)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tam"), &assign_GovSteamFV4_tam)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tc"), &assign_GovSteamFV4_tc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tcm"), &assign_GovSteamFV4_tcm)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmx"), &assign_GovSteamFV4_ympmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmn"), &assign_GovSteamFV4_ympmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.y"), &assign_GovSteamFV4_y)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.thp"), &assign_GovSteamFV4_thp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.trh"), &assign_GovSteamFV4_trh)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tmp"), &assign_GovSteamFV4_tmp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.khp"), &assign_GovSteamFV4_khp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr1"), &assign_GovSteamFV4_pr1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr2"), &assign_GovSteamFV4_pr2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.psmn"), &assign_GovSteamFV4_psmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpc"), &assign_GovSteamFV4_kpc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kic"), &assign_GovSteamFV4_kic)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kdc"), &assign_GovSteamFV4_kdc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tdc"), &assign_GovSteamFV4_tdc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmx"), &assign_GovSteamFV4_cpsmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmn"), &assign_GovSteamFV4_cpsmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.krc"), &assign_GovSteamFV4_krc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tf1"), &assign_GovSteamFV4_tf1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tf2"), &assign_GovSteamFV4_tf2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.thp"), &assign_GovSteamFV4_thp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tmp"), &assign_GovSteamFV4_tmp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.trh"), &assign_GovSteamFV4_trh)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tv"), &assign_GovSteamFV4_tv)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ksh"), &assign_GovSteamFV4_ksh)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ty"), &assign_GovSteamFV4_ty)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.y"), &assign_GovSteamFV4_y)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmn"), &assign_GovSteamFV4_yhpmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmx"), &assign_GovSteamFV4_yhpmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmn"), &assign_GovSteamFV4_ympmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmx"), &assign_GovSteamFV4_ympmx)); } -void GovSteamFV4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamFV4::debugName[] = "GovSteamFV4"; -const char* GovSteamFV4::debugString() +void GovSteamFV4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamFV4::debugName; } const BaseClassDefiner GovSteamFV4::declare() @@ -803,4 +854,10 @@ const BaseClassDefiner GovSteamFV4::declare() return BaseClassDefiner(GovSteamFV4::addConstructToMap, GovSteamFV4::addPrimitiveAssignFnsToMap, GovSteamFV4::addClassAssignFnsToMap, GovSteamFV4::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamFV4_factory() + { + return new GovSteamFV4; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamFV4.hpp b/CGMES_2.4.15_16FEB2016/GovSteamFV4.hpp index 0054e6425..2b19c8f6e 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamFV4.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamFV4.hpp @@ -1,90 +1,91 @@ #ifndef GovSteamFV4_H #define GovSteamFV4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Detailed electro-hydraulic governor for steam unit. */ - class GovSteamFV4: public TurbineGovernorDynamics + class GovSteamFV4 : public TurbineGovernorDynamics { - public: - CIMPP::PU kf1; /* Frequency bias (reciprocal of droop) (Kf1). Typical Value = 20. Default: nullptr */ - CIMPP::PU kf3; /* Frequency control (reciprocal of droop) (Kf3). Typical Value = 20. Default: nullptr */ - CIMPP::PU lps; /* Maximum positive power error (Lps). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU lpi; /* Maximum negative power error (Lpi). Typical Value = -0.15. Default: nullptr */ - CIMPP::PU mxef; /* Upper limit for frequency correction (MX). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU mnef; /* Lower limit for frequency correction (MN). Typical Value = -0.05. Default: nullptr */ - CIMPP::PU crmx; /* Maximum value of regulator set-point (Crmx). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU crmn; /* Minimum value of regulator set-point (Crmn). Typical Value = 0. Default: nullptr */ - CIMPP::PU kpt; /* Proportional gain of electro-hydraulic regulator (Kpt). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU kit; /* Integral gain of electro-hydraulic regulator (Kit). Typical Value = 0.04. Default: nullptr */ - CIMPP::PU rvgmx; /* Maximum value of integral regulator (Rvgmx). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU rvgmn; /* Minimum value of integral regulator (Rvgmn). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float svmx; /* Maximum regulator gate opening velocity (Svmx). Typical Value = 0.0333. Default: nullptr */ - CIMPP::Simple_Float svmn; /* Maximum regulator gate closing velocity (Svmn). Typical Value = -0.0333. Default: nullptr */ - CIMPP::PU srmx; /* Maximum valve opening (Srmx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU srmn; /* Minimum valve opening (Srmn). Typical Value = 0. Default: nullptr */ - CIMPP::PU kpp; /* Proportional gain of pressure feedback regulator (Kpp). Typical Value = 1. Default: nullptr */ - CIMPP::PU kip; /* Integral gain of pressure feedback regulator (Kip). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU rsmimx; /* Maximum value of integral regulator (Rsmimx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU rsmimn; /* Minimum value of integral regulator (Rsmimn). Typical Value = 0. Default: nullptr */ - CIMPP::PU kmp1; /* First gain coefficient of intercept valves characteristic (Kmp1). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kmp2; /* Second gain coefficient of intercept valves characteristic (Kmp2). Typical Value = 3.5. Default: nullptr */ - CIMPP::PU srsmp; /* Intercept valves characteristic discontinuity point (Srsmp). Typical Value = 0.43. Default: nullptr */ - CIMPP::Seconds ta; /* Control valves rate opening time (Ta). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tc; /* Control valves rate closing time (Tc). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds ty; /* Control valves servo time constant (Ty). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU yhpmx; /* Maximum control valve position (Yhpmx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU yhpmn; /* Minimum control valve position (Yhpmn). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tam; /* Intercept valves rate opening time (Tam). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tcm; /* Intercept valves rate closing time (Tcm). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU ympmx; /* Maximum intercept valve position (Ympmx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU ympmn; /* Minimum intercept valve position (Ympmn). Typical Value = 0. Default: nullptr */ - CIMPP::PU y; /* Coefficient of linearized equations of turbine (Stodola formulation) (Y). Typical Value = 0.13. Default: nullptr */ - CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.15. Default: nullptr */ - CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tmp; /* Low pressure (LP) time constant of the turbine (Tmp). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.35. Default: nullptr */ - CIMPP::PU pr1; /* First value of pressure set point static characteristic (Pr1). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU pr2; /* Second value of pressure set point static characteristic, corresponding to Ps0 = 1.0 PU (Pr2). Typical Value = 0.75. Default: nullptr */ - CIMPP::PU psmn; /* Minimum value of pressure set point static characteristic (Psmn). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpc; /* Proportional gain of pressure regulator (Kpc). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kic; /* Integral gain of pressure regulator (Kic). Typical Value = 0.0033. Default: nullptr */ - CIMPP::PU kdc; /* Derivative gain of pressure regulator (Kdc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tdc; /* Derivative time constant of pressure regulator (Tdc). Typical Value = 90. Default: nullptr */ - CIMPP::PU cpsmx; /* Maximum value of pressure regulator output (Cpsmx). Typical Value = 1. Default: nullptr */ - CIMPP::PU cpsmn; /* Minimum value of pressure regulator output (Cpsmn). Typical Value = -1. Default: nullptr */ - CIMPP::PU krc; /* Maximum variation of fuel flow (Krc). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf1; /* Time constant of fuel regulation (Tf1). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tf2; /* Time constant of steam chest (Tf2). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tv; /* Boiler time constant (Tv). Typical Value = 60. Default: nullptr */ - CIMPP::PU ksh; /* Pressure loss due to flow friction in the boiler tubes (Ksh). Typical Value = 0.08. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamFV4(); - virtual ~GovSteamFV4(); - + ~GovSteamFV4() override; + + CIMPP::PU cpsmn; /* Minimum value of pressure regulator output (Cpsmn). Typical Value = -1. Default: nullptr */ + CIMPP::PU cpsmx; /* Maximum value of pressure regulator output (Cpsmx). Typical Value = 1. Default: nullptr */ + CIMPP::PU crmn; /* Minimum value of regulator set-point (Crmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU crmx; /* Maximum value of regulator set-point (Crmx). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU kdc; /* Derivative gain of pressure regulator (Kdc). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf1; /* Frequency bias (reciprocal of droop) (Kf1). Typical Value = 20. Default: nullptr */ + CIMPP::PU kf3; /* Frequency control (reciprocal of droop) (Kf3). Typical Value = 20. Default: nullptr */ + CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.35. Default: nullptr */ + CIMPP::PU kic; /* Integral gain of pressure regulator (Kic). Typical Value = 0.0033. Default: nullptr */ + CIMPP::PU kip; /* Integral gain of pressure feedback regulator (Kip). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kit; /* Integral gain of electro-hydraulic regulator (Kit). Typical Value = 0.04. Default: nullptr */ + CIMPP::PU kmp1; /* First gain coefficient of intercept valves characteristic (Kmp1). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kmp2; /* Second gain coefficient of intercept valves characteristic (Kmp2). Typical Value = 3.5. Default: nullptr */ + CIMPP::PU kpc; /* Proportional gain of pressure regulator (Kpc). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kpp; /* Proportional gain of pressure feedback regulator (Kpp). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpt; /* Proportional gain of electro-hydraulic regulator (Kpt). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU krc; /* Maximum variation of fuel flow (Krc). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ksh; /* Pressure loss due to flow friction in the boiler tubes (Ksh). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU lpi; /* Maximum negative power error (Lpi). Typical Value = -0.15. Default: nullptr */ + CIMPP::PU lps; /* Maximum positive power error (Lps). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU mnef; /* Lower limit for frequency correction (MN). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU mxef; /* Upper limit for frequency correction (MX). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU pr1; /* First value of pressure set point static characteristic (Pr1). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU pr2; /* Second value of pressure set point static characteristic, corresponding to Ps0 = 1.0 PU (Pr2). Typical Value = 0.75. Default: nullptr */ + CIMPP::PU psmn; /* Minimum value of pressure set point static characteristic (Psmn). Typical Value = 1. Default: nullptr */ + CIMPP::PU rsmimn; /* Minimum value of integral regulator (Rsmimn). Typical Value = 0. Default: nullptr */ + CIMPP::PU rsmimx; /* Maximum value of integral regulator (Rsmimx). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU rvgmn; /* Minimum value of integral regulator (Rvgmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU rvgmx; /* Maximum value of integral regulator (Rvgmx). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU srmn; /* Minimum valve opening (Srmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU srmx; /* Maximum valve opening (Srmx). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU srsmp; /* Intercept valves characteristic discontinuity point (Srsmp). Typical Value = 0.43. Default: nullptr */ + CIMPP::Simple_Float svmn; /* Maximum regulator gate closing velocity (Svmn). Typical Value = -0.0333. Default: nullptr */ + CIMPP::Simple_Float svmx; /* Maximum regulator gate opening velocity (Svmx). Typical Value = 0.0333. Default: nullptr */ + CIMPP::Seconds ta; /* Control valves rate opening time (Ta). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tam; /* Intercept valves rate opening time (Tam). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tc; /* Control valves rate closing time (Tc). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tcm; /* Intercept valves rate closing time (Tcm). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tdc; /* Derivative time constant of pressure regulator (Tdc). Typical Value = 90. Default: nullptr */ + CIMPP::Seconds tf1; /* Time constant of fuel regulation (Tf1). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tf2; /* Time constant of steam chest (Tf2). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tmp; /* Low pressure (LP) time constant of the turbine (Tmp). Typical Value = 0.4. Default: nullptr */ + CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tv; /* Boiler time constant (Tv). Typical Value = 60. Default: nullptr */ + CIMPP::Seconds ty; /* Control valves servo time constant (Ty). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU y; /* Coefficient of linearized equations of turbine (Stodola formulation) (Y). Typical Value = 0.13. Default: nullptr */ + CIMPP::PU yhpmn; /* Minimum control valve position (Yhpmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU yhpmx; /* Maximum control valve position (Yhpmx). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU ympmn; /* Minimum intercept valve position (Ympmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU ympmx; /* Maximum intercept valve position (Ympmx). Typical Value = 1.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamFV4_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.cpp b/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.cpp index de0955544..e21c36d0a 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.cpp @@ -1,25 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamIEEE1.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "ActivePower.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -27,325 +31,342 @@ using namespace CIMPP; GovSteamIEEE1::GovSteamIEEE1() {}; - GovSteamIEEE1::~GovSteamIEEE1() {}; +bool assign_GovSteamIEEE1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamIEEE1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteamIEEE1_factory() { - return new GovSteamIEEE1; - } +const char GovSteamIEEE1::debugName[] = "GovSteamIEEE1"; +const char* GovSteamIEEE1::debugString() const +{ + return GovSteamIEEE1::debugName; } -void GovSteamIEEE1::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamIEEE1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1"), &GovSteamIEEE1_factory)); } -void GovSteamIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.mwbase"), &assign_GovSteamIEEE1_mwbase)); +void GovSteamIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k"), &assign_GovSteamIEEE1_k)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t1"), &assign_GovSteamIEEE1_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t2"), &assign_GovSteamIEEE1_t2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t3"), &assign_GovSteamIEEE1_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uo"), &assign_GovSteamIEEE1_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uc"), &assign_GovSteamIEEE1_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmax"), &assign_GovSteamIEEE1_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmin"), &assign_GovSteamIEEE1_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t4"), &assign_GovSteamIEEE1_t4)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k1"), &assign_GovSteamIEEE1_k1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k2"), &assign_GovSteamIEEE1_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t5"), &assign_GovSteamIEEE1_t5)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k3"), &assign_GovSteamIEEE1_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k4"), &assign_GovSteamIEEE1_k4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t6"), &assign_GovSteamIEEE1_t6)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k5"), &assign_GovSteamIEEE1_k5)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k6"), &assign_GovSteamIEEE1_k6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t7"), &assign_GovSteamIEEE1_t7)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k7"), &assign_GovSteamIEEE1_k7)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k8"), &assign_GovSteamIEEE1_k8)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.mwbase"), &assign_GovSteamIEEE1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmax"), &assign_GovSteamIEEE1_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmin"), &assign_GovSteamIEEE1_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t1"), &assign_GovSteamIEEE1_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t2"), &assign_GovSteamIEEE1_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t3"), &assign_GovSteamIEEE1_t3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t4"), &assign_GovSteamIEEE1_t4)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t5"), &assign_GovSteamIEEE1_t5)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t6"), &assign_GovSteamIEEE1_t6)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t7"), &assign_GovSteamIEEE1_t7)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uc"), &assign_GovSteamIEEE1_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uo"), &assign_GovSteamIEEE1_uo)); } -void GovSteamIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamIEEE1::debugName[] = "GovSteamIEEE1"; -const char* GovSteamIEEE1::debugString() +void GovSteamIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamIEEE1::debugName; } const BaseClassDefiner GovSteamIEEE1::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner GovSteamIEEE1::declare() return BaseClassDefiner(GovSteamIEEE1::addConstructToMap, GovSteamIEEE1::addPrimitiveAssignFnsToMap, GovSteamIEEE1::addClassAssignFnsToMap, GovSteamIEEE1::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamIEEE1_factory() + { + return new GovSteamIEEE1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.hpp b/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.hpp index 5d42a4071..e42a8348c 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamIEEE1.hpp @@ -1,61 +1,62 @@ #ifndef GovSteamIEEE1_H #define GovSteamIEEE1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEEE steam turbine governor model. Ref */ - class GovSteamIEEE1: public TurbineGovernorDynamics + class GovSteamIEEE1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0) Default: nullptr */ - CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (> 0). Typical Value = 25. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Valve positioner time constant (T3) (> 0). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (> 0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (< 0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ - CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>= 0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ - CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamIEEE1(); - virtual ~GovSteamIEEE1(); - + ~GovSteamIEEE1() override; + + CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (> 0). Typical Value = 25. Default: nullptr */ + CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ + CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ + CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0) Default: nullptr */ + CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>= 0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Valve positioner time constant (T3) (> 0). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (< 0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (> 0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamIEEE1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GovSteamSGO.cpp b/CGMES_2.4.15_16FEB2016/GovSteamSGO.cpp index 009818518..6ebbc4068 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamSGO.cpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamSGO.cpp @@ -1,216 +1,228 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamSGO.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" using namespace CIMPP; GovSteamSGO::GovSteamSGO() {}; - GovSteamSGO::~GovSteamSGO() {}; +bool assign_GovSteamSGO_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamSGO_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamSGO_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamSGO_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamSGO_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamSGO_factory() { - return new GovSteamSGO; - } + + + + + + + + + +const char GovSteamSGO::debugName[] = "GovSteamSGO"; +const char* GovSteamSGO::debugString() const +{ + return GovSteamSGO::debugName; } -void GovSteamSGO::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamSGO::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamSGO"), &GovSteamSGO_factory)); } -void GovSteamSGO::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamSGO::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k1"), &assign_GovSteamSGO_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k2"), &assign_GovSteamSGO_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k3"), &assign_GovSteamSGO_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.mwbase"), &assign_GovSteamSGO_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmax"), &assign_GovSteamSGO_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmin"), &assign_GovSteamSGO_pmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t1"), &assign_GovSteamSGO_t1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t2"), &assign_GovSteamSGO_t2)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t3"), &assign_GovSteamSGO_t3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t4"), &assign_GovSteamSGO_t4)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t5"), &assign_GovSteamSGO_t5)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t6"), &assign_GovSteamSGO_t6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k1"), &assign_GovSteamSGO_k1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k2"), &assign_GovSteamSGO_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k3"), &assign_GovSteamSGO_k3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmax"), &assign_GovSteamSGO_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmin"), &assign_GovSteamSGO_pmin)); } -void GovSteamSGO::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamSGO::debugName[] = "GovSteamSGO"; -const char* GovSteamSGO::debugString() +void GovSteamSGO::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamSGO::debugName; } const BaseClassDefiner GovSteamSGO::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner GovSteamSGO::declare() return BaseClassDefiner(GovSteamSGO::addConstructToMap, GovSteamSGO::addPrimitiveAssignFnsToMap, GovSteamSGO::addClassAssignFnsToMap, GovSteamSGO::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamSGO_factory() + { + return new GovSteamSGO; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GovSteamSGO.hpp b/CGMES_2.4.15_16FEB2016/GovSteamSGO.hpp index 01f856226..24b2aab7f 100644 --- a/CGMES_2.4.15_16FEB2016/GovSteamSGO.hpp +++ b/CGMES_2.4.15_16FEB2016/GovSteamSGO.hpp @@ -1,51 +1,52 @@ #ifndef GovSteamSGO_H #define GovSteamSGO_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified Steam turbine governor model. */ - class GovSteamSGO: public TurbineGovernorDynamics + class GovSteamSGO : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds t1; /* Controller lag (T1). Default: nullptr */ - CIMPP::Seconds t2; /* Controller lead compensation (T2). Default: nullptr */ - CIMPP::Seconds t3; /* Governor lag (T3) (>0). Default: nullptr */ - CIMPP::Seconds t4; /* Delay due to steam inlet volumes associated with steam chest and inlet piping (T4). Default: nullptr */ - CIMPP::Seconds t5; /* Reheater delay including hot and cold leads (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Delay due to IP-LP turbine, crossover pipes and LP end hoods (T6). Default: nullptr */ - CIMPP::PU k1; /* One/per unit regulation (K1). Default: nullptr */ - CIMPP::PU k2; /* Fraction (K2). Default: nullptr */ - CIMPP::PU k3; /* Fraction (K3). Default: nullptr */ - CIMPP::PU pmax; /* Upper power limit (Pmax). Default: nullptr */ - CIMPP::Seconds pmin; /* Lower power limit (Pmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamSGO(); - virtual ~GovSteamSGO(); - + ~GovSteamSGO() override; + + CIMPP::PU k1; /* One/per unit regulation (K1). Default: nullptr */ + CIMPP::PU k2; /* Fraction (K2). Default: nullptr */ + CIMPP::PU k3; /* Fraction (K3). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Upper power limit (Pmax). Default: nullptr */ + CIMPP::Seconds pmin; /* Lower power limit (Pmin). Default: nullptr */ + CIMPP::Seconds t1; /* Controller lag (T1). Default: nullptr */ + CIMPP::Seconds t2; /* Controller lead compensation (T2). Default: nullptr */ + CIMPP::Seconds t3; /* Governor lag (T3) (>0). Default: nullptr */ + CIMPP::Seconds t4; /* Delay due to steam inlet volumes associated with steam chest and inlet piping (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Reheater delay including hot and cold leads (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Delay due to IP-LP turbine, crossover pipes and LP end hoods (T6). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamSGO_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.cpp b/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.cpp index f2b70de95..5613e7343 100644 --- a/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.cpp +++ b/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.cpp @@ -1,49 +1,56 @@ -#include -#include "Curve.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GrossToNetActivePowerCurve.hpp" +#include +#include + #include "GeneratingUnit.hpp" using namespace CIMPP; -GrossToNetActivePowerCurve::GrossToNetActivePowerCurve(): GeneratingUnit(nullptr) {}; - +GrossToNetActivePowerCurve::GrossToNetActivePowerCurve() : GeneratingUnit(nullptr) {}; GrossToNetActivePowerCurve::~GrossToNetActivePowerCurve() {}; -bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass*, BaseClass*); -bool assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GrossToNetActivePowerCurve* element = dynamic_cast(BaseClass_ptr1)) { - element->GeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->GeneratingUnit != nullptr) - return assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* GrossToNetActivePowerCurve_factory() { - return new GrossToNetActivePowerCurve; +bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass*, BaseClass*); +bool assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GrossToNetActivePowerCurve* element = dynamic_cast(BaseClass_ptr1); + GeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->GeneratingUnit != element2) + { + element->GeneratingUnit = element2; + return assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void GrossToNetActivePowerCurve::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve"), &GrossToNetActivePowerCurve_factory)); +const char GrossToNetActivePowerCurve::debugName[] = "GrossToNetActivePowerCurve"; +const char* GrossToNetActivePowerCurve::debugString() const +{ + return GrossToNetActivePowerCurve::debugName; } -void GrossToNetActivePowerCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void GrossToNetActivePowerCurve::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve"), &GrossToNetActivePowerCurve_factory)); +} -void GrossToNetActivePowerCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve.GeneratingUnit"), &assign_GrossToNetActivePowerCurve_GeneratingUnit)); +void GrossToNetActivePowerCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char GrossToNetActivePowerCurve::debugName[] = "GrossToNetActivePowerCurve"; -const char* GrossToNetActivePowerCurve::debugString() +void GrossToNetActivePowerCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GrossToNetActivePowerCurve::debugName; + assign_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve.GeneratingUnit"), &assign_GrossToNetActivePowerCurve_GeneratingUnit)); } const BaseClassDefiner GrossToNetActivePowerCurve::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner GrossToNetActivePowerCurve::declare() return BaseClassDefiner(GrossToNetActivePowerCurve::addConstructToMap, GrossToNetActivePowerCurve::addPrimitiveAssignFnsToMap, GrossToNetActivePowerCurve::addClassAssignFnsToMap, GrossToNetActivePowerCurve::debugName); } - +namespace CIMPP +{ + BaseClass* GrossToNetActivePowerCurve_factory() + { + return new GrossToNetActivePowerCurve; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.hpp b/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.hpp index 5b039fbee..9d1c592a5 100644 --- a/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.hpp +++ b/CGMES_2.4.15_16FEB2016/GrossToNetActivePowerCurve.hpp @@ -1,38 +1,39 @@ #ifndef GrossToNetActivePowerCurve_H #define GrossToNetActivePowerCurve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Curve.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Curve.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class GeneratingUnit; -class GeneratingUnit; /* Relationship between the generating unit's gross active power output on the X-axis (measured at the terminals of the machine(s)) and the generating unit's net active power output on the Y-axis (based on utility-defined measurements at the power station). Station service loads, when modeled, should be treated as non-conforming bus loads. There may be more than one curve, depending on the auxiliary equipment that is in service. */ - class GrossToNetActivePowerCurve: public Curve + class GrossToNetActivePowerCurve : public Curve { - public: - CIMPP::GeneratingUnit* GeneratingUnit; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GrossToNetActivePowerCurve(); - virtual ~GrossToNetActivePowerCurve(); - + ~GrossToNetActivePowerCurve() override; + + CIMPP::GeneratingUnit* GeneratingUnit; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GrossToNetActivePowerCurve_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Ground.cpp b/CGMES_2.4.15_16FEB2016/Ground.cpp index f4782840d..6ecc2e31b 100644 --- a/CGMES_2.4.15_16FEB2016/Ground.cpp +++ b/CGMES_2.4.15_16FEB2016/Ground.cpp @@ -1,36 +1,36 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Ground.hpp" +#include +#include + using namespace CIMPP; Ground::Ground() {}; - Ground::~Ground() {}; -namespace CIMPP { - BaseClass* Ground_factory() { - return new Ground; - } +const char Ground::debugName[] = "Ground"; +const char* Ground::debugString() const +{ + return Ground::debugName; } -void Ground::addConstructToMap(std::unordered_map& factory_map) { +void Ground::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Ground"), &Ground_factory)); } -void Ground::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Ground::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Ground::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Ground::debugName[] = "Ground"; -const char* Ground::debugString() +void Ground::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Ground::debugName; } const BaseClassDefiner Ground::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Ground::declare() return BaseClassDefiner(Ground::addConstructToMap, Ground::addPrimitiveAssignFnsToMap, Ground::addClassAssignFnsToMap, Ground::debugName); } - +namespace CIMPP +{ + BaseClass* Ground_factory() + { + return new Ground; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Ground.hpp b/CGMES_2.4.15_16FEB2016/Ground.hpp index 957975aec..884ee0ea2 100644 --- a/CGMES_2.4.15_16FEB2016/Ground.hpp +++ b/CGMES_2.4.15_16FEB2016/Ground.hpp @@ -1,36 +1,37 @@ #ifndef Ground_H #define Ground_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A point where the system is grounded used for connecting conducting equipment to ground. The power system model can have any number of grounds. */ - class Ground: public ConductingEquipment + class Ground : public ConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Ground(); - virtual ~Ground(); - + ~Ground() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Ground_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GroundDisconnector.cpp b/CGMES_2.4.15_16FEB2016/GroundDisconnector.cpp index 916d77d68..0e0e20f77 100644 --- a/CGMES_2.4.15_16FEB2016/GroundDisconnector.cpp +++ b/CGMES_2.4.15_16FEB2016/GroundDisconnector.cpp @@ -1,36 +1,36 @@ -#include -#include "Switch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GroundDisconnector.hpp" +#include +#include + using namespace CIMPP; GroundDisconnector::GroundDisconnector() {}; - GroundDisconnector::~GroundDisconnector() {}; -namespace CIMPP { - BaseClass* GroundDisconnector_factory() { - return new GroundDisconnector; - } +const char GroundDisconnector::debugName[] = "GroundDisconnector"; +const char* GroundDisconnector::debugString() const +{ + return GroundDisconnector::debugName; } -void GroundDisconnector::addConstructToMap(std::unordered_map& factory_map) { +void GroundDisconnector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GroundDisconnector"), &GroundDisconnector_factory)); } -void GroundDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void GroundDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void GroundDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char GroundDisconnector::debugName[] = "GroundDisconnector"; -const char* GroundDisconnector::debugString() +void GroundDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GroundDisconnector::debugName; } const BaseClassDefiner GroundDisconnector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner GroundDisconnector::declare() return BaseClassDefiner(GroundDisconnector::addConstructToMap, GroundDisconnector::addPrimitiveAssignFnsToMap, GroundDisconnector::addClassAssignFnsToMap, GroundDisconnector::debugName); } - +namespace CIMPP +{ + BaseClass* GroundDisconnector_factory() + { + return new GroundDisconnector; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GroundDisconnector.hpp b/CGMES_2.4.15_16FEB2016/GroundDisconnector.hpp index 6468eb944..205e960d4 100644 --- a/CGMES_2.4.15_16FEB2016/GroundDisconnector.hpp +++ b/CGMES_2.4.15_16FEB2016/GroundDisconnector.hpp @@ -1,36 +1,37 @@ #ifndef GroundDisconnector_H #define GroundDisconnector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Switch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Switch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from ground. */ - class GroundDisconnector: public Switch + class GroundDisconnector : public Switch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GroundDisconnector(); - virtual ~GroundDisconnector(); - + ~GroundDisconnector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GroundDisconnector_factory(); diff --git a/CGMES_2.4.15_16FEB2016/GroundingImpedance.cpp b/CGMES_2.4.15_16FEB2016/GroundingImpedance.cpp index 2921d989c..69249ef74 100644 --- a/CGMES_2.4.15_16FEB2016/GroundingImpedance.cpp +++ b/CGMES_2.4.15_16FEB2016/GroundingImpedance.cpp @@ -1,51 +1,52 @@ -#include -#include "EarthFaultCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GroundingImpedance.hpp" +#include +#include + #include "Reactance.hpp" using namespace CIMPP; GroundingImpedance::GroundingImpedance() {}; - GroundingImpedance::~GroundingImpedance() {}; +bool assign_GroundingImpedance_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GroundingImpedance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GroundingImpedance_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GroundingImpedance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GroundingImpedance_factory() { - return new GroundingImpedance; - } +const char GroundingImpedance::debugName[] = "GroundingImpedance"; +const char* GroundingImpedance::debugString() const +{ + return GroundingImpedance::debugName; } -void GroundingImpedance::addConstructToMap(std::unordered_map& factory_map) { +void GroundingImpedance::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GroundingImpedance"), &GroundingImpedance_factory)); } -void GroundingImpedance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GroundingImpedance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GroundingImpedance.x"), &assign_GroundingImpedance_x)); } -void GroundingImpedance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GroundingImpedance::debugName[] = "GroundingImpedance"; -const char* GroundingImpedance::debugString() +void GroundingImpedance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GroundingImpedance::debugName; } const BaseClassDefiner GroundingImpedance::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner GroundingImpedance::declare() return BaseClassDefiner(GroundingImpedance::addConstructToMap, GroundingImpedance::addPrimitiveAssignFnsToMap, GroundingImpedance::addClassAssignFnsToMap, GroundingImpedance::debugName); } - +namespace CIMPP +{ + BaseClass* GroundingImpedance_factory() + { + return new GroundingImpedance; + } +} diff --git a/CGMES_2.4.15_16FEB2016/GroundingImpedance.hpp b/CGMES_2.4.15_16FEB2016/GroundingImpedance.hpp index 9dff17f5d..38e6733ff 100644 --- a/CGMES_2.4.15_16FEB2016/GroundingImpedance.hpp +++ b/CGMES_2.4.15_16FEB2016/GroundingImpedance.hpp @@ -1,38 +1,39 @@ #ifndef GroundingImpedance_H #define GroundingImpedance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EarthFaultCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "EarthFaultCompensator.hpp" +#include "BaseClassDefiner.hpp" #include "Reactance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A fixed impedance device used for grounding. */ - class GroundingImpedance: public EarthFaultCompensator + class GroundingImpedance : public EarthFaultCompensator { - public: - CIMPP::Reactance x; /* Reactance of device. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GroundingImpedance(); - virtual ~GroundingImpedance(); - + ~GroundingImpedance() override; + + CIMPP::Reactance x; /* Reactance of device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GroundingImpedance_factory(); diff --git a/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.cpp b/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.cpp index 4b2174501..1bc81701f 100644 --- a/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.cpp +++ b/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroEnergyConversionKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::HydroEnergyConversionKind& rop) +HydroEnergyConversionKind& HydroEnergyConversionKind::operator=(HydroEnergyConversionKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +HydroEnergyConversionKind::operator HydroEnergyConversionKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char HydroEnergyConversionKind::debugName[] = "HydroEnergyConversionKind"; +const char* HydroEnergyConversionKind::debugString() const +{ + return HydroEnergyConversionKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, HydroEnergyConversionKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const HydroEnergyConversionKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == HydroEnergyConversionKind::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == HydroEnergyConversionKind::pumpAndGenerator) + { + EnumSymbol = "pumpAndGenerator"; + } + + if (!EnumSymbol.empty()) + { + os << "HydroEnergyConversionKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.hpp b/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.hpp index 8c8a2bc26..fb666b097 100644 --- a/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.hpp +++ b/CGMES_2.4.15_16FEB2016/HydroEnergyConversionKind.hpp @@ -1,21 +1,46 @@ #ifndef HydroEnergyConversionKind_H #define HydroEnergyConversionKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Specifies the capability of the hydro generating unit to convert energy as a generator or pump. */ - enum class HydroEnergyConversionKind + class HydroEnergyConversionKind { - /** - * Able to generate power, but not able to pump water for energy storage. - */ - generator, - /** - * Able to both generate power and pump water for energy storage. - */ - pumpAndGenerator, + public: + enum HydroEnergyConversionKind_ENUM + { + /** + * Able to generate power, but not able to pump water for energy storage. + */ + generator, + /** + * Able to both generate power and pump water for energy storage. + */ + pumpAndGenerator, + }; + + HydroEnergyConversionKind() : value(), initialized(false) {} + HydroEnergyConversionKind(HydroEnergyConversionKind_ENUM value) : value(value), initialized(true) {} + + HydroEnergyConversionKind& operator=(HydroEnergyConversionKind_ENUM rop); + operator HydroEnergyConversionKind_ENUM() const; + + HydroEnergyConversionKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, HydroEnergyConversionKind& rop); + friend std::ostream& operator<<(std::ostream& os, const HydroEnergyConversionKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::HydroEnergyConversionKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.cpp index 0ec06387c..f9ce566a9 100644 --- a/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.cpp @@ -1,64 +1,72 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroGeneratingUnit.hpp" -#include "HydroEnergyConversionKind.hpp" +#include +#include + #include "HydroPowerPlant.hpp" +#include "HydroEnergyConversionKind.hpp" using namespace CIMPP; -HydroGeneratingUnit::HydroGeneratingUnit(): HydroPowerPlant(nullptr) {}; - +HydroGeneratingUnit::HydroGeneratingUnit() : HydroPowerPlant(nullptr) {}; HydroGeneratingUnit::~HydroGeneratingUnit() {}; -bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass*, BaseClass*); -bool assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->HydroPowerPlant = dynamic_cast(BaseClass_ptr2); - if(element->HydroPowerPlant != nullptr) - return assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_HydroGeneratingUnit_energyConversionCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->energyConversionCapability; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_HydroGeneratingUnit_energyConversionCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->energyConversionCapability; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass*, BaseClass*); +bool assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + HydroPowerPlant* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->HydroPowerPlant != element2) + { + element->HydroPowerPlant = element2; + return assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* HydroGeneratingUnit_factory() { - return new HydroGeneratingUnit; - } +const char HydroGeneratingUnit::debugName[] = "HydroGeneratingUnit"; +const char* HydroGeneratingUnit::debugString() const +{ + return HydroGeneratingUnit::debugName; } -void HydroGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void HydroGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit"), &HydroGeneratingUnit_factory)); } -void HydroGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void HydroGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit.energyConversionCapability"), &assign_HydroGeneratingUnit_energyConversionCapability)); - } - -void HydroGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit.HydroPowerPlant"), &assign_HydroGeneratingUnit_HydroPowerPlant)); } -const char HydroGeneratingUnit::debugName[] = "HydroGeneratingUnit"; -const char* HydroGeneratingUnit::debugString() +void HydroGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return HydroGeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit.HydroPowerPlant"), &assign_HydroGeneratingUnit_HydroPowerPlant)); } const BaseClassDefiner HydroGeneratingUnit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner HydroGeneratingUnit::declare() return BaseClassDefiner(HydroGeneratingUnit::addConstructToMap, HydroGeneratingUnit::addPrimitiveAssignFnsToMap, HydroGeneratingUnit::addClassAssignFnsToMap, HydroGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* HydroGeneratingUnit_factory() + { + return new HydroGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.hpp index 06c820579..c431967f3 100644 --- a/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/HydroGeneratingUnit.hpp @@ -1,40 +1,41 @@ #ifndef HydroGeneratingUnit_H #define HydroGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" #include "HydroEnergyConversionKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class HydroPowerPlant; - -class HydroPowerPlant; /* A generating unit whose prime mover is a hydraulic turbine (e.g., Francis, Pelton, Kaplan). */ - class HydroGeneratingUnit: public GeneratingUnit + class HydroGeneratingUnit : public GeneratingUnit { - public: - CIMPP::HydroEnergyConversionKind energyConversionCapability; /* Energy conversion capability for generating. Default: 0 */ - CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ HydroGeneratingUnit(); - virtual ~HydroGeneratingUnit(); - + ~HydroGeneratingUnit() override; + + CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ + CIMPP::HydroEnergyConversionKind energyConversionCapability; /* Energy conversion capability for generating. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* HydroGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.cpp b/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.cpp index 253416bd5..4930efb66 100644 --- a/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.cpp +++ b/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroPlantStorageKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::HydroPlantStorageKind& rop) +HydroPlantStorageKind& HydroPlantStorageKind::operator=(HydroPlantStorageKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +HydroPlantStorageKind::operator HydroPlantStorageKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char HydroPlantStorageKind::debugName[] = "HydroPlantStorageKind"; +const char* HydroPlantStorageKind::debugString() const +{ + return HydroPlantStorageKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, HydroPlantStorageKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const HydroPlantStorageKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == HydroPlantStorageKind::runOfRiver) + { + EnumSymbol = "runOfRiver"; + } + if (obj.value == HydroPlantStorageKind::pumpedStorage) + { + EnumSymbol = "pumpedStorage"; + } + if (obj.value == HydroPlantStorageKind::storage) + { + EnumSymbol = "storage"; + } + + if (!EnumSymbol.empty()) + { + os << "HydroPlantStorageKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.hpp b/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.hpp index 80b35ab00..ddd375110 100644 --- a/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.hpp +++ b/CGMES_2.4.15_16FEB2016/HydroPlantStorageKind.hpp @@ -1,25 +1,50 @@ #ifndef HydroPlantStorageKind_H #define HydroPlantStorageKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The type of hydro power plant. */ - enum class HydroPlantStorageKind + class HydroPlantStorageKind { - /** - * Run of river. - */ - runOfRiver, - /** - * Pumped storage. - */ - pumpedStorage, - /** - * Storage. - */ - storage, + public: + enum HydroPlantStorageKind_ENUM + { + /** + * Run of river. + */ + runOfRiver, + /** + * Pumped storage. + */ + pumpedStorage, + /** + * Storage. + */ + storage, + }; + + HydroPlantStorageKind() : value(), initialized(false) {} + HydroPlantStorageKind(HydroPlantStorageKind_ENUM value) : value(value), initialized(true) {} + + HydroPlantStorageKind& operator=(HydroPlantStorageKind_ENUM rop); + operator HydroPlantStorageKind_ENUM() const; + + HydroPlantStorageKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, HydroPlantStorageKind& rop); + friend std::ostream& operator<<(std::ostream& os, const HydroPlantStorageKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::HydroPlantStorageKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/HydroPowerPlant.cpp b/CGMES_2.4.15_16FEB2016/HydroPowerPlant.cpp index 818dd93b0..d17dd63dc 100644 --- a/CGMES_2.4.15_16FEB2016/HydroPowerPlant.cpp +++ b/CGMES_2.4.15_16FEB2016/HydroPowerPlant.cpp @@ -1,77 +1,92 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroPowerPlant.hpp" -#include "HydroPlantStorageKind.hpp" +#include +#include + #include "HydroGeneratingUnit.hpp" #include "HydroPump.hpp" +#include "HydroPlantStorageKind.hpp" using namespace CIMPP; HydroPowerPlant::HydroPowerPlant() {}; - HydroPowerPlant::~HydroPowerPlant() {}; -bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HydroGeneratingUnits.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_HydroPowerPlant_hydroPlantStorageType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hydroPlantStorageType; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_HydroPowerPlant_HydroPumps(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HydroPumps.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + +bool assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass*, BaseClass*); +bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1); + HydroGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HydroGeneratingUnits.begin(), element->HydroGeneratingUnits.end(), element2) == element->HydroGeneratingUnits.end()) + { + element->HydroGeneratingUnits.push_back(element2); + return assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - -bool assign_HydroPowerPlant_hydroPlantStorageType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hydroPlantStorageType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_HydroPump_HydroPowerPlant(BaseClass*, BaseClass*); +bool assign_HydroPowerPlant_HydroPumps(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1); + HydroPump* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HydroPumps.begin(), element->HydroPumps.end(), element2) == element->HydroPumps.end()) + { + element->HydroPumps.push_back(element2); + return assign_HydroPump_HydroPowerPlant(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - -namespace CIMPP { - BaseClass* HydroPowerPlant_factory() { - return new HydroPowerPlant; - } +const char HydroPowerPlant::debugName[] = "HydroPowerPlant"; +const char* HydroPowerPlant::debugString() const +{ + return HydroPowerPlant::debugName; } -void HydroPowerPlant::addConstructToMap(std::unordered_map& factory_map) { +void HydroPowerPlant::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:HydroPowerPlant"), &HydroPowerPlant_factory)); } -void HydroPowerPlant::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void HydroPowerPlant::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.hydroPlantStorageType"), &assign_HydroPowerPlant_hydroPlantStorageType)); - } - -void HydroPowerPlant::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroGeneratingUnits"), &assign_HydroPowerPlant_HydroGeneratingUnits)); - assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroPumps"), &assign_HydroPowerPlant_HydroPumps)); } -const char HydroPowerPlant::debugName[] = "HydroPowerPlant"; -const char* HydroPowerPlant::debugString() +void HydroPowerPlant::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return HydroPowerPlant::debugName; + assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroGeneratingUnits"), &assign_HydroPowerPlant_HydroGeneratingUnits)); + assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroPumps"), &assign_HydroPowerPlant_HydroPumps)); } const BaseClassDefiner HydroPowerPlant::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner HydroPowerPlant::declare() return BaseClassDefiner(HydroPowerPlant::addConstructToMap, HydroPowerPlant::addPrimitiveAssignFnsToMap, HydroPowerPlant::addClassAssignFnsToMap, HydroPowerPlant::debugName); } - +namespace CIMPP +{ + BaseClass* HydroPowerPlant_factory() + { + return new HydroPowerPlant; + } +} diff --git a/CGMES_2.4.15_16FEB2016/HydroPowerPlant.hpp b/CGMES_2.4.15_16FEB2016/HydroPowerPlant.hpp index 2d05bb669..40f735bc6 100644 --- a/CGMES_2.4.15_16FEB2016/HydroPowerPlant.hpp +++ b/CGMES_2.4.15_16FEB2016/HydroPowerPlant.hpp @@ -1,42 +1,43 @@ #ifndef HydroPowerPlant_H #define HydroPowerPlant_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "HydroPlantStorageKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class HydroGeneratingUnit; + class HydroPump; - -class HydroGeneratingUnit; -class HydroPump; /* A hydro power station which can generate or pump. When generating, the generator turbines receive water from an upper reservoir. When pumping, the pumps receive their water from a lower reservoir. */ - class HydroPowerPlant: public PowerSystemResource + class HydroPowerPlant : public PowerSystemResource { - public: - CIMPP::HydroPlantStorageKind hydroPlantStorageType; /* The type of hydro power plant water storage. Default: 0 */ - std::list HydroGeneratingUnits; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ - std::list HydroPumps; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ HydroPowerPlant(); - virtual ~HydroPowerPlant(); - + ~HydroPowerPlant() override; + + std::list HydroGeneratingUnits; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ + std::list HydroPumps; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ + CIMPP::HydroPlantStorageKind hydroPlantStorageType; /* The type of hydro power plant water storage. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* HydroPowerPlant_factory(); diff --git a/CGMES_2.4.15_16FEB2016/HydroPump.cpp b/CGMES_2.4.15_16FEB2016/HydroPump.cpp index ce26816c6..0e80d09dc 100644 --- a/CGMES_2.4.15_16FEB2016/HydroPump.cpp +++ b/CGMES_2.4.15_16FEB2016/HydroPump.cpp @@ -1,62 +1,76 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroPump.hpp" +#include +#include + #include "HydroPowerPlant.hpp" #include "RotatingMachine.hpp" using namespace CIMPP; -HydroPump::HydroPump(): HydroPowerPlant(nullptr), RotatingMachine(nullptr) {}; - +HydroPump::HydroPump() : HydroPowerPlant(nullptr), RotatingMachine(nullptr) {}; HydroPump::~HydroPump() {}; + + + bool assign_HydroPowerPlant_HydroPumps(BaseClass*, BaseClass*); -bool assign_HydroPump_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPump* element = dynamic_cast(BaseClass_ptr1)) { - element->HydroPowerPlant = dynamic_cast(BaseClass_ptr2); - if(element->HydroPowerPlant != nullptr) - return assign_HydroPowerPlant_HydroPumps(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_HydroPump_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPump* element = dynamic_cast(BaseClass_ptr1); + HydroPowerPlant* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->HydroPowerPlant != element2) + { + element->HydroPowerPlant = element2; + return assign_HydroPowerPlant_HydroPumps(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_RotatingMachine_HydroPump(BaseClass*, BaseClass*); -bool assign_HydroPump_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPump* element = dynamic_cast(BaseClass_ptr1)) { - element->RotatingMachine = dynamic_cast(BaseClass_ptr2); - if(element->RotatingMachine != nullptr) - return assign_RotatingMachine_HydroPump(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_HydroPump_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPump* element = dynamic_cast(BaseClass_ptr1); + RotatingMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RotatingMachine != element2) + { + element->RotatingMachine = element2; + return assign_RotatingMachine_HydroPump(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* HydroPump_factory() { - return new HydroPump; - } +const char HydroPump::debugName[] = "HydroPump"; +const char* HydroPump::debugString() const +{ + return HydroPump::debugName; } -void HydroPump::addConstructToMap(std::unordered_map& factory_map) { +void HydroPump::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:HydroPump"), &HydroPump_factory)); } -void HydroPump::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void HydroPump::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroPump.HydroPowerPlant"), &assign_HydroPump_HydroPowerPlant)); - assign_map.insert(std::make_pair(std::string("cim:HydroPump.RotatingMachine"), &assign_HydroPump_RotatingMachine)); +void HydroPump::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char HydroPump::debugName[] = "HydroPump"; -const char* HydroPump::debugString() +void HydroPump::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return HydroPump::debugName; + assign_map.insert(std::make_pair(std::string("cim:HydroPump.HydroPowerPlant"), &assign_HydroPump_HydroPowerPlant)); + assign_map.insert(std::make_pair(std::string("cim:HydroPump.RotatingMachine"), &assign_HydroPump_RotatingMachine)); } const BaseClassDefiner HydroPump::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner HydroPump::declare() return BaseClassDefiner(HydroPump::addConstructToMap, HydroPump::addPrimitiveAssignFnsToMap, HydroPump::addClassAssignFnsToMap, HydroPump::debugName); } - +namespace CIMPP +{ + BaseClass* HydroPump_factory() + { + return new HydroPump; + } +} diff --git a/CGMES_2.4.15_16FEB2016/HydroPump.hpp b/CGMES_2.4.15_16FEB2016/HydroPump.hpp index 03d6266d0..54ab372d8 100644 --- a/CGMES_2.4.15_16FEB2016/HydroPump.hpp +++ b/CGMES_2.4.15_16FEB2016/HydroPump.hpp @@ -1,40 +1,41 @@ #ifndef HydroPump_H #define HydroPump_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class HydroPowerPlant; + class RotatingMachine; -class HydroPowerPlant; -class RotatingMachine; /* A synchronous motor-driven pump, typically associated with a pumped storage plant. */ - class HydroPump: public Equipment + class HydroPump : public Equipment { - public: - CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ - CIMPP::RotatingMachine* RotatingMachine; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ HydroPump(); - virtual ~HydroPump(); - + ~HydroPump() override; + + CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ + CIMPP::RotatingMachine* RotatingMachine; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* HydroPump_factory(); diff --git a/CGMES_2.4.15_16FEB2016/IEC61970.hpp b/CGMES_2.4.15_16FEB2016/IEC61970.hpp index 792dd585d..32e9abca4 100644 --- a/CGMES_2.4.15_16FEB2016/IEC61970.hpp +++ b/CGMES_2.4.15_16FEB2016/IEC61970.hpp @@ -1,5 +1,9 @@ #ifndef IEC61970_H #define IEC61970_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + #include "ACDCConverter.hpp" #include "ACDCConverterDCTerminal.hpp" #include "ACDCTerminal.hpp" @@ -9,39 +13,25 @@ #include "AccumulatorLimitSet.hpp" #include "AccumulatorReset.hpp" #include "AccumulatorValue.hpp" -#include "ActivePower.hpp" #include "ActivePowerLimit.hpp" -#include "ActivePowerPerCurrentFlow.hpp" -#include "ActivePowerPerFrequency.hpp" #include "Analog.hpp" #include "AnalogControl.hpp" #include "AnalogLimit.hpp" #include "AnalogLimitSet.hpp" #include "AnalogValue.hpp" -#include "AngleDegrees.hpp" -#include "AngleRadians.hpp" -#include "ApparentPower.hpp" #include "ApparentPowerLimit.hpp" -#include "Area.hpp" #include "AsynchronousMachine.hpp" #include "AsynchronousMachineDynamics.hpp" #include "AsynchronousMachineEquivalentCircuit.hpp" #include "AsynchronousMachineTimeConstantReactance.hpp" #include "AsynchronousMachineUserDefined.hpp" -#include "BaseClass.hpp" -#include "BaseClassDefiner.hpp" #include "BaseVoltage.hpp" #include "BasicIntervalSchedule.hpp" #include "Bay.hpp" -#include "Boolean.hpp" #include "Breaker.hpp" #include "BusNameMarker.hpp" #include "BusbarSection.hpp" -#include "CIMFactory.hpp" -#include "Capacitance.hpp" -#include "CapacitancePerLength.hpp" #include "Command.hpp" -#include "Conductance.hpp" #include "ConductingEquipment.hpp" #include "Conductor.hpp" #include "ConformLoad.hpp" @@ -55,7 +45,6 @@ #include "ControlAreaGeneratingUnit.hpp" #include "CoordinateSystem.hpp" #include "CsConverter.hpp" -#include "CurrentFlow.hpp" #include "CurrentLimit.hpp" #include "Curve.hpp" #include "CurveData.hpp" @@ -77,10 +66,7 @@ #include "DCTerminal.hpp" #include "DCTopologicalIsland.hpp" #include "DCTopologicalNode.hpp" -#include "Date.hpp" -#include "DateTime.hpp" #include "DayType.hpp" -#include "Decimal.hpp" #include "Diagram.hpp" #include "DiagramLayoutVersion.hpp" #include "DiagramObject.hpp" @@ -169,9 +155,7 @@ #include "ExcitationSystemDynamics.hpp" #include "ExcitationSystemUserDefined.hpp" #include "ExternalNetworkInjection.hpp" -#include "Float.hpp" #include "FossilFuel.hpp" -#include "Frequency.hpp" #include "GenICompensationForGenJ.hpp" #include "GeneratingUnit.hpp" #include "GeographicalLocationVersion.hpp" @@ -216,11 +200,7 @@ #include "HydroPowerPlant.hpp" #include "HydroPump.hpp" #include "IdentifiedObject.hpp" -#include "Inductance.hpp" -#include "InductancePerLength.hpp" -#include "Integer.hpp" #include "Junction.hpp" -#include "Length.hpp" #include "Limit.hpp" #include "LimitSet.hpp" #include "Line.hpp" @@ -244,8 +224,6 @@ #include "MechLoad1.hpp" #include "MechanicalLoadDynamics.hpp" #include "MechanicalLoadUserDefined.hpp" -#include "Money.hpp" -#include "MonthDay.hpp" #include "MutualCoupling.hpp" #include "NonConformLoad.hpp" #include "NonConformLoadGroup.hpp" @@ -271,8 +249,6 @@ #include "PFVArType2Common1.hpp" #include "PFVArType2IEEEPFController.hpp" #include "PFVArType2IEEEVArController.hpp" -#include "PU.hpp" -#include "PerCent.hpp" #include "PerLengthDCLineParameter.hpp" #include "PetersenCoil.hpp" #include "PhaseTapChanger.hpp" @@ -312,9 +288,7 @@ #include "RatioTapChanger.hpp" #include "RatioTapChangerTable.hpp" #include "RatioTapChangerTablePoint.hpp" -#include "Reactance.hpp" #include "ReactiveCapabilityCurve.hpp" -#include "ReactivePower.hpp" #include "RegularIntervalSchedule.hpp" #include "RegularTimePoint.hpp" #include "RegulatingCondEq.hpp" @@ -322,30 +296,23 @@ #include "RegulationSchedule.hpp" #include "RemoteInputSignal.hpp" #include "ReportingGroup.hpp" -#include "Resistance.hpp" -#include "ResistancePerLength.hpp" #include "RotatingMachine.hpp" #include "RotatingMachineDynamics.hpp" -#include "RotationSpeed.hpp" #include "Season.hpp" #include "SeasonDayTypeSchedule.hpp" -#include "Seconds.hpp" #include "SeriesCompensator.hpp" #include "SetPoint.hpp" #include "ShuntCompensator.hpp" -#include "Simple_Float.hpp" #include "SolarGeneratingUnit.hpp" #include "StateVariablesVersion.hpp" #include "StaticVarCompensator.hpp" #include "StationSupply.hpp" #include "SteadyStateHypothesisVersion.hpp" -#include "String.hpp" #include "StringMeasurement.hpp" #include "StringMeasurementValue.hpp" #include "SubGeographicalRegion.hpp" #include "SubLoadArea.hpp" #include "Substation.hpp" -#include "Susceptance.hpp" #include "SvInjection.hpp" #include "SvPowerFlow.hpp" #include "SvShuntCompensatorSections.hpp" @@ -365,7 +332,6 @@ #include "TapChangerControl.hpp" #include "TapChangerTablePoint.hpp" #include "TapSchedule.hpp" -#include "Temperature.hpp" #include "Terminal.hpp" #include "TextDiagramObject.hpp" #include "ThermalGeneratingUnit.hpp" @@ -387,22 +353,18 @@ #include "UnderexcLimX2.hpp" #include "UnderexcitationLimiterDynamics.hpp" #include "UnderexcitationLimiterUserDefined.hpp" -#include "UnknownType.hpp" #include "VAdjIEEE.hpp" #include "VCompIEEEType1.hpp" #include "VCompIEEEType2.hpp" #include "ValueAliasSet.hpp" #include "ValueToAlias.hpp" #include "VisibilityLayer.hpp" -#include "Voltage.hpp" #include "VoltageAdjusterDynamics.hpp" #include "VoltageAdjusterUserDefined.hpp" #include "VoltageCompensatorDynamics.hpp" #include "VoltageCompensatorUserDefined.hpp" #include "VoltageLevel.hpp" #include "VoltageLimit.hpp" -#include "VoltagePerReactivePower.hpp" -#include "VolumeFlowRate.hpp" #include "VsCapabilityCurve.hpp" #include "VsConverter.hpp" #include "WindAeroConstIEC.hpp" @@ -438,6 +400,5 @@ #include "WindTurbineType4bIEC.hpp" #include "WindType1or2UserDefined.hpp" #include "WindType3or4UserDefined.hpp" -#include "assignments.hpp" #include "UnknownType.hpp" #endif \ No newline at end of file diff --git a/CGMES_2.4.15_16FEB2016/IdentifiedObject.cpp b/CGMES_2.4.15_16FEB2016/IdentifiedObject.cpp index fcba1d4c6..764198002 100644 --- a/CGMES_2.4.15_16FEB2016/IdentifiedObject.cpp +++ b/CGMES_2.4.15_16FEB2016/IdentifiedObject.cpp @@ -1,41 +1,44 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "IdentifiedObject.hpp" +#include +#include + +#include "DiagramObject.hpp" #include "String.hpp" #include "String.hpp" #include "String.hpp" #include "String.hpp" #include "String.hpp" -#include "DiagramObject.hpp" using namespace CIMPP; IdentifiedObject::IdentifiedObject() {}; - IdentifiedObject::~IdentifiedObject() {}; - - - - -bool assign_IdentifiedObject_DiagramObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiagramObjects.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_IdentifiedObject_description(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->description = buffer.str(); + if (buffer.fail()) + return false; + else return true; - } } return false; } - -bool assign_IdentifiedObject_description(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->description = buffer.str(); - if(buffer.fail()) +bool assign_IdentifiedObject_energyIdentCodeEic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->energyIdentCodeEic = buffer.str(); + if (buffer.fail()) return false; else return true; @@ -43,10 +46,12 @@ bool assign_IdentifiedObject_description(std::stringstream &buffer, BaseClass* B return false; } -bool assign_IdentifiedObject_mRID(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_IdentifiedObject_mRID(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { element->mRID = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -54,10 +59,12 @@ bool assign_IdentifiedObject_mRID(std::stringstream &buffer, BaseClass* BaseClas return false; } -bool assign_IdentifiedObject_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_IdentifiedObject_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { element->name = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -65,10 +72,12 @@ bool assign_IdentifiedObject_name(std::stringstream &buffer, BaseClass* BaseClas return false; } -bool assign_IdentifiedObject_energyIdentCodeEic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->energyIdentCodeEic = buffer.str(); - if(buffer.fail()) +bool assign_IdentifiedObject_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->shortName = buffer.str(); + if (buffer.fail()) return false; else return true; @@ -76,44 +85,52 @@ bool assign_IdentifiedObject_energyIdentCodeEic(std::stringstream &buffer, BaseC return false; } -bool assign_IdentifiedObject_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->shortName = buffer.str(); - if(buffer.fail()) - return false; - else - return true; + +bool assign_DiagramObject_IdentifiedObject(BaseClass*, BaseClass*); +bool assign_IdentifiedObject_DiagramObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + IdentifiedObject* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramObjects.begin(), element->DiagramObjects.end(), element2) == element->DiagramObjects.end()) + { + element->DiagramObjects.push_back(element2); + return assign_DiagramObject_IdentifiedObject(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } return false; } -namespace CIMPP { - BaseClass* IdentifiedObject_factory() { - return new IdentifiedObject; - } + + + + +const char IdentifiedObject::debugName[] = "IdentifiedObject"; +const char* IdentifiedObject::debugString() const +{ + return IdentifiedObject::debugName; } -void IdentifiedObject::addConstructToMap(std::unordered_map& factory_map) { +void IdentifiedObject::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:IdentifiedObject"), &IdentifiedObject_factory)); } -void IdentifiedObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void IdentifiedObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.description"), &assign_IdentifiedObject_description)); + assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.energyIdentCodeEic"), &assign_IdentifiedObject_energyIdentCodeEic)); assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.mRID"), &assign_IdentifiedObject_mRID)); assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.name"), &assign_IdentifiedObject_name)); - assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.energyIdentCodeEic"), &assign_IdentifiedObject_energyIdentCodeEic)); assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.shortName"), &assign_IdentifiedObject_shortName)); - } - -void IdentifiedObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.DiagramObjects"), &assign_IdentifiedObject_DiagramObjects)); } -const char IdentifiedObject::debugName[] = "IdentifiedObject"; -const char* IdentifiedObject::debugString() +void IdentifiedObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return IdentifiedObject::debugName; + assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.DiagramObjects"), &assign_IdentifiedObject_DiagramObjects)); } const BaseClassDefiner IdentifiedObject::declare() @@ -121,4 +138,10 @@ const BaseClassDefiner IdentifiedObject::declare() return BaseClassDefiner(IdentifiedObject::addConstructToMap, IdentifiedObject::addPrimitiveAssignFnsToMap, IdentifiedObject::addClassAssignFnsToMap, IdentifiedObject::debugName); } - +namespace CIMPP +{ + BaseClass* IdentifiedObject_factory() + { + return new IdentifiedObject; + } +} diff --git a/CGMES_2.4.15_16FEB2016/IdentifiedObject.hpp b/CGMES_2.4.15_16FEB2016/IdentifiedObject.hpp index cd66981ad..fd12212b2 100644 --- a/CGMES_2.4.15_16FEB2016/IdentifiedObject.hpp +++ b/CGMES_2.4.15_16FEB2016/IdentifiedObject.hpp @@ -1,44 +1,45 @@ #ifndef IdentifiedObject_H #define IdentifiedObject_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; - -class DiagramObject; /* This is a root class to provide common identification for all classes needing identification and naming attributes. */ - class IdentifiedObject: public BaseClass + class IdentifiedObject : public BaseClass { - public: - CIMPP::String description; /* The description is a free human readable text describing or naming the object. It may be non unique and may not correlate to a naming hierarchy. Default: '' */ - CIMPP::String mRID; /* Master resource identifier issued by a model authority. The mRID is globally unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended. For CIMXML data files in RDF syntax conforming to IEC 61970-552 Edition 1, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements. Default: '' */ - CIMPP::String name; /* The name is any free human readable and possibly non unique text naming the object. Default: '' */ - CIMPP::String energyIdentCodeEic; /* The attribute is used for an exchange of the EIC code (Energy identification Code). The length of the string is 16 characters as defined by the EIC code. References: Default: '' */ - CIMPP::String shortName; /* The attribute is used for an exchange of a human readable short name with length of the string 12 characters maximum. Default: '' */ - std::list DiagramObjects; /* The domain object to which this diagram object is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ IdentifiedObject(); - virtual ~IdentifiedObject(); - + ~IdentifiedObject() override; + + std::list DiagramObjects; /* The domain object to which this diagram object is associated. Default: 0 */ + CIMPP::String description; /* The description is a free human readable text describing or naming the object. It may be non unique and may not correlate to a naming hierarchy. Default: '' */ + CIMPP::String energyIdentCodeEic; /* The attribute is used for an exchange of the EIC code (Energy identification Code). The length of the string is 16 characters as defined by the EIC code. References: Default: '' */ + CIMPP::String mRID; /* Master resource identifier issued by a model authority. The mRID is globally unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended. For CIMXML data files in RDF syntax conforming to IEC 61970-552 Edition 1, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements. Default: '' */ + CIMPP::String name; /* The name is any free human readable and possibly non unique text naming the object. Default: '' */ + CIMPP::String shortName; /* The attribute is used for an exchange of a human readable short name with length of the string 12 characters maximum. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* IdentifiedObject_factory(); diff --git a/CGMES_2.4.15_16FEB2016/IfdBaseKind.cpp b/CGMES_2.4.15_16FEB2016/IfdBaseKind.cpp index a1c2a51a3..06c6513c2 100644 --- a/CGMES_2.4.15_16FEB2016/IfdBaseKind.cpp +++ b/CGMES_2.4.15_16FEB2016/IfdBaseKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "IfdBaseKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::IfdBaseKind& rop) +IfdBaseKind& IfdBaseKind::operator=(IfdBaseKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +IfdBaseKind::operator IfdBaseKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char IfdBaseKind::debugName[] = "IfdBaseKind"; +const char* IfdBaseKind::debugString() const +{ + return IfdBaseKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, IfdBaseKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const IfdBaseKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == IfdBaseKind::ifag) + { + EnumSymbol = "ifag"; + } + if (obj.value == IfdBaseKind::ifnl) + { + EnumSymbol = "ifnl"; + } + if (obj.value == IfdBaseKind::iffl) + { + EnumSymbol = "iffl"; + } + if (obj.value == IfdBaseKind::other) + { + EnumSymbol = "other"; + } + + if (!EnumSymbol.empty()) + { + os << "IfdBaseKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/IfdBaseKind.hpp b/CGMES_2.4.15_16FEB2016/IfdBaseKind.hpp index b7a5dbfbd..6938195f3 100644 --- a/CGMES_2.4.15_16FEB2016/IfdBaseKind.hpp +++ b/CGMES_2.4.15_16FEB2016/IfdBaseKind.hpp @@ -1,29 +1,54 @@ #ifndef IfdBaseKind_H #define IfdBaseKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Excitation base system mode. */ - enum class IfdBaseKind + class IfdBaseKind { - /** - * Air gap line mode. ifdBaseValue is computed, not defined by the user, in this mode. - */ - ifag, - /** - * No load system with saturation mode. ifdBaseValue is computed, not defined by the user, in this mode. - */ - ifnl, - /** - * Full load system mode. ifdBaseValue is computed, not defined by the user, in this mode. - */ - iffl, - /** - * Free mode. ifdBaseValue is defined by the user in this mode. - */ - other, + public: + enum IfdBaseKind_ENUM + { + /** + * Air gap line mode. ifdBaseValue is computed, not defined by the user, in this mode. + */ + ifag, + /** + * No load system with saturation mode. ifdBaseValue is computed, not defined by the user, in this mode. + */ + ifnl, + /** + * Full load system mode. ifdBaseValue is computed, not defined by the user, in this mode. + */ + iffl, + /** + * Free mode. ifdBaseValue is defined by the user in this mode. + */ + other, + }; + + IfdBaseKind() : value(), initialized(false) {} + IfdBaseKind(IfdBaseKind_ENUM value) : value(value), initialized(true) {} + + IfdBaseKind& operator=(IfdBaseKind_ENUM rop); + operator IfdBaseKind_ENUM() const; + + IfdBaseKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, IfdBaseKind& rop); + friend std::ostream& operator<<(std::ostream& os, const IfdBaseKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::IfdBaseKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/Inductance.cpp b/CGMES_2.4.15_16FEB2016/Inductance.cpp index 3fca7421a..8a13c71fe 100644 --- a/CGMES_2.4.15_16FEB2016/Inductance.cpp +++ b/CGMES_2.4.15_16FEB2016/Inductance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Inductance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Inductance::Inductance() {} -Inductance::~Inductance(){} +#include -Inductance::Inductance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Inductance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Inductance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Inductance& Inductance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Inductance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Inductance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Inductance::debugName[] = "Inductance"; -const char* Inductance::debugString() { +const char* Inductance::debugString() const +{ return Inductance::debugName; } - -const BaseClassDefiner Inductance::declare() { - return BaseClassDefiner(Inductance::addConstructToMap, Inductance::addPrimitiveAssignFnsToMap, Inductance::addClassAssignFnsToMap, Inductance::debugName); +Inductance& Inductance::operator+=(const Inductance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Inductance& Inductance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Inductance& Inductance::operator-=(const Inductance& rhs) { - value -= rhs.value; - return *this; - } - - Inductance& Inductance::operator*=(const Inductance& rhs) { - value *= rhs.value; - return *this; - } - - Inductance& Inductance::operator/=(const Inductance& rhs) { - value /= rhs.value; - return *this; - } +Inductance& Inductance::operator-=(const Inductance& rhs) +{ + value -= rhs.value; + return *this; +} - Inductance& Inductance::operator+=(const Inductance& rhs) { - value += rhs.value; - return *this; - } +Inductance& Inductance::operator*=(const Inductance& rhs) +{ + value *= rhs.value; + return *this; +} - Inductance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Inductance& Inductance::operator/=(const Inductance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Inductance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Inductance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Inductance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Inductance.hpp b/CGMES_2.4.15_16FEB2016/Inductance.hpp index 3634234ce..9d5005915 100644 --- a/CGMES_2.4.15_16FEB2016/Inductance.hpp +++ b/CGMES_2.4.15_16FEB2016/Inductance.hpp @@ -1,38 +1,39 @@ #ifndef Inductance_H #define Inductance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Inductance : public BaseClass + /* + Inductive part of reactance (imaginary part of impedance), at rated frequency. + */ + class Inductance { - public: - Inductance(); - virtual ~Inductance(); - Inductance(long double value); - static const BaseClassDefiner declare(); - Inductance& operator=(long double &rop); + Inductance() : value(0.0), initialized(false) {} + Inductance(long double value) : value(value), initialized(true) {} + + Inductance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Inductance& operator+=(const Inductance& rhs); Inductance& operator-=(const Inductance& rhs); Inductance& operator*=(const Inductance& rhs); Inductance& operator/=(const Inductance& rhs); + friend std::istream& operator>>(std::istream& lop, Inductance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Inductance& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/InductancePerLength.cpp b/CGMES_2.4.15_16FEB2016/InductancePerLength.cpp index da27f78df..b655d1e70 100644 --- a/CGMES_2.4.15_16FEB2016/InductancePerLength.cpp +++ b/CGMES_2.4.15_16FEB2016/InductancePerLength.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "InductancePerLength.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -InductancePerLength::InductancePerLength(): value(nullptr) {}; - -InductancePerLength::~InductancePerLength() {}; - - -bool assign_InductancePerLength_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_InductancePerLength_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_InductancePerLength_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_InductancePerLength_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_InductancePerLength_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +InductancePerLength& InductancePerLength::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* InductancePerLength_factory() { - return new InductancePerLength; +InductancePerLength::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void InductancePerLength::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:InductancePerLength"), &InductancePerLength_factory)); +const char InductancePerLength::debugName[] = "InductancePerLength"; +const char* InductancePerLength::debugString() const +{ + return InductancePerLength::debugName; } -void InductancePerLength::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.unit"), &assign_InductancePerLength_unit)); - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.multiplier"), &assign_InductancePerLength_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.denominatorUnit"), &assign_InductancePerLength_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.denominatorMultiplier"), &assign_InductancePerLength_denominatorMultiplier)); +InductancePerLength& InductancePerLength::operator+=(const InductancePerLength& rhs) +{ + value += rhs.value; + return *this; } -void InductancePerLength::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.value"), &assign_InductancePerLength_value)); - } +InductancePerLength& InductancePerLength::operator-=(const InductancePerLength& rhs) +{ + value -= rhs.value; + return *this; +} -const char InductancePerLength::debugName[] = "InductancePerLength"; -const char* InductancePerLength::debugString() +InductancePerLength& InductancePerLength::operator*=(const InductancePerLength& rhs) { - return InductancePerLength::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner InductancePerLength::declare() +InductancePerLength& InductancePerLength::operator/=(const InductancePerLength& rhs) { - return BaseClassDefiner(InductancePerLength::addConstructToMap, InductancePerLength::addPrimitiveAssignFnsToMap, InductancePerLength::addClassAssignFnsToMap, InductancePerLength::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, InductancePerLength& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const InductancePerLength& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/InductancePerLength.hpp b/CGMES_2.4.15_16FEB2016/InductancePerLength.hpp index f29b9fcc9..8ede31f20 100644 --- a/CGMES_2.4.15_16FEB2016/InductancePerLength.hpp +++ b/CGMES_2.4.15_16FEB2016/InductancePerLength.hpp @@ -1,46 +1,39 @@ #ifndef InductancePerLength_H #define InductancePerLength_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Inductance per unit of length. */ - class InductancePerLength: public BaseClass + class InductancePerLength { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + InductancePerLength() : value(0.0), initialized(false) {} + InductancePerLength(long double value) : value(value), initialized(true) {} + + InductancePerLength& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - InductancePerLength(); - virtual ~InductancePerLength(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + InductancePerLength& operator+=(const InductancePerLength& rhs); + InductancePerLength& operator-=(const InductancePerLength& rhs); + InductancePerLength& operator*=(const InductancePerLength& rhs); + InductancePerLength& operator/=(const InductancePerLength& rhs); - BaseClass* InductancePerLength_factory(); + friend std::istream& operator>>(std::istream& lop, InductancePerLength& rop); + friend std::ostream& operator<<(std::ostream& os, const InductancePerLength& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/InputSignalKind.cpp b/CGMES_2.4.15_16FEB2016/InputSignalKind.cpp index 482cf1713..fc207f2f1 100644 --- a/CGMES_2.4.15_16FEB2016/InputSignalKind.cpp +++ b/CGMES_2.4.15_16FEB2016/InputSignalKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "InputSignalKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::InputSignalKind& rop) +InputSignalKind& InputSignalKind::operator=(InputSignalKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +InputSignalKind::operator InputSignalKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char InputSignalKind::debugName[] = "InputSignalKind"; +const char* InputSignalKind::debugString() const +{ + return InputSignalKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, InputSignalKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -73,5 +104,59 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const InputSignalKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == InputSignalKind::rotorSpeed) + { + EnumSymbol = "rotorSpeed"; + } + if (obj.value == InputSignalKind::rotorAngularFrequencyDeviation) + { + EnumSymbol = "rotorAngularFrequencyDeviation"; + } + if (obj.value == InputSignalKind::busFrequency) + { + EnumSymbol = "busFrequency"; + } + if (obj.value == InputSignalKind::busFrequencyDeviation) + { + EnumSymbol = "busFrequencyDeviation"; + } + if (obj.value == InputSignalKind::generatorElectricalPower) + { + EnumSymbol = "generatorElectricalPower"; + } + if (obj.value == InputSignalKind::generatorAcceleratingPower) + { + EnumSymbol = "generatorAcceleratingPower"; + } + if (obj.value == InputSignalKind::busVoltage) + { + EnumSymbol = "busVoltage"; + } + if (obj.value == InputSignalKind::busVoltageDerivative) + { + EnumSymbol = "busVoltageDerivative"; + } + if (obj.value == InputSignalKind::branchCurrent) + { + EnumSymbol = "branchCurrent"; + } + if (obj.value == InputSignalKind::fieldCurrent) + { + EnumSymbol = "fieldCurrent"; + } + + if (!EnumSymbol.empty()) + { + os << "InputSignalKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/InputSignalKind.hpp b/CGMES_2.4.15_16FEB2016/InputSignalKind.hpp index cc11f6f94..98b85d1f8 100644 --- a/CGMES_2.4.15_16FEB2016/InputSignalKind.hpp +++ b/CGMES_2.4.15_16FEB2016/InputSignalKind.hpp @@ -1,53 +1,78 @@ #ifndef InputSignalKind_H #define InputSignalKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Input signal type. In Dynamics modelling, commonly represented by j parameter. */ - enum class InputSignalKind + class InputSignalKind { - /** - * Input signal is rotor or shaft speed (angular frequency). - */ - rotorSpeed, - /** - * Input signal is rotor or shaft angular frequency deviation. - */ - rotorAngularFrequencyDeviation, - /** - * Input signal is bus voltage fr - */ - busFrequency, - /** - * Input signal is deviation of bus voltage frequ - */ - busFrequencyDeviation, - /** - * Input signal is generator electrical power on rated S. - */ - generatorElectricalPower, - /** - * Input signal is generating accelerating power. - */ - generatorAcceleratingPower, - /** - * Input signal - */ - busVoltage, - /** - * Input signal is derivative of bus voltag - */ - busVoltageDerivative, - /** - * Input signal is amplitude of remote branch current. - */ - branchCurrent, - /** - * Input signal is generator field current. - */ - fieldCurrent, + public: + enum InputSignalKind_ENUM + { + /** + * Input signal is rotor or shaft speed (angular frequency). + */ + rotorSpeed, + /** + * Input signal is rotor or shaft angular frequency deviation. + */ + rotorAngularFrequencyDeviation, + /** + * Input signal is bus voltage fr + */ + busFrequency, + /** + * Input signal is deviation of bus voltage frequ + */ + busFrequencyDeviation, + /** + * Input signal is generator electrical power on rated S. + */ + generatorElectricalPower, + /** + * Input signal is generating accelerating power. + */ + generatorAcceleratingPower, + /** + * Input signal + */ + busVoltage, + /** + * Input signal is derivative of bus voltag + */ + busVoltageDerivative, + /** + * Input signal is amplitude of remote branch current. + */ + branchCurrent, + /** + * Input signal is generator field current. + */ + fieldCurrent, + }; + + InputSignalKind() : value(), initialized(false) {} + InputSignalKind(InputSignalKind_ENUM value) : value(value), initialized(true) {} + + InputSignalKind& operator=(InputSignalKind_ENUM rop); + operator InputSignalKind_ENUM() const; + + InputSignalKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, InputSignalKind& rop); + friend std::ostream& operator<<(std::ostream& os, const InputSignalKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::InputSignalKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/Junction.cpp b/CGMES_2.4.15_16FEB2016/Junction.cpp index f8ffd734b..0ffba7325 100644 --- a/CGMES_2.4.15_16FEB2016/Junction.cpp +++ b/CGMES_2.4.15_16FEB2016/Junction.cpp @@ -1,36 +1,36 @@ -#include -#include "Connector.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Junction.hpp" +#include +#include + using namespace CIMPP; Junction::Junction() {}; - Junction::~Junction() {}; -namespace CIMPP { - BaseClass* Junction_factory() { - return new Junction; - } +const char Junction::debugName[] = "Junction"; +const char* Junction::debugString() const +{ + return Junction::debugName; } -void Junction::addConstructToMap(std::unordered_map& factory_map) { +void Junction::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Junction"), &Junction_factory)); } -void Junction::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Junction::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Junction::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Junction::debugName[] = "Junction"; -const char* Junction::debugString() +void Junction::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Junction::debugName; } const BaseClassDefiner Junction::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Junction::declare() return BaseClassDefiner(Junction::addConstructToMap, Junction::addPrimitiveAssignFnsToMap, Junction::addClassAssignFnsToMap, Junction::debugName); } - +namespace CIMPP +{ + BaseClass* Junction_factory() + { + return new Junction; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Junction.hpp b/CGMES_2.4.15_16FEB2016/Junction.hpp index 9d390733d..bf1c7f41e 100644 --- a/CGMES_2.4.15_16FEB2016/Junction.hpp +++ b/CGMES_2.4.15_16FEB2016/Junction.hpp @@ -1,36 +1,37 @@ #ifndef Junction_H #define Junction_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Connector.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Connector.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A point where one or more conducting equipments are connected with zero resistance. */ - class Junction: public Connector + class Junction : public Connector { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Junction(); - virtual ~Junction(); - + ~Junction() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Junction_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Length.cpp b/CGMES_2.4.15_16FEB2016/Length.cpp index 59e68bac1..2c089f847 100644 --- a/CGMES_2.4.15_16FEB2016/Length.cpp +++ b/CGMES_2.4.15_16FEB2016/Length.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Length.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Length::Length() {} -Length::~Length(){} +#include -Length::Length(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Length::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Length::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Length& Length::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Length::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Length::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Length::debugName[] = "Length"; -const char* Length::debugString() { +const char* Length::debugString() const +{ return Length::debugName; } - -const BaseClassDefiner Length::declare() { - return BaseClassDefiner(Length::addConstructToMap, Length::addPrimitiveAssignFnsToMap, Length::addClassAssignFnsToMap, Length::debugName); +Length& Length::operator+=(const Length& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Length& Length::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Length& Length::operator-=(const Length& rhs) { - value -= rhs.value; - return *this; - } - - Length& Length::operator*=(const Length& rhs) { - value *= rhs.value; - return *this; - } - - Length& Length::operator/=(const Length& rhs) { - value /= rhs.value; - return *this; - } +Length& Length::operator-=(const Length& rhs) +{ + value -= rhs.value; + return *this; +} - Length& Length::operator+=(const Length& rhs) { - value += rhs.value; - return *this; - } +Length& Length::operator*=(const Length& rhs) +{ + value *= rhs.value; + return *this; +} - Length::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Length& Length::operator/=(const Length& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Length& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Length& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Length& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Length.hpp b/CGMES_2.4.15_16FEB2016/Length.hpp index 999a55e3b..f3f5c9403 100644 --- a/CGMES_2.4.15_16FEB2016/Length.hpp +++ b/CGMES_2.4.15_16FEB2016/Length.hpp @@ -1,38 +1,39 @@ #ifndef Length_H #define Length_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Length : public BaseClass + /* + Unit of length. Never negative. + */ + class Length { - public: - Length(); - virtual ~Length(); - Length(long double value); - static const BaseClassDefiner declare(); - Length& operator=(long double &rop); + Length() : value(0.0), initialized(false) {} + Length(long double value) : value(value), initialized(true) {} + + Length& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Length& operator+=(const Length& rhs); Length& operator-=(const Length& rhs); Length& operator*=(const Length& rhs); Length& operator/=(const Length& rhs); + friend std::istream& operator>>(std::istream& lop, Length& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Length& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/Limit.cpp b/CGMES_2.4.15_16FEB2016/Limit.cpp index baebfa177..487b4c6c8 100644 --- a/CGMES_2.4.15_16FEB2016/Limit.cpp +++ b/CGMES_2.4.15_16FEB2016/Limit.cpp @@ -1,36 +1,36 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Limit.hpp" +#include +#include + using namespace CIMPP; Limit::Limit() {}; - Limit::~Limit() {}; -namespace CIMPP { - BaseClass* Limit_factory() { - return new Limit; - } +const char Limit::debugName[] = "Limit"; +const char* Limit::debugString() const +{ + return Limit::debugName; } -void Limit::addConstructToMap(std::unordered_map& factory_map) { +void Limit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Limit"), &Limit_factory)); } -void Limit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Limit::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Limit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Limit::debugName[] = "Limit"; -const char* Limit::debugString() +void Limit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Limit::debugName; } const BaseClassDefiner Limit::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Limit::declare() return BaseClassDefiner(Limit::addConstructToMap, Limit::addPrimitiveAssignFnsToMap, Limit::addClassAssignFnsToMap, Limit::debugName); } - +namespace CIMPP +{ + BaseClass* Limit_factory() + { + return new Limit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Limit.hpp b/CGMES_2.4.15_16FEB2016/Limit.hpp index 0bfa855f1..47dda3684 100644 --- a/CGMES_2.4.15_16FEB2016/Limit.hpp +++ b/CGMES_2.4.15_16FEB2016/Limit.hpp @@ -1,36 +1,37 @@ #ifndef Limit_H #define Limit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Specifies one limit value for a Measurement. A Measurement typically has several limits that are kept together by the LimitSet class. The actual meaning and use of a Limit instance (i.e., if it is an alarm or warning limit or if it is a high or low limit) is not captured in the Limit class. However the name of a Limit instance may indicate both meaning and use. */ - class Limit: public IdentifiedObject + class Limit : public IdentifiedObject { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Limit(); - virtual ~Limit(); - + ~Limit() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Limit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LimitSet.cpp b/CGMES_2.4.15_16FEB2016/LimitSet.cpp index de59edc72..0622bd81f 100644 --- a/CGMES_2.4.15_16FEB2016/LimitSet.cpp +++ b/CGMES_2.4.15_16FEB2016/LimitSet.cpp @@ -1,51 +1,52 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LimitSet.hpp" +#include +#include + #include "Boolean.hpp" using namespace CIMPP; LimitSet::LimitSet() {}; - LimitSet::~LimitSet() {}; +bool assign_LimitSet_isPercentageLimits(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LimitSet* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isPercentageLimits; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LimitSet_isPercentageLimits(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LimitSet* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isPercentageLimits; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LimitSet_factory() { - return new LimitSet; - } +const char LimitSet::debugName[] = "LimitSet"; +const char* LimitSet::debugString() const +{ + return LimitSet::debugName; } -void LimitSet::addConstructToMap(std::unordered_map& factory_map) { +void LimitSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LimitSet"), &LimitSet_factory)); } -void LimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LimitSet.isPercentageLimits"), &assign_LimitSet_isPercentageLimits)); } -void LimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LimitSet::debugName[] = "LimitSet"; -const char* LimitSet::debugString() +void LimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LimitSet::debugName; } const BaseClassDefiner LimitSet::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner LimitSet::declare() return BaseClassDefiner(LimitSet::addConstructToMap, LimitSet::addPrimitiveAssignFnsToMap, LimitSet::addClassAssignFnsToMap, LimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* LimitSet_factory() + { + return new LimitSet; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LimitSet.hpp b/CGMES_2.4.15_16FEB2016/LimitSet.hpp index 5321da963..553b70ef6 100644 --- a/CGMES_2.4.15_16FEB2016/LimitSet.hpp +++ b/CGMES_2.4.15_16FEB2016/LimitSet.hpp @@ -1,38 +1,39 @@ #ifndef LimitSet_H #define LimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Specifies a set of Limits that are associated with a Measurement. A Measurement may have several LimitSets corresponding to seasonal or other changing conditions. The condition is captured in the name and description attributes. The same LimitSet may be used for several Measurements. In particular percentage limits are used this way. */ - class LimitSet: public IdentifiedObject + class LimitSet : public IdentifiedObject { - public: - CIMPP::Boolean isPercentageLimits; /* Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LimitSet(); - virtual ~LimitSet(); - + ~LimitSet() override; + + CIMPP::Boolean isPercentageLimits; /* Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LimitSet_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LimitTypeKind.cpp b/CGMES_2.4.15_16FEB2016/LimitTypeKind.cpp index 52efaf862..d6bf93a42 100644 --- a/CGMES_2.4.15_16FEB2016/LimitTypeKind.cpp +++ b/CGMES_2.4.15_16FEB2016/LimitTypeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LimitTypeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::LimitTypeKind& rop) +LimitTypeKind& LimitTypeKind::operator=(LimitTypeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +LimitTypeKind::operator LimitTypeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char LimitTypeKind::debugName[] = "LimitTypeKind"; +const char* LimitTypeKind::debugString() const +{ + return LimitTypeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, LimitTypeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -58,5 +89,47 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const LimitTypeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == LimitTypeKind::patl) + { + EnumSymbol = "patl"; + } + if (obj.value == LimitTypeKind::patlt) + { + EnumSymbol = "patlt"; + } + if (obj.value == LimitTypeKind::tatl) + { + EnumSymbol = "tatl"; + } + if (obj.value == LimitTypeKind::tc) + { + EnumSymbol = "tc"; + } + if (obj.value == LimitTypeKind::tct) + { + EnumSymbol = "tct"; + } + if (obj.value == LimitTypeKind::highVoltage) + { + EnumSymbol = "highVoltage"; + } + if (obj.value == LimitTypeKind::lowVoltage) + { + EnumSymbol = "lowVoltage"; + } + + if (!EnumSymbol.empty()) + { + os << "LimitTypeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LimitTypeKind.hpp b/CGMES_2.4.15_16FEB2016/LimitTypeKind.hpp index 8e674ccd5..3d95bd4ec 100644 --- a/CGMES_2.4.15_16FEB2016/LimitTypeKind.hpp +++ b/CGMES_2.4.15_16FEB2016/LimitTypeKind.hpp @@ -1,41 +1,66 @@ #ifndef LimitTypeKind_H #define LimitTypeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The enumeration defines the kinds of the limit types. */ - enum class LimitTypeKind + class LimitTypeKind { - /** - * The Permanent Admissible Transmission Loading (PATL) is the loading in Amps, MVA or MW that can be accepted by a network branch for an unlimited duration without any risk for the material. The duration attribute is not used and shall be excluded for the PATL limit type. Hence only one limit value exists for the PATL type. - */ - patl, - /** - * Permanent Admissible Transmission Loading Threshold (PATLT) is a value in engineering units defined for PATL and calculated using percentage less than 100 of the PATL type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. - */ - patlt, - /** - * Temporarily Admissible Transmission Loading (TATL) which is the loading in Amps, MVA or MW that can be accepted by a branch for a certain limited duration. The TATL can be defined in different ways: Such a definition of TATL can depend on the initial operating conditions of the network element (sag situation of a line). The duration attribute can be used define several TATL limit types. Hence multiple TATL limit values may exist having different durations. - */ - tatl, - /** - * Tripping Current (TC) is the ultimate intensity without any delay. It is defined as the threshold the line will trip without any possible remedial actions. The tripping of the network element is ordered by protections against short circuits or by overload protections, but in any case, the activation delay of these protections is not compatible with the reaction delay of an operator (less than one minute). The duration is always zero and the duration attribute may be left out. Hence only one limit value exists for the TC type. - */ - tc, - /** - * Tripping Current Threshold (TCT) is a value in engineering units defined for TC and calculated using percentage less than 100 of the TC type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. - */ - tct, - /** - * Referring to the rating of the equipments, a voltage too high can lead to accelerated ageing or the destruction of the equipment. This limit type may or may not have duration. - */ - highVoltage, - /** - * A too low voltage can disturb the normal operation of some protections and transformer equipped with on-load tap changers, electronic power devices or can affect the behaviour of the auxiliaries of generation units. This limit type may or may not have duration. - */ - lowVoltage, + public: + enum LimitTypeKind_ENUM + { + /** + * The Permanent Admissible Transmission Loading (PATL) is the loading in Amps, MVA or MW that can be accepted by a network branch for an unlimited duration without any risk for the material. The duration attribute is not used and shall be excluded for the PATL limit type. Hence only one limit value exists for the PATL type. + */ + patl, + /** + * Permanent Admissible Transmission Loading Threshold (PATLT) is a value in engineering units defined for PATL and calculated using percentage less than 100 of the PATL type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. + */ + patlt, + /** + * Temporarily Admissible Transmission Loading (TATL) which is the loading in Amps, MVA or MW that can be accepted by a branch for a certain limited duration. The TATL can be defined in different ways: Such a definition of TATL can depend on the initial operating conditions of the network element (sag situation of a line). The duration attribute can be used define several TATL limit types. Hence multiple TATL limit values may exist having different durations. + */ + tatl, + /** + * Tripping Current (TC) is the ultimate intensity without any delay. It is defined as the threshold the line will trip without any possible remedial actions. The tripping of the network element is ordered by protections against short circuits or by overload protections, but in any case, the activation delay of these protections is not compatible with the reaction delay of an operator (less than one minute). The duration is always zero and the duration attribute may be left out. Hence only one limit value exists for the TC type. + */ + tc, + /** + * Tripping Current Threshold (TCT) is a value in engineering units defined for TC and calculated using percentage less than 100 of the TC type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. + */ + tct, + /** + * Referring to the rating of the equipments, a voltage too high can lead to accelerated ageing or the destruction of the equipment. This limit type may or may not have duration. + */ + highVoltage, + /** + * A too low voltage can disturb the normal operation of some protections and transformer equipped with on-load tap changers, electronic power devices or can affect the behaviour of the auxiliaries of generation units. This limit type may or may not have duration. + */ + lowVoltage, + }; + + LimitTypeKind() : value(), initialized(false) {} + LimitTypeKind(LimitTypeKind_ENUM value) : value(value), initialized(true) {} + + LimitTypeKind& operator=(LimitTypeKind_ENUM rop); + operator LimitTypeKind_ENUM() const; + + LimitTypeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, LimitTypeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const LimitTypeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::LimitTypeKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/Line.cpp b/CGMES_2.4.15_16FEB2016/Line.cpp index 5cd36f03c..d115a5496 100644 --- a/CGMES_2.4.15_16FEB2016/Line.cpp +++ b/CGMES_2.4.15_16FEB2016/Line.cpp @@ -1,49 +1,56 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Line.hpp" +#include +#include + #include "SubGeographicalRegion.hpp" using namespace CIMPP; -Line::Line(): Region(nullptr) {}; - +Line::Line() : Region(nullptr) {}; Line::~Line() {}; -bool assign_SubGeographicalRegion_Lines(BaseClass*, BaseClass*); -bool assign_Line_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Line* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_SubGeographicalRegion_Lines(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* Line_factory() { - return new Line; +bool assign_SubGeographicalRegion_Lines(BaseClass*, BaseClass*); +bool assign_Line_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Line* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_SubGeographicalRegion_Lines(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void Line::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:Line"), &Line_factory)); +const char Line::debugName[] = "Line"; +const char* Line::debugString() const +{ + return Line::debugName; } -void Line::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void Line::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:Line"), &Line_factory)); +} -void Line::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Line.Region"), &assign_Line_Region)); +void Line::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Line::debugName[] = "Line"; -const char* Line::debugString() +void Line::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Line::debugName; + assign_map.insert(std::make_pair(std::string("cim:Line.Region"), &assign_Line_Region)); } const BaseClassDefiner Line::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner Line::declare() return BaseClassDefiner(Line::addConstructToMap, Line::addPrimitiveAssignFnsToMap, Line::addClassAssignFnsToMap, Line::debugName); } - +namespace CIMPP +{ + BaseClass* Line_factory() + { + return new Line; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Line.hpp b/CGMES_2.4.15_16FEB2016/Line.hpp index 191586170..1ebd15ab8 100644 --- a/CGMES_2.4.15_16FEB2016/Line.hpp +++ b/CGMES_2.4.15_16FEB2016/Line.hpp @@ -1,38 +1,39 @@ #ifndef Line_H #define Line_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubGeographicalRegion; -class SubGeographicalRegion; /* Contains equipment beyond a substation belonging to a power transmission line. */ - class Line: public EquipmentContainer + class Line : public EquipmentContainer { - public: - CIMPP::SubGeographicalRegion* Region; /* The sub-geographical region of the line. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Line(); - virtual ~Line(); - + ~Line() override; + + CIMPP::SubGeographicalRegion* Region; /* The lines within the sub-geographical region. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Line_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.cpp b/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.cpp index 8f593eb90..06b73e6ad 100644 --- a/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.cpp +++ b/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.cpp @@ -1,96 +1,100 @@ -#include -#include "ShuntCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LinearShuntCompensator.hpp" +#include +#include + #include "Susceptance.hpp" -#include "Conductance.hpp" #include "Susceptance.hpp" #include "Conductance.hpp" +#include "Conductance.hpp" using namespace CIMPP; LinearShuntCompensator::LinearShuntCompensator() {}; - LinearShuntCompensator::~LinearShuntCompensator() {}; +bool assign_LinearShuntCompensator_b0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0PerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LinearShuntCompensator_bPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bPerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LinearShuntCompensator_g0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0PerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LinearShuntCompensator_gPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gPerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LinearShuntCompensator_bPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bPerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LinearShuntCompensator_gPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gPerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LinearShuntCompensator_b0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0PerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LinearShuntCompensator_g0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0PerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LinearShuntCompensator_factory() { - return new LinearShuntCompensator; - } +const char LinearShuntCompensator::debugName[] = "LinearShuntCompensator"; +const char* LinearShuntCompensator::debugString() const +{ + return LinearShuntCompensator::debugName; } -void LinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) { +void LinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator"), &LinearShuntCompensator_factory)); } -void LinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.bPerSection"), &assign_LinearShuntCompensator_bPerSection)); - assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.gPerSection"), &assign_LinearShuntCompensator_gPerSection)); +void LinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.b0PerSection"), &assign_LinearShuntCompensator_b0PerSection)); + assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.bPerSection"), &assign_LinearShuntCompensator_bPerSection)); assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.g0PerSection"), &assign_LinearShuntCompensator_g0PerSection)); + assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.gPerSection"), &assign_LinearShuntCompensator_gPerSection)); } -void LinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LinearShuntCompensator::debugName[] = "LinearShuntCompensator"; -const char* LinearShuntCompensator::debugString() +void LinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LinearShuntCompensator::debugName; } const BaseClassDefiner LinearShuntCompensator::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner LinearShuntCompensator::declare() return BaseClassDefiner(LinearShuntCompensator::addConstructToMap, LinearShuntCompensator::addPrimitiveAssignFnsToMap, LinearShuntCompensator::addClassAssignFnsToMap, LinearShuntCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* LinearShuntCompensator_factory() + { + return new LinearShuntCompensator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.hpp b/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.hpp index b8a26902a..38c19002d 100644 --- a/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.hpp +++ b/CGMES_2.4.15_16FEB2016/LinearShuntCompensator.hpp @@ -1,42 +1,43 @@ #ifndef LinearShuntCompensator_H #define LinearShuntCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ShuntCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "ShuntCompensator.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A linear shunt compensator has banks or sections with equal admittance values. */ - class LinearShuntCompensator: public ShuntCompensator + class LinearShuntCompensator : public ShuntCompensator { - public: - CIMPP::Susceptance bPerSection; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance gPerSection; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ - CIMPP::Susceptance b0PerSection; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance g0PerSection; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LinearShuntCompensator(); - virtual ~LinearShuntCompensator(); - + ~LinearShuntCompensator() override; + + CIMPP::Susceptance b0PerSection; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Susceptance bPerSection; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Conductance g0PerSection; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ + CIMPP::Conductance gPerSection; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LinearShuntCompensator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadAggregate.cpp b/CGMES_2.4.15_16FEB2016/LoadAggregate.cpp index 04785e416..d6a367b9d 100644 --- a/CGMES_2.4.15_16FEB2016/LoadAggregate.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadAggregate.cpp @@ -1,60 +1,76 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadAggregate.hpp" -#include "LoadStatic.hpp" +#include +#include + #include "LoadMotor.hpp" +#include "LoadStatic.hpp" using namespace CIMPP; -LoadAggregate::LoadAggregate(): LoadStatic(nullptr), LoadMotor(nullptr) {}; - +LoadAggregate::LoadAggregate() : LoadMotor(nullptr), LoadStatic(nullptr) {}; LoadAggregate::~LoadAggregate() {}; -bool assign_LoadAggregate_LoadStatic(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadAggregate* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadStatic = dynamic_cast(BaseClass_ptr2); - if(element->LoadStatic != nullptr) - return true; - } - return false; -} - -bool assign_LoadAggregate_LoadMotor(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadAggregate* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadMotor = dynamic_cast(BaseClass_ptr2); - if(element->LoadMotor != nullptr) - return true; - } - return false; -} +bool assign_LoadMotor_LoadAggregate(BaseClass*, BaseClass*); +bool assign_LoadAggregate_LoadMotor(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadAggregate* element = dynamic_cast(BaseClass_ptr1); + LoadMotor* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadMotor != element2) + { + element->LoadMotor = element2; + return assign_LoadMotor_LoadAggregate(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* LoadAggregate_factory() { - return new LoadAggregate; +bool assign_LoadStatic_LoadAggregate(BaseClass*, BaseClass*); +bool assign_LoadAggregate_LoadStatic(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadAggregate* element = dynamic_cast(BaseClass_ptr1); + LoadStatic* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadStatic != element2) + { + element->LoadStatic = element2; + return assign_LoadStatic_LoadAggregate(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void LoadAggregate::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:LoadAggregate"), &LoadAggregate_factory)); +const char LoadAggregate::debugName[] = "LoadAggregate"; +const char* LoadAggregate::debugString() const +{ + return LoadAggregate::debugName; } -void LoadAggregate::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void LoadAggregate::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:LoadAggregate"), &LoadAggregate_factory)); +} -void LoadAggregate::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadStatic"), &assign_LoadAggregate_LoadStatic)); - assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadMotor"), &assign_LoadAggregate_LoadMotor)); +void LoadAggregate::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadAggregate::debugName[] = "LoadAggregate"; -const char* LoadAggregate::debugString() +void LoadAggregate::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadAggregate::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadMotor"), &assign_LoadAggregate_LoadMotor)); + assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadStatic"), &assign_LoadAggregate_LoadStatic)); } const BaseClassDefiner LoadAggregate::declare() @@ -62,4 +78,10 @@ const BaseClassDefiner LoadAggregate::declare() return BaseClassDefiner(LoadAggregate::addConstructToMap, LoadAggregate::addPrimitiveAssignFnsToMap, LoadAggregate::addClassAssignFnsToMap, LoadAggregate::debugName); } - +namespace CIMPP +{ + BaseClass* LoadAggregate_factory() + { + return new LoadAggregate; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadAggregate.hpp b/CGMES_2.4.15_16FEB2016/LoadAggregate.hpp index 0e138c16d..86ba44d00 100644 --- a/CGMES_2.4.15_16FEB2016/LoadAggregate.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadAggregate.hpp @@ -1,40 +1,41 @@ #ifndef LoadAggregate_H #define LoadAggregate_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class LoadMotor; + class LoadStatic; -class LoadStatic; -class LoadMotor; /* Standard aggregate load model comprised of static and/or dynamic components. A static load model represents the sensitivity of the real and reactive power consumed by the load to the amplitude and frequency of the bus voltage. A dynamic load model can used to represent the aggregate response of the motor components of the load. */ - class LoadAggregate: public LoadDynamics + class LoadAggregate : public LoadDynamics { - public: - CIMPP::LoadStatic* LoadStatic; /* Aggregate static load associated with this aggregate load. Default: 0 */ - CIMPP::LoadMotor* LoadMotor; /* Aggregate motor (dynamic) load associated with this aggregate load. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadAggregate(); - virtual ~LoadAggregate(); - + ~LoadAggregate() override; + + CIMPP::LoadMotor* LoadMotor; /* Aggregate motor (dynamic) load associated with this aggregate load. Default: 0 */ + CIMPP::LoadStatic* LoadStatic; /* Aggregate static load associated with this aggregate load. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadAggregate_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadArea.cpp b/CGMES_2.4.15_16FEB2016/LoadArea.cpp index a698a730f..ed24626bc 100644 --- a/CGMES_2.4.15_16FEB2016/LoadArea.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadArea.cpp @@ -1,49 +1,56 @@ -#include -#include "EnergyArea.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadArea.hpp" +#include +#include + #include "SubLoadArea.hpp" using namespace CIMPP; LoadArea::LoadArea() {}; - LoadArea::~LoadArea() {}; -bool assign_LoadArea_SubLoadAreas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SubLoadAreas.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_SubLoadArea_LoadArea(BaseClass*, BaseClass*); +bool assign_LoadArea_SubLoadAreas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadArea* element = dynamic_cast(BaseClass_ptr1); + SubLoadArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SubLoadAreas.begin(), element->SubLoadAreas.end(), element2) == element->SubLoadAreas.end()) + { + element->SubLoadAreas.push_back(element2); + return assign_SubLoadArea_LoadArea(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* LoadArea_factory() { - return new LoadArea; - } +const char LoadArea::debugName[] = "LoadArea"; +const char* LoadArea::debugString() const +{ + return LoadArea::debugName; } -void LoadArea::addConstructToMap(std::unordered_map& factory_map) { +void LoadArea::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadArea"), &LoadArea_factory)); } -void LoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void LoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadArea.SubLoadAreas"), &assign_LoadArea_SubLoadAreas)); +void LoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadArea::debugName[] = "LoadArea"; -const char* LoadArea::debugString() +void LoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadArea.SubLoadAreas"), &assign_LoadArea_SubLoadAreas)); } const BaseClassDefiner LoadArea::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner LoadArea::declare() return BaseClassDefiner(LoadArea::addConstructToMap, LoadArea::addPrimitiveAssignFnsToMap, LoadArea::addClassAssignFnsToMap, LoadArea::debugName); } - +namespace CIMPP +{ + BaseClass* LoadArea_factory() + { + return new LoadArea; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadArea.hpp b/CGMES_2.4.15_16FEB2016/LoadArea.hpp index 8e65aa6fe..c4bd5f831 100644 --- a/CGMES_2.4.15_16FEB2016/LoadArea.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadArea.hpp @@ -1,38 +1,39 @@ #ifndef LoadArea_H #define LoadArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyArea.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyArea.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubLoadArea; -class SubLoadArea; /* The class is the root or first level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. */ - class LoadArea: public EnergyArea + class LoadArea : public EnergyArea { - public: - std::list SubLoadAreas; /* The SubLoadAreas in the LoadArea. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadArea(); - virtual ~LoadArea(); - + ~LoadArea() override; + + std::list SubLoadAreas; /* The SubLoadAreas in the LoadArea. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadArea_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.cpp b/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.cpp index 48d70a647..bc2238810 100644 --- a/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.cpp @@ -1,36 +1,36 @@ -#include -#include "ProtectedSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadBreakSwitch.hpp" +#include +#include + using namespace CIMPP; LoadBreakSwitch::LoadBreakSwitch() {}; - LoadBreakSwitch::~LoadBreakSwitch() {}; -namespace CIMPP { - BaseClass* LoadBreakSwitch_factory() { - return new LoadBreakSwitch; - } +const char LoadBreakSwitch::debugName[] = "LoadBreakSwitch"; +const char* LoadBreakSwitch::debugString() const +{ + return LoadBreakSwitch::debugName; } -void LoadBreakSwitch::addConstructToMap(std::unordered_map& factory_map) { +void LoadBreakSwitch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadBreakSwitch"), &LoadBreakSwitch_factory)); } -void LoadBreakSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void LoadBreakSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void LoadBreakSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadBreakSwitch::debugName[] = "LoadBreakSwitch"; -const char* LoadBreakSwitch::debugString() +void LoadBreakSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadBreakSwitch::debugName; } const BaseClassDefiner LoadBreakSwitch::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner LoadBreakSwitch::declare() return BaseClassDefiner(LoadBreakSwitch::addConstructToMap, LoadBreakSwitch::addPrimitiveAssignFnsToMap, LoadBreakSwitch::addClassAssignFnsToMap, LoadBreakSwitch::debugName); } - +namespace CIMPP +{ + BaseClass* LoadBreakSwitch_factory() + { + return new LoadBreakSwitch; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.hpp b/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.hpp index fd0dfbd1c..843b54d07 100644 --- a/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadBreakSwitch.hpp @@ -1,36 +1,37 @@ #ifndef LoadBreakSwitch_H #define LoadBreakSwitch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ProtectedSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ProtectedSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. */ - class LoadBreakSwitch: public ProtectedSwitch + class LoadBreakSwitch : public ProtectedSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadBreakSwitch(); - virtual ~LoadBreakSwitch(); - + ~LoadBreakSwitch() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadBreakSwitch_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadComposite.cpp b/CGMES_2.4.15_16FEB2016/LoadComposite.cpp index 98b340ca4..5fe50b8fc 100644 --- a/CGMES_2.4.15_16FEB2016/LoadComposite.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadComposite.cpp @@ -1,8 +1,11 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadComposite.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -13,189 +16,197 @@ #include "Simple_Float.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; LoadComposite::LoadComposite() {}; - LoadComposite::~LoadComposite() {}; +bool assign_LoadComposite_epfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_epfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epfs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_epvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_epvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqfs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_lfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lfrac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfrac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadComposite_epvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadComposite_epfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epfs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadComposite_eqvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_eqfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqfs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_epvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_epfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_eqvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_eqfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_lfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lfrac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfrac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* LoadComposite_factory() { - return new LoadComposite; - } + + + + + + + + + +const char LoadComposite::debugName[] = "LoadComposite"; +const char* LoadComposite::debugString() const +{ + return LoadComposite::debugName; } -void LoadComposite::addConstructToMap(std::unordered_map& factory_map) { +void LoadComposite::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadComposite"), &LoadComposite_factory)); } -void LoadComposite::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epvs"), &assign_LoadComposite_epvs)); +void LoadComposite::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epfd"), &assign_LoadComposite_epfd)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epfs"), &assign_LoadComposite_epfs)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvs"), &assign_LoadComposite_eqvs)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqfs"), &assign_LoadComposite_eqfs)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epvd"), &assign_LoadComposite_epvd)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epfd"), &assign_LoadComposite_epfd)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvd"), &assign_LoadComposite_eqvd)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epvs"), &assign_LoadComposite_epvs)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqfd"), &assign_LoadComposite_eqfd)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.lfrac"), &assign_LoadComposite_lfrac)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqfs"), &assign_LoadComposite_eqfs)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvd"), &assign_LoadComposite_eqvd)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvs"), &assign_LoadComposite_eqvs)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.h"), &assign_LoadComposite_h)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.lfrac"), &assign_LoadComposite_lfrac)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.pfrac"), &assign_LoadComposite_pfrac)); } -void LoadComposite::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LoadComposite::debugName[] = "LoadComposite"; -const char* LoadComposite::debugString() +void LoadComposite::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadComposite::debugName; } const BaseClassDefiner LoadComposite::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner LoadComposite::declare() return BaseClassDefiner(LoadComposite::addConstructToMap, LoadComposite::addPrimitiveAssignFnsToMap, LoadComposite::addClassAssignFnsToMap, LoadComposite::debugName); } - +namespace CIMPP +{ + BaseClass* LoadComposite_factory() + { + return new LoadComposite; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadComposite.hpp b/CGMES_2.4.15_16FEB2016/LoadComposite.hpp index 410ffb8c9..389aaceae 100644 --- a/CGMES_2.4.15_16FEB2016/LoadComposite.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadComposite.hpp @@ -1,49 +1,50 @@ #ifndef LoadComposite_H #define LoadComposite_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* This models combines static load and induction motor load effects. The dynamics of the motor are simplified by linearizing the induction machine equations. */ - class LoadComposite: public LoadDynamics + class LoadComposite : public LoadDynamics { - public: - CIMPP::Simple_Float epvs; /* Active load-voltage dependence index (static) (Epvs). Typical Value = 0.7. Default: nullptr */ - CIMPP::Simple_Float epfs; /* Active load-frequency dependence index (static) (Epfs). Typical Value = 1.5. Default: nullptr */ - CIMPP::Simple_Float eqvs; /* Reactive load-voltage dependence index (static) (Eqvs). Typical Value = 2. Default: nullptr */ - CIMPP::Simple_Float eqfs; /* Reactive load-frequency dependence index (static) (Eqfs). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float epvd; /* Active load-voltage dependence index (dynamic) (Epvd). Typical Value = 0.7. Default: nullptr */ - CIMPP::Simple_Float epfd; /* Active load-frequency dependence index (dynamic) (Epfd). Typical Value = 1.5. Default: nullptr */ - CIMPP::Simple_Float eqvd; /* Reactive load-voltage dependence index (dynamic) (Eqvd). Typical Value = 2. Default: nullptr */ - CIMPP::Simple_Float eqfd; /* Reactive load-frequency dependence index (dynamic) (Eqfd). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float lfrac; /* Loading factor - ratio of initial P to motor MVA base (Lfrac). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds h; /* Inertia constant (H). Typical Value = 2.5. Default: nullptr */ - CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadComposite(); - virtual ~LoadComposite(); - + ~LoadComposite() override; + + CIMPP::Simple_Float epfd; /* Active load-frequency dependence index (dynamic) (Epfd). Typical Value = 1.5. Default: nullptr */ + CIMPP::Simple_Float epfs; /* Active load-frequency dependence index (static) (Epfs). Typical Value = 1.5. Default: nullptr */ + CIMPP::Simple_Float epvd; /* Active load-voltage dependence index (dynamic) (Epvd). Typical Value = 0.7. Default: nullptr */ + CIMPP::Simple_Float epvs; /* Active load-voltage dependence index (static) (Epvs). Typical Value = 0.7. Default: nullptr */ + CIMPP::Simple_Float eqfd; /* Reactive load-frequency dependence index (dynamic) (Eqfd). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float eqfs; /* Reactive load-frequency dependence index (static) (Eqfs). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float eqvd; /* Reactive load-voltage dependence index (dynamic) (Eqvd). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float eqvs; /* Reactive load-voltage dependence index (static) (Eqvs). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds h; /* Inertia constant (H). Typical Value = 2.5. Default: nullptr */ + CIMPP::Simple_Float lfrac; /* Loading factor - ratio of initial P to motor MVA base (Lfrac). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadComposite_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadDynamics.cpp b/CGMES_2.4.15_16FEB2016/LoadDynamics.cpp index 47cafda7f..2dc9c9f3e 100644 --- a/CGMES_2.4.15_16FEB2016/LoadDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadDynamics.hpp" +#include +#include + #include "EnergyConsumer.hpp" using namespace CIMPP; LoadDynamics::LoadDynamics() {}; - LoadDynamics::~LoadDynamics() {}; -bool assign_LoadDynamics_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumer.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_EnergyConsumer_LoadDynamics(BaseClass*, BaseClass*); +bool assign_LoadDynamics_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadDynamics* element = dynamic_cast(BaseClass_ptr1); + EnergyConsumer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumer.begin(), element->EnergyConsumer.end(), element2) == element->EnergyConsumer.end()) + { + element->EnergyConsumer.push_back(element2); + return assign_EnergyConsumer_LoadDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* LoadDynamics_factory() { - return new LoadDynamics; - } +const char LoadDynamics::debugName[] = "LoadDynamics"; +const char* LoadDynamics::debugString() const +{ + return LoadDynamics::debugName; } -void LoadDynamics::addConstructToMap(std::unordered_map& factory_map) { +void LoadDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadDynamics"), &LoadDynamics_factory)); } -void LoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void LoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadDynamics.EnergyConsumer"), &assign_LoadDynamics_EnergyConsumer)); +void LoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadDynamics::debugName[] = "LoadDynamics"; -const char* LoadDynamics::debugString() +void LoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadDynamics.EnergyConsumer"), &assign_LoadDynamics_EnergyConsumer)); } const BaseClassDefiner LoadDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner LoadDynamics::declare() return BaseClassDefiner(LoadDynamics::addConstructToMap, LoadDynamics::addPrimitiveAssignFnsToMap, LoadDynamics::addClassAssignFnsToMap, LoadDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* LoadDynamics_factory() + { + return new LoadDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadDynamics.hpp b/CGMES_2.4.15_16FEB2016/LoadDynamics.hpp index d6693e71f..d21cef390 100644 --- a/CGMES_2.4.15_16FEB2016/LoadDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadDynamics.hpp @@ -1,38 +1,39 @@ #ifndef LoadDynamics_H #define LoadDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EnergyConsumer; -class EnergyConsumer; /* Load whose behaviour is described by reference to a standard model A standard feature of dynamic load behaviour modelling is the ability to associate the same behaviour to multiple energy consumers by means of a single aggregate load definition. Aggregate loads are used to represent all or part of the real and reactive load from one or more loads in the static (power flow) data. This load is usually the aggregation of many individual load devices and the load model is approximate representation of the aggregate response of the load devices to system disturbances. The load model is always applied to individual bus loads (energy consumers) but a single set of load model parameters can used for all loads in the grouping. */ - class LoadDynamics: public IdentifiedObject + class LoadDynamics : public IdentifiedObject { - public: - std::list EnergyConsumer; /* Energy consumer to which this dynamics load model applies. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadDynamics(); - virtual ~LoadDynamics(); - + ~LoadDynamics() override; + + std::list EnergyConsumer; /* Energy consumer to which this dynamics load model applies. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.cpp b/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.cpp index 6ed0a1bbd..71b3161cc 100644 --- a/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.cpp @@ -1,171 +1,180 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadGenericNonLinear.hpp" -#include "GenericNonLinearLoadModelKind.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include "GenericNonLinearLoadModelKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; LoadGenericNonLinear::LoadGenericNonLinear() {}; - LoadGenericNonLinear::~LoadGenericNonLinear() {}; +bool assign_LoadGenericNonLinear_bs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_bt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_genericNonLinearLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->genericNonLinearLoadModelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ls; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_lt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_pt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_qt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_tq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadGenericNonLinear_genericNonLinearLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->genericNonLinearLoadModelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_pt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_qt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_tq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ls; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_lt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_bs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_bt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LoadGenericNonLinear_factory() { - return new LoadGenericNonLinear; - } +const char LoadGenericNonLinear::debugName[] = "LoadGenericNonLinear"; +const char* LoadGenericNonLinear::debugString() const +{ + return LoadGenericNonLinear::debugName; } -void LoadGenericNonLinear::addConstructToMap(std::unordered_map& factory_map) { +void LoadGenericNonLinear::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear"), &LoadGenericNonLinear_factory)); } -void LoadGenericNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LoadGenericNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bs"), &assign_LoadGenericNonLinear_bs)); + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bt"), &assign_LoadGenericNonLinear_bt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.genericNonLinearLoadModelType"), &assign_LoadGenericNonLinear_genericNonLinearLoadModelType)); + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.ls"), &assign_LoadGenericNonLinear_ls)); + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.lt"), &assign_LoadGenericNonLinear_lt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.pt"), &assign_LoadGenericNonLinear_pt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.qt"), &assign_LoadGenericNonLinear_qt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.tp"), &assign_LoadGenericNonLinear_tp)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.tq"), &assign_LoadGenericNonLinear_tq)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.ls"), &assign_LoadGenericNonLinear_ls)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.lt"), &assign_LoadGenericNonLinear_lt)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bs"), &assign_LoadGenericNonLinear_bs)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bt"), &assign_LoadGenericNonLinear_bt)); } -void LoadGenericNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LoadGenericNonLinear::debugName[] = "LoadGenericNonLinear"; -const char* LoadGenericNonLinear::debugString() +void LoadGenericNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadGenericNonLinear::debugName; } const BaseClassDefiner LoadGenericNonLinear::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner LoadGenericNonLinear::declare() return BaseClassDefiner(LoadGenericNonLinear::addConstructToMap, LoadGenericNonLinear::addPrimitiveAssignFnsToMap, LoadGenericNonLinear::addClassAssignFnsToMap, LoadGenericNonLinear::debugName); } - +namespace CIMPP +{ + BaseClass* LoadGenericNonLinear_factory() + { + return new LoadGenericNonLinear; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.hpp b/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.hpp index bcb4a2cce..a5ffacb16 100644 --- a/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadGenericNonLinear.hpp @@ -1,48 +1,49 @@ #ifndef LoadGenericNonLinear_H #define LoadGenericNonLinear_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "GenericNonLinearLoadModelKind.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* These load models (known also as generic non-linear dynamic (GNLD) load models) can be used in mid-term and long-term voltage stability simulations (i.e., to study voltage collapse), as they can replace a more detailed representation of aggregate load, including induction motors, thermostatically controlled and static loads. */ - class LoadGenericNonLinear: public LoadDynamics + class LoadGenericNonLinear : public LoadDynamics { - public: - CIMPP::GenericNonLinearLoadModelKind genericNonLinearLoadModelType; /* Type of generic non-linear load model. Default: 0 */ - CIMPP::Simple_Float pt; /* Dynamic portion of active load (P). Default: nullptr */ - CIMPP::Simple_Float qt; /* Dynamic portion of reactive load (Q). Default: nullptr */ - CIMPP::Seconds tp; /* Time constant of lag function of active power (T). Default: nullptr */ - CIMPP::Seconds tq; /* Time constant of lag function of reactive power (T). Default: nullptr */ - CIMPP::Simple_Float ls; /* Steady state voltage index for active power (LS). Default: nullptr */ - CIMPP::Simple_Float lt; /* Transient voltage index for active power (LT). Default: nullptr */ - CIMPP::Simple_Float bs; /* Steady state voltage index for reactive power (BS). Default: nullptr */ - CIMPP::Simple_Float bt; /* Transient voltage index for reactive power (BT). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadGenericNonLinear(); - virtual ~LoadGenericNonLinear(); - + ~LoadGenericNonLinear() override; + + CIMPP::Simple_Float bs; /* Steady state voltage index for reactive power (BS). Default: nullptr */ + CIMPP::Simple_Float bt; /* Transient voltage index for reactive power (BT). Default: nullptr */ + CIMPP::GenericNonLinearLoadModelKind genericNonLinearLoadModelType; /* Type of generic non-linear load model. Default: 0 */ + CIMPP::Simple_Float ls; /* Steady state voltage index for active power (LS). Default: nullptr */ + CIMPP::Simple_Float lt; /* Transient voltage index for active power (LT). Default: nullptr */ + CIMPP::Simple_Float pt; /* Dynamic portion of active load (P). Default: nullptr */ + CIMPP::Simple_Float qt; /* Dynamic portion of reactive load (Q). Default: nullptr */ + CIMPP::Seconds tp; /* Time constant of lag function of active power (T). Default: nullptr */ + CIMPP::Seconds tq; /* Time constant of lag function of reactive power (T). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadGenericNonLinear_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadGroup.cpp b/CGMES_2.4.15_16FEB2016/LoadGroup.cpp index 83b54e687..4dce2a407 100644 --- a/CGMES_2.4.15_16FEB2016/LoadGroup.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadGroup.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadGroup.hpp" +#include +#include + #include "SubLoadArea.hpp" using namespace CIMPP; -LoadGroup::LoadGroup(): SubLoadArea(nullptr) {}; - +LoadGroup::LoadGroup() : SubLoadArea(nullptr) {}; LoadGroup::~LoadGroup() {}; -bool assign_SubLoadArea_LoadGroups(BaseClass*, BaseClass*); -bool assign_LoadGroup_SubLoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - element->SubLoadArea = dynamic_cast(BaseClass_ptr2); - if(element->SubLoadArea != nullptr) - return assign_SubLoadArea_LoadGroups(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* LoadGroup_factory() { - return new LoadGroup; +bool assign_SubLoadArea_LoadGroups(BaseClass*, BaseClass*); +bool assign_LoadGroup_SubLoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadGroup* element = dynamic_cast(BaseClass_ptr1); + SubLoadArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SubLoadArea != element2) + { + element->SubLoadArea = element2; + return assign_SubLoadArea_LoadGroups(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void LoadGroup::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:LoadGroup"), &LoadGroup_factory)); +const char LoadGroup::debugName[] = "LoadGroup"; +const char* LoadGroup::debugString() const +{ + return LoadGroup::debugName; } -void LoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void LoadGroup::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:LoadGroup"), &LoadGroup_factory)); +} -void LoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadGroup.SubLoadArea"), &assign_LoadGroup_SubLoadArea)); +void LoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadGroup::debugName[] = "LoadGroup"; -const char* LoadGroup::debugString() +void LoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadGroup.SubLoadArea"), &assign_LoadGroup_SubLoadArea)); } const BaseClassDefiner LoadGroup::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner LoadGroup::declare() return BaseClassDefiner(LoadGroup::addConstructToMap, LoadGroup::addPrimitiveAssignFnsToMap, LoadGroup::addClassAssignFnsToMap, LoadGroup::debugName); } - +namespace CIMPP +{ + BaseClass* LoadGroup_factory() + { + return new LoadGroup; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadGroup.hpp b/CGMES_2.4.15_16FEB2016/LoadGroup.hpp index 648d54b00..768f27c0c 100644 --- a/CGMES_2.4.15_16FEB2016/LoadGroup.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadGroup.hpp @@ -1,38 +1,39 @@ #ifndef LoadGroup_H #define LoadGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubLoadArea; -class SubLoadArea; /* The class is the third level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. */ - class LoadGroup: public IdentifiedObject + class LoadGroup : public IdentifiedObject { - public: - CIMPP::SubLoadArea* SubLoadArea; /* The SubLoadArea where the Loadgroup belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadGroup(); - virtual ~LoadGroup(); - + ~LoadGroup() override; + + CIMPP::SubLoadArea* SubLoadArea; /* The SubLoadArea where the Loadgroup belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadGroup_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadMotor.cpp b/CGMES_2.4.15_16FEB2016/LoadMotor.cpp index ac2df6f92..b7fa7d89f 100644 --- a/CGMES_2.4.15_16FEB2016/LoadMotor.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadMotor.cpp @@ -1,244 +1,264 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadMotor.hpp" +#include +#include + #include "LoadAggregate.hpp" #include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; -LoadMotor::LoadMotor(): LoadAggregate(nullptr) {}; - +LoadMotor::LoadMotor() : LoadAggregate(nullptr) {}; LoadMotor::~LoadMotor() {}; -bool assign_LoadAggregate_LoadMotor(BaseClass*, BaseClass*); -bool assign_LoadMotor_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadAggregate = dynamic_cast(BaseClass_ptr2); - if(element->LoadAggregate != nullptr) - return assign_LoadAggregate_LoadMotor(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + +bool assign_LoadMotor_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_LoadMotor_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_lfac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lfac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_lpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ls; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfrac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_ra(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ra; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tbkr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tbkr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_vt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadAggregate_LoadMotor(BaseClass*, BaseClass*); +bool assign_LoadMotor_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadMotor* element = dynamic_cast(BaseClass_ptr1); + LoadAggregate* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadAggregate != element2) + { + element->LoadAggregate = element2; + return assign_LoadAggregate_LoadMotor(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_LoadMotor_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfrac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadMotor_lfac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lfac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadMotor_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ls; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_lpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_ra(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ra; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadMotor_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_vt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_tbkr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tbkr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* LoadMotor_factory() { - return new LoadMotor; - } + + + + + + + + + +const char LoadMotor::debugName[] = "LoadMotor"; +const char* LoadMotor::debugString() const +{ + return LoadMotor::debugName; } -void LoadMotor::addConstructToMap(std::unordered_map& factory_map) { +void LoadMotor::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadMotor"), &LoadMotor_factory)); } -void LoadMotor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.pfrac"), &assign_LoadMotor_pfrac)); +void LoadMotor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.d"), &assign_LoadMotor_d)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.h"), &assign_LoadMotor_h)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.lfac"), &assign_LoadMotor_lfac)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.ls"), &assign_LoadMotor_ls)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.lp"), &assign_LoadMotor_lp)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.lpp"), &assign_LoadMotor_lpp)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.ls"), &assign_LoadMotor_ls)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.pfrac"), &assign_LoadMotor_pfrac)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.ra"), &assign_LoadMotor_ra)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tbkr"), &assign_LoadMotor_tbkr)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tpo"), &assign_LoadMotor_tpo)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tppo"), &assign_LoadMotor_tppo)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.h"), &assign_LoadMotor_h)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.d"), &assign_LoadMotor_d)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.vt"), &assign_LoadMotor_vt)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tv"), &assign_LoadMotor_tv)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tbkr"), &assign_LoadMotor_tbkr)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.vt"), &assign_LoadMotor_vt)); } -void LoadMotor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.LoadAggregate"), &assign_LoadMotor_LoadAggregate)); - } - -const char LoadMotor::debugName[] = "LoadMotor"; -const char* LoadMotor::debugString() +void LoadMotor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadMotor::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.LoadAggregate"), &assign_LoadMotor_LoadAggregate)); } const BaseClassDefiner LoadMotor::declare() @@ -246,4 +266,10 @@ const BaseClassDefiner LoadMotor::declare() return BaseClassDefiner(LoadMotor::addConstructToMap, LoadMotor::addPrimitiveAssignFnsToMap, LoadMotor::addClassAssignFnsToMap, LoadMotor::debugName); } - +namespace CIMPP +{ + BaseClass* LoadMotor_factory() + { + return new LoadMotor; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadMotor.hpp b/CGMES_2.4.15_16FEB2016/LoadMotor.hpp index cb15d6517..570ff0286 100644 --- a/CGMES_2.4.15_16FEB2016/LoadMotor.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadMotor.hpp @@ -1,54 +1,55 @@ #ifndef LoadMotor_H #define LoadMotor_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class LoadAggregate; -class LoadAggregate; /* Aggregate induction motor load. This model is used to represent a fraction of an ordinary load as "induction motor load". It allows load that is treated as ordinary constant power in power flow analysis to be represented by an induction motor in dynamic simulation. If = 0. or = , or = 0., only one cage is represented. Magnetic saturation is not modelled. Either a "one-cage" or "two-cage" model of the induction machine can be modelled. Magnetic saturation is not modelled. This model is intended for representation of aggregations of many motors dispersed through a load represented at a high voltage bus but where there is no information on the characteristics of individual motors. This model treats a fraction of the constant power part of a load as a motor. During initialisation, the initial power drawn by the motor is set equal to times the constant part of the static load. The remainder of the load is left as static load. The reactive power demand of the motor is calculated during initialisation as a function of voltage at the load bus. This reactive power demand may be less than or greater than the constant component of the load. If the motor's reactive demand is greater than the constant component of the load, the model inserts a shunt capacitor at the terminal of the motor to bring its reactive demand down to equal the constant reactive load. If a motor model and a static load model are both present for a load, the motor is assumed to be subtracted from the power flow constant load before the static load model is applied. The remainder of the load, if any, is then represented by the static load model. */ - class LoadMotor: public IdentifiedObject + class LoadMotor : public IdentifiedObject { - public: - CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate motor (dynamic) load belongs. Default: 0 */ - CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float lfac; /* Loading factor - ratio of initial P to motor MVA base (Lfac). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU ls; /* Synchronous reactance (Ls). Typical Value = 3.2. Default: nullptr */ - CIMPP::PU lp; /* Transient reactance (Lp). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU lpp; /* Subtransient reactance (Lpp). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU ra; /* Stator resistance (Ra). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tpo; /* Transient rotor time constant (Tpo) (not=0). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tppo; /* Subtransient rotor time constant (Tppo). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds h; /* Inertia constant (H) (not=0). Typical Value = 0.4. Default: nullptr */ - CIMPP::Simple_Float d; /* Damping factor (D). Unit = delta P/delta speed. Typical Value = 2. Default: nullptr */ - CIMPP::PU vt; /* Voltage threshold for tripping (Vt). Typical Value = 0.7. Default: nullptr */ - CIMPP::Seconds tv; /* Voltage trip pickup time (Tv). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tbkr; /* Circuit breaker operating time (Tbkr). Typical Value = 0.08. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadMotor(); - virtual ~LoadMotor(); - + ~LoadMotor() override; + + CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate motor (dynamic) load belongs. Default: 0 */ + CIMPP::Simple_Float d; /* Damping factor (D). Unit = delta P/delta speed. Typical Value = 2. Default: nullptr */ + CIMPP::Seconds h; /* Inertia constant (H) (not=0). Typical Value = 0.4. Default: nullptr */ + CIMPP::Simple_Float lfac; /* Loading factor - ratio of initial P to motor MVA base (Lfac). Typical Value = 0.8. Default: nullptr */ + CIMPP::PU lp; /* Transient reactance (Lp). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU lpp; /* Subtransient reactance (Lpp). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU ls; /* Synchronous reactance (Ls). Typical Value = 3.2. Default: nullptr */ + CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU ra; /* Stator resistance (Ra). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tbkr; /* Circuit breaker operating time (Tbkr). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tpo; /* Transient rotor time constant (Tpo) (not=0). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tppo; /* Subtransient rotor time constant (Tppo). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tv; /* Voltage trip pickup time (Tv). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vt; /* Voltage threshold for tripping (Vt). Typical Value = 0.7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadMotor_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.cpp b/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.cpp index 52072325d..bca018da6 100644 --- a/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.cpp @@ -1,7 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadResponseCharacteristic.hpp" +#include +#include + +#include "EnergyConsumer.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -13,181 +18,199 @@ #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "EnergyConsumer.hpp" using namespace CIMPP; LoadResponseCharacteristic::LoadResponseCharacteristic() {}; - LoadResponseCharacteristic::~LoadResponseCharacteristic() {}; +bool assign_LoadResponseCharacteristic_exponentModel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exponentModel; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pConstantCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pConstantImpedance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pConstantPower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pFrequencyExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pVoltageExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qConstantCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qConstantImpedance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qConstantPower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qFrequencyExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumer.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_LoadResponseCharacteristic_qVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qVoltageExponent; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_LoadResponseCharacteristic_exponentModel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exponentModel; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_pConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pConstantCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_pConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pConstantImpedance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_pConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pConstantPower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_pFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pFrequencyExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_pVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pVoltageExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qConstantCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qConstantImpedance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qConstantPower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qFrequencyExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qVoltageExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* LoadResponseCharacteristic_factory() { - return new LoadResponseCharacteristic; +bool assign_EnergyConsumer_LoadResponse(BaseClass*, BaseClass*); +bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1); + EnergyConsumer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumer.begin(), element->EnergyConsumer.end(), element2) == element->EnergyConsumer.end()) + { + element->EnergyConsumer.push_back(element2); + return assign_EnergyConsumer_LoadResponse(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + + + + +const char LoadResponseCharacteristic::debugName[] = "LoadResponseCharacteristic"; +const char* LoadResponseCharacteristic::debugString() const +{ + return LoadResponseCharacteristic::debugName; } -void LoadResponseCharacteristic::addConstructToMap(std::unordered_map& factory_map) { +void LoadResponseCharacteristic::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic"), &LoadResponseCharacteristic_factory)); } -void LoadResponseCharacteristic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LoadResponseCharacteristic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.exponentModel"), &assign_LoadResponseCharacteristic_exponentModel)); assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.pConstantCurrent"), &assign_LoadResponseCharacteristic_pConstantCurrent)); assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.pConstantImpedance"), &assign_LoadResponseCharacteristic_pConstantImpedance)); @@ -199,16 +222,11 @@ void LoadResponseCharacteristic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.EnergyConsumer"), &assign_LoadResponseCharacteristic_EnergyConsumer)); } -const char LoadResponseCharacteristic::debugName[] = "LoadResponseCharacteristic"; -const char* LoadResponseCharacteristic::debugString() +void LoadResponseCharacteristic::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadResponseCharacteristic::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.EnergyConsumer"), &assign_LoadResponseCharacteristic_EnergyConsumer)); } const BaseClassDefiner LoadResponseCharacteristic::declare() @@ -216,4 +234,10 @@ const BaseClassDefiner LoadResponseCharacteristic::declare() return BaseClassDefiner(LoadResponseCharacteristic::addConstructToMap, LoadResponseCharacteristic::addPrimitiveAssignFnsToMap, LoadResponseCharacteristic::addClassAssignFnsToMap, LoadResponseCharacteristic::debugName); } - +namespace CIMPP +{ + BaseClass* LoadResponseCharacteristic_factory() + { + return new LoadResponseCharacteristic; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.hpp b/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.hpp index fe374c1a5..5a7e07e60 100644 --- a/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadResponseCharacteristic.hpp @@ -1,51 +1,52 @@ #ifndef LoadResponseCharacteristic_H #define LoadResponseCharacteristic_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class EnergyConsumer; -class EnergyConsumer; /* Models the characteristic response of the load demand due to changes in system conditions such as voltage and frequency. This is not related to demand response. If LoadResponseCharacteristic.exponentModel is True, the voltage exponents are specified and used as to calculate: Active power component = Pnominal * (Voltage/cim:BaseVoltage.nominalVoltage) ** cim:LoadResponseCharacteristic.pVoltageExponent Reactive power component = Qnominal * (Voltage/cim:BaseVoltage.nominalVoltage)** cim:LoadResponseCharacteristic.qVoltageExponent Where * means "multiply" and ** is "raised to power of". */ - class LoadResponseCharacteristic: public IdentifiedObject + class LoadResponseCharacteristic : public IdentifiedObject { - public: - CIMPP::Boolean exponentModel; /* Indicates the exponential voltage dependency model is to be used. If false, the coefficient model is to be used. The exponential voltage dependency model consist of the attributes - pVoltageExponent - qVoltageExponent. The coefficient model consist of the attributes - pConstantImpedance - pConstantCurrent - pConstantPower - qConstantImpedance - qConstantCurrent - qConstantPower. The sum of pConstantImpedance, pConstantCurrent and pConstantPower shall equal 1. The sum of qConstantImpedance, qConstantCurrent and qConstantPower shall equal 1. Default: false */ - CIMPP::Simple_Float pConstantCurrent; /* Portion of active power load modeled as constant current. Default: nullptr */ - CIMPP::Simple_Float pConstantImpedance; /* Portion of active power load modeled as constant impedance. Default: nullptr */ - CIMPP::Simple_Float pConstantPower; /* Portion of active power load modeled as constant power. Default: nullptr */ - CIMPP::Simple_Float pFrequencyExponent; /* Exponent of per unit frequency effecting active power. Default: nullptr */ - CIMPP::Simple_Float pVoltageExponent; /* Exponent of per unit voltage effecting real power. Default: nullptr */ - CIMPP::Simple_Float qConstantCurrent; /* Portion of reactive power load modeled as constant current. Default: nullptr */ - CIMPP::Simple_Float qConstantImpedance; /* Portion of reactive power load modeled as constant impedance. Default: nullptr */ - CIMPP::Simple_Float qConstantPower; /* Portion of reactive power load modeled as constant power. Default: nullptr */ - CIMPP::Simple_Float qFrequencyExponent; /* Exponent of per unit frequency effecting reactive power. Default: nullptr */ - CIMPP::Simple_Float qVoltageExponent; /* Exponent of per unit voltage effecting reactive power. Default: nullptr */ - std::list EnergyConsumer; /* The set of loads that have the response characteristics. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadResponseCharacteristic(); - virtual ~LoadResponseCharacteristic(); - + ~LoadResponseCharacteristic() override; + + std::list EnergyConsumer; /* The set of loads that have the response characteristics. Default: 0 */ + CIMPP::Boolean exponentModel; /* Indicates the exponential voltage dependency model is to be used. If false, the coefficient model is to be used. The exponential voltage dependency model consist of the attributes - pVoltageExponent - qVoltageExponent. The coefficient model consist of the attributes - pConstantImpedance - pConstantCurrent - pConstantPower - qConstantImpedance - qConstantCurrent - qConstantPower. The sum of pConstantImpedance, pConstantCurrent and pConstantPower shall equal 1. The sum of qConstantImpedance, qConstantCurrent and qConstantPower shall equal 1. Default: false */ + CIMPP::Simple_Float pConstantCurrent; /* Portion of active power load modeled as constant current. Default: nullptr */ + CIMPP::Simple_Float pConstantImpedance; /* Portion of active power load modeled as constant impedance. Default: nullptr */ + CIMPP::Simple_Float pConstantPower; /* Portion of active power load modeled as constant power. Default: nullptr */ + CIMPP::Simple_Float pFrequencyExponent; /* Exponent of per unit frequency effecting active power. Default: nullptr */ + CIMPP::Simple_Float pVoltageExponent; /* Exponent of per unit voltage effecting real power. Default: nullptr */ + CIMPP::Simple_Float qConstantCurrent; /* Portion of reactive power load modeled as constant current. Default: nullptr */ + CIMPP::Simple_Float qConstantImpedance; /* Portion of reactive power load modeled as constant impedance. Default: nullptr */ + CIMPP::Simple_Float qConstantPower; /* Portion of reactive power load modeled as constant power. Default: nullptr */ + CIMPP::Simple_Float qFrequencyExponent; /* Exponent of per unit frequency effecting reactive power. Default: nullptr */ + CIMPP::Simple_Float qVoltageExponent; /* Exponent of per unit voltage effecting reactive power. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadResponseCharacteristic_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadStatic.cpp b/CGMES_2.4.15_16FEB2016/LoadStatic.cpp index aab0f5ccd..f73a0f201 100644 --- a/CGMES_2.4.15_16FEB2016/LoadStatic.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadStatic.cpp @@ -1,9 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadStatic.hpp" +#include +#include + #include "LoadAggregate.hpp" -#include "StaticLoadModelKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -20,285 +23,306 @@ #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "StaticLoadModelKind.hpp" using namespace CIMPP; -LoadStatic::LoadStatic(): LoadAggregate(nullptr) {}; - +LoadStatic::LoadStatic() : LoadAggregate(nullptr) {}; LoadStatic::~LoadStatic() {}; -bool assign_LoadAggregate_LoadStatic(BaseClass*, BaseClass*); -bool assign_LoadStatic_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadAggregate = dynamic_cast(BaseClass_ptr2); - if(element->LoadAggregate != nullptr) - return assign_LoadAggregate_LoadStatic(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_LoadStatic_ep1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ep1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_ep2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ep2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_ep3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ep3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_eq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eq1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_eq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eq2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_eq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eq3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kqf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_staticLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->staticLoadModelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadStatic_staticLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->staticLoadModelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_LoadAggregate_LoadStatic(BaseClass*, BaseClass*); +bool assign_LoadStatic_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadStatic* element = dynamic_cast(BaseClass_ptr1); + LoadAggregate* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadAggregate != element2) + { + element->LoadAggregate = element2; + return assign_LoadAggregate_LoadStatic(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_LoadStatic_kp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_ep1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ep1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_ep2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ep2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_ep3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ep3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_eq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eq1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_eq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eq2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_eq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eq3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kqf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LoadStatic_factory() { - return new LoadStatic; - } + +const char LoadStatic::debugName[] = "LoadStatic"; +const char* LoadStatic::debugString() const +{ + return LoadStatic::debugName; } -void LoadStatic::addConstructToMap(std::unordered_map& factory_map) { +void LoadStatic::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadStatic"), &LoadStatic_factory)); } -void LoadStatic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.staticLoadModelType"), &assign_LoadStatic_staticLoadModelType)); +void LoadStatic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep1"), &assign_LoadStatic_ep1)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep2"), &assign_LoadStatic_ep2)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep3"), &assign_LoadStatic_ep3)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq1"), &assign_LoadStatic_eq1)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq2"), &assign_LoadStatic_eq2)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq3"), &assign_LoadStatic_eq3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp1"), &assign_LoadStatic_kp1)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp2"), &assign_LoadStatic_kp2)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp3"), &assign_LoadStatic_kp3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp4"), &assign_LoadStatic_kp4)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep1"), &assign_LoadStatic_ep1)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep2"), &assign_LoadStatic_ep2)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep3"), &assign_LoadStatic_ep3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kpf"), &assign_LoadStatic_kpf)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq1"), &assign_LoadStatic_kq1)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq2"), &assign_LoadStatic_kq2)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq3"), &assign_LoadStatic_kq3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq4"), &assign_LoadStatic_kq4)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq1"), &assign_LoadStatic_eq1)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq2"), &assign_LoadStatic_eq2)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq3"), &assign_LoadStatic_eq3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kqf"), &assign_LoadStatic_kqf)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.staticLoadModelType"), &assign_LoadStatic_staticLoadModelType)); } -void LoadStatic::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.LoadAggregate"), &assign_LoadStatic_LoadAggregate)); - } - -const char LoadStatic::debugName[] = "LoadStatic"; -const char* LoadStatic::debugString() +void LoadStatic::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadStatic::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.LoadAggregate"), &assign_LoadStatic_LoadAggregate)); } const BaseClassDefiner LoadStatic::declare() @@ -306,4 +330,10 @@ const BaseClassDefiner LoadStatic::declare() return BaseClassDefiner(LoadStatic::addConstructToMap, LoadStatic::addPrimitiveAssignFnsToMap, LoadStatic::addClassAssignFnsToMap, LoadStatic::debugName); } - +namespace CIMPP +{ + BaseClass* LoadStatic_factory() + { + return new LoadStatic; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadStatic.hpp b/CGMES_2.4.15_16FEB2016/LoadStatic.hpp index 6e23b6fbb..20d2f697c 100644 --- a/CGMES_2.4.15_16FEB2016/LoadStatic.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadStatic.hpp @@ -1,57 +1,58 @@ #ifndef LoadStatic_H #define LoadStatic_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "StaticLoadModelKind.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" +#include "StaticLoadModelKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class LoadAggregate; -class LoadAggregate; /* General static load model representing the sensitivity of the real and reactive power consumed by the load to the amplitude and frequency of the bus voltage. */ - class LoadStatic: public IdentifiedObject + class LoadStatic : public IdentifiedObject { - public: - CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate static load belongs. Default: 0 */ - CIMPP::StaticLoadModelKind staticLoadModelType; /* Type of static load model. Typical Value = constantZ. Default: 0 */ - CIMPP::Simple_Float kp1; /* First term voltage coefficient for active power (Kp1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kp2; /* Second term voltage coefficient for active power (Kp2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kp3; /* Third term voltage coefficient for active power (Kp3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kp4; /* Frequency coefficient for active power (Kp4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ - CIMPP::Simple_Float ep1; /* First term voltage exponent for active power (Ep1). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float ep2; /* Second term voltage exponent for active power (Ep2). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float ep3; /* Third term voltage exponent for active power (Ep3). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float kpf; /* Frequency deviation coefficient for active power (Kpf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq1; /* First term voltage coefficient for reactive power (Kq1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq2; /* Second term voltage coefficient for reactive power (Kq2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq3; /* Third term voltage coefficient for reactive power (Kq3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq4; /* Frequency coefficient for reactive power (Kq4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ - CIMPP::Simple_Float eq1; /* First term voltage exponent for reactive power (Eq1). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float eq2; /* Second term voltage exponent for reactive power (Eq2). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float eq3; /* Third term voltage exponent for reactive power (Eq3). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float kqf; /* Frequency deviation coefficient for reactive power (Kqf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadStatic(); - virtual ~LoadStatic(); - + ~LoadStatic() override; + + CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate static load belongs. Default: 0 */ + CIMPP::Simple_Float ep1; /* First term voltage exponent for active power (Ep1). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float ep2; /* Second term voltage exponent for active power (Ep2). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float ep3; /* Third term voltage exponent for active power (Ep3). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float eq1; /* First term voltage exponent for reactive power (Eq1). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float eq2; /* Second term voltage exponent for reactive power (Eq2). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float eq3; /* Third term voltage exponent for reactive power (Eq3). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float kp1; /* First term voltage coefficient for active power (Kp1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kp2; /* Second term voltage coefficient for active power (Kp2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kp3; /* Third term voltage coefficient for active power (Kp3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kp4; /* Frequency coefficient for active power (Kp4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ + CIMPP::Simple_Float kpf; /* Frequency deviation coefficient for active power (Kpf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq1; /* First term voltage coefficient for reactive power (Kq1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq2; /* Second term voltage coefficient for reactive power (Kq2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq3; /* Third term voltage coefficient for reactive power (Kq3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq4; /* Frequency coefficient for reactive power (Kq4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ + CIMPP::Simple_Float kqf; /* Frequency deviation coefficient for reactive power (Kqf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::StaticLoadModelKind staticLoadModelType; /* Type of static load model. Typical Value = constantZ. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadStatic_factory(); diff --git a/CGMES_2.4.15_16FEB2016/LoadUserDefined.cpp b/CGMES_2.4.15_16FEB2016/LoadUserDefined.cpp index ba2ad4b40..e183a2407 100644 --- a/CGMES_2.4.15_16FEB2016/LoadUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/LoadUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; LoadUserDefined::LoadUserDefined() {}; - LoadUserDefined::~LoadUserDefined() {}; -bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_LoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_LoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass*, BaseClass*); +bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* LoadUserDefined_factory() { - return new LoadUserDefined; - } +const char LoadUserDefined::debugName[] = "LoadUserDefined"; +const char* LoadUserDefined::debugString() const +{ + return LoadUserDefined::debugName; } -void LoadUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void LoadUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadUserDefined"), &LoadUserDefined_factory)); } -void LoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LoadUserDefined.proprietary"), &assign_LoadUserDefined_proprietary)); - } - -void LoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadUserDefined.ProprietaryParameterDynamics"), &assign_LoadUserDefined_ProprietaryParameterDynamics)); } -const char LoadUserDefined::debugName[] = "LoadUserDefined"; -const char* LoadUserDefined::debugString() +void LoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadUserDefined.ProprietaryParameterDynamics"), &assign_LoadUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner LoadUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner LoadUserDefined::declare() return BaseClassDefiner(LoadUserDefined::addConstructToMap, LoadUserDefined::addPrimitiveAssignFnsToMap, LoadUserDefined::addClassAssignFnsToMap, LoadUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* LoadUserDefined_factory() + { + return new LoadUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/LoadUserDefined.hpp b/CGMES_2.4.15_16FEB2016/LoadUserDefined.hpp index 37d3c3a78..552ad477f 100644 --- a/CGMES_2.4.15_16FEB2016/LoadUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/LoadUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef LoadUserDefined_H #define LoadUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Load whose dynamic behaviour is described by a user-defined model. */ - class LoadUserDefined: public LoadDynamics + class LoadUserDefined : public LoadDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadUserDefined(); - virtual ~LoadUserDefined(); - + ~LoadUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Location.cpp b/CGMES_2.4.15_16FEB2016/Location.cpp index 51552b401..324a13705 100644 --- a/CGMES_2.4.15_16FEB2016/Location.cpp +++ b/CGMES_2.4.15_16FEB2016/Location.cpp @@ -1,75 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Location.hpp" +#include +#include + #include "CoordinateSystem.hpp" -#include "PowerSystemResource.hpp" #include "PositionPoint.hpp" +#include "PowerSystemResource.hpp" using namespace CIMPP; -Location::Location(): CoordinateSystem(nullptr), PowerSystemResources(nullptr) {}; - +Location::Location() : CoordinateSystem(nullptr), PowerSystemResources(nullptr) {}; Location::~Location() {}; + + + + bool assign_CoordinateSystem_Location(BaseClass*, BaseClass*); -bool assign_Location_CoordinateSystem(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Location* element = dynamic_cast(BaseClass_ptr1)) { - element->CoordinateSystem = dynamic_cast(BaseClass_ptr2); - if(element->CoordinateSystem != nullptr) - return assign_CoordinateSystem_Location(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Location_CoordinateSystem(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Location* element = dynamic_cast(BaseClass_ptr1); + CoordinateSystem* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->CoordinateSystem != element2) + { + element->CoordinateSystem = element2; + return assign_CoordinateSystem_Location(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PowerSystemResource_Location(BaseClass*, BaseClass*); -bool assign_Location_PowerSystemResources(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Location* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemResources = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemResources != nullptr) - return assign_PowerSystemResource_Location(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PositionPoint_Location(BaseClass*, BaseClass*); +bool assign_Location_PositionPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Location* element = dynamic_cast(BaseClass_ptr1); + PositionPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PositionPoints.begin(), element->PositionPoints.end(), element2) == element->PositionPoints.end()) + { + element->PositionPoints.push_back(element2); + return assign_PositionPoint_Location(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Location_PositionPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Location* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PositionPoints.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_PowerSystemResource_Location(BaseClass*, BaseClass*); +bool assign_Location_PowerSystemResources(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Location* element = dynamic_cast(BaseClass_ptr1); + PowerSystemResource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemResources != element2) + { + element->PowerSystemResources = element2; + return assign_PowerSystemResource_Location(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - -namespace CIMPP { - BaseClass* Location_factory() { - return new Location; - } +const char Location::debugName[] = "Location"; +const char* Location::debugString() const +{ + return Location::debugName; } -void Location::addConstructToMap(std::unordered_map& factory_map) { +void Location::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Location"), &Location_factory)); } -void Location::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Location::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Location.CoordinateSystem"), &assign_Location_CoordinateSystem)); - assign_map.insert(std::make_pair(std::string("cim:Location.PowerSystemResources"), &assign_Location_PowerSystemResources)); - assign_map.insert(std::make_pair(std::string("cim:Location.PositionPoints"), &assign_Location_PositionPoints)); +void Location::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Location::debugName[] = "Location"; -const char* Location::debugString() +void Location::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Location::debugName; + assign_map.insert(std::make_pair(std::string("cim:Location.CoordinateSystem"), &assign_Location_CoordinateSystem)); + assign_map.insert(std::make_pair(std::string("cim:Location.PositionPoints"), &assign_Location_PositionPoints)); + assign_map.insert(std::make_pair(std::string("cim:Location.PowerSystemResources"), &assign_Location_PowerSystemResources)); } const BaseClassDefiner Location::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner Location::declare() return BaseClassDefiner(Location::addConstructToMap, Location::addPrimitiveAssignFnsToMap, Location::addClassAssignFnsToMap, Location::debugName); } - +namespace CIMPP +{ + BaseClass* Location_factory() + { + return new Location; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Location.hpp b/CGMES_2.4.15_16FEB2016/Location.hpp index 4f1e5df0e..717a070ff 100644 --- a/CGMES_2.4.15_16FEB2016/Location.hpp +++ b/CGMES_2.4.15_16FEB2016/Location.hpp @@ -1,42 +1,43 @@ #ifndef Location_H #define Location_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class CoordinateSystem; + class PositionPoint; + class PowerSystemResource; -class CoordinateSystem; -class PowerSystemResource; -class PositionPoint; /* The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more postition points (coordinates) in a given coordinate system. */ - class Location: public IdentifiedObject + class Location : public IdentifiedObject { - public: - CIMPP::CoordinateSystem* CoordinateSystem; /* Coordinate system used to describe position points of this location. Default: 0 */ - CIMPP::PowerSystemResource* PowerSystemResources; /* All power system resources at this location. Default: 0 */ - std::list PositionPoints; /* Sequence of position points describing this location, expressed in coordinate system `Location.CoordinateSystem`. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Location(); - virtual ~Location(); - + ~Location() override; + + CIMPP::CoordinateSystem* CoordinateSystem; /* Coordinate system used to describe position points of this location. Default: 0 */ + std::list PositionPoints; /* Sequence of position points describing this location, expressed in coordinate system `Location.CoordinateSystem`. Default: 0 */ + CIMPP::PowerSystemResource* PowerSystemResources; /* All power system resources at this location. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Location_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Measurement.cpp b/CGMES_2.4.15_16FEB2016/Measurement.cpp index 5e00ecfee..fb5a3137e 100644 --- a/CGMES_2.4.15_16FEB2016/Measurement.cpp +++ b/CGMES_2.4.15_16FEB2016/Measurement.cpp @@ -1,50 +1,58 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Measurement.hpp" +#include +#include + +#include "PowerSystemResource.hpp" +#include "ACDCTerminal.hpp" #include "String.hpp" #include "PhaseCode.hpp" -#include "UnitSymbol.hpp" #include "UnitMultiplier.hpp" -#include "ACDCTerminal.hpp" -#include "PowerSystemResource.hpp" +#include "UnitSymbol.hpp" using namespace CIMPP; -Measurement::Measurement(): Terminal(nullptr), PowerSystemResource(nullptr) {}; - +Measurement::Measurement() : PowerSystemResource(nullptr), Terminal(nullptr) {}; Measurement::~Measurement() {}; - - -bool assign_ACDCTerminal_Measurements(BaseClass*, BaseClass*); -bool assign_Measurement_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_ACDCTerminal_Measurements(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Measurement_measurementType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + element->measurementType = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PowerSystemResource_Measurements(BaseClass*, BaseClass*); -bool assign_Measurement_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemResource = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemResource != nullptr) - return assign_PowerSystemResource_Measurements(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Measurement_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->phases; + if (buffer.fail()) + return false; + else + return true; + } + return false; } - -bool assign_Measurement_measurementType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - element->measurementType = buffer.str(); - if(buffer.fail()) +bool assign_Measurement_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitMultiplier; + if (buffer.fail()) return false; else return true; @@ -52,70 +60,81 @@ bool assign_Measurement_measurementType(std::stringstream &buffer, BaseClass* Ba return false; } -bool assign_Measurement_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->phases; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Measurement_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitSymbol; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Measurement_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitSymbol; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; + +bool assign_PowerSystemResource_Measurements(BaseClass*, BaseClass*); +bool assign_Measurement_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Measurement* element = dynamic_cast(BaseClass_ptr1); + PowerSystemResource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemResource != element2) + { + element->PowerSystemResource = element2; + return assign_PowerSystemResource_Measurements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Measurement_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ACDCTerminal_Measurements(BaseClass*, BaseClass*); +bool assign_Measurement_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Measurement* element = dynamic_cast(BaseClass_ptr1); + ACDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_ACDCTerminal_Measurements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* Measurement_factory() { - return new Measurement; - } + + +const char Measurement::debugName[] = "Measurement"; +const char* Measurement::debugString() const +{ + return Measurement::debugName; } -void Measurement::addConstructToMap(std::unordered_map& factory_map) { +void Measurement::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Measurement"), &Measurement_factory)); } -void Measurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Measurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Measurement.measurementType"), &assign_Measurement_measurementType)); assign_map.insert(std::make_pair(std::string("cim:Measurement.phases"), &assign_Measurement_phases)); - assign_map.insert(std::make_pair(std::string("cim:Measurement.unitSymbol"), &assign_Measurement_unitSymbol)); assign_map.insert(std::make_pair(std::string("cim:Measurement.unitMultiplier"), &assign_Measurement_unitMultiplier)); - } - -void Measurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Measurement.Terminal"), &assign_Measurement_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:Measurement.PowerSystemResource"), &assign_Measurement_PowerSystemResource)); + assign_map.insert(std::make_pair(std::string("cim:Measurement.unitSymbol"), &assign_Measurement_unitSymbol)); } -const char Measurement::debugName[] = "Measurement"; -const char* Measurement::debugString() +void Measurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Measurement::debugName; + assign_map.insert(std::make_pair(std::string("cim:Measurement.PowerSystemResource"), &assign_Measurement_PowerSystemResource)); + assign_map.insert(std::make_pair(std::string("cim:Measurement.Terminal"), &assign_Measurement_Terminal)); } const BaseClassDefiner Measurement::declare() @@ -123,4 +142,10 @@ const BaseClassDefiner Measurement::declare() return BaseClassDefiner(Measurement::addConstructToMap, Measurement::addPrimitiveAssignFnsToMap, Measurement::addClassAssignFnsToMap, Measurement::debugName); } - +namespace CIMPP +{ + BaseClass* Measurement_factory() + { + return new Measurement; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Measurement.hpp b/CGMES_2.4.15_16FEB2016/Measurement.hpp index 9e7f2f064..bd320f912 100644 --- a/CGMES_2.4.15_16FEB2016/Measurement.hpp +++ b/CGMES_2.4.15_16FEB2016/Measurement.hpp @@ -1,48 +1,49 @@ #ifndef Measurement_H #define Measurement_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "String.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PhaseCode.hpp" -#include "UnitSymbol.hpp" +#include "String.hpp" #include "UnitMultiplier.hpp" +#include "UnitSymbol.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ACDCTerminal; + class PowerSystemResource; -class ACDCTerminal; -class PowerSystemResource; /* A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment may contain Measurements, e.g. a substation may have temperature measurements and door open indications, a transformer may have oil temperature and tank pressure measurements, a bay may contain a number of power flow measurements and a Breaker may contain a switch status measurement. The PSR - Measurement association is intended to capture this use of Measurement and is included in the naming hierarchy based on EquipmentContainer. The naming hierarchy typically has Measurements as leafs, e.g. Substation-VoltageLevel-Bay-Switch-Measurement. Some Measurements represent quantities related to a particular sensor location in the network, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is not captured in the PSR - Measurement association. Instead it is captured by the Measurement - Terminal association that is used to define the sensing location in the network topology. The location is defined by the connection of the Terminal to ConductingEquipment. If both a Terminal and PSR are associated, and the PSR is of type ConductingEquipment, the associated Terminal should belong to that ConductingEquipment instance. When the sensor location is needed both Measurement-PSR and Measurement-Terminal are used. The Measurement-Terminal association is never used alone. */ - class Measurement: public IdentifiedObject + class Measurement : public IdentifiedObject { - public: - CIMPP::String measurementType; /* Specifies the type of measurement. For example, this specifies if the measurement represents an indoor temperature, outdoor temperature, bus voltage, line flow, etc. Default: '' */ - CIMPP::PhaseCode phases; /* Indicates to which phases the measurement applies and avoids the need to use `measurementType` to also encode phase information (which would explode the types). The phase information in Measurement, along with `measurementType` and `phases` uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. If the attribute is missing three phases (ABC) shall be assumed. Default: 0 */ - CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the measured quantity. Default: 0 */ - CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the measured quantity. Default: 0 */ - CIMPP::ACDCTerminal* Terminal; /* One or more measurements may be associated with a terminal in the network. Default: 0 */ - CIMPP::PowerSystemResource* PowerSystemResource; /* The measurements associated with this power system resource. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Measurement(); - virtual ~Measurement(); - + ~Measurement() override; + + CIMPP::PowerSystemResource* PowerSystemResource; /* The measurements associated with this power system resource. Default: 0 */ + CIMPP::ACDCTerminal* Terminal; /* One or more measurements may be associated with a terminal in the network. Default: 0 */ + CIMPP::String measurementType; /* Specifies the type of measurement. For example, this specifies if the measurement represents an indoor temperature, outdoor temperature, bus voltage, line flow, etc. Default: '' */ + CIMPP::PhaseCode phases; /* Indicates to which phases the measurement applies and avoids the need to use `measurementType` to also encode phase information (which would explode the types). The phase information in Measurement, along with `measurementType` and `phases` uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. If the attribute is missing three phases (ABC) shall be assumed. Default: 0 */ + CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the measured quantity. Default: 0 */ + CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the measured quantity. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Measurement_factory(); diff --git a/CGMES_2.4.15_16FEB2016/MeasurementValue.cpp b/CGMES_2.4.15_16FEB2016/MeasurementValue.cpp index 63d4b71c8..84231fa0a 100644 --- a/CGMES_2.4.15_16FEB2016/MeasurementValue.cpp +++ b/CGMES_2.4.15_16FEB2016/MeasurementValue.cpp @@ -1,88 +1,108 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MeasurementValue.hpp" -#include "DateTime.hpp" -#include "PerCent.hpp" +#include +#include + #include "MeasurementValueQuality.hpp" #include "MeasurementValueSource.hpp" +#include "PerCent.hpp" +#include "DateTime.hpp" using namespace CIMPP; -MeasurementValue::MeasurementValue(): timeStamp(nullptr), MeasurementValueQuality(nullptr), MeasurementValueSource(nullptr) {}; - +MeasurementValue::MeasurementValue() : MeasurementValueQuality(nullptr), MeasurementValueSource(nullptr) {}; MeasurementValue::~MeasurementValue() {}; -bool assign_MeasurementValue_timeStamp(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->timeStamp = dynamic_cast(BaseClass_ptr2); - if(element->timeStamp != nullptr) - return true; - } - return false; -} -bool assign_MeasurementValue_MeasurementValueQuality(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->MeasurementValueQuality = dynamic_cast(BaseClass_ptr2); - if(element->MeasurementValueQuality != nullptr) - return true; - } - return false; +bool assign_MeasurementValue_sensorAccuracy(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sensorAccuracy; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_MeasurementValueSource_MeasurementValues(BaseClass*, BaseClass*); -bool assign_MeasurementValue_MeasurementValueSource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->MeasurementValueSource = dynamic_cast(BaseClass_ptr2); - if(element->MeasurementValueSource != nullptr) - return assign_MeasurementValueSource_MeasurementValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_MeasurementValue_timeStamp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) + { + element->timeStamp = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_MeasurementValueQuality_MeasurementValue(BaseClass*, BaseClass*); +bool assign_MeasurementValue_MeasurementValueQuality(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValue* element = dynamic_cast(BaseClass_ptr1); + MeasurementValueQuality* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MeasurementValueQuality != element2) + { + element->MeasurementValueQuality = element2; + return assign_MeasurementValueQuality_MeasurementValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_MeasurementValue_sensorAccuracy(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sensorAccuracy; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_MeasurementValueSource_MeasurementValues(BaseClass*, BaseClass*); +bool assign_MeasurementValue_MeasurementValueSource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValue* element = dynamic_cast(BaseClass_ptr1); + MeasurementValueSource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MeasurementValueSource != element2) + { + element->MeasurementValueSource = element2; + return assign_MeasurementValueSource_MeasurementValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* MeasurementValue_factory() { - return new MeasurementValue; - } +const char MeasurementValue::debugName[] = "MeasurementValue"; +const char* MeasurementValue::debugString() const +{ + return MeasurementValue::debugName; } -void MeasurementValue::addConstructToMap(std::unordered_map& factory_map) { +void MeasurementValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MeasurementValue"), &MeasurementValue_factory)); } -void MeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.sensorAccuracy"), &assign_MeasurementValue_sensorAccuracy)); - } - -void MeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void MeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.sensorAccuracy"), &assign_MeasurementValue_sensorAccuracy)); assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.timeStamp"), &assign_MeasurementValue_timeStamp)); - assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueQuality"), &assign_MeasurementValue_MeasurementValueQuality)); - assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueSource"), &assign_MeasurementValue_MeasurementValueSource)); } -const char MeasurementValue::debugName[] = "MeasurementValue"; -const char* MeasurementValue::debugString() +void MeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MeasurementValue::debugName; + assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueQuality"), &assign_MeasurementValue_MeasurementValueQuality)); + assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueSource"), &assign_MeasurementValue_MeasurementValueSource)); } const BaseClassDefiner MeasurementValue::declare() @@ -90,4 +110,10 @@ const BaseClassDefiner MeasurementValue::declare() return BaseClassDefiner(MeasurementValue::addConstructToMap, MeasurementValue::addPrimitiveAssignFnsToMap, MeasurementValue::addClassAssignFnsToMap, MeasurementValue::debugName); } - +namespace CIMPP +{ + BaseClass* MeasurementValue_factory() + { + return new MeasurementValue; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MeasurementValue.hpp b/CGMES_2.4.15_16FEB2016/MeasurementValue.hpp index fa2681e76..c24d7f7bd 100644 --- a/CGMES_2.4.15_16FEB2016/MeasurementValue.hpp +++ b/CGMES_2.4.15_16FEB2016/MeasurementValue.hpp @@ -1,44 +1,45 @@ #ifndef MeasurementValue_H #define MeasurementValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "DateTime.hpp" #include "PerCent.hpp" -namespace CIMPP { +namespace CIMPP +{ + class MeasurementValueQuality; + class MeasurementValueSource; - -class DateTime; -class MeasurementValueQuality; -class MeasurementValueSource; /* The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement. */ - class MeasurementValue: public IdentifiedObject + class MeasurementValue : public IdentifiedObject { - public: - CIMPP::DateTime* timeStamp; /* The time when the value was last updated Default: '' */ - CIMPP::PerCent sensorAccuracy; /* The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. Default: nullptr */ - CIMPP::MeasurementValueQuality* MeasurementValueQuality; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ - CIMPP::MeasurementValueSource* MeasurementValueSource; /* The MeasurementValues updated by the source. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MeasurementValue(); - virtual ~MeasurementValue(); - + ~MeasurementValue() override; + + CIMPP::MeasurementValueQuality* MeasurementValueQuality; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ + CIMPP::MeasurementValueSource* MeasurementValueSource; /* The MeasurementValues updated by the source. Default: 0 */ + CIMPP::PerCent sensorAccuracy; /* The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. Default: nullptr */ + CIMPP::DateTime timeStamp; /* The time when the value was last updated Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MeasurementValue_factory(); diff --git a/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.cpp b/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.cpp index 714a78c7f..4200ee1df 100644 --- a/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.cpp +++ b/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.cpp @@ -1,49 +1,56 @@ -#include -#include "Quality61850.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MeasurementValueQuality.hpp" +#include +#include + #include "MeasurementValue.hpp" using namespace CIMPP; -MeasurementValueQuality::MeasurementValueQuality(): MeasurementValue(nullptr) {}; - +MeasurementValueQuality::MeasurementValueQuality() : MeasurementValue(nullptr) {}; MeasurementValueQuality::~MeasurementValueQuality() {}; -bool assign_MeasurementValue_MeasurementValueQuality(BaseClass*, BaseClass*); -bool assign_MeasurementValueQuality_MeasurementValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValueQuality* element = dynamic_cast(BaseClass_ptr1)) { - element->MeasurementValue = dynamic_cast(BaseClass_ptr2); - if(element->MeasurementValue != nullptr) - return assign_MeasurementValue_MeasurementValueQuality(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* MeasurementValueQuality_factory() { - return new MeasurementValueQuality; +bool assign_MeasurementValue_MeasurementValueQuality(BaseClass*, BaseClass*); +bool assign_MeasurementValueQuality_MeasurementValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValueQuality* element = dynamic_cast(BaseClass_ptr1); + MeasurementValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MeasurementValue != element2) + { + element->MeasurementValue = element2; + return assign_MeasurementValue_MeasurementValueQuality(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void MeasurementValueQuality::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality"), &MeasurementValueQuality_factory)); +const char MeasurementValueQuality::debugName[] = "MeasurementValueQuality"; +const char* MeasurementValueQuality::debugString() const +{ + return MeasurementValueQuality::debugName; } -void MeasurementValueQuality::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void MeasurementValueQuality::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality"), &MeasurementValueQuality_factory)); +} -void MeasurementValueQuality::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality.MeasurementValue"), &assign_MeasurementValueQuality_MeasurementValue)); +void MeasurementValueQuality::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char MeasurementValueQuality::debugName[] = "MeasurementValueQuality"; -const char* MeasurementValueQuality::debugString() +void MeasurementValueQuality::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MeasurementValueQuality::debugName; + assign_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality.MeasurementValue"), &assign_MeasurementValueQuality_MeasurementValue)); } const BaseClassDefiner MeasurementValueQuality::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner MeasurementValueQuality::declare() return BaseClassDefiner(MeasurementValueQuality::addConstructToMap, MeasurementValueQuality::addPrimitiveAssignFnsToMap, MeasurementValueQuality::addClassAssignFnsToMap, MeasurementValueQuality::debugName); } - +namespace CIMPP +{ + BaseClass* MeasurementValueQuality_factory() + { + return new MeasurementValueQuality; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.hpp b/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.hpp index ea2ba6681..a03b9d52f 100644 --- a/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.hpp +++ b/CGMES_2.4.15_16FEB2016/MeasurementValueQuality.hpp @@ -1,38 +1,39 @@ #ifndef MeasurementValueQuality_H #define MeasurementValueQuality_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Quality61850.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Quality61850.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class MeasurementValue; -class MeasurementValue; /* Measurement quality flags. Bits 0-10 are defined for substation automation in draft IEC 61850 part 7-3. Bits 11-15 are reserved for future expansion by that document. Bits 16-31 are reserved for EMS applications. */ - class MeasurementValueQuality: public Quality61850 + class MeasurementValueQuality : public Quality61850 { - public: - CIMPP::MeasurementValue* MeasurementValue; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MeasurementValueQuality(); - virtual ~MeasurementValueQuality(); - + ~MeasurementValueQuality() override; + + CIMPP::MeasurementValue* MeasurementValue; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MeasurementValueQuality_factory(); diff --git a/CGMES_2.4.15_16FEB2016/MeasurementValueSource.cpp b/CGMES_2.4.15_16FEB2016/MeasurementValueSource.cpp index e4b009712..6c8c10f30 100644 --- a/CGMES_2.4.15_16FEB2016/MeasurementValueSource.cpp +++ b/CGMES_2.4.15_16FEB2016/MeasurementValueSource.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MeasurementValueSource.hpp" +#include +#include + #include "MeasurementValue.hpp" using namespace CIMPP; MeasurementValueSource::MeasurementValueSource() {}; - MeasurementValueSource::~MeasurementValueSource() {}; -bool assign_MeasurementValueSource_MeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValueSource* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->MeasurementValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_MeasurementValue_MeasurementValueSource(BaseClass*, BaseClass*); +bool assign_MeasurementValueSource_MeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValueSource* element = dynamic_cast(BaseClass_ptr1); + MeasurementValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->MeasurementValues.begin(), element->MeasurementValues.end(), element2) == element->MeasurementValues.end()) + { + element->MeasurementValues.push_back(element2); + return assign_MeasurementValue_MeasurementValueSource(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* MeasurementValueSource_factory() { - return new MeasurementValueSource; - } +const char MeasurementValueSource::debugName[] = "MeasurementValueSource"; +const char* MeasurementValueSource::debugString() const +{ + return MeasurementValueSource::debugName; } -void MeasurementValueSource::addConstructToMap(std::unordered_map& factory_map) { +void MeasurementValueSource::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MeasurementValueSource"), &MeasurementValueSource_factory)); } -void MeasurementValueSource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void MeasurementValueSource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MeasurementValueSource.MeasurementValues"), &assign_MeasurementValueSource_MeasurementValues)); +void MeasurementValueSource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char MeasurementValueSource::debugName[] = "MeasurementValueSource"; -const char* MeasurementValueSource::debugString() +void MeasurementValueSource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MeasurementValueSource::debugName; + assign_map.insert(std::make_pair(std::string("cim:MeasurementValueSource.MeasurementValues"), &assign_MeasurementValueSource_MeasurementValues)); } const BaseClassDefiner MeasurementValueSource::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner MeasurementValueSource::declare() return BaseClassDefiner(MeasurementValueSource::addConstructToMap, MeasurementValueSource::addPrimitiveAssignFnsToMap, MeasurementValueSource::addClassAssignFnsToMap, MeasurementValueSource::debugName); } - +namespace CIMPP +{ + BaseClass* MeasurementValueSource_factory() + { + return new MeasurementValueSource; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MeasurementValueSource.hpp b/CGMES_2.4.15_16FEB2016/MeasurementValueSource.hpp index 5f4e60a0c..2a591a510 100644 --- a/CGMES_2.4.15_16FEB2016/MeasurementValueSource.hpp +++ b/CGMES_2.4.15_16FEB2016/MeasurementValueSource.hpp @@ -1,38 +1,39 @@ #ifndef MeasurementValueSource_H #define MeasurementValueSource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class MeasurementValue; -class MeasurementValue; /* MeasurementValueSource describes the alternative sources updating a MeasurementValue. User conventions for how to use the MeasurementValueSource attributes are described in the introduction to IEC 61970-301. */ - class MeasurementValueSource: public IdentifiedObject + class MeasurementValueSource : public IdentifiedObject { - public: - std::list MeasurementValues; /* A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MeasurementValueSource(); - virtual ~MeasurementValueSource(); - + ~MeasurementValueSource() override; + + std::list MeasurementValues; /* A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MeasurementValueSource_factory(); diff --git a/CGMES_2.4.15_16FEB2016/MechLoad1.cpp b/CGMES_2.4.15_16FEB2016/MechLoad1.cpp index 4c23dd381..dcb3efe20 100644 --- a/CGMES_2.4.15_16FEB2016/MechLoad1.cpp +++ b/CGMES_2.4.15_16FEB2016/MechLoad1.cpp @@ -1,7 +1,11 @@ -#include -#include "MechanicalLoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MechLoad1.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -10,87 +14,87 @@ using namespace CIMPP; MechLoad1::MechLoad1() {}; - MechLoad1::~MechLoad1() {}; +bool assign_MechLoad1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MechLoad1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MechLoad1_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MechLoad1_e(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_MechLoad1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MechLoad1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MechLoad1_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MechLoad1_e(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* MechLoad1_factory() { - return new MechLoad1; - } +const char MechLoad1::debugName[] = "MechLoad1"; +const char* MechLoad1::debugString() const +{ + return MechLoad1::debugName; } -void MechLoad1::addConstructToMap(std::unordered_map& factory_map) { +void MechLoad1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MechLoad1"), &MechLoad1_factory)); } -void MechLoad1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void MechLoad1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:MechLoad1.a"), &assign_MechLoad1_a)); assign_map.insert(std::make_pair(std::string("cim:MechLoad1.b"), &assign_MechLoad1_b)); assign_map.insert(std::make_pair(std::string("cim:MechLoad1.d"), &assign_MechLoad1_d)); assign_map.insert(std::make_pair(std::string("cim:MechLoad1.e"), &assign_MechLoad1_e)); } -void MechLoad1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char MechLoad1::debugName[] = "MechLoad1"; -const char* MechLoad1::debugString() +void MechLoad1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MechLoad1::debugName; } const BaseClassDefiner MechLoad1::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner MechLoad1::declare() return BaseClassDefiner(MechLoad1::addConstructToMap, MechLoad1::addPrimitiveAssignFnsToMap, MechLoad1::addClassAssignFnsToMap, MechLoad1::debugName); } - +namespace CIMPP +{ + BaseClass* MechLoad1_factory() + { + return new MechLoad1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MechLoad1.hpp b/CGMES_2.4.15_16FEB2016/MechLoad1.hpp index 6d8c10200..92b49f819 100644 --- a/CGMES_2.4.15_16FEB2016/MechLoad1.hpp +++ b/CGMES_2.4.15_16FEB2016/MechLoad1.hpp @@ -1,41 +1,42 @@ #ifndef MechLoad1_H #define MechLoad1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MechanicalLoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MechanicalLoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Mechanical load model type 1. */ - class MechLoad1: public MechanicalLoadDynamics + class MechLoad1 : public MechanicalLoadDynamics { - public: - CIMPP::Simple_Float a; /* Speed squared coefficient (a). Default: nullptr */ - CIMPP::Simple_Float b; /* Speed coefficient (b). Default: nullptr */ - CIMPP::Simple_Float d; /* Speed to the exponent coefficient (d). Default: nullptr */ - CIMPP::Simple_Float e; /* Exponent (e). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MechLoad1(); - virtual ~MechLoad1(); - + ~MechLoad1() override; + + CIMPP::Simple_Float a; /* Speed squared coefficient (a). Default: nullptr */ + CIMPP::Simple_Float b; /* Speed coefficient (b). Default: nullptr */ + CIMPP::Simple_Float d; /* Speed to the exponent coefficient (d). Default: nullptr */ + CIMPP::Simple_Float e; /* Exponent (e). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MechLoad1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.cpp b/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.cpp index 740a75944..1309e97f3 100644 --- a/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MechanicalLoadDynamics.hpp" -#include "SynchronousMachineDynamics.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" +#include "SynchronousMachineDynamics.hpp" using namespace CIMPP; -MechanicalLoadDynamics::MechanicalLoadDynamics(): SynchronousMachineDynamics(nullptr), AsynchronousMachineDynamics(nullptr) {}; - +MechanicalLoadDynamics::MechanicalLoadDynamics() : AsynchronousMachineDynamics(nullptr), SynchronousMachineDynamics(nullptr) {}; MechanicalLoadDynamics::~MechanicalLoadDynamics() {}; -bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); -bool assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); -bool assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); +bool assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* MechanicalLoadDynamics_factory() { - return new MechanicalLoadDynamics; +bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); +bool assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void MechanicalLoadDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics"), &MechanicalLoadDynamics_factory)); +const char MechanicalLoadDynamics::debugName[] = "MechanicalLoadDynamics"; +const char* MechanicalLoadDynamics::debugString() const +{ + return MechanicalLoadDynamics::debugName; } -void MechanicalLoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void MechanicalLoadDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics"), &MechanicalLoadDynamics_factory)); +} -void MechanicalLoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.SynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.AsynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_AsynchronousMachineDynamics)); +void MechanicalLoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char MechanicalLoadDynamics::debugName[] = "MechanicalLoadDynamics"; -const char* MechanicalLoadDynamics::debugString() +void MechanicalLoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MechanicalLoadDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.AsynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_AsynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.SynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_SynchronousMachineDynamics)); } const BaseClassDefiner MechanicalLoadDynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner MechanicalLoadDynamics::declare() return BaseClassDefiner(MechanicalLoadDynamics::addConstructToMap, MechanicalLoadDynamics::addPrimitiveAssignFnsToMap, MechanicalLoadDynamics::addClassAssignFnsToMap, MechanicalLoadDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* MechanicalLoadDynamics_factory() + { + return new MechanicalLoadDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.hpp b/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.hpp index c938e9201..a6b7f7952 100644 --- a/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/MechanicalLoadDynamics.hpp @@ -1,40 +1,41 @@ #ifndef MechanicalLoadDynamics_H #define MechanicalLoadDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachineDynamics; + class SynchronousMachineDynamics; -class SynchronousMachineDynamics; -class AsynchronousMachineDynamics; /* Mechanical load function block whose behavior is described by reference to a standard model */ - class MechanicalLoadDynamics: public DynamicsFunctionBlock + class MechanicalLoadDynamics : public DynamicsFunctionBlock { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this mechanical load model is associated. Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this mechanical load model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MechanicalLoadDynamics(); - virtual ~MechanicalLoadDynamics(); - + ~MechanicalLoadDynamics() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this mechanical load model is associated. Default: 0 */ + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this mechanical load model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MechanicalLoadDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.cpp b/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.cpp index 9640a0bb3..64c23efdf 100644 --- a/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "MechanicalLoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MechanicalLoadUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; MechanicalLoadUserDefined::MechanicalLoadUserDefined() {}; - MechanicalLoadUserDefined::~MechanicalLoadUserDefined() {}; -bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_MechanicalLoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_MechanicalLoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass*, BaseClass*); +bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* MechanicalLoadUserDefined_factory() { - return new MechanicalLoadUserDefined; - } +const char MechanicalLoadUserDefined::debugName[] = "MechanicalLoadUserDefined"; +const char* MechanicalLoadUserDefined::debugString() const +{ + return MechanicalLoadUserDefined::debugName; } -void MechanicalLoadUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void MechanicalLoadUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined"), &MechanicalLoadUserDefined_factory)); } -void MechanicalLoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void MechanicalLoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined.proprietary"), &assign_MechanicalLoadUserDefined_proprietary)); - } - -void MechanicalLoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined.ProprietaryParameterDynamics"), &assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics)); } -const char MechanicalLoadUserDefined::debugName[] = "MechanicalLoadUserDefined"; -const char* MechanicalLoadUserDefined::debugString() +void MechanicalLoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MechanicalLoadUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined.ProprietaryParameterDynamics"), &assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner MechanicalLoadUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner MechanicalLoadUserDefined::declare() return BaseClassDefiner(MechanicalLoadUserDefined::addConstructToMap, MechanicalLoadUserDefined::addPrimitiveAssignFnsToMap, MechanicalLoadUserDefined::addClassAssignFnsToMap, MechanicalLoadUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* MechanicalLoadUserDefined_factory() + { + return new MechanicalLoadUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.hpp b/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.hpp index 6a21617a5..5e61ad69b 100644 --- a/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/MechanicalLoadUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef MechanicalLoadUserDefined_H #define MechanicalLoadUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MechanicalLoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MechanicalLoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Mechanical load function block whose dynamic behaviour is described by */ - class MechanicalLoadUserDefined: public MechanicalLoadDynamics + class MechanicalLoadUserDefined : public MechanicalLoadDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MechanicalLoadUserDefined(); - virtual ~MechanicalLoadUserDefined(); - + ~MechanicalLoadUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MechanicalLoadUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Money.cpp b/CGMES_2.4.15_16FEB2016/Money.cpp index 5080a7dc9..89e8271c2 100644 --- a/CGMES_2.4.15_16FEB2016/Money.cpp +++ b/CGMES_2.4.15_16FEB2016/Money.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Money.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Money::Money() {} -Money::~Money(){} +#include -Money::Money(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Money::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Money::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Money& Money::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Money::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Money::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Money::debugName[] = "Money"; -const char* Money::debugString() { +const char* Money::debugString() const +{ return Money::debugName; } - -const BaseClassDefiner Money::declare() { - return BaseClassDefiner(Money::addConstructToMap, Money::addPrimitiveAssignFnsToMap, Money::addClassAssignFnsToMap, Money::debugName); +Money& Money::operator+=(const Money& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Money& Money::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Money& Money::operator-=(const Money& rhs) { - value -= rhs.value; - return *this; - } - - Money& Money::operator*=(const Money& rhs) { - value *= rhs.value; - return *this; - } - - Money& Money::operator/=(const Money& rhs) { - value /= rhs.value; - return *this; - } +Money& Money::operator-=(const Money& rhs) +{ + value -= rhs.value; + return *this; +} - Money& Money::operator+=(const Money& rhs) { - value += rhs.value; - return *this; - } +Money& Money::operator*=(const Money& rhs) +{ + value *= rhs.value; + return *this; +} - Money::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Money& Money::operator/=(const Money& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Money& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Money& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Money& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Money.hpp b/CGMES_2.4.15_16FEB2016/Money.hpp index 0de1c0f1d..b6c47f743 100644 --- a/CGMES_2.4.15_16FEB2016/Money.hpp +++ b/CGMES_2.4.15_16FEB2016/Money.hpp @@ -1,38 +1,39 @@ #ifndef Money_H #define Money_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Money : public BaseClass + /* + Amount of money. + */ + class Money { - public: - Money(); - virtual ~Money(); - Money(long double value); - static const BaseClassDefiner declare(); - Money& operator=(long double &rop); + Money() : value(0.0), initialized(false) {} + Money(long double value) : value(value), initialized(true) {} + + Money& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Money& operator+=(const Money& rhs); Money& operator-=(const Money& rhs); Money& operator*=(const Money& rhs); Money& operator/=(const Money& rhs); + friend std::istream& operator>>(std::istream& lop, Money& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Money& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/MonthDay.cpp b/CGMES_2.4.15_16FEB2016/MonthDay.cpp index 7e9be476a..2ef4c8b7e 100644 --- a/CGMES_2.4.15_16FEB2016/MonthDay.cpp +++ b/CGMES_2.4.15_16FEB2016/MonthDay.cpp @@ -1,41 +1,49 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MonthDay.hpp" +#include "../src/CIMExceptions.hpp" using namespace CIMPP; -MonthDay::MonthDay() {}; - -MonthDay::~MonthDay() {}; - - - -namespace CIMPP { - BaseClass* MonthDay_factory() { - return new MonthDay; - } -} - -void MonthDay::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:MonthDay"), &MonthDay_factory)); -} - -void MonthDay::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +MonthDay& MonthDay::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; } -void MonthDay::addClassAssignFnsToMap(std::unordered_map& assign_map) { +MonthDay::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; } const char MonthDay::debugName[] = "MonthDay"; -const char* MonthDay::debugString() +const char* MonthDay::debugString() const { return MonthDay::debugName; } -const BaseClassDefiner MonthDay::declare() +namespace CIMPP { - return BaseClassDefiner(MonthDay::addConstructToMap, MonthDay::addPrimitiveAssignFnsToMap, MonthDay::addClassAssignFnsToMap, MonthDay::debugName); -} - + std::istream& operator>>(std::istream& lop, MonthDay& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const MonthDay& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MonthDay.hpp b/CGMES_2.4.15_16FEB2016/MonthDay.hpp index 202cd4b4d..1669168fe 100644 --- a/CGMES_2.4.15_16FEB2016/MonthDay.hpp +++ b/CGMES_2.4.15_16FEB2016/MonthDay.hpp @@ -1,38 +1,35 @@ #ifndef MonthDay_H #define MonthDay_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { - +#include +#include +#include +namespace CIMPP +{ /* MonthDay format as "--mm-dd", which conforms with XSD data type gMonthDay. */ - class MonthDay: public BaseClass + class MonthDay { - public: - + MonthDay() : initialized(false) {} + MonthDay(const std::string& value) : value(value), initialized(true) {} + + MonthDay& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - MonthDay(); - virtual ~MonthDay(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; + friend std::istream& operator>>(std::istream& lop, MonthDay& rop); + friend std::ostream& operator<<(std::ostream& os, const MonthDay& obj); }; - - BaseClass* MonthDay_factory(); } #endif diff --git a/CGMES_2.4.15_16FEB2016/MutualCoupling.cpp b/CGMES_2.4.15_16FEB2016/MutualCoupling.cpp index 32229dbc4..3d54c7cc1 100644 --- a/CGMES_2.4.15_16FEB2016/MutualCoupling.cpp +++ b/CGMES_2.4.15_16FEB2016/MutualCoupling.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MutualCoupling.hpp" +#include +#include + #include "Terminal.hpp" #include "Terminal.hpp" #include "Susceptance.hpp" @@ -15,150 +19,173 @@ using namespace CIMPP; -MutualCoupling::MutualCoupling(): First_Terminal(nullptr), Second_Terminal(nullptr) {}; - +MutualCoupling::MutualCoupling() : First_Terminal(nullptr), Second_Terminal(nullptr) {}; MutualCoupling::~MutualCoupling() {}; -bool assign_Terminal_HasFirstMutualCoupling(BaseClass*, BaseClass*); -bool assign_MutualCoupling_First_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - element->First_Terminal = dynamic_cast(BaseClass_ptr2); - if(element->First_Terminal != nullptr) - return assign_Terminal_HasFirstMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_Terminal_HasSecondMutualCoupling(BaseClass*, BaseClass*); -bool assign_MutualCoupling_Second_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - element->Second_Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Second_Terminal != nullptr) - return assign_Terminal_HasSecondMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + +bool assign_MutualCoupling_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_MutualCoupling_distance11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_distance12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_distance21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_distance22(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance22; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - - -bool assign_MutualCoupling_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_HasFirstMutualCoupling(BaseClass*, BaseClass*); +bool assign_MutualCoupling_First_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MutualCoupling* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->First_Terminal != element2) + { + element->First_Terminal = element2; + return assign_Terminal_HasFirstMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_MutualCoupling_distance11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_HasSecondMutualCoupling(BaseClass*, BaseClass*); +bool assign_MutualCoupling_Second_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MutualCoupling* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Second_Terminal != element2) + { + element->Second_Terminal = element2; + return assign_Terminal_HasSecondMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_MutualCoupling_distance12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_distance21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_distance22(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance22; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* MutualCoupling_factory() { - return new MutualCoupling; - } + + + +const char MutualCoupling::debugName[] = "MutualCoupling"; +const char* MutualCoupling::debugString() const +{ + return MutualCoupling::debugName; } -void MutualCoupling::addConstructToMap(std::unordered_map& factory_map) { +void MutualCoupling::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MutualCoupling"), &MutualCoupling_factory)); } -void MutualCoupling::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.b0ch"), &assign_MutualCoupling_b0ch)); +void MutualCoupling::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.b0ch"), &assign_MutualCoupling_b0ch)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.distance11"), &assign_MutualCoupling_distance11)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.distance12"), &assign_MutualCoupling_distance12)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.distance21"), &assign_MutualCoupling_distance21)); @@ -168,15 +195,10 @@ void MutualCoupling::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void MutualCoupling::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.First_Terminal"), &assign_MutualCoupling_First_Terminal)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.Second_Terminal"), &assign_MutualCoupling_Second_Terminal)); - } - -const char MutualCoupling::debugName[] = "MutualCoupling"; -const char* MutualCoupling::debugString() -{ - return MutualCoupling::debugName; } const BaseClassDefiner MutualCoupling::declare() @@ -184,4 +206,10 @@ const BaseClassDefiner MutualCoupling::declare() return BaseClassDefiner(MutualCoupling::addConstructToMap, MutualCoupling::addPrimitiveAssignFnsToMap, MutualCoupling::addClassAssignFnsToMap, MutualCoupling::debugName); } - +namespace CIMPP +{ + BaseClass* MutualCoupling_factory() + { + return new MutualCoupling; + } +} diff --git a/CGMES_2.4.15_16FEB2016/MutualCoupling.hpp b/CGMES_2.4.15_16FEB2016/MutualCoupling.hpp index 5d7873232..7e9437378 100644 --- a/CGMES_2.4.15_16FEB2016/MutualCoupling.hpp +++ b/CGMES_2.4.15_16FEB2016/MutualCoupling.hpp @@ -1,52 +1,53 @@ #ifndef MutualCoupling_H #define MutualCoupling_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" -#include "Length.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" -#include "Resistance.hpp" +#include "Length.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class Terminal; -class Terminal; /* This class represents the zero sequence line mutual coupling. */ - class MutualCoupling: public IdentifiedObject + class MutualCoupling : public IdentifiedObject { - public: - CIMPP::Terminal* First_Terminal; /* The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments. Default: 0 */ - CIMPP::Terminal* Second_Terminal; /* The starting terminal for the calculation of distances along the second branch of the mutual coupling. Default: 0 */ - CIMPP::Susceptance b0ch; /* Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Length distance11; /* Distance to the start of the coupled region from the first line`s terminal having sequence number equal to 1. Default: nullptr */ - CIMPP::Length distance12; /* Distance to the end of the coupled region from the first line`s terminal with sequence number equal to 1. Default: nullptr */ - CIMPP::Length distance21; /* Distance to the start of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ - CIMPP::Length distance22; /* Distance to the end of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ - CIMPP::Conductance g0ch; /* Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence branch-to-branch mutual impedance coupling, resistance. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence branch-to-branch mutual impedance coupling, reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MutualCoupling(); - virtual ~MutualCoupling(); - + ~MutualCoupling() override; + + CIMPP::Terminal* First_Terminal; /* The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments. Default: 0 */ + CIMPP::Terminal* Second_Terminal; /* The starting terminal for the calculation of distances along the second branch of the mutual coupling. Default: 0 */ + CIMPP::Susceptance b0ch; /* Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Length distance11; /* Distance to the start of the coupled region from the first line`s terminal having sequence number equal to 1. Default: nullptr */ + CIMPP::Length distance12; /* Distance to the end of the coupled region from the first line`s terminal with sequence number equal to 1. Default: nullptr */ + CIMPP::Length distance21; /* Distance to the start of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ + CIMPP::Length distance22; /* Distance to the end of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ + CIMPP::Conductance g0ch; /* Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence branch-to-branch mutual impedance coupling, resistance. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence branch-to-branch mutual impedance coupling, reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MutualCoupling_factory(); diff --git a/CGMES_2.4.15_16FEB2016/NonConformLoad.cpp b/CGMES_2.4.15_16FEB2016/NonConformLoad.cpp index fa7e294e9..2ef76bf9b 100644 --- a/CGMES_2.4.15_16FEB2016/NonConformLoad.cpp +++ b/CGMES_2.4.15_16FEB2016/NonConformLoad.cpp @@ -1,49 +1,56 @@ -#include -#include "EnergyConsumer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonConformLoad.hpp" +#include +#include + #include "NonConformLoadGroup.hpp" using namespace CIMPP; -NonConformLoad::NonConformLoad(): LoadGroup(nullptr) {}; - +NonConformLoad::NonConformLoad() : LoadGroup(nullptr) {}; NonConformLoad::~NonConformLoad() {}; -bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); -bool assign_NonConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoad* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->LoadGroup != nullptr) - return assign_NonConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* NonConformLoad_factory() { - return new NonConformLoad; +bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); +bool assign_NonConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoad* element = dynamic_cast(BaseClass_ptr1); + NonConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadGroup != element2) + { + element->LoadGroup = element2; + return assign_NonConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void NonConformLoad::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:NonConformLoad"), &NonConformLoad_factory)); +const char NonConformLoad::debugName[] = "NonConformLoad"; +const char* NonConformLoad::debugString() const +{ + return NonConformLoad::debugName; } -void NonConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void NonConformLoad::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:NonConformLoad"), &NonConformLoad_factory)); +} -void NonConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonConformLoad.LoadGroup"), &assign_NonConformLoad_LoadGroup)); +void NonConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonConformLoad::debugName[] = "NonConformLoad"; -const char* NonConformLoad::debugString() +void NonConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonConformLoad::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonConformLoad.LoadGroup"), &assign_NonConformLoad_LoadGroup)); } const BaseClassDefiner NonConformLoad::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner NonConformLoad::declare() return BaseClassDefiner(NonConformLoad::addConstructToMap, NonConformLoad::addPrimitiveAssignFnsToMap, NonConformLoad::addClassAssignFnsToMap, NonConformLoad::debugName); } - +namespace CIMPP +{ + BaseClass* NonConformLoad_factory() + { + return new NonConformLoad; + } +} diff --git a/CGMES_2.4.15_16FEB2016/NonConformLoad.hpp b/CGMES_2.4.15_16FEB2016/NonConformLoad.hpp index e53291a4f..d7e4bd9ca 100644 --- a/CGMES_2.4.15_16FEB2016/NonConformLoad.hpp +++ b/CGMES_2.4.15_16FEB2016/NonConformLoad.hpp @@ -1,38 +1,39 @@ #ifndef NonConformLoad_H #define NonConformLoad_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyConsumer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyConsumer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonConformLoadGroup; -class NonConformLoadGroup; /* NonConformLoad represent loads that do not follow a daily load change pattern and changes are not correlated with the daily load change pattern. */ - class NonConformLoad: public EnergyConsumer + class NonConformLoad : public EnergyConsumer { - public: - CIMPP::NonConformLoadGroup* LoadGroup; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonConformLoad(); - virtual ~NonConformLoad(); - + ~NonConformLoad() override; + + CIMPP::NonConformLoadGroup* LoadGroup; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonConformLoad_factory(); diff --git a/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.cpp b/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.cpp index 8897ca92e..6382d77c5 100644 --- a/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.cpp +++ b/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.cpp @@ -1,62 +1,76 @@ -#include -#include "LoadGroup.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonConformLoadGroup.hpp" +#include +#include + #include "NonConformLoad.hpp" #include "NonConformLoadSchedule.hpp" using namespace CIMPP; NonConformLoadGroup::NonConformLoadGroup() {}; - NonConformLoadGroup::~NonConformLoadGroup() {}; -bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumers.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_NonConformLoad_LoadGroup(BaseClass*, BaseClass*); +bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + NonConformLoad* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumers.begin(), element->EnergyConsumers.end(), element2) == element->EnergyConsumers.end()) + { + element->EnergyConsumers.push_back(element2); + return assign_NonConformLoad_LoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->NonConformLoadSchedules.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass*, BaseClass*); +bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + NonConformLoadSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->NonConformLoadSchedules.begin(), element->NonConformLoadSchedules.end(), element2) == element->NonConformLoadSchedules.end()) + { + element->NonConformLoadSchedules.push_back(element2); + return assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* NonConformLoadGroup_factory() { - return new NonConformLoadGroup; - } +const char NonConformLoadGroup::debugName[] = "NonConformLoadGroup"; +const char* NonConformLoadGroup::debugString() const +{ + return NonConformLoadGroup::debugName; } -void NonConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) { +void NonConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup"), &NonConformLoadGroup_factory)); } -void NonConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void NonConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.EnergyConsumers"), &assign_NonConformLoadGroup_EnergyConsumers)); - assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.NonConformLoadSchedules"), &assign_NonConformLoadGroup_NonConformLoadSchedules)); +void NonConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonConformLoadGroup::debugName[] = "NonConformLoadGroup"; -const char* NonConformLoadGroup::debugString() +void NonConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonConformLoadGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.EnergyConsumers"), &assign_NonConformLoadGroup_EnergyConsumers)); + assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.NonConformLoadSchedules"), &assign_NonConformLoadGroup_NonConformLoadSchedules)); } const BaseClassDefiner NonConformLoadGroup::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner NonConformLoadGroup::declare() return BaseClassDefiner(NonConformLoadGroup::addConstructToMap, NonConformLoadGroup::addPrimitiveAssignFnsToMap, NonConformLoadGroup::addClassAssignFnsToMap, NonConformLoadGroup::debugName); } - +namespace CIMPP +{ + BaseClass* NonConformLoadGroup_factory() + { + return new NonConformLoadGroup; + } +} diff --git a/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.hpp b/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.hpp index 1685c6f84..86179d093 100644 --- a/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.hpp +++ b/CGMES_2.4.15_16FEB2016/NonConformLoadGroup.hpp @@ -1,40 +1,41 @@ #ifndef NonConformLoadGroup_H #define NonConformLoadGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadGroup.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LoadGroup.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonConformLoad; + class NonConformLoadSchedule; -class NonConformLoad; -class NonConformLoadSchedule; /* Loads that do not follow a daily and seasonal load variation pattern. */ - class NonConformLoadGroup: public LoadGroup + class NonConformLoadGroup : public LoadGroup { - public: - std::list EnergyConsumers; /* Group of this ConformLoad. Default: 0 */ - std::list NonConformLoadSchedules; /* The NonConformLoadSchedules in the NonConformLoadGroup. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonConformLoadGroup(); - virtual ~NonConformLoadGroup(); - + ~NonConformLoadGroup() override; + + std::list EnergyConsumers; /* Group of this ConformLoad. Default: 0 */ + std::list NonConformLoadSchedules; /* The NonConformLoadSchedules in the NonConformLoadGroup. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonConformLoadGroup_factory(); diff --git a/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.cpp b/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.cpp index bc30e5194..aaf9d0641 100644 --- a/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonConformLoadSchedule.hpp" +#include +#include + #include "NonConformLoadGroup.hpp" using namespace CIMPP; -NonConformLoadSchedule::NonConformLoadSchedule(): NonConformLoadGroup(nullptr) {}; - +NonConformLoadSchedule::NonConformLoadSchedule() : NonConformLoadGroup(nullptr) {}; NonConformLoadSchedule::~NonConformLoadSchedule() {}; -bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass*, BaseClass*); -bool assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->NonConformLoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->NonConformLoadGroup != nullptr) - return assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* NonConformLoadSchedule_factory() { - return new NonConformLoadSchedule; +bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass*, BaseClass*); +bool assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1); + NonConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->NonConformLoadGroup != element2) + { + element->NonConformLoadGroup = element2; + return assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void NonConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule"), &NonConformLoadSchedule_factory)); +const char NonConformLoadSchedule::debugName[] = "NonConformLoadSchedule"; +const char* NonConformLoadSchedule::debugString() const +{ + return NonConformLoadSchedule::debugName; } -void NonConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void NonConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule"), &NonConformLoadSchedule_factory)); +} -void NonConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule.NonConformLoadGroup"), &assign_NonConformLoadSchedule_NonConformLoadGroup)); +void NonConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonConformLoadSchedule::debugName[] = "NonConformLoadSchedule"; -const char* NonConformLoadSchedule::debugString() +void NonConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonConformLoadSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule.NonConformLoadGroup"), &assign_NonConformLoadSchedule_NonConformLoadGroup)); } const BaseClassDefiner NonConformLoadSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner NonConformLoadSchedule::declare() return BaseClassDefiner(NonConformLoadSchedule::addConstructToMap, NonConformLoadSchedule::addPrimitiveAssignFnsToMap, NonConformLoadSchedule::addClassAssignFnsToMap, NonConformLoadSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* NonConformLoadSchedule_factory() + { + return new NonConformLoadSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.hpp b/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.hpp index 7bdfe2c9b..66e28f843 100644 --- a/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/NonConformLoadSchedule.hpp @@ -1,38 +1,39 @@ #ifndef NonConformLoadSchedule_H #define NonConformLoadSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonConformLoadGroup; -class NonConformLoadGroup; /* An active power (Y1-axis) and reactive power (Y2-axis) schedule (curves) versus time (X-axis) for non-conforming loads, e.g., large industrial load or power station service (where modeled). */ - class NonConformLoadSchedule: public SeasonDayTypeSchedule + class NonConformLoadSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::NonConformLoadGroup* NonConformLoadGroup; /* The NonConformLoadGroup where the NonConformLoadSchedule belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonConformLoadSchedule(); - virtual ~NonConformLoadSchedule(); - + ~NonConformLoadSchedule() override; + + CIMPP::NonConformLoadGroup* NonConformLoadGroup; /* The NonConformLoadGroup where the NonConformLoadSchedule belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonConformLoadSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.cpp b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.cpp index a8af57fd0..99a0ef8cc 100644 --- a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.cpp +++ b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.cpp @@ -1,49 +1,56 @@ -#include -#include "ShuntCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonlinearShuntCompensator.hpp" +#include +#include + #include "NonlinearShuntCompensatorPoint.hpp" using namespace CIMPP; NonlinearShuntCompensator::NonlinearShuntCompensator() {}; - NonlinearShuntCompensator::~NonlinearShuntCompensator() {}; -bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonlinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->NonlinearShuntCompensatorPoints.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass*, BaseClass*); +bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonlinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1); + NonlinearShuntCompensatorPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->NonlinearShuntCompensatorPoints.begin(), element->NonlinearShuntCompensatorPoints.end(), element2) == element->NonlinearShuntCompensatorPoints.end()) + { + element->NonlinearShuntCompensatorPoints.push_back(element2); + return assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* NonlinearShuntCompensator_factory() { - return new NonlinearShuntCompensator; - } +const char NonlinearShuntCompensator::debugName[] = "NonlinearShuntCompensator"; +const char* NonlinearShuntCompensator::debugString() const +{ + return NonlinearShuntCompensator::debugName; } -void NonlinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) { +void NonlinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensator"), &NonlinearShuntCompensator_factory)); } -void NonlinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void NonlinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensator.NonlinearShuntCompensatorPoints"), &assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints)); +void NonlinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonlinearShuntCompensator::debugName[] = "NonlinearShuntCompensator"; -const char* NonlinearShuntCompensator::debugString() +void NonlinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonlinearShuntCompensator::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensator.NonlinearShuntCompensatorPoints"), &assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints)); } const BaseClassDefiner NonlinearShuntCompensator::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner NonlinearShuntCompensator::declare() return BaseClassDefiner(NonlinearShuntCompensator::addConstructToMap, NonlinearShuntCompensator::addPrimitiveAssignFnsToMap, NonlinearShuntCompensator::addClassAssignFnsToMap, NonlinearShuntCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* NonlinearShuntCompensator_factory() + { + return new NonlinearShuntCompensator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.hpp b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.hpp index f771f72cf..a42b0d6c7 100644 --- a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.hpp +++ b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensator.hpp @@ -1,38 +1,39 @@ #ifndef NonlinearShuntCompensator_H #define NonlinearShuntCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ShuntCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ShuntCompensator.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonlinearShuntCompensatorPoint; -class NonlinearShuntCompensatorPoint; /* A non linear shunt compensator has bank or section admittance values that differs. */ - class NonlinearShuntCompensator: public ShuntCompensator + class NonlinearShuntCompensator : public ShuntCompensator { - public: - std::list NonlinearShuntCompensatorPoints; /* All points of the non-linear shunt compensator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonlinearShuntCompensator(); - virtual ~NonlinearShuntCompensator(); - + ~NonlinearShuntCompensator() override; + + std::list NonlinearShuntCompensatorPoints; /* All points of the non-linear shunt compensator. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonlinearShuntCompensator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.cpp b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.cpp index 62d01f580..41ee84d9c 100644 --- a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.cpp +++ b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.cpp @@ -1,124 +1,136 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonlinearShuntCompensatorPoint.hpp" -#include "Susceptance.hpp" -#include "Conductance.hpp" -#include "Integer.hpp" +#include +#include + #include "NonlinearShuntCompensator.hpp" #include "Susceptance.hpp" +#include "Susceptance.hpp" #include "Conductance.hpp" +#include "Conductance.hpp" +#include "Integer.hpp" using namespace CIMPP; -NonlinearShuntCompensatorPoint::NonlinearShuntCompensatorPoint(): NonlinearShuntCompensator(nullptr) {}; - +NonlinearShuntCompensatorPoint::NonlinearShuntCompensatorPoint() : NonlinearShuntCompensator(nullptr) {}; NonlinearShuntCompensatorPoint::~NonlinearShuntCompensatorPoint() {}; +bool assign_NonlinearShuntCompensatorPoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_NonlinearShuntCompensatorPoint_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass*, BaseClass*); -bool assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->NonlinearShuntCompensator = dynamic_cast(BaseClass_ptr2); - if(element->NonlinearShuntCompensator != nullptr) - return assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_NonlinearShuntCompensatorPoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_NonlinearShuntCompensatorPoint_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_NonlinearShuntCompensatorPoint_sectionNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sectionNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_NonlinearShuntCompensatorPoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass*, BaseClass*); +bool assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1); + NonlinearShuntCompensator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->NonlinearShuntCompensator != element2) + { + element->NonlinearShuntCompensator = element2; + return assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_NonlinearShuntCompensatorPoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_NonlinearShuntCompensatorPoint_sectionNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sectionNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_NonlinearShuntCompensatorPoint_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_NonlinearShuntCompensatorPoint_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* NonlinearShuntCompensatorPoint_factory() { - return new NonlinearShuntCompensatorPoint; - } +const char NonlinearShuntCompensatorPoint::debugName[] = "NonlinearShuntCompensatorPoint"; +const char* NonlinearShuntCompensatorPoint::debugString() const +{ + return NonlinearShuntCompensatorPoint::debugName; } -void NonlinearShuntCompensatorPoint::addConstructToMap(std::unordered_map& factory_map) { +void NonlinearShuntCompensatorPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint"), &NonlinearShuntCompensatorPoint_factory)); } -void NonlinearShuntCompensatorPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void NonlinearShuntCompensatorPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.b"), &assign_NonlinearShuntCompensatorPoint_b)); + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.b0"), &assign_NonlinearShuntCompensatorPoint_b0)); assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.g"), &assign_NonlinearShuntCompensatorPoint_g)); - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.sectionNumber"), &assign_NonlinearShuntCompensatorPoint_sectionNumber)); - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.b0"), &assign_NonlinearShuntCompensatorPoint_b0)); assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.g0"), &assign_NonlinearShuntCompensatorPoint_g0)); + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.sectionNumber"), &assign_NonlinearShuntCompensatorPoint_sectionNumber)); } -void NonlinearShuntCompensatorPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.NonlinearShuntCompensator"), &assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator)); - } - -const char NonlinearShuntCompensatorPoint::debugName[] = "NonlinearShuntCompensatorPoint"; -const char* NonlinearShuntCompensatorPoint::debugString() +void NonlinearShuntCompensatorPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonlinearShuntCompensatorPoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.NonlinearShuntCompensator"), &assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator)); } const BaseClassDefiner NonlinearShuntCompensatorPoint::declare() @@ -126,4 +138,10 @@ const BaseClassDefiner NonlinearShuntCompensatorPoint::declare() return BaseClassDefiner(NonlinearShuntCompensatorPoint::addConstructToMap, NonlinearShuntCompensatorPoint::addPrimitiveAssignFnsToMap, NonlinearShuntCompensatorPoint::addClassAssignFnsToMap, NonlinearShuntCompensatorPoint::debugName); } - +namespace CIMPP +{ + BaseClass* NonlinearShuntCompensatorPoint_factory() + { + return new NonlinearShuntCompensatorPoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.hpp b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.hpp index 86c0bc79a..73982a75e 100644 --- a/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.hpp +++ b/CGMES_2.4.15_16FEB2016/NonlinearShuntCompensatorPoint.hpp @@ -1,46 +1,47 @@ #ifndef NonlinearShuntCompensatorPoint_H #define NonlinearShuntCompensatorPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" #include "Integer.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class NonlinearShuntCompensator; -class NonlinearShuntCompensator; /* A non linear shunt compensator bank or section admittance value. */ - class NonlinearShuntCompensatorPoint: public BaseClass + class NonlinearShuntCompensatorPoint : public BaseClass { - public: - CIMPP::Susceptance b; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance g; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ - CIMPP::Integer sectionNumber; /* The number of the section. Default: 0 */ - CIMPP::NonlinearShuntCompensator* NonlinearShuntCompensator; /* Non-linear shunt compensator owning this point. Default: 0 */ - CIMPP::Susceptance b0; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance g0; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonlinearShuntCompensatorPoint(); - virtual ~NonlinearShuntCompensatorPoint(); - + ~NonlinearShuntCompensatorPoint() override; + + CIMPP::NonlinearShuntCompensator* NonlinearShuntCompensator; /* Non-linear shunt compensator owning this point. Default: 0 */ + CIMPP::Susceptance b; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Susceptance b0; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Conductance g; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ + CIMPP::Conductance g0; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ + CIMPP::Integer sectionNumber; /* The number of the section. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonlinearShuntCompensatorPoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.cpp index 63a9c7e15..98d7415bb 100644 --- a/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.cpp @@ -1,36 +1,36 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NuclearGeneratingUnit.hpp" +#include +#include + using namespace CIMPP; NuclearGeneratingUnit::NuclearGeneratingUnit() {}; - NuclearGeneratingUnit::~NuclearGeneratingUnit() {}; -namespace CIMPP { - BaseClass* NuclearGeneratingUnit_factory() { - return new NuclearGeneratingUnit; - } +const char NuclearGeneratingUnit::debugName[] = "NuclearGeneratingUnit"; +const char* NuclearGeneratingUnit::debugString() const +{ + return NuclearGeneratingUnit::debugName; } -void NuclearGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void NuclearGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NuclearGeneratingUnit"), &NuclearGeneratingUnit_factory)); } -void NuclearGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void NuclearGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void NuclearGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NuclearGeneratingUnit::debugName[] = "NuclearGeneratingUnit"; -const char* NuclearGeneratingUnit::debugString() +void NuclearGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NuclearGeneratingUnit::debugName; } const BaseClassDefiner NuclearGeneratingUnit::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner NuclearGeneratingUnit::declare() return BaseClassDefiner(NuclearGeneratingUnit::addConstructToMap, NuclearGeneratingUnit::addPrimitiveAssignFnsToMap, NuclearGeneratingUnit::addClassAssignFnsToMap, NuclearGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* NuclearGeneratingUnit_factory() + { + return new NuclearGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.hpp index eb359a1e0..81f68a25f 100644 --- a/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/NuclearGeneratingUnit.hpp @@ -1,36 +1,37 @@ #ifndef NuclearGeneratingUnit_H #define NuclearGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A nuclear generating unit. */ - class NuclearGeneratingUnit: public GeneratingUnit + class NuclearGeneratingUnit : public GeneratingUnit { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NuclearGeneratingUnit(); - virtual ~NuclearGeneratingUnit(); - + ~NuclearGeneratingUnit() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NuclearGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimit.cpp b/CGMES_2.4.15_16FEB2016/OperationalLimit.cpp index cf3a675ea..469d42fdc 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimit.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimit.hpp" +#include +#include + #include "OperationalLimitSet.hpp" #include "OperationalLimitType.hpp" using namespace CIMPP; -OperationalLimit::OperationalLimit(): OperationalLimitSet(nullptr), OperationalLimitType(nullptr) {}; - +OperationalLimit::OperationalLimit() : OperationalLimitSet(nullptr), OperationalLimitType(nullptr) {}; OperationalLimit::~OperationalLimit() {}; + + + bool assign_OperationalLimitSet_OperationalLimitValue(BaseClass*, BaseClass*); -bool assign_OperationalLimit_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->OperationalLimitSet = dynamic_cast(BaseClass_ptr2); - if(element->OperationalLimitSet != nullptr) - return assign_OperationalLimitSet_OperationalLimitValue(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_OperationalLimit_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimit* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OperationalLimitSet != element2) + { + element->OperationalLimitSet = element2; + return assign_OperationalLimitSet_OperationalLimitValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_OperationalLimitType_OperationalLimit(BaseClass*, BaseClass*); -bool assign_OperationalLimit_OperationalLimitType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->OperationalLimitType = dynamic_cast(BaseClass_ptr2); - if(element->OperationalLimitType != nullptr) - return assign_OperationalLimitType_OperationalLimit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_OperationalLimit_OperationalLimitType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimit* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitType* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OperationalLimitType != element2) + { + element->OperationalLimitType = element2; + return assign_OperationalLimitType_OperationalLimit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* OperationalLimit_factory() { - return new OperationalLimit; - } +const char OperationalLimit::debugName[] = "OperationalLimit"; +const char* OperationalLimit::debugString() const +{ + return OperationalLimit::debugName; } -void OperationalLimit::addConstructToMap(std::unordered_map& factory_map) { +void OperationalLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OperationalLimit"), &OperationalLimit_factory)); } -void OperationalLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void OperationalLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitSet"), &assign_OperationalLimit_OperationalLimitSet)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitType"), &assign_OperationalLimit_OperationalLimitType)); +void OperationalLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char OperationalLimit::debugName[] = "OperationalLimit"; -const char* OperationalLimit::debugString() +void OperationalLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OperationalLimit::debugName; + assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitSet"), &assign_OperationalLimit_OperationalLimitSet)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitType"), &assign_OperationalLimit_OperationalLimitType)); } const BaseClassDefiner OperationalLimit::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner OperationalLimit::declare() return BaseClassDefiner(OperationalLimit::addConstructToMap, OperationalLimit::addPrimitiveAssignFnsToMap, OperationalLimit::addClassAssignFnsToMap, OperationalLimit::debugName); } - +namespace CIMPP +{ + BaseClass* OperationalLimit_factory() + { + return new OperationalLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimit.hpp b/CGMES_2.4.15_16FEB2016/OperationalLimit.hpp index 9db66a379..42c59f9fc 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimit.hpp @@ -1,40 +1,41 @@ #ifndef OperationalLimit_H #define OperationalLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class OperationalLimitSet; + class OperationalLimitType; -class OperationalLimitSet; -class OperationalLimitType; /* A value associated with a specific kind of limit. The sub class value attribute shall be positive. The sub class value attribute is inversely proportional to OperationalLimitType.acceptableDuration (acceptableDuration for short). A pair of value_x and acceptableDuration_x are related to each other as follows: if value_1 > value_2 > value_3 >... then acceptableDuration_1 < acceptableDuration_2 < acceptableDuration_3 < ... A value_x with direction="high" shall be greater than a value_y with direction="low". */ - class OperationalLimit: public IdentifiedObject + class OperationalLimit : public IdentifiedObject { - public: - CIMPP::OperationalLimitSet* OperationalLimitSet; /* Values of equipment limits. Default: 0 */ - CIMPP::OperationalLimitType* OperationalLimitType; /* The limit type associated with this limit. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OperationalLimit(); - virtual ~OperationalLimit(); - + ~OperationalLimit() override; + + CIMPP::OperationalLimitSet* OperationalLimitSet; /* Values of equipment limits. Default: 0 */ + CIMPP::OperationalLimitType* OperationalLimitType; /* The limit type associated with this limit. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OperationalLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.cpp b/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.cpp index 9cb5f80b9..4aeb56e6d 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.cpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimitDirectionKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::OperationalLimitDirectionKind& rop) +OperationalLimitDirectionKind& OperationalLimitDirectionKind::operator=(OperationalLimitDirectionKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +OperationalLimitDirectionKind::operator OperationalLimitDirectionKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char OperationalLimitDirectionKind::debugName[] = "OperationalLimitDirectionKind"; +const char* OperationalLimitDirectionKind::debugString() const +{ + return OperationalLimitDirectionKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, OperationalLimitDirectionKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const OperationalLimitDirectionKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == OperationalLimitDirectionKind::high) + { + EnumSymbol = "high"; + } + if (obj.value == OperationalLimitDirectionKind::low) + { + EnumSymbol = "low"; + } + if (obj.value == OperationalLimitDirectionKind::absoluteValue) + { + EnumSymbol = "absoluteValue"; + } + + if (!EnumSymbol.empty()) + { + os << "OperationalLimitDirectionKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.hpp b/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.hpp index ce1461f83..33d23f39a 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.hpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimitDirectionKind.hpp @@ -1,25 +1,50 @@ #ifndef OperationalLimitDirectionKind_H #define OperationalLimitDirectionKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The direction attribute describes the side of a limit that is a violation. */ - enum class OperationalLimitDirectionKind + class OperationalLimitDirectionKind { - /** - * High means that a monitored value above the limit value is a violation. If applied to a terminal flow, the positive direction is into the terminal. - */ - high, - /** - * Low means a monitored value below the limit is a violation. If applied to a terminal flow, the positive direction is into the terminal. - */ - low, - /** - * An absoluteValue limit means that a monitored absolute value above the limit value is a violation. - */ - absoluteValue, + public: + enum OperationalLimitDirectionKind_ENUM + { + /** + * High means that a monitored value above the limit value is a violation. If applied to a terminal flow, the positive direction is into the terminal. + */ + high, + /** + * Low means a monitored value below the limit is a violation. If applied to a terminal flow, the positive direction is into the terminal. + */ + low, + /** + * An absoluteValue limit means that a monitored absolute value above the limit value is a violation. + */ + absoluteValue, + }; + + OperationalLimitDirectionKind() : value(), initialized(false) {} + OperationalLimitDirectionKind(OperationalLimitDirectionKind_ENUM value) : value(value), initialized(true) {} + + OperationalLimitDirectionKind& operator=(OperationalLimitDirectionKind_ENUM rop); + operator OperationalLimitDirectionKind_ENUM() const; + + OperationalLimitDirectionKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, OperationalLimitDirectionKind& rop); + friend std::ostream& operator<<(std::ostream& os, const OperationalLimitDirectionKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::OperationalLimitDirectionKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimitSet.cpp b/CGMES_2.4.15_16FEB2016/OperationalLimitSet.cpp index 6b820c844..65fd3559f 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimitSet.cpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimitSet.cpp @@ -1,75 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimitSet.hpp" -#include "ACDCTerminal.hpp" +#include +#include + #include "Equipment.hpp" #include "OperationalLimit.hpp" +#include "ACDCTerminal.hpp" using namespace CIMPP; -OperationalLimitSet::OperationalLimitSet(): Terminal(nullptr), Equipment(nullptr) {}; - +OperationalLimitSet::OperationalLimitSet() : Equipment(nullptr), Terminal(nullptr) {}; OperationalLimitSet::~OperationalLimitSet() {}; -bool assign_ACDCTerminal_OperationalLimitSet(BaseClass*, BaseClass*); -bool assign_OperationalLimitSet_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_ACDCTerminal_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} + + + bool assign_Equipment_OperationalLimitSet(BaseClass*, BaseClass*); -bool assign_OperationalLimitSet_Equipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - element->Equipment = dynamic_cast(BaseClass_ptr2); - if(element->Equipment != nullptr) - return assign_Equipment_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_OperationalLimitSet_Equipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1); + Equipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Equipment != element2) + { + element->Equipment = element2; + return assign_Equipment_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_OperationalLimitSet_OperationalLimitValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimitValue.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_OperationalLimit_OperationalLimitSet(BaseClass*, BaseClass*); +bool assign_OperationalLimitSet_OperationalLimitValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1); + OperationalLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimitValue.begin(), element->OperationalLimitValue.end(), element2) == element->OperationalLimitValue.end()) + { + element->OperationalLimitValue.push_back(element2); + return assign_OperationalLimit_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - -namespace CIMPP { - BaseClass* OperationalLimitSet_factory() { - return new OperationalLimitSet; +bool assign_ACDCTerminal_OperationalLimitSet(BaseClass*, BaseClass*); +bool assign_OperationalLimitSet_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1); + ACDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_ACDCTerminal_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void OperationalLimitSet::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:OperationalLimitSet"), &OperationalLimitSet_factory)); +const char OperationalLimitSet::debugName[] = "OperationalLimitSet"; +const char* OperationalLimitSet::debugString() const +{ + return OperationalLimitSet::debugName; } -void OperationalLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void OperationalLimitSet::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:OperationalLimitSet"), &OperationalLimitSet_factory)); +} -void OperationalLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Terminal"), &assign_OperationalLimitSet_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Equipment"), &assign_OperationalLimitSet_Equipment)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.OperationalLimitValue"), &assign_OperationalLimitSet_OperationalLimitValue)); +void OperationalLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char OperationalLimitSet::debugName[] = "OperationalLimitSet"; -const char* OperationalLimitSet::debugString() +void OperationalLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OperationalLimitSet::debugName; + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Equipment"), &assign_OperationalLimitSet_Equipment)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.OperationalLimitValue"), &assign_OperationalLimitSet_OperationalLimitValue)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Terminal"), &assign_OperationalLimitSet_Terminal)); } const BaseClassDefiner OperationalLimitSet::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner OperationalLimitSet::declare() return BaseClassDefiner(OperationalLimitSet::addConstructToMap, OperationalLimitSet::addPrimitiveAssignFnsToMap, OperationalLimitSet::addClassAssignFnsToMap, OperationalLimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* OperationalLimitSet_factory() + { + return new OperationalLimitSet; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimitSet.hpp b/CGMES_2.4.15_16FEB2016/OperationalLimitSet.hpp index 3fd1e4ba2..a6a94680b 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimitSet.hpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimitSet.hpp @@ -1,42 +1,43 @@ #ifndef OperationalLimitSet_H #define OperationalLimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ACDCTerminal; + class Equipment; + class OperationalLimit; -class ACDCTerminal; -class Equipment; -class OperationalLimit; /* A set of limits associated with equipment. Sets of limits might apply to a specific temperature, or season for example. A set of limits may contain different severities of limit levels that would apply to the same equipment. The set may contain limits of different types such as apparent power and current limits or high and low voltage limits that are logically applied together as a set. */ - class OperationalLimitSet: public IdentifiedObject + class OperationalLimitSet : public IdentifiedObject { - public: - CIMPP::ACDCTerminal* Terminal; /* Default: 0 */ - CIMPP::Equipment* Equipment; /* The equipment to which the limit set applies. Default: 0 */ - std::list OperationalLimitValue; /* The limit set to which the limit values belong. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OperationalLimitSet(); - virtual ~OperationalLimitSet(); - + ~OperationalLimitSet() override; + + CIMPP::Equipment* Equipment; /* The equipment to which the limit set applies. Default: 0 */ + std::list OperationalLimitValue; /* The limit set to which the limit values belong. Default: 0 */ + CIMPP::ACDCTerminal* Terminal; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OperationalLimitSet_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimitType.cpp b/CGMES_2.4.15_16FEB2016/OperationalLimitType.cpp index bc1194a1d..29ea706ae 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimitType.cpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimitType.cpp @@ -1,94 +1,104 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimitType.hpp" +#include +#include + +#include "OperationalLimit.hpp" #include "Seconds.hpp" -#include "LimitTypeKind.hpp" #include "OperationalLimitDirectionKind.hpp" -#include "OperationalLimit.hpp" +#include "LimitTypeKind.hpp" using namespace CIMPP; OperationalLimitType::OperationalLimitType() {}; - OperationalLimitType::~OperationalLimitType() {}; +bool assign_OperationalLimitType_acceptableDuration(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->acceptableDuration; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OperationalLimitType_direction(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->direction; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OperationalLimitType_OperationalLimit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimit.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_OperationalLimitType_limitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->limitType; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_OperationalLimitType_acceptableDuration(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->acceptableDuration; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_OperationalLimit_OperationalLimitType(BaseClass*, BaseClass*); +bool assign_OperationalLimitType_OperationalLimit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitType* element = dynamic_cast(BaseClass_ptr1); + OperationalLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimit.begin(), element->OperationalLimit.end(), element2) == element->OperationalLimit.end()) + { + element->OperationalLimit.push_back(element2); + return assign_OperationalLimit_OperationalLimitType(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_OperationalLimitType_limitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->limitType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OperationalLimitType_direction(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->direction; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* OperationalLimitType_factory() { - return new OperationalLimitType; - } +const char OperationalLimitType::debugName[] = "OperationalLimitType"; +const char* OperationalLimitType::debugString() const +{ + return OperationalLimitType::debugName; } -void OperationalLimitType::addConstructToMap(std::unordered_map& factory_map) { +void OperationalLimitType::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OperationalLimitType"), &OperationalLimitType_factory)); } -void OperationalLimitType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void OperationalLimitType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.acceptableDuration"), &assign_OperationalLimitType_acceptableDuration)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.limitType"), &assign_OperationalLimitType_limitType)); assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.direction"), &assign_OperationalLimitType_direction)); - } - -void OperationalLimitType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.OperationalLimit"), &assign_OperationalLimitType_OperationalLimit)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.limitType"), &assign_OperationalLimitType_limitType)); } -const char OperationalLimitType::debugName[] = "OperationalLimitType"; -const char* OperationalLimitType::debugString() +void OperationalLimitType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OperationalLimitType::debugName; + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.OperationalLimit"), &assign_OperationalLimitType_OperationalLimit)); } const BaseClassDefiner OperationalLimitType::declare() @@ -96,4 +106,10 @@ const BaseClassDefiner OperationalLimitType::declare() return BaseClassDefiner(OperationalLimitType::addConstructToMap, OperationalLimitType::addPrimitiveAssignFnsToMap, OperationalLimitType::addClassAssignFnsToMap, OperationalLimitType::debugName); } - +namespace CIMPP +{ + BaseClass* OperationalLimitType_factory() + { + return new OperationalLimitType; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OperationalLimitType.hpp b/CGMES_2.4.15_16FEB2016/OperationalLimitType.hpp index 74b225998..6de5044fe 100644 --- a/CGMES_2.4.15_16FEB2016/OperationalLimitType.hpp +++ b/CGMES_2.4.15_16FEB2016/OperationalLimitType.hpp @@ -1,44 +1,45 @@ #ifndef OperationalLimitType_H #define OperationalLimitType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "LimitTypeKind.hpp" #include "OperationalLimitDirectionKind.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class OperationalLimit; -class OperationalLimit; /* The operational meaning of a category of limits. */ - class OperationalLimitType: public IdentifiedObject + class OperationalLimitType : public IdentifiedObject { - public: - CIMPP::Seconds acceptableDuration; /* The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed. Default: nullptr */ - CIMPP::LimitTypeKind limitType; /* Types of limits defined in the ENTSO-E Operational Handbook Policy 3. Default: 0 */ - CIMPP::OperationalLimitDirectionKind direction; /* The direction of the limit. Default: 0 */ - std::list OperationalLimit; /* The operational limits associated with this type of limit. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OperationalLimitType(); - virtual ~OperationalLimitType(); - + ~OperationalLimitType() override; + + std::list OperationalLimit; /* The operational limits associated with this type of limit. Default: 0 */ + CIMPP::Seconds acceptableDuration; /* The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed. Default: nullptr */ + CIMPP::OperationalLimitDirectionKind direction; /* The direction of the limit. Default: 0 */ + CIMPP::LimitTypeKind limitType; /* Types of limits defined in the ENTSO-E Operational Handbook Policy 3. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OperationalLimitType_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OrientationKind.cpp b/CGMES_2.4.15_16FEB2016/OrientationKind.cpp index d9eae1669..e02a50057 100644 --- a/CGMES_2.4.15_16FEB2016/OrientationKind.cpp +++ b/CGMES_2.4.15_16FEB2016/OrientationKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OrientationKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::OrientationKind& rop) +OrientationKind& OrientationKind::operator=(OrientationKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +OrientationKind::operator OrientationKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char OrientationKind::debugName[] = "OrientationKind"; +const char* OrientationKind::debugString() const +{ + return OrientationKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, OrientationKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -28,5 +59,23 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const OrientationKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == OrientationKind::negative) + { + EnumSymbol = "negative"; + } + + if (!EnumSymbol.empty()) + { + os << "OrientationKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OrientationKind.hpp b/CGMES_2.4.15_16FEB2016/OrientationKind.hpp index 203bcf91a..0ab661444 100644 --- a/CGMES_2.4.15_16FEB2016/OrientationKind.hpp +++ b/CGMES_2.4.15_16FEB2016/OrientationKind.hpp @@ -1,17 +1,42 @@ #ifndef OrientationKind_H #define OrientationKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The orientation of the coordinate system with respect to top, left, and the coordinate number system. */ - enum class OrientationKind + class OrientationKind { - /** - * For 2D diagrams, a negative orientation gives the left-hand orientation (favoured by computer graphics displays) with X values increasing from left to right and Y values increasing from top to bottom. This is also known as a left hand orientation. - */ - negative, + public: + enum OrientationKind_ENUM + { + /** + * For 2D diagrams, a negative orientation gives the left-hand orientation (favoured by computer graphics displays) with X values increasing from left to right and Y values increasing from top to bottom. This is also known as a left hand orientation. + */ + negative, + }; + + OrientationKind() : value(), initialized(false) {} + OrientationKind(OrientationKind_ENUM value) : value(value), initialized(true) {} + + OrientationKind& operator=(OrientationKind_ENUM rop); + operator OrientationKind_ENUM() const; + + OrientationKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, OrientationKind& rop); + friend std::ostream& operator<<(std::ostream& os, const OrientationKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::OrientationKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/OverexcLim2.cpp b/CGMES_2.4.15_16FEB2016/OverexcLim2.cpp index fdaa8c396..4b41edb94 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLim2.cpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLim2.cpp @@ -1,7 +1,11 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLim2.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -10,87 +14,87 @@ using namespace CIMPP; OverexcLim2::OverexcLim2() {}; - OverexcLim2::~OverexcLim2() {}; +bool assign_OverexcLim2_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLim2_koi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->koi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLim2_voimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLim2_voimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLim2_koi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->koi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLim2_voimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLim2_voimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLim2_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* OverexcLim2_factory() { - return new OverexcLim2; - } +const char OverexcLim2::debugName[] = "OverexcLim2"; +const char* OverexcLim2::debugString() const +{ + return OverexcLim2::debugName; } -void OverexcLim2::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLim2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLim2"), &OverexcLim2_factory)); } -void OverexcLim2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void OverexcLim2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.ifdlim"), &assign_OverexcLim2_ifdlim)); assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.koi"), &assign_OverexcLim2_koi)); assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.voimax"), &assign_OverexcLim2_voimax)); assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.voimin"), &assign_OverexcLim2_voimin)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.ifdlim"), &assign_OverexcLim2_ifdlim)); } -void OverexcLim2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLim2::debugName[] = "OverexcLim2"; -const char* OverexcLim2::debugString() +void OverexcLim2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLim2::debugName; } const BaseClassDefiner OverexcLim2::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner OverexcLim2::declare() return BaseClassDefiner(OverexcLim2::addConstructToMap, OverexcLim2::addPrimitiveAssignFnsToMap, OverexcLim2::addClassAssignFnsToMap, OverexcLim2::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLim2_factory() + { + return new OverexcLim2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OverexcLim2.hpp b/CGMES_2.4.15_16FEB2016/OverexcLim2.hpp index 453fef17c..5ee4319c4 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLim2.hpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLim2.hpp @@ -1,41 +1,42 @@ #ifndef OverexcLim2_H #define OverexcLim2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Different from LimIEEEOEL, LimOEL2 has a fixed pickup threshold and reduces the excitation set-point by mean of non-windup integral regulator. Irated is the rated machine excitation current (calculated from nameplate conditions: V, P, CosPhi). */ - class OverexcLim2: public OverexcitationLimiterDynamics + class OverexcLim2 : public OverexcitationLimiterDynamics { - public: - CIMPP::PU koi; /* Gain Over excitation limiter (K). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU voimax; /* Maximum error signal (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU voimin; /* Minimum error signal (V). Typical Value = -9999. Default: nullptr */ - CIMPP::PU ifdlim; /* Limit value of rated field current (I). Typical Value = 1.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLim2(); - virtual ~OverexcLim2(); - + ~OverexcLim2() override; + + CIMPP::PU ifdlim; /* Limit value of rated field current (I). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU koi; /* Gain Over excitation limiter (K). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU voimax; /* Maximum error signal (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU voimin; /* Minimum error signal (V). Typical Value = -9999. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLim2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.cpp b/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.cpp index d2180b520..10157d970 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.cpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.cpp @@ -1,7 +1,11 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLimIEEE.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -12,115 +16,117 @@ using namespace CIMPP; OverexcLimIEEE::OverexcLimIEEE() {}; - OverexcLimIEEE::~OverexcLimIEEE() {}; +bool assign_OverexcLimIEEE_hyst(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hyst; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_ifdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_itfpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->itfpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_kcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kcd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_kramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kramp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLimIEEE_itfpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->itfpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_ifdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_hyst(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hyst; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_kcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kcd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_kramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kramp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* OverexcLimIEEE_factory() { - return new OverexcLimIEEE; - } +const char OverexcLimIEEE::debugName[] = "OverexcLimIEEE"; +const char* OverexcLimIEEE::debugString() const +{ + return OverexcLimIEEE::debugName; } -void OverexcLimIEEE::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLimIEEE::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE"), &OverexcLimIEEE_factory)); } -void OverexcLimIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.itfpu"), &assign_OverexcLimIEEE_itfpu)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdmax"), &assign_OverexcLimIEEE_ifdmax)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdlim"), &assign_OverexcLimIEEE_ifdlim)); +void OverexcLimIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.hyst"), &assign_OverexcLimIEEE_hyst)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdlim"), &assign_OverexcLimIEEE_ifdlim)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdmax"), &assign_OverexcLimIEEE_ifdmax)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.itfpu"), &assign_OverexcLimIEEE_itfpu)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.kcd"), &assign_OverexcLimIEEE_kcd)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.kramp"), &assign_OverexcLimIEEE_kramp)); } -void OverexcLimIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLimIEEE::debugName[] = "OverexcLimIEEE"; -const char* OverexcLimIEEE::debugString() +void OverexcLimIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLimIEEE::debugName; } const BaseClassDefiner OverexcLimIEEE::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner OverexcLimIEEE::declare() return BaseClassDefiner(OverexcLimIEEE::addConstructToMap, OverexcLimIEEE::addPrimitiveAssignFnsToMap, OverexcLimIEEE::addClassAssignFnsToMap, OverexcLimIEEE::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLimIEEE_factory() + { + return new OverexcLimIEEE; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.hpp b/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.hpp index e5f8cc28f..8c66e3475 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.hpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLimIEEE.hpp @@ -1,44 +1,45 @@ #ifndef OverexcLimIEEE_H #define OverexcLimIEEE_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The over excitation limiter model is intended to represent the significant features of OELs necessary for some large-scale system studies. It is the result of a pragmatic approach to obtain a model that can be widely applied with attainable data from generator owners. An attempt to include all variations in the functionality of OELs and duplicate how they interact with the rest of the excitation systems would likely result in a level of application insufficient for the studies for which they are intended. Reference: IEEE OEL 421.5-2005 Section 9. */ - class OverexcLimIEEE: public OverexcitationLimiterDynamics + class OverexcLimIEEE : public OverexcitationLimiterDynamics { - public: - CIMPP::PU itfpu; /* OEL timed field current limiter pickup level (I). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU ifdmax; /* OEL instantaneous field current limit (I). Typical Value = 1.5. Default: nullptr */ - CIMPP::PU ifdlim; /* OEL timed field current limit (I). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU hyst; /* OEL pickup/drop-out hysteresis (HYST). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU kcd; /* OEL cooldown gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float kramp; /* OEL ramped limit rate (K). Unit = PU/sec. Typical Value = 10. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLimIEEE(); - virtual ~OverexcLimIEEE(); - + ~OverexcLimIEEE() override; + + CIMPP::PU hyst; /* OEL pickup/drop-out hysteresis (HYST). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU ifdlim; /* OEL timed field current limit (I). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU ifdmax; /* OEL instantaneous field current limit (I). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU itfpu; /* OEL timed field current limiter pickup level (I). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU kcd; /* OEL cooldown gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float kramp; /* OEL ramped limit rate (K). Unit = PU/sec. Typical Value = 10. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLimIEEE_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OverexcLimX1.cpp b/CGMES_2.4.15_16FEB2016/OverexcLimX1.cpp index 486d368dc..ab18dfe51 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLimX1.cpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLimX1.cpp @@ -1,186 +1,196 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLimX1.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" using namespace CIMPP; OverexcLimX1::OverexcLimX1() {}; - OverexcLimX1::~OverexcLimX1() {}; +bool assign_OverexcLimX1_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efddes; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdrated; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlow; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLimX1_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdrated; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efddes; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX1_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX1_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlow; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* OverexcLimX1_factory() { - return new OverexcLimX1; - } + + + +const char OverexcLimX1::debugName[] = "OverexcLimX1"; +const char* OverexcLimX1::debugString() const +{ + return OverexcLimX1::debugName; } -void OverexcLimX1::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLimX1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLimX1"), &OverexcLimX1_factory)); } -void OverexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efdrated"), &assign_OverexcLimX1_efdrated)); +void OverexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efd1"), &assign_OverexcLimX1_efd1)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t1"), &assign_OverexcLimX1_t1)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efd2"), &assign_OverexcLimX1_efd2)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t2"), &assign_OverexcLimX1_t2)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efd3"), &assign_OverexcLimX1_efd3)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t3"), &assign_OverexcLimX1_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efddes"), &assign_OverexcLimX1_efddes)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efdrated"), &assign_OverexcLimX1_efdrated)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.kmx"), &assign_OverexcLimX1_kmx)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t1"), &assign_OverexcLimX1_t1)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t2"), &assign_OverexcLimX1_t2)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t3"), &assign_OverexcLimX1_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.vlow"), &assign_OverexcLimX1_vlow)); } -void OverexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLimX1::debugName[] = "OverexcLimX1"; -const char* OverexcLimX1::debugString() +void OverexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLimX1::debugName; } const BaseClassDefiner OverexcLimX1::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner OverexcLimX1::declare() return BaseClassDefiner(OverexcLimX1::addConstructToMap, OverexcLimX1::addPrimitiveAssignFnsToMap, OverexcLimX1::addClassAssignFnsToMap, OverexcLimX1::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLimX1_factory() + { + return new OverexcLimX1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OverexcLimX1.hpp b/CGMES_2.4.15_16FEB2016/OverexcLimX1.hpp index 7fdc27e45..02fe918e3 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLimX1.hpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLimX1.hpp @@ -1,48 +1,49 @@ #ifndef OverexcLimX1_H #define OverexcLimX1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Field voltage over excitation limiter. */ - class OverexcLimX1: public OverexcitationLimiterDynamics + class OverexcLimX1 : public OverexcitationLimiterDynamics { - public: - CIMPP::PU efdrated; /* Rated field voltage (EFD). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU efd1; /* Low voltage point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ - CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ - CIMPP::PU efd2; /* Mid voltage point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ - CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ - CIMPP::PU efd3; /* High voltage point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ - CIMPP::PU efddes; /* Desired field voltage (EFD). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU kmx; /* Gain (K). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLimX1(); - virtual ~OverexcLimX1(); - + ~OverexcLimX1() override; + + CIMPP::PU efd1; /* Low voltage point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU efd2; /* Mid voltage point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU efd3; /* High voltage point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU efddes; /* Desired field voltage (EFD). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU efdrated; /* Rated field voltage (EFD). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU kmx; /* Gain (K). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ + CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ + CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ + CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLimX1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OverexcLimX2.cpp b/CGMES_2.4.15_16FEB2016/OverexcLimX2.cpp index 896cac502..88677bf5f 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLimX2.cpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLimX2.cpp @@ -1,201 +1,212 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLimX2.hpp" -#include "Boolean.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" using namespace CIMPP; OverexcLimX2::OverexcLimX2() {}; - OverexcLimX2::~OverexcLimX2() {}; +bool assign_OverexcLimX2_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efddes; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdrated; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlow; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLimX2_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX2_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdrated; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX2_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efddes; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlow; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* OverexcLimX2_factory() { - return new OverexcLimX2; - } + + + + + + + + + +const char OverexcLimX2::debugName[] = "OverexcLimX2"; +const char* OverexcLimX2::debugString() const +{ + return OverexcLimX2::debugName; } -void OverexcLimX2::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLimX2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLimX2"), &OverexcLimX2_factory)); } -void OverexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.m"), &assign_OverexcLimX2_m)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efdrated"), &assign_OverexcLimX2_efdrated)); +void OverexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efd1"), &assign_OverexcLimX2_efd1)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t1"), &assign_OverexcLimX2_t1)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efd2"), &assign_OverexcLimX2_efd2)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t2"), &assign_OverexcLimX2_t2)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efd3"), &assign_OverexcLimX2_efd3)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t3"), &assign_OverexcLimX2_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efddes"), &assign_OverexcLimX2_efddes)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efdrated"), &assign_OverexcLimX2_efdrated)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.kmx"), &assign_OverexcLimX2_kmx)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.m"), &assign_OverexcLimX2_m)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t1"), &assign_OverexcLimX2_t1)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t2"), &assign_OverexcLimX2_t2)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t3"), &assign_OverexcLimX2_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.vlow"), &assign_OverexcLimX2_vlow)); } -void OverexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLimX2::debugName[] = "OverexcLimX2"; -const char* OverexcLimX2::debugString() +void OverexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLimX2::debugName; } const BaseClassDefiner OverexcLimX2::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner OverexcLimX2::declare() return BaseClassDefiner(OverexcLimX2::addConstructToMap, OverexcLimX2::addPrimitiveAssignFnsToMap, OverexcLimX2::addClassAssignFnsToMap, OverexcLimX2::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLimX2_factory() + { + return new OverexcLimX2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OverexcLimX2.hpp b/CGMES_2.4.15_16FEB2016/OverexcLimX2.hpp index 7dd09d678..2b733c272 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcLimX2.hpp +++ b/CGMES_2.4.15_16FEB2016/OverexcLimX2.hpp @@ -1,50 +1,51 @@ #ifndef OverexcLimX2_H #define OverexcLimX2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Field Voltage or Current overexcitation limiter designed to protect the generator field of an AC machine with automatic excitation control from overheating due to prolonged overexcitation. */ - class OverexcLimX2: public OverexcitationLimiterDynamics + class OverexcLimX2 : public OverexcitationLimiterDynamics { - public: - CIMPP::Boolean m; /* (m). true = IFD limiting false = EFD limiting. Default: false */ - CIMPP::PU efdrated; /* Rated field voltage if m=F or field current if m=T (EFD). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU efd1; /* Low voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ - CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage or current point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ - CIMPP::PU efd2; /* Mid voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ - CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage or current point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ - CIMPP::PU efd3; /* High voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage or current point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ - CIMPP::PU efddes; /* Desired field voltage if m=F or field current if m=T (EFD). Typical Value = 1. Default: nullptr */ - CIMPP::PU kmx; /* Gain (K). Typical Value = 0.002. Default: nullptr */ - CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLimX2(); - virtual ~OverexcLimX2(); - + ~OverexcLimX2() override; + + CIMPP::PU efd1; /* Low voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU efd2; /* Mid voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU efd3; /* High voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU efddes; /* Desired field voltage if m=F or field current if m=T (EFD). Typical Value = 1. Default: nullptr */ + CIMPP::PU efdrated; /* Rated field voltage if m=F or field current if m=T (EFD). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU kmx; /* Gain (K). Typical Value = 0.002. Default: nullptr */ + CIMPP::Boolean m; /* (m). true = IFD limiting false = EFD limiting. Default: false */ + CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage or current point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ + CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage or current point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ + CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage or current point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ + CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLimX2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.cpp b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.cpp index 443cc045e..a1adf0088 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcitationLimiterDynamics.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" using namespace CIMPP; -OverexcitationLimiterDynamics::OverexcitationLimiterDynamics(): ExcitationSystemDynamics(nullptr) {}; - +OverexcitationLimiterDynamics::OverexcitationLimiterDynamics() : ExcitationSystemDynamics(nullptr) {}; OverexcitationLimiterDynamics::~OverexcitationLimiterDynamics() {}; -bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass*, BaseClass*); -bool assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OverexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* OverexcitationLimiterDynamics_factory() { - return new OverexcitationLimiterDynamics; +bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass*, BaseClass*); +bool assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OverexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void OverexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics"), &OverexcitationLimiterDynamics_factory)); +const char OverexcitationLimiterDynamics::debugName[] = "OverexcitationLimiterDynamics"; +const char* OverexcitationLimiterDynamics::debugString() const +{ + return OverexcitationLimiterDynamics::debugName; } -void OverexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void OverexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics"), &OverexcitationLimiterDynamics_factory)); +} -void OverexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics)); +void OverexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char OverexcitationLimiterDynamics::debugName[] = "OverexcitationLimiterDynamics"; -const char* OverexcitationLimiterDynamics::debugString() +void OverexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcitationLimiterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics)); } const BaseClassDefiner OverexcitationLimiterDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner OverexcitationLimiterDynamics::declare() return BaseClassDefiner(OverexcitationLimiterDynamics::addConstructToMap, OverexcitationLimiterDynamics::addPrimitiveAssignFnsToMap, OverexcitationLimiterDynamics::addClassAssignFnsToMap, OverexcitationLimiterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcitationLimiterDynamics_factory() + { + return new OverexcitationLimiterDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.hpp b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.hpp index 1564df6a9..5fe95ae21 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterDynamics.hpp @@ -1,38 +1,39 @@ #ifndef OverexcitationLimiterDynamics_H #define OverexcitationLimiterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; -class ExcitationSystemDynamics; /* Overexcitation limiter function block whose behaviour is described by reference to a standard model */ - class OverexcitationLimiterDynamics: public DynamicsFunctionBlock + class OverexcitationLimiterDynamics : public DynamicsFunctionBlock { - public: - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this overexcitation limiter model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcitationLimiterDynamics(); - virtual ~OverexcitationLimiterDynamics(); - + ~OverexcitationLimiterDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this overexcitation limiter model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcitationLimiterDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.cpp b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.cpp index aa3169f18..bd8419785 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcitationLimiterUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; OverexcitationLimiterUserDefined::OverexcitationLimiterUserDefined() {}; - OverexcitationLimiterUserDefined::~OverexcitationLimiterUserDefined() {}; -bool assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_OverexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_OverexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass*, BaseClass*); +bool assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* OverexcitationLimiterUserDefined_factory() { - return new OverexcitationLimiterUserDefined; - } +const char OverexcitationLimiterUserDefined::debugName[] = "OverexcitationLimiterUserDefined"; +const char* OverexcitationLimiterUserDefined::debugString() const +{ + return OverexcitationLimiterUserDefined::debugName; } -void OverexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void OverexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined"), &OverexcitationLimiterUserDefined_factory)); } -void OverexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void OverexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined.proprietary"), &assign_OverexcitationLimiterUserDefined_proprietary)); - } - -void OverexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } -const char OverexcitationLimiterUserDefined::debugName[] = "OverexcitationLimiterUserDefined"; -const char* OverexcitationLimiterUserDefined::debugString() +void OverexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcitationLimiterUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner OverexcitationLimiterUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner OverexcitationLimiterUserDefined::declare() return BaseClassDefiner(OverexcitationLimiterUserDefined::addConstructToMap, OverexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap, OverexcitationLimiterUserDefined::addClassAssignFnsToMap, OverexcitationLimiterUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcitationLimiterUserDefined_factory() + { + return new OverexcitationLimiterUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.hpp b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.hpp index 6bb76fbdf..b86dd5aa0 100644 --- a/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/OverexcitationLimiterUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef OverexcitationLimiterUserDefined_H #define OverexcitationLimiterUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Overexcitation limiter system function block whose dynamic behaviour is described by */ - class OverexcitationLimiterUserDefined: public OverexcitationLimiterDynamics + class OverexcitationLimiterUserDefined : public OverexcitationLimiterDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcitationLimiterUserDefined(); - virtual ~OverexcitationLimiterUserDefined(); - + ~OverexcitationLimiterUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcitationLimiterUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.cpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.cpp index 2d290b767..72bd784f3 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.cpp @@ -1,73 +1,96 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType1Dynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" #include "VoltageAdjusterDynamics.hpp" using namespace CIMPP; -PFVArControllerType1Dynamics::PFVArControllerType1Dynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr), VoltageAdjusterDynamics(nullptr) {}; - +PFVArControllerType1Dynamics::PFVArControllerType1Dynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr), VoltageAdjusterDynamics(nullptr) {}; PFVArControllerType1Dynamics::~PFVArControllerType1Dynamics() {}; -bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); -bool assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageAdjusterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->VoltageAdjusterDynamics != nullptr) - return true; - } - return false; -} +bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* PFVArControllerType1Dynamics_factory() { - return new PFVArControllerType1Dynamics; +bool assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageAdjusterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageAdjusterDynamics != element2) + { + element->VoltageAdjusterDynamics = element2; + return assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PFVArControllerType1Dynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics"), &PFVArControllerType1Dynamics_factory)); +const char PFVArControllerType1Dynamics::debugName[] = "PFVArControllerType1Dynamics"; +const char* PFVArControllerType1Dynamics::debugString() const +{ + return PFVArControllerType1Dynamics::debugName; } -void PFVArControllerType1Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PFVArControllerType1Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics"), &PFVArControllerType1Dynamics_factory)); +} -void PFVArControllerType1Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.RemoteInputSignal"), &assign_PFVArControllerType1Dynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics)); - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.VoltageAdjusterDynamics"), &assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics)); +void PFVArControllerType1Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PFVArControllerType1Dynamics::debugName[] = "PFVArControllerType1Dynamics"; -const char* PFVArControllerType1Dynamics::debugString() +void PFVArControllerType1Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType1Dynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.RemoteInputSignal"), &assign_PFVArControllerType1Dynamics_RemoteInputSignal)); + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.VoltageAdjusterDynamics"), &assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics)); } const BaseClassDefiner PFVArControllerType1Dynamics::declare() @@ -75,4 +98,10 @@ const BaseClassDefiner PFVArControllerType1Dynamics::declare() return BaseClassDefiner(PFVArControllerType1Dynamics::addConstructToMap, PFVArControllerType1Dynamics::addPrimitiveAssignFnsToMap, PFVArControllerType1Dynamics::addClassAssignFnsToMap, PFVArControllerType1Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType1Dynamics_factory() + { + return new PFVArControllerType1Dynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.hpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.hpp index 76edafcd4..2332e70d4 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType1Dynamics.hpp @@ -1,42 +1,43 @@ #ifndef PFVArControllerType1Dynamics_H #define PFVArControllerType1Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; + class VoltageAdjusterDynamics; -class RemoteInputSignal; -class ExcitationSystemDynamics; -class VoltageAdjusterDynamics; /* Power Factor or VAr controller Type I function block whose behaviour is described by reference to a standard model */ - class PFVArControllerType1Dynamics: public DynamicsFunctionBlock + class PFVArControllerType1Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this Power Factor or VAr controller Type I model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type I model is associated. Default: 0 */ - CIMPP::VoltageAdjusterDynamics* VoltageAdjusterDynamics; /* Voltage adjuster model associated with this Power Factor or VA controller Type I model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType1Dynamics(); - virtual ~PFVArControllerType1Dynamics(); - + ~PFVArControllerType1Dynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type I model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this Power Factor or VAr controller Type I model. Default: 0 */ + CIMPP::VoltageAdjusterDynamics* VoltageAdjusterDynamics; /* Voltage adjuster model associated with this Power Factor or VA controller Type I model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType1Dynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.cpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.cpp index 966ff6b9b..f58a6b228 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "PFVArControllerType1Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType1UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; PFVArControllerType1UserDefined::PFVArControllerType1UserDefined() {}; - PFVArControllerType1UserDefined::~PFVArControllerType1UserDefined() {}; -bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PFVArControllerType1UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PFVArControllerType1UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PFVArControllerType1UserDefined_factory() { - return new PFVArControllerType1UserDefined; - } +const char PFVArControllerType1UserDefined::debugName[] = "PFVArControllerType1UserDefined"; +const char* PFVArControllerType1UserDefined::debugString() const +{ + return PFVArControllerType1UserDefined::debugName; } -void PFVArControllerType1UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void PFVArControllerType1UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined"), &PFVArControllerType1UserDefined_factory)); } -void PFVArControllerType1UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArControllerType1UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined.proprietary"), &assign_PFVArControllerType1UserDefined_proprietary)); - } - -void PFVArControllerType1UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics)); } -const char PFVArControllerType1UserDefined::debugName[] = "PFVArControllerType1UserDefined"; -const char* PFVArControllerType1UserDefined::debugString() +void PFVArControllerType1UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType1UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner PFVArControllerType1UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PFVArControllerType1UserDefined::declare() return BaseClassDefiner(PFVArControllerType1UserDefined::addConstructToMap, PFVArControllerType1UserDefined::addPrimitiveAssignFnsToMap, PFVArControllerType1UserDefined::addClassAssignFnsToMap, PFVArControllerType1UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType1UserDefined_factory() + { + return new PFVArControllerType1UserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.hpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.hpp index 81be06182..29fcc7aa6 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType1UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef PFVArControllerType1UserDefined_H #define PFVArControllerType1UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType1Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType1Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Power Factor or VAr controller Type I function block whose dynamic behaviour is described by */ - class PFVArControllerType1UserDefined: public PFVArControllerType1Dynamics + class PFVArControllerType1UserDefined : public PFVArControllerType1Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType1UserDefined(); - virtual ~PFVArControllerType1UserDefined(); - + ~PFVArControllerType1UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType1UserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.cpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.cpp index 013e188fa..2c2640a53 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType2Dynamics.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" using namespace CIMPP; -PFVArControllerType2Dynamics::PFVArControllerType2Dynamics(): ExcitationSystemDynamics(nullptr) {}; - +PFVArControllerType2Dynamics::PFVArControllerType2Dynamics() : ExcitationSystemDynamics(nullptr) {}; PFVArControllerType2Dynamics::~PFVArControllerType2Dynamics() {}; -bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass*, BaseClass*); -bool assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType2Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* PFVArControllerType2Dynamics_factory() { - return new PFVArControllerType2Dynamics; +bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType2Dynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PFVArControllerType2Dynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics"), &PFVArControllerType2Dynamics_factory)); +const char PFVArControllerType2Dynamics::debugName[] = "PFVArControllerType2Dynamics"; +const char* PFVArControllerType2Dynamics::debugString() const +{ + return PFVArControllerType2Dynamics::debugName; } -void PFVArControllerType2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PFVArControllerType2Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics"), &PFVArControllerType2Dynamics_factory)); +} -void PFVArControllerType2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics)); +void PFVArControllerType2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PFVArControllerType2Dynamics::debugName[] = "PFVArControllerType2Dynamics"; -const char* PFVArControllerType2Dynamics::debugString() +void PFVArControllerType2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType2Dynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics)); } const BaseClassDefiner PFVArControllerType2Dynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner PFVArControllerType2Dynamics::declare() return BaseClassDefiner(PFVArControllerType2Dynamics::addConstructToMap, PFVArControllerType2Dynamics::addPrimitiveAssignFnsToMap, PFVArControllerType2Dynamics::addClassAssignFnsToMap, PFVArControllerType2Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType2Dynamics_factory() + { + return new PFVArControllerType2Dynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.hpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.hpp index 4cd383163..9554f466d 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType2Dynamics.hpp @@ -1,38 +1,39 @@ #ifndef PFVArControllerType2Dynamics_H #define PFVArControllerType2Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; -class ExcitationSystemDynamics; /* Power Factor or VAr controller Type II function block whose behaviour is described by reference to a standard model */ - class PFVArControllerType2Dynamics: public DynamicsFunctionBlock + class PFVArControllerType2Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type II is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType2Dynamics(); - virtual ~PFVArControllerType2Dynamics(); - + ~PFVArControllerType2Dynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type II is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType2Dynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.cpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.cpp index eb576916d..527718fc6 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType2UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; PFVArControllerType2UserDefined::PFVArControllerType2UserDefined() {}; - PFVArControllerType2UserDefined::~PFVArControllerType2UserDefined() {}; -bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PFVArControllerType2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PFVArControllerType2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass*, BaseClass*); +bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PFVArControllerType2UserDefined_factory() { - return new PFVArControllerType2UserDefined; - } +const char PFVArControllerType2UserDefined::debugName[] = "PFVArControllerType2UserDefined"; +const char* PFVArControllerType2UserDefined::debugString() const +{ + return PFVArControllerType2UserDefined::debugName; } -void PFVArControllerType2UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void PFVArControllerType2UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined"), &PFVArControllerType2UserDefined_factory)); } -void PFVArControllerType2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArControllerType2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined.proprietary"), &assign_PFVArControllerType2UserDefined_proprietary)); - } - -void PFVArControllerType2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics)); } -const char PFVArControllerType2UserDefined::debugName[] = "PFVArControllerType2UserDefined"; -const char* PFVArControllerType2UserDefined::debugString() +void PFVArControllerType2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType2UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner PFVArControllerType2UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PFVArControllerType2UserDefined::declare() return BaseClassDefiner(PFVArControllerType2UserDefined::addConstructToMap, PFVArControllerType2UserDefined::addPrimitiveAssignFnsToMap, PFVArControllerType2UserDefined::addClassAssignFnsToMap, PFVArControllerType2UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType2UserDefined_factory() + { + return new PFVArControllerType2UserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.hpp b/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.hpp index d4cdbd153..9069946a5 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArControllerType2UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef PFVArControllerType2UserDefined_H #define PFVArControllerType2UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Power Factor or VAr controller Type II function block whose dynamic behaviour is described by */ - class PFVArControllerType2UserDefined: public PFVArControllerType2Dynamics + class PFVArControllerType2UserDefined : public PFVArControllerType2Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType2UserDefined(); - virtual ~PFVArControllerType2UserDefined(); - + ~PFVArControllerType2UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType2UserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.cpp b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.cpp index bc2548157..99455cb7d 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.cpp @@ -1,7 +1,11 @@ -#include -#include "PFVArControllerType1Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType1IEEEPFController.hpp" +#include +#include + #include "Boolean.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -14,126 +18,135 @@ using namespace CIMPP; PFVArType1IEEEPFController::PFVArType1IEEEPFController() {}; - PFVArType1IEEEPFController::~PFVArType1IEEEPFController() {}; +bool assign_PFVArType1IEEEPFController_ovex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ovex; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_tpfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vitmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vitmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vpfcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpfcbw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vpfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpfref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType1IEEEPFController_ovex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ovex; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_tpfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vitmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vitmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vpfcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpfcbw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vpfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpfref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType1IEEEPFController_factory() { - return new PFVArType1IEEEPFController; - } +const char PFVArType1IEEEPFController::debugName[] = "PFVArType1IEEEPFController"; +const char* PFVArType1IEEEPFController::debugString() const +{ + return PFVArType1IEEEPFController::debugName; } -void PFVArType1IEEEPFController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType1IEEEPFController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController"), &PFVArType1IEEEPFController_factory)); } -void PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController.ovex"), &assign_PFVArType1IEEEPFController_ovex)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController.tpfc"), &assign_PFVArType1IEEEPFController_tpfc)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController.vitmin"), &assign_PFVArType1IEEEPFController_vitmin)); @@ -144,13 +157,8 @@ void PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType1IEEEPFController::debugName[] = "PFVArType1IEEEPFController"; -const char* PFVArType1IEEEPFController::debugString() +void PFVArType1IEEEPFController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType1IEEEPFController::debugName; } const BaseClassDefiner PFVArType1IEEEPFController::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner PFVArType1IEEEPFController::declare() return BaseClassDefiner(PFVArType1IEEEPFController::addConstructToMap, PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap, PFVArType1IEEEPFController::addClassAssignFnsToMap, PFVArType1IEEEPFController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType1IEEEPFController_factory() + { + return new PFVArType1IEEEPFController; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.hpp b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.hpp index e9e3af601..20f16d338 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEPFController.hpp @@ -1,48 +1,49 @@ #ifndef PFVArType1IEEEPFController_H #define PFVArType1IEEEPFController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType1Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType1Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE PF Controller Type 1 which operates by moving the voltage reference directly. Reference: IEEE Standard 421.5-2005 Section 11.2. */ - class PFVArType1IEEEPFController: public PFVArControllerType1Dynamics + class PFVArType1IEEEPFController : public PFVArControllerType1Dynamics { - public: - CIMPP::Boolean ovex; /* Overexcitation Flag () true = overexcited false = underexcited. Default: false */ - CIMPP::Seconds tpfc; /* PF controller time delay (). Typical Value = 5. Default: nullptr */ - CIMPP::PU vitmin; /* Minimum machine terminal current needed to enable pf/var controller (). Default: nullptr */ - CIMPP::PU vpf; /* Synchronous machine power factor (). Default: nullptr */ - CIMPP::Simple_Float vpfcbw; /* PF controller dead band (). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vpfref; /* PF controller reference (). Default: nullptr */ - CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ - CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType1IEEEPFController(); - virtual ~PFVArType1IEEEPFController(); - + ~PFVArType1IEEEPFController() override; + + CIMPP::Boolean ovex; /* Overexcitation Flag () true = overexcited false = underexcited. Default: false */ + CIMPP::Seconds tpfc; /* PF controller time delay (). Typical Value = 5. Default: nullptr */ + CIMPP::PU vitmin; /* Minimum machine terminal current needed to enable pf/var controller (). Default: nullptr */ + CIMPP::PU vpf; /* Synchronous machine power factor (). Default: nullptr */ + CIMPP::Simple_Float vpfcbw; /* PF controller dead band (). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU vpfref; /* PF controller reference (). Default: nullptr */ + CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ + CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType1IEEEPFController_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.cpp b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.cpp index 7e752901e..c45005674 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.cpp @@ -1,7 +1,11 @@ -#include -#include "PFVArControllerType1Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType1IEEEVArController.hpp" +#include +#include + #include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" @@ -12,100 +16,107 @@ using namespace CIMPP; PFVArType1IEEEVArController::PFVArType1IEEEVArController() {}; - PFVArType1IEEEVArController::~PFVArType1IEEEVArController() {}; +bool assign_PFVArType1IEEEVArController_tvarc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvarc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvar(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvar; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvarcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvarcbw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvarref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvarref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType1IEEEVArController_tvarc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvarc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvar(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvar; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvarcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvarcbw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvarref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvarref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType1IEEEVArController_factory() { - return new PFVArType1IEEEVArController; - } +const char PFVArType1IEEEVArController::debugName[] = "PFVArType1IEEEVArController"; +const char* PFVArType1IEEEVArController::debugString() const +{ + return PFVArType1IEEEVArController::debugName; } -void PFVArType1IEEEVArController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType1IEEEVArController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController"), &PFVArType1IEEEVArController_factory)); } -void PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.tvarc"), &assign_PFVArType1IEEEVArController_tvarc)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.vvar"), &assign_PFVArType1IEEEVArController_vvar)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.vvarcbw"), &assign_PFVArType1IEEEVArController_vvarcbw)); @@ -114,13 +125,8 @@ void PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map< assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.vvtmin"), &assign_PFVArType1IEEEVArController_vvtmin)); } -void PFVArType1IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType1IEEEVArController::debugName[] = "PFVArType1IEEEVArController"; -const char* PFVArType1IEEEVArController::debugString() +void PFVArType1IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType1IEEEVArController::debugName; } const BaseClassDefiner PFVArType1IEEEVArController::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner PFVArType1IEEEVArController::declare() return BaseClassDefiner(PFVArType1IEEEVArController::addConstructToMap, PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap, PFVArType1IEEEVArController::addClassAssignFnsToMap, PFVArType1IEEEVArController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType1IEEEVArController_factory() + { + return new PFVArType1IEEEVArController; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.hpp b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.hpp index 2f852e844..9b7e852ff 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType1IEEEVArController.hpp @@ -1,45 +1,46 @@ #ifndef PFVArType1IEEEVArController_H #define PFVArType1IEEEVArController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType1Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "PFVArControllerType1Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE VAR Controller Type 1 which operates by moving the voltage reference directly. Reference: IEEE Standard 421.5-2005 Section 11.3. */ - class PFVArType1IEEEVArController: public PFVArControllerType1Dynamics + class PFVArType1IEEEVArController : public PFVArControllerType1Dynamics { - public: - CIMPP::Seconds tvarc; /* Var controller time delay (). Typical Value = 5. Default: nullptr */ - CIMPP::PU vvar; /* Synchronous machine power factor (). Default: nullptr */ - CIMPP::Simple_Float vvarcbw; /* Var controller dead band (). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vvarref; /* Var controller reference (). Default: nullptr */ - CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ - CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType1IEEEVArController(); - virtual ~PFVArType1IEEEVArController(); - + ~PFVArType1IEEEVArController() override; + + CIMPP::Seconds tvarc; /* Var controller time delay (). Typical Value = 5. Default: nullptr */ + CIMPP::PU vvar; /* Synchronous machine power factor (). Default: nullptr */ + CIMPP::Simple_Float vvarcbw; /* Var controller dead band (). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU vvarref; /* Var controller reference (). Default: nullptr */ + CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ + CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType1IEEEVArController_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArType2Common1.cpp b/CGMES_2.4.15_16FEB2016/PFVArType2Common1.cpp index 69789ab36..706c30675 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType2Common1.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType2Common1.cpp @@ -1,7 +1,11 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType2Common1.hpp" +#include +#include + #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" @@ -11,101 +15,102 @@ using namespace CIMPP; PFVArType2Common1::PFVArType2Common1() {}; - PFVArType2Common1::~PFVArType2Common1() {}; +bool assign_PFVArType2Common1_j(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->j; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_ref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType2Common1_j(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->j; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_ref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType2Common1_factory() { - return new PFVArType2Common1; - } +const char PFVArType2Common1::debugName[] = "PFVArType2Common1"; +const char* PFVArType2Common1::debugString() const +{ + return PFVArType2Common1::debugName; } -void PFVArType2Common1::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType2Common1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType2Common1"), &PFVArType2Common1_factory)); } -void PFVArType2Common1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType2Common1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.j"), &assign_PFVArType2Common1_j)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.kp"), &assign_PFVArType2Common1_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.ki"), &assign_PFVArType2Common1_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.kp"), &assign_PFVArType2Common1_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.max"), &assign_PFVArType2Common1_max)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.ref"), &assign_PFVArType2Common1_ref)); } -void PFVArType2Common1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType2Common1::debugName[] = "PFVArType2Common1"; -const char* PFVArType2Common1::debugString() +void PFVArType2Common1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType2Common1::debugName; } const BaseClassDefiner PFVArType2Common1::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner PFVArType2Common1::declare() return BaseClassDefiner(PFVArType2Common1::addConstructToMap, PFVArType2Common1::addPrimitiveAssignFnsToMap, PFVArType2Common1::addClassAssignFnsToMap, PFVArType2Common1::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType2Common1_factory() + { + return new PFVArType2Common1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArType2Common1.hpp b/CGMES_2.4.15_16FEB2016/PFVArType2Common1.hpp index ad830a145..0f0520b9e 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType2Common1.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType2Common1.hpp @@ -1,43 +1,44 @@ #ifndef PFVArType2Common1_H #define PFVArType2Common1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Power factor / Reactive power regulator. This model represents the power factor or reactive power controller such as the Basler SCP-250. The controller measures power factor or reactive power (PU on generator rated power) and compares it with the operator's set point. */ - class PFVArType2Common1: public PFVArControllerType2Dynamics + class PFVArType2Common1 : public PFVArControllerType2Dynamics { - public: - CIMPP::Boolean j; /* Selector (J). true = control mode for reactive power false = control mode for power factor. Default: false */ - CIMPP::PU kp; /* Proportional gain (Kp). Default: nullptr */ - CIMPP::PU ki; /* Reset gain (Ki). Default: nullptr */ - CIMPP::PU max; /* Output limit (max). Default: nullptr */ - CIMPP::PU ref; /* Reference value of reactive power or power factor (Ref). The reference value is initialised by this model. This initialisation may override the value exchanged by this attribute to represent a plant operator`s change of the reference setting. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType2Common1(); - virtual ~PFVArType2Common1(); - + ~PFVArType2Common1() override; + + CIMPP::Boolean j; /* Selector (J). true = control mode for reactive power false = control mode for power factor. Default: false */ + CIMPP::PU ki; /* Reset gain (Ki). Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Default: nullptr */ + CIMPP::PU max; /* Output limit (max). Default: nullptr */ + CIMPP::PU ref; /* Reference value of reactive power or power factor (Ref). The reference value is initialised by this model. This initialisation may override the value exchanged by this attribute to represent a plant operator`s change of the reference setting. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType2Common1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.cpp b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.cpp index 7e058f07a..7310bf23c 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.cpp @@ -1,141 +1,148 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType2IEEEPFController.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" using namespace CIMPP; PFVArType2IEEEPFController::PFVArType2IEEEPFController() {}; - PFVArType2IEEEPFController::~PFVArType2IEEEPFController() {}; +bool assign_PFVArType2IEEEPFController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exlon; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_pfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vclmt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType2IEEEPFController_pfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vclmt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exlon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType2IEEEPFController_factory() { - return new PFVArType2IEEEPFController; - } +const char PFVArType2IEEEPFController::debugName[] = "PFVArType2IEEEPFController"; +const char* PFVArType2IEEEPFController::debugString() const +{ + return PFVArType2IEEEPFController::debugName; } -void PFVArType2IEEEPFController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType2IEEEPFController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController"), &PFVArType2IEEEPFController_factory)); } -void PFVArType2IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType2IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.exlon"), &assign_PFVArType2IEEEPFController_exlon)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.ki"), &assign_PFVArType2IEEEPFController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.kp"), &assign_PFVArType2IEEEPFController_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.pfref"), &assign_PFVArType2IEEEPFController_pfref)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vref"), &assign_PFVArType2IEEEPFController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vclmt"), &assign_PFVArType2IEEEPFController_vclmt)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.kp"), &assign_PFVArType2IEEEPFController_kp)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.ki"), &assign_PFVArType2IEEEPFController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vref"), &assign_PFVArType2IEEEPFController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vs"), &assign_PFVArType2IEEEPFController_vs)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.exlon"), &assign_PFVArType2IEEEPFController_exlon)); } -void PFVArType2IEEEPFController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType2IEEEPFController::debugName[] = "PFVArType2IEEEPFController"; -const char* PFVArType2IEEEPFController::debugString() +void PFVArType2IEEEPFController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType2IEEEPFController::debugName; } const BaseClassDefiner PFVArType2IEEEPFController::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner PFVArType2IEEEPFController::declare() return BaseClassDefiner(PFVArType2IEEEPFController::addConstructToMap, PFVArType2IEEEPFController::addPrimitiveAssignFnsToMap, PFVArType2IEEEPFController::addClassAssignFnsToMap, PFVArType2IEEEPFController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType2IEEEPFController_factory() + { + return new PFVArType2IEEEPFController; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.hpp b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.hpp index 480d6c0b9..515a7648c 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEPFController.hpp @@ -1,46 +1,47 @@ #ifndef PFVArType2IEEEPFController_H #define PFVArType2IEEEPFController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE PF Controller Type 2 which is a summing point type controller and makes up the outside loop of a two-loop system. This controller is implemented as a slow PI type controller. The voltage regulator forms the inner loop and is implemented as a fast controller. Reference: IEEE Standard 421.5-2005 Section 11.4. */ - class PFVArType2IEEEPFController: public PFVArControllerType2Dynamics + class PFVArType2IEEEPFController : public PFVArControllerType2Dynamics { - public: - CIMPP::PU pfref; /* Power factor reference (). Default: nullptr */ - CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ - CIMPP::PU vclmt; /* Maximum output of the pf controller (). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain of the pf controller (). Typical Value = 1. Default: nullptr */ - CIMPP::PU ki; /* Integral gain of the pf controller (). Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ - CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType2IEEEPFController(); - virtual ~PFVArType2IEEEPFController(); - + ~PFVArType2IEEEPFController() override; + + CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ + CIMPP::PU ki; /* Integral gain of the pf controller (). Typical Value = 1. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain of the pf controller (). Typical Value = 1. Default: nullptr */ + CIMPP::PU pfref; /* Power factor reference (). Default: nullptr */ + CIMPP::PU vclmt; /* Maximum output of the pf controller (). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ + CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType2IEEEPFController_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.cpp b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.cpp index f5d150ecb..eaf3b23a8 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.cpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.cpp @@ -1,141 +1,148 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType2IEEEVArController.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" using namespace CIMPP; PFVArType2IEEEVArController::PFVArType2IEEEVArController() {}; - PFVArType2IEEEVArController::~PFVArType2IEEEVArController() {}; +bool assign_PFVArType2IEEEVArController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exlon; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_qref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vclmt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType2IEEEVArController_qref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vclmt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exlon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType2IEEEVArController_factory() { - return new PFVArType2IEEEVArController; - } +const char PFVArType2IEEEVArController::debugName[] = "PFVArType2IEEEVArController"; +const char* PFVArType2IEEEVArController::debugString() const +{ + return PFVArType2IEEEVArController::debugName; } -void PFVArType2IEEEVArController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType2IEEEVArController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController"), &PFVArType2IEEEVArController_factory)); } -void PFVArType2IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType2IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.exlon"), &assign_PFVArType2IEEEVArController_exlon)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.ki"), &assign_PFVArType2IEEEVArController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.kp"), &assign_PFVArType2IEEEVArController_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.qref"), &assign_PFVArType2IEEEVArController_qref)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vref"), &assign_PFVArType2IEEEVArController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vclmt"), &assign_PFVArType2IEEEVArController_vclmt)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.kp"), &assign_PFVArType2IEEEVArController_kp)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.ki"), &assign_PFVArType2IEEEVArController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vref"), &assign_PFVArType2IEEEVArController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vs"), &assign_PFVArType2IEEEVArController_vs)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.exlon"), &assign_PFVArType2IEEEVArController_exlon)); } -void PFVArType2IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType2IEEEVArController::debugName[] = "PFVArType2IEEEVArController"; -const char* PFVArType2IEEEVArController::debugString() +void PFVArType2IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType2IEEEVArController::debugName; } const BaseClassDefiner PFVArType2IEEEVArController::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner PFVArType2IEEEVArController::declare() return BaseClassDefiner(PFVArType2IEEEVArController::addConstructToMap, PFVArType2IEEEVArController::addPrimitiveAssignFnsToMap, PFVArType2IEEEVArController::addClassAssignFnsToMap, PFVArType2IEEEVArController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType2IEEEVArController_factory() + { + return new PFVArType2IEEEVArController; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.hpp b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.hpp index 6cd94b6b8..2a1d21455 100644 --- a/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.hpp +++ b/CGMES_2.4.15_16FEB2016/PFVArType2IEEEVArController.hpp @@ -1,46 +1,47 @@ #ifndef PFVArType2IEEEVArController_H #define PFVArType2IEEEVArController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE VAR Controller Type 2 which is a summing point type controller. It makes up the outside loop of a two-loop system. This controller is implemented as a slow PI type controller, and the voltage regulator forms the inner loop and is implemented as a fast controller. Reference: IEEE Standard 421.5-2005 Section 11.5. */ - class PFVArType2IEEEVArController: public PFVArControllerType2Dynamics + class PFVArType2IEEEVArController : public PFVArControllerType2Dynamics { - public: - CIMPP::PU qref; /* Reactive power reference (). Default: nullptr */ - CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ - CIMPP::PU vclmt; /* Maximum output of the pf controller (). Default: nullptr */ - CIMPP::PU kp; /* Proportional gain of the pf controller (). Default: nullptr */ - CIMPP::PU ki; /* Integral gain of the pf controller (). Default: nullptr */ - CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ - CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType2IEEEVArController(); - virtual ~PFVArType2IEEEVArController(); - + ~PFVArType2IEEEVArController() override; + + CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ + CIMPP::PU ki; /* Integral gain of the pf controller (). Default: nullptr */ + CIMPP::PU kp; /* Proportional gain of the pf controller (). Default: nullptr */ + CIMPP::PU qref; /* Reactive power reference (). Default: nullptr */ + CIMPP::PU vclmt; /* Maximum output of the pf controller (). Default: nullptr */ + CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ + CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType2IEEEVArController_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PU.cpp b/CGMES_2.4.15_16FEB2016/PU.cpp index 61bf98728..2c17173ca 100644 --- a/CGMES_2.4.15_16FEB2016/PU.cpp +++ b/CGMES_2.4.15_16FEB2016/PU.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PU.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -PU::PU() {} -PU::~PU(){} +#include -PU::PU(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void PU::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void PU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +PU& PU::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void PU::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +PU::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char PU::debugName[] = "PU"; -const char* PU::debugString() { +const char* PU::debugString() const +{ return PU::debugName; } - -const BaseClassDefiner PU::declare() { - return BaseClassDefiner(PU::addConstructToMap, PU::addPrimitiveAssignFnsToMap, PU::addClassAssignFnsToMap, PU::debugName); +PU& PU::operator+=(const PU& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - PU& PU::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - PU& PU::operator-=(const PU& rhs) { - value -= rhs.value; - return *this; - } - - PU& PU::operator*=(const PU& rhs) { - value *= rhs.value; - return *this; - } - - PU& PU::operator/=(const PU& rhs) { - value /= rhs.value; - return *this; - } +PU& PU::operator-=(const PU& rhs) +{ + value -= rhs.value; + return *this; +} - PU& PU::operator+=(const PU& rhs) { - value += rhs.value; - return *this; - } +PU& PU::operator*=(const PU& rhs) +{ + value *= rhs.value; + return *this; +} - PU::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +PU& PU::operator/=(const PU& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, PU& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PU& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const PU& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/PU.hpp b/CGMES_2.4.15_16FEB2016/PU.hpp index a83305ca5..51a1d1117 100644 --- a/CGMES_2.4.15_16FEB2016/PU.hpp +++ b/CGMES_2.4.15_16FEB2016/PU.hpp @@ -1,38 +1,39 @@ #ifndef PU_H #define PU_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class PU : public BaseClass + /* + Per Unit - a positive or negative value referred to a defined base. Values typically range from -10 to +10. + */ + class PU { - public: - PU(); - virtual ~PU(); - PU(long double value); - static const BaseClassDefiner declare(); - PU& operator=(long double &rop); + PU() : value(0.0), initialized(false) {} + PU(long double value) : value(value), initialized(true) {} + + PU& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + PU& operator+=(const PU& rhs); PU& operator-=(const PU& rhs); PU& operator*=(const PU& rhs); PU& operator/=(const PU& rhs); + friend std::istream& operator>>(std::istream& lop, PU& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const PU& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/PerCent.cpp b/CGMES_2.4.15_16FEB2016/PerCent.cpp index 057b28165..34fe37067 100644 --- a/CGMES_2.4.15_16FEB2016/PerCent.cpp +++ b/CGMES_2.4.15_16FEB2016/PerCent.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PerCent.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -PerCent::PerCent() {} -PerCent::~PerCent(){} +#include -PerCent::PerCent(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void PerCent::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void PerCent::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +PerCent& PerCent::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void PerCent::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +PerCent::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char PerCent::debugName[] = "PerCent"; -const char* PerCent::debugString() { +const char* PerCent::debugString() const +{ return PerCent::debugName; } - -const BaseClassDefiner PerCent::declare() { - return BaseClassDefiner(PerCent::addConstructToMap, PerCent::addPrimitiveAssignFnsToMap, PerCent::addClassAssignFnsToMap, PerCent::debugName); +PerCent& PerCent::operator+=(const PerCent& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - PerCent& PerCent::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - PerCent& PerCent::operator-=(const PerCent& rhs) { - value -= rhs.value; - return *this; - } - - PerCent& PerCent::operator*=(const PerCent& rhs) { - value *= rhs.value; - return *this; - } - - PerCent& PerCent::operator/=(const PerCent& rhs) { - value /= rhs.value; - return *this; - } +PerCent& PerCent::operator-=(const PerCent& rhs) +{ + value -= rhs.value; + return *this; +} - PerCent& PerCent::operator+=(const PerCent& rhs) { - value += rhs.value; - return *this; - } +PerCent& PerCent::operator*=(const PerCent& rhs) +{ + value *= rhs.value; + return *this; +} - PerCent::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +PerCent& PerCent::operator/=(const PerCent& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, PerCent& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PerCent& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const PerCent& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/PerCent.hpp b/CGMES_2.4.15_16FEB2016/PerCent.hpp index 065ec60f1..67bb36e78 100644 --- a/CGMES_2.4.15_16FEB2016/PerCent.hpp +++ b/CGMES_2.4.15_16FEB2016/PerCent.hpp @@ -1,38 +1,39 @@ #ifndef PerCent_H #define PerCent_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class PerCent : public BaseClass + /* + Percentage on a defined base. For example, specify as 100 to indicate at the defined base. + */ + class PerCent { - public: - PerCent(); - virtual ~PerCent(); - PerCent(long double value); - static const BaseClassDefiner declare(); - PerCent& operator=(long double &rop); + PerCent() : value(0.0), initialized(false) {} + PerCent(long double value) : value(value), initialized(true) {} + + PerCent& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + PerCent& operator+=(const PerCent& rhs); PerCent& operator-=(const PerCent& rhs); PerCent& operator*=(const PerCent& rhs); PerCent& operator/=(const PerCent& rhs); + friend std::istream& operator>>(std::istream& lop, PerCent& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const PerCent& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.cpp b/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.cpp index 6427a58e8..f9a4b4015 100644 --- a/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.cpp +++ b/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.cpp @@ -1,85 +1,104 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PerLengthDCLineParameter.hpp" +#include +#include + +#include "DCLineSegment.hpp" #include "CapacitancePerLength.hpp" #include "InductancePerLength.hpp" #include "ResistancePerLength.hpp" -#include "DCLineSegment.hpp" using namespace CIMPP; -PerLengthDCLineParameter::PerLengthDCLineParameter(): capacitance(nullptr), inductance(nullptr), resistance(nullptr) {}; - +PerLengthDCLineParameter::PerLengthDCLineParameter() {}; PerLengthDCLineParameter::~PerLengthDCLineParameter() {}; -bool assign_PerLengthDCLineParameter_capacitance(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - element->capacitance = dynamic_cast(BaseClass_ptr2); - if(element->capacitance != nullptr) - return true; - } - return false; -} -bool assign_PerLengthDCLineParameter_inductance(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - element->inductance = dynamic_cast(BaseClass_ptr2); - if(element->inductance != nullptr) - return true; - } - return false; +bool assign_PerLengthDCLineParameter_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitance; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PerLengthDCLineParameter_resistance(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - element->resistance = dynamic_cast(BaseClass_ptr2); - if(element->resistance != nullptr) - return true; - } - return false; +bool assign_PerLengthDCLineParameter_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCLineSegments.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PerLengthDCLineParameter_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_DCLineSegment_PerLengthParameter(BaseClass*, BaseClass*); +bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1); + DCLineSegment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCLineSegments.begin(), element->DCLineSegments.end(), element2) == element->DCLineSegments.end()) + { + element->DCLineSegments.push_back(element2); + return assign_DCLineSegment_PerLengthParameter(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* PerLengthDCLineParameter_factory() { - return new PerLengthDCLineParameter; - } +const char PerLengthDCLineParameter::debugName[] = "PerLengthDCLineParameter"; +const char* PerLengthDCLineParameter::debugString() const +{ + return PerLengthDCLineParameter::debugName; } -void PerLengthDCLineParameter::addConstructToMap(std::unordered_map& factory_map) { +void PerLengthDCLineParameter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter"), &PerLengthDCLineParameter_factory)); } -void PerLengthDCLineParameter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PerLengthDCLineParameter::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void PerLengthDCLineParameter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.capacitance"), &assign_PerLengthDCLineParameter_capacitance)); assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.inductance"), &assign_PerLengthDCLineParameter_inductance)); assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.resistance"), &assign_PerLengthDCLineParameter_resistance)); - assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.DCLineSegments"), &assign_PerLengthDCLineParameter_DCLineSegments)); } -const char PerLengthDCLineParameter::debugName[] = "PerLengthDCLineParameter"; -const char* PerLengthDCLineParameter::debugString() +void PerLengthDCLineParameter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PerLengthDCLineParameter::debugName; + assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.DCLineSegments"), &assign_PerLengthDCLineParameter_DCLineSegments)); } const BaseClassDefiner PerLengthDCLineParameter::declare() @@ -87,4 +106,10 @@ const BaseClassDefiner PerLengthDCLineParameter::declare() return BaseClassDefiner(PerLengthDCLineParameter::addConstructToMap, PerLengthDCLineParameter::addPrimitiveAssignFnsToMap, PerLengthDCLineParameter::addClassAssignFnsToMap, PerLengthDCLineParameter::debugName); } - +namespace CIMPP +{ + BaseClass* PerLengthDCLineParameter_factory() + { + return new PerLengthDCLineParameter; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.hpp b/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.hpp index 59cf5491c..4f194a716 100644 --- a/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.hpp +++ b/CGMES_2.4.15_16FEB2016/PerLengthDCLineParameter.hpp @@ -1,44 +1,42 @@ #ifndef PerLengthDCLineParameter_H #define PerLengthDCLineParameter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "CapacitancePerLength.hpp" +#include "InductancePerLength.hpp" +#include "ResistancePerLength.hpp" +namespace CIMPP +{ + class DCLineSegment; -class CapacitancePerLength; -class InductancePerLength; -class ResistancePerLength; -class DCLineSegment; - /* - - */ - class PerLengthDCLineParameter: public BaseClass + class PerLengthDCLineParameter : public BaseClass { - public: - CIMPP::CapacitancePerLength* capacitance; /* Capacitance per unit of length of the DC line segment; significant for cables only. Default: nullptr */ - CIMPP::InductancePerLength* inductance; /* Inductance per unit of length of the DC line segment. Default: nullptr */ - CIMPP::ResistancePerLength* resistance; /* Resistance per length of the DC line segment. Default: nullptr */ - std::list DCLineSegments; /* All line segments described by this set of per-length parameters. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PerLengthDCLineParameter(); - virtual ~PerLengthDCLineParameter(); - + ~PerLengthDCLineParameter() override; + + std::list DCLineSegments; /* All line segments described by this set of per-length parameters. Default: 0 */ + CIMPP::CapacitancePerLength capacitance; /* Capacitance per unit of length of the DC line segment; significant for cables only. Default: nullptr */ + CIMPP::InductancePerLength inductance; /* Inductance per unit of length of the DC line segment. Default: nullptr */ + CIMPP::ResistancePerLength resistance; /* Resistance per length of the DC line segment. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PerLengthDCLineParameter_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PetersenCoil.cpp b/CGMES_2.4.15_16FEB2016/PetersenCoil.cpp index 0026ba8bc..d0ab8eb1d 100644 --- a/CGMES_2.4.15_16FEB2016/PetersenCoil.cpp +++ b/CGMES_2.4.15_16FEB2016/PetersenCoil.cpp @@ -1,7 +1,11 @@ -#include -#include "EarthFaultCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PetersenCoil.hpp" +#include +#include + #include "PetersenCoilModeKind.hpp" #include "Voltage.hpp" #include "CurrentFlow.hpp" @@ -13,113 +17,121 @@ using namespace CIMPP; PetersenCoil::PetersenCoil() {}; - PetersenCoil::~PetersenCoil() {}; +bool assign_PetersenCoil_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_nominalU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_offsetCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->offsetCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_positionCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positionCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_xGroundMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xGroundMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_xGroundMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xGroundMin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_xGroundNominal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xGroundNominal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PetersenCoil_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_nominalU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_offsetCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->offsetCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_positionCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positionCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_xGroundMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xGroundMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_xGroundMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xGroundMin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_xGroundNominal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xGroundNominal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PetersenCoil_factory() { - return new PetersenCoil; - } +const char PetersenCoil::debugName[] = "PetersenCoil"; +const char* PetersenCoil::debugString() const +{ + return PetersenCoil::debugName; } -void PetersenCoil::addConstructToMap(std::unordered_map& factory_map) { +void PetersenCoil::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PetersenCoil"), &PetersenCoil_factory)); } -void PetersenCoil::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PetersenCoil::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PetersenCoil.mode"), &assign_PetersenCoil_mode)); assign_map.insert(std::make_pair(std::string("cim:PetersenCoil.nominalU"), &assign_PetersenCoil_nominalU)); assign_map.insert(std::make_pair(std::string("cim:PetersenCoil.offsetCurrent"), &assign_PetersenCoil_offsetCurrent)); @@ -129,13 +141,8 @@ void PetersenCoil::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PetersenCoil::debugName[] = "PetersenCoil"; -const char* PetersenCoil::debugString() +void PetersenCoil::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PetersenCoil::debugName; } const BaseClassDefiner PetersenCoil::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner PetersenCoil::declare() return BaseClassDefiner(PetersenCoil::addConstructToMap, PetersenCoil::addPrimitiveAssignFnsToMap, PetersenCoil::addClassAssignFnsToMap, PetersenCoil::debugName); } - +namespace CIMPP +{ + BaseClass* PetersenCoil_factory() + { + return new PetersenCoil; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PetersenCoil.hpp b/CGMES_2.4.15_16FEB2016/PetersenCoil.hpp index 4c22351bc..e4a3b7040 100644 --- a/CGMES_2.4.15_16FEB2016/PetersenCoil.hpp +++ b/CGMES_2.4.15_16FEB2016/PetersenCoil.hpp @@ -1,47 +1,48 @@ #ifndef PetersenCoil_H #define PetersenCoil_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EarthFaultCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PetersenCoilModeKind.hpp" -#include "Voltage.hpp" +#include "EarthFaultCompensator.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" +#include "PetersenCoilModeKind.hpp" #include "Reactance.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A tunable impedance device normally used to offset line charging during single line faults in an ungrounded section of network. */ - class PetersenCoil: public EarthFaultCompensator + class PetersenCoil : public EarthFaultCompensator { - public: - CIMPP::PetersenCoilModeKind mode; /* The mode of operation of the Petersen coil. Default: 0 */ - CIMPP::Voltage nominalU; /* The nominal voltage for which the coil is designed. Default: nullptr */ - CIMPP::CurrentFlow offsetCurrent; /* The offset current that the Petersen coil controller is operating from the resonant point. This is normally a fixed amount for which the controller is configured and could be positive or negative. Typically 0 to 60 Amperes depending on voltage and resonance conditions. Default: nullptr */ - CIMPP::CurrentFlow positionCurrent; /* The control current used to control the Petersen coil also known as the position current. Typically in the range of 20-200mA. Default: nullptr */ - CIMPP::Reactance xGroundMax; /* The maximum reactance. Default: nullptr */ - CIMPP::Reactance xGroundMin; /* The minimum reactance. Default: nullptr */ - CIMPP::Reactance xGroundNominal; /* The nominal reactance. This is the operating point (normally over compensation) that is defined based on the resonance point in the healthy network condition. The impedance is calculated based on nominal voltage divided by position current. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PetersenCoil(); - virtual ~PetersenCoil(); - + ~PetersenCoil() override; + + CIMPP::PetersenCoilModeKind mode; /* The mode of operation of the Petersen coil. Default: 0 */ + CIMPP::Voltage nominalU; /* The nominal voltage for which the coil is designed. Default: nullptr */ + CIMPP::CurrentFlow offsetCurrent; /* The offset current that the Petersen coil controller is operating from the resonant point. This is normally a fixed amount for which the controller is configured and could be positive or negative. Typically 0 to 60 Amperes depending on voltage and resonance conditions. Default: nullptr */ + CIMPP::CurrentFlow positionCurrent; /* The control current used to control the Petersen coil also known as the position current. Typically in the range of 20-200mA. Default: nullptr */ + CIMPP::Reactance xGroundMax; /* The maximum reactance. Default: nullptr */ + CIMPP::Reactance xGroundMin; /* The minimum reactance. Default: nullptr */ + CIMPP::Reactance xGroundNominal; /* The nominal reactance. This is the operating point (normally over compensation) that is defined based on the resonance point in the healthy network condition. The impedance is calculated based on nominal voltage divided by position current. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PetersenCoil_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.cpp b/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.cpp index 8f8096909..a2e6dcbf7 100644 --- a/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.cpp +++ b/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PetersenCoilModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::PetersenCoilModeKind& rop) +PetersenCoilModeKind& PetersenCoilModeKind::operator=(PetersenCoilModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +PetersenCoilModeKind::operator PetersenCoilModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char PetersenCoilModeKind::debugName[] = "PetersenCoilModeKind"; +const char* PetersenCoilModeKind::debugString() const +{ + return PetersenCoilModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PetersenCoilModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const PetersenCoilModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == PetersenCoilModeKind::fixed) + { + EnumSymbol = "fixed"; + } + if (obj.value == PetersenCoilModeKind::manual) + { + EnumSymbol = "manual"; + } + if (obj.value == PetersenCoilModeKind::automaticPositioning) + { + EnumSymbol = "automaticPositioning"; + } + + if (!EnumSymbol.empty()) + { + os << "PetersenCoilModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.hpp b/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.hpp index f1aac46cf..6bfff0ea0 100644 --- a/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.hpp +++ b/CGMES_2.4.15_16FEB2016/PetersenCoilModeKind.hpp @@ -1,25 +1,50 @@ #ifndef PetersenCoilModeKind_H #define PetersenCoilModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The mode of operation for a Petersen coil. */ - enum class PetersenCoilModeKind + class PetersenCoilModeKind { - /** - * Fixed position. - */ - fixed, - /** - * Manual positioning. - */ - manual, - /** - * Automatic positioning. - */ - automaticPositioning, + public: + enum PetersenCoilModeKind_ENUM + { + /** + * Fixed position. + */ + fixed, + /** + * Manual positioning. + */ + manual, + /** + * Automatic positioning. + */ + automaticPositioning, + }; + + PetersenCoilModeKind() : value(), initialized(false) {} + PetersenCoilModeKind(PetersenCoilModeKind_ENUM value) : value(value), initialized(true) {} + + PetersenCoilModeKind& operator=(PetersenCoilModeKind_ENUM rop); + operator PetersenCoilModeKind_ENUM() const; + + PetersenCoilModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, PetersenCoilModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const PetersenCoilModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::PetersenCoilModeKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/PhaseCode.cpp b/CGMES_2.4.15_16FEB2016/PhaseCode.cpp index b493c0a41..49aa040c7 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseCode.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseCode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseCode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::PhaseCode& rop) +PhaseCode& PhaseCode::operator=(PhaseCode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +PhaseCode::operator PhaseCode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char PhaseCode::debugName[] = "PhaseCode"; +const char* PhaseCode::debugString() const +{ + return PhaseCode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PhaseCode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -128,5 +159,103 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const PhaseCode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == PhaseCode::ABCN) + { + EnumSymbol = "ABCN"; + } + if (obj.value == PhaseCode::ABC) + { + EnumSymbol = "ABC"; + } + if (obj.value == PhaseCode::ABN) + { + EnumSymbol = "ABN"; + } + if (obj.value == PhaseCode::ACN) + { + EnumSymbol = "ACN"; + } + if (obj.value == PhaseCode::BCN) + { + EnumSymbol = "BCN"; + } + if (obj.value == PhaseCode::AB) + { + EnumSymbol = "AB"; + } + if (obj.value == PhaseCode::AC) + { + EnumSymbol = "AC"; + } + if (obj.value == PhaseCode::BC) + { + EnumSymbol = "BC"; + } + if (obj.value == PhaseCode::AN) + { + EnumSymbol = "AN"; + } + if (obj.value == PhaseCode::BN) + { + EnumSymbol = "BN"; + } + if (obj.value == PhaseCode::CN) + { + EnumSymbol = "CN"; + } + if (obj.value == PhaseCode::A) + { + EnumSymbol = "A"; + } + if (obj.value == PhaseCode::B) + { + EnumSymbol = "B"; + } + if (obj.value == PhaseCode::C) + { + EnumSymbol = "C"; + } + if (obj.value == PhaseCode::N) + { + EnumSymbol = "N"; + } + if (obj.value == PhaseCode::s1N) + { + EnumSymbol = "s1N"; + } + if (obj.value == PhaseCode::s2N) + { + EnumSymbol = "s2N"; + } + if (obj.value == PhaseCode::s12N) + { + EnumSymbol = "s12N"; + } + if (obj.value == PhaseCode::s1) + { + EnumSymbol = "s1"; + } + if (obj.value == PhaseCode::s2) + { + EnumSymbol = "s2"; + } + if (obj.value == PhaseCode::s12) + { + EnumSymbol = "s12"; + } + + if (!EnumSymbol.empty()) + { + os << "PhaseCode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseCode.hpp b/CGMES_2.4.15_16FEB2016/PhaseCode.hpp index 383677709..37a523ed2 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseCode.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseCode.hpp @@ -1,97 +1,122 @@ #ifndef PhaseCode_H #define PhaseCode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Enumeration of phase identifiers. Allows designation of phases for both transmission and distribution equipment, circuits and loads. Residential and small commercial loads are often served from single-phase, or split-phase, secondary circuits. For example of s12N, phases 1 and 2 refer to hot wires that are 180 degrees out of phase, while N refers to the neutral wire. Through single-phase transformer connections, these secondary circuits may be served from one or two of the primary phases A, B, and C. For three-phase loads, use the A, B, C phase codes instead of s12N. */ - enum class PhaseCode + class PhaseCode { - /** - * Phases A, B, C, and N. - */ - ABCN, - /** - * Phases A, B, and C. - */ - ABC, - /** - * Phases A, B, and neutral. - */ - ABN, - /** - * Phases A, C and neutral. - */ - ACN, - /** - * Phases B, C, and neutral. - */ - BCN, - /** - * Phases A and B. - */ - AB, - /** - * Phases A and C. - */ - AC, - /** - * Phases B and C. - */ - BC, - /** - * Phases A and neutral. - */ - AN, - /** - * Phases B and neutral. - */ - BN, - /** - * Phases C and neutral. - */ - CN, - /** - * Phase A. - */ - A, - /** - * Phase B. - */ - B, - /** - * Phase C. - */ - C, - /** - * Neutral phase. - */ - N, - /** - * Secondary phase 1 and neutral. - */ - s1N, - /** - * Secondary phase 2 and neutral. - */ - s2N, - /** - * Secondary phases 1, 2, and neutral. - */ - s12N, - /** - * Secondary phase 1. - */ - s1, - /** - * Secondary phase 2. - */ - s2, - /** - * Secondary phase 1 and 2. - */ - s12, + public: + enum PhaseCode_ENUM + { + /** + * Phases A, B, C, and N. + */ + ABCN, + /** + * Phases A, B, and C. + */ + ABC, + /** + * Phases A, B, and neutral. + */ + ABN, + /** + * Phases A, C and neutral. + */ + ACN, + /** + * Phases B, C, and neutral. + */ + BCN, + /** + * Phases A and B. + */ + AB, + /** + * Phases A and C. + */ + AC, + /** + * Phases B and C. + */ + BC, + /** + * Phases A and neutral. + */ + AN, + /** + * Phases B and neutral. + */ + BN, + /** + * Phases C and neutral. + */ + CN, + /** + * Phase A. + */ + A, + /** + * Phase B. + */ + B, + /** + * Phase C. + */ + C, + /** + * Neutral phase. + */ + N, + /** + * Secondary phase 1 and neutral. + */ + s1N, + /** + * Secondary phase 2 and neutral. + */ + s2N, + /** + * Secondary phases 1, 2, and neutral. + */ + s12N, + /** + * Secondary phase 1. + */ + s1, + /** + * Secondary phase 2. + */ + s2, + /** + * Secondary phase 1 and 2. + */ + s12, + }; + + PhaseCode() : value(), initialized(false) {} + PhaseCode(PhaseCode_ENUM value) : value(value), initialized(true) {} + + PhaseCode& operator=(PhaseCode_ENUM rop); + operator PhaseCode_ENUM() const; + + PhaseCode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, PhaseCode& rop); + friend std::ostream& operator<<(std::ostream& os, const PhaseCode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::PhaseCode& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChanger.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChanger.cpp index cbfac61df..709d1c4c2 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChanger.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChanger.cpp @@ -1,49 +1,56 @@ -#include -#include "TapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChanger.hpp" +#include +#include + #include "TransformerEnd.hpp" using namespace CIMPP; -PhaseTapChanger::PhaseTapChanger(): TransformerEnd(nullptr) {}; - +PhaseTapChanger::PhaseTapChanger() : TransformerEnd(nullptr) {}; PhaseTapChanger::~PhaseTapChanger() {}; -bool assign_TransformerEnd_PhaseTapChanger(BaseClass*, BaseClass*); -bool assign_PhaseTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->TransformerEnd = dynamic_cast(BaseClass_ptr2); - if(element->TransformerEnd != nullptr) - return assign_TransformerEnd_PhaseTapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* PhaseTapChanger_factory() { - return new PhaseTapChanger; +bool assign_TransformerEnd_PhaseTapChanger(BaseClass*, BaseClass*); +bool assign_PhaseTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChanger* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TransformerEnd != element2) + { + element->TransformerEnd = element2; + return assign_TransformerEnd_PhaseTapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PhaseTapChanger::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PhaseTapChanger"), &PhaseTapChanger_factory)); +const char PhaseTapChanger::debugName[] = "PhaseTapChanger"; +const char* PhaseTapChanger::debugString() const +{ + return PhaseTapChanger::debugName; } -void PhaseTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PhaseTapChanger::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PhaseTapChanger"), &PhaseTapChanger_factory)); +} -void PhaseTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChanger.TransformerEnd"), &assign_PhaseTapChanger_TransformerEnd)); +void PhaseTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChanger::debugName[] = "PhaseTapChanger"; -const char* PhaseTapChanger::debugString() +void PhaseTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChanger::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChanger.TransformerEnd"), &assign_PhaseTapChanger_TransformerEnd)); } const BaseClassDefiner PhaseTapChanger::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner PhaseTapChanger::declare() return BaseClassDefiner(PhaseTapChanger::addConstructToMap, PhaseTapChanger::addPrimitiveAssignFnsToMap, PhaseTapChanger::addClassAssignFnsToMap, PhaseTapChanger::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChanger_factory() + { + return new PhaseTapChanger; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChanger.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChanger.hpp index 5d806868e..0fef3584e 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChanger.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChanger.hpp @@ -1,38 +1,39 @@ #ifndef PhaseTapChanger_H #define PhaseTapChanger_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "TapChanger.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TransformerEnd; -class TransformerEnd; /* A transformer phase shifting tap model that controls the phase angle difference across the power transformer and potentially the active power flow through the power transformer. This phase tap model may also impact the voltage magnitude. */ - class PhaseTapChanger: public TapChanger + class PhaseTapChanger : public TapChanger { - public: - CIMPP::TransformerEnd* TransformerEnd; /* Phase tap changer associated with this transformer end. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChanger(); - virtual ~PhaseTapChanger(); - + ~PhaseTapChanger() override; + + CIMPP::TransformerEnd* TransformerEnd; /* Phase tap changer associated with this transformer end. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChanger_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.cpp index ef9f2ab24..d56507fe1 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.cpp @@ -1,51 +1,52 @@ -#include -#include "PhaseTapChangerNonLinear.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerAsymmetrical.hpp" +#include +#include + #include "AngleDegrees.hpp" using namespace CIMPP; PhaseTapChangerAsymmetrical::PhaseTapChangerAsymmetrical() {}; - PhaseTapChangerAsymmetrical::~PhaseTapChangerAsymmetrical() {}; +bool assign_PhaseTapChangerAsymmetrical_windingConnectionAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerAsymmetrical* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windingConnectionAngle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerAsymmetrical_windingConnectionAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerAsymmetrical* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windingConnectionAngle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PhaseTapChangerAsymmetrical_factory() { - return new PhaseTapChangerAsymmetrical; - } +const char PhaseTapChangerAsymmetrical::debugName[] = "PhaseTapChangerAsymmetrical"; +const char* PhaseTapChangerAsymmetrical::debugString() const +{ + return PhaseTapChangerAsymmetrical::debugName; } -void PhaseTapChangerAsymmetrical::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerAsymmetrical::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerAsymmetrical"), &PhaseTapChangerAsymmetrical_factory)); } -void PhaseTapChangerAsymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerAsymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerAsymmetrical.windingConnectionAngle"), &assign_PhaseTapChangerAsymmetrical_windingConnectionAngle)); } -void PhaseTapChangerAsymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PhaseTapChangerAsymmetrical::debugName[] = "PhaseTapChangerAsymmetrical"; -const char* PhaseTapChangerAsymmetrical::debugString() +void PhaseTapChangerAsymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerAsymmetrical::debugName; } const BaseClassDefiner PhaseTapChangerAsymmetrical::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner PhaseTapChangerAsymmetrical::declare() return BaseClassDefiner(PhaseTapChangerAsymmetrical::addConstructToMap, PhaseTapChangerAsymmetrical::addPrimitiveAssignFnsToMap, PhaseTapChangerAsymmetrical::addClassAssignFnsToMap, PhaseTapChangerAsymmetrical::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerAsymmetrical_factory() + { + return new PhaseTapChangerAsymmetrical; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.hpp index 6e2cbfdff..1b341e379 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerAsymmetrical.hpp @@ -1,38 +1,39 @@ #ifndef PhaseTapChangerAsymmetrical_H #define PhaseTapChangerAsymmetrical_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChangerNonLinear.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PhaseTapChangerNonLinear.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Describes the tap model for an asymmetrical phase shifting transformer in which the difference voltage vector adds to the primary side voltage. The angle between the primary side voltage and the difference voltage is named the winding connection angle. The phase shift depends on both the difference voltage magnitude and the winding connection angle. */ - class PhaseTapChangerAsymmetrical: public PhaseTapChangerNonLinear + class PhaseTapChangerAsymmetrical : public PhaseTapChangerNonLinear { - public: - CIMPP::AngleDegrees windingConnectionAngle; /* The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. The out-of-phase winding produces what is known as the difference voltage. Setting this angle to 90 degrees is not the same as a symmemtrical transformer. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerAsymmetrical(); - virtual ~PhaseTapChangerAsymmetrical(); - + ~PhaseTapChangerAsymmetrical() override; + + CIMPP::AngleDegrees windingConnectionAngle; /* The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. The out-of-phase winding produces what is known as the difference voltage. Setting this angle to 90 degrees is not the same as a symmemtrical transformer. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerAsymmetrical_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.cpp index e098e2fbf..aebc14b4b 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.cpp @@ -1,7 +1,11 @@ -#include -#include "PhaseTapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerLinear.hpp" +#include +#include + #include "AngleDegrees.hpp" #include "Reactance.hpp" #include "Reactance.hpp" @@ -9,73 +13,72 @@ using namespace CIMPP; PhaseTapChangerLinear::PhaseTapChangerLinear() {}; - PhaseTapChangerLinear::~PhaseTapChangerLinear() {}; +bool assign_PhaseTapChangerLinear_stepPhaseShiftIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->stepPhaseShiftIncrement; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerLinear_stepPhaseShiftIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->stepPhaseShiftIncrement; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PhaseTapChangerLinear_factory() { - return new PhaseTapChangerLinear; - } +const char PhaseTapChangerLinear::debugName[] = "PhaseTapChangerLinear"; +const char* PhaseTapChangerLinear::debugString() const +{ + return PhaseTapChangerLinear::debugName; } -void PhaseTapChangerLinear::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerLinear::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear"), &PhaseTapChangerLinear_factory)); } -void PhaseTapChangerLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear.stepPhaseShiftIncrement"), &assign_PhaseTapChangerLinear_stepPhaseShiftIncrement)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear.xMax"), &assign_PhaseTapChangerLinear_xMax)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear.xMin"), &assign_PhaseTapChangerLinear_xMin)); } -void PhaseTapChangerLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PhaseTapChangerLinear::debugName[] = "PhaseTapChangerLinear"; -const char* PhaseTapChangerLinear::debugString() +void PhaseTapChangerLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerLinear::debugName; } const BaseClassDefiner PhaseTapChangerLinear::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner PhaseTapChangerLinear::declare() return BaseClassDefiner(PhaseTapChangerLinear::addConstructToMap, PhaseTapChangerLinear::addPrimitiveAssignFnsToMap, PhaseTapChangerLinear::addClassAssignFnsToMap, PhaseTapChangerLinear::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerLinear_factory() + { + return new PhaseTapChangerLinear; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.hpp index f53e2f1dc..8efa03f19 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerLinear.hpp @@ -1,41 +1,42 @@ #ifndef PhaseTapChangerLinear_H #define PhaseTapChangerLinear_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PhaseTapChanger.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Reactance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Describes a tap changer with a linear relation between the tap step and the phase angle difference across the transformer. This is a mathematical model that is an approximation of a real phase tap changer. The phase angle is computed as stepPhaseShitfIncrement times the tap position. The secondary side voltage magnitude is the same as at the primary side. */ - class PhaseTapChangerLinear: public PhaseTapChanger + class PhaseTapChangerLinear : public PhaseTapChanger { - public: - CIMPP::AngleDegrees stepPhaseShiftIncrement; /* Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. Default: nullptr */ - CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ - CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerLinear(); - virtual ~PhaseTapChangerLinear(); - + ~PhaseTapChangerLinear() override; + + CIMPP::AngleDegrees stepPhaseShiftIncrement; /* Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. Default: nullptr */ + CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ + CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerLinear_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.cpp index 321bcc079..10a2c21f0 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.cpp @@ -1,7 +1,11 @@ -#include -#include "PhaseTapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerNonLinear.hpp" +#include +#include + #include "PerCent.hpp" #include "Reactance.hpp" #include "Reactance.hpp" @@ -9,73 +13,72 @@ using namespace CIMPP; PhaseTapChangerNonLinear::PhaseTapChangerNonLinear() {}; - PhaseTapChangerNonLinear::~PhaseTapChangerNonLinear() {}; +bool assign_PhaseTapChangerNonLinear_voltageStepIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageStepIncrement; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerNonLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerNonLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerNonLinear_voltageStepIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageStepIncrement; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerNonLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerNonLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PhaseTapChangerNonLinear_factory() { - return new PhaseTapChangerNonLinear; - } +const char PhaseTapChangerNonLinear::debugName[] = "PhaseTapChangerNonLinear"; +const char* PhaseTapChangerNonLinear::debugString() const +{ + return PhaseTapChangerNonLinear::debugName; } -void PhaseTapChangerNonLinear::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerNonLinear::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear"), &PhaseTapChangerNonLinear_factory)); } -void PhaseTapChangerNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear.voltageStepIncrement"), &assign_PhaseTapChangerNonLinear_voltageStepIncrement)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear.xMax"), &assign_PhaseTapChangerNonLinear_xMax)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear.xMin"), &assign_PhaseTapChangerNonLinear_xMin)); } -void PhaseTapChangerNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PhaseTapChangerNonLinear::debugName[] = "PhaseTapChangerNonLinear"; -const char* PhaseTapChangerNonLinear::debugString() +void PhaseTapChangerNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerNonLinear::debugName; } const BaseClassDefiner PhaseTapChangerNonLinear::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner PhaseTapChangerNonLinear::declare() return BaseClassDefiner(PhaseTapChangerNonLinear::addConstructToMap, PhaseTapChangerNonLinear::addPrimitiveAssignFnsToMap, PhaseTapChangerNonLinear::addClassAssignFnsToMap, PhaseTapChangerNonLinear::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerNonLinear_factory() + { + return new PhaseTapChangerNonLinear; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.hpp index 49fd4efa1..6b220652b 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerNonLinear.hpp @@ -1,41 +1,42 @@ #ifndef PhaseTapChangerNonLinear_H #define PhaseTapChangerNonLinear_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PhaseTapChanger.hpp" +#include "BaseClassDefiner.hpp" #include "PerCent.hpp" #include "Reactance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The non-linear phase tap changer describes the non-linear behavior of a phase tap changer. This is a base class for the symmetrical and asymmetrical phase tap changer models. The details of these models can be found in the IEC 61970-301 document. */ - class PhaseTapChangerNonLinear: public PhaseTapChanger + class PhaseTapChangerNonLinear : public PhaseTapChanger { - public: - CIMPP::PerCent voltageStepIncrement; /* The voltage step increment on the out of phase winding specified in percent of nominal voltage of the transformer end. Default: nullptr */ - CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ - CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerNonLinear(); - virtual ~PhaseTapChangerNonLinear(); - + ~PhaseTapChangerNonLinear() override; + + CIMPP::PerCent voltageStepIncrement; /* The voltage step increment on the out of phase winding specified in percent of nominal voltage of the transformer end. Default: nullptr */ + CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ + CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerNonLinear_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.cpp index 28464b003..349239582 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.cpp @@ -1,36 +1,36 @@ -#include -#include "PhaseTapChangerNonLinear.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerSymmetrical.hpp" +#include +#include + using namespace CIMPP; PhaseTapChangerSymmetrical::PhaseTapChangerSymmetrical() {}; - PhaseTapChangerSymmetrical::~PhaseTapChangerSymmetrical() {}; -namespace CIMPP { - BaseClass* PhaseTapChangerSymmetrical_factory() { - return new PhaseTapChangerSymmetrical; - } +const char PhaseTapChangerSymmetrical::debugName[] = "PhaseTapChangerSymmetrical"; +const char* PhaseTapChangerSymmetrical::debugString() const +{ + return PhaseTapChangerSymmetrical::debugName; } -void PhaseTapChangerSymmetrical::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerSymmetrical::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerSymmetrical"), &PhaseTapChangerSymmetrical_factory)); } -void PhaseTapChangerSymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void PhaseTapChangerSymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerSymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChangerSymmetrical::debugName[] = "PhaseTapChangerSymmetrical"; -const char* PhaseTapChangerSymmetrical::debugString() +void PhaseTapChangerSymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerSymmetrical::debugName; } const BaseClassDefiner PhaseTapChangerSymmetrical::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner PhaseTapChangerSymmetrical::declare() return BaseClassDefiner(PhaseTapChangerSymmetrical::addConstructToMap, PhaseTapChangerSymmetrical::addPrimitiveAssignFnsToMap, PhaseTapChangerSymmetrical::addClassAssignFnsToMap, PhaseTapChangerSymmetrical::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerSymmetrical_factory() + { + return new PhaseTapChangerSymmetrical; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.hpp index 91be9c6f2..613a8040d 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerSymmetrical.hpp @@ -1,36 +1,37 @@ #ifndef PhaseTapChangerSymmetrical_H #define PhaseTapChangerSymmetrical_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChangerNonLinear.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "PhaseTapChangerNonLinear.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Describes a symmetrical phase shifting transformer tap model in which the secondary side voltage magnitude is the same as at the primary side. The difference voltage magnitude is the base in an equal-sided triangle where the sides corresponds to the primary and secondary voltages. The phase angle difference corresponds to the top angle and can be expressed as twice the arctangent of half the total difference voltage. */ - class PhaseTapChangerSymmetrical: public PhaseTapChangerNonLinear + class PhaseTapChangerSymmetrical : public PhaseTapChangerNonLinear { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerSymmetrical(); - virtual ~PhaseTapChangerSymmetrical(); - + ~PhaseTapChangerSymmetrical() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerSymmetrical_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.cpp index 178b12a8d..e47a0b148 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerTable.hpp" +#include +#include + #include "PhaseTapChangerTablePoint.hpp" #include "PhaseTapChangerTabular.hpp" using namespace CIMPP; PhaseTapChangerTable::PhaseTapChangerTable() {}; - PhaseTapChangerTable::~PhaseTapChangerTable() {}; -bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PhaseTapChangerTablePoint.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTablePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PhaseTapChangerTablePoint.begin(), element->PhaseTapChangerTablePoint.end(), element2) == element->PhaseTapChangerTablePoint.end()) + { + element->PhaseTapChangerTablePoint.push_back(element2); + return assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PhaseTapChangerTabular.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTabular* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PhaseTapChangerTabular.begin(), element->PhaseTapChangerTabular.end(), element2) == element->PhaseTapChangerTabular.end()) + { + element->PhaseTapChangerTabular.push_back(element2); + return assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* PhaseTapChangerTable_factory() { - return new PhaseTapChangerTable; - } +const char PhaseTapChangerTable::debugName[] = "PhaseTapChangerTable"; +const char* PhaseTapChangerTable::debugString() const +{ + return PhaseTapChangerTable::debugName; } -void PhaseTapChangerTable::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerTable::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable"), &PhaseTapChangerTable_factory)); } -void PhaseTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PhaseTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTablePoint"), &assign_PhaseTapChangerTable_PhaseTapChangerTablePoint)); - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTabular"), &assign_PhaseTapChangerTable_PhaseTapChangerTabular)); +void PhaseTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChangerTable::debugName[] = "PhaseTapChangerTable"; -const char* PhaseTapChangerTable::debugString() +void PhaseTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerTable::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTablePoint"), &assign_PhaseTapChangerTable_PhaseTapChangerTablePoint)); + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTabular"), &assign_PhaseTapChangerTable_PhaseTapChangerTabular)); } const BaseClassDefiner PhaseTapChangerTable::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner PhaseTapChangerTable::declare() return BaseClassDefiner(PhaseTapChangerTable::addConstructToMap, PhaseTapChangerTable::addPrimitiveAssignFnsToMap, PhaseTapChangerTable::addClassAssignFnsToMap, PhaseTapChangerTable::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerTable_factory() + { + return new PhaseTapChangerTable; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.hpp index 32dc55135..7db6e7ccd 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTable.hpp @@ -1,40 +1,41 @@ #ifndef PhaseTapChangerTable_H #define PhaseTapChangerTable_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class PhaseTapChangerTablePoint; + class PhaseTapChangerTabular; -class PhaseTapChangerTablePoint; -class PhaseTapChangerTabular; /* Describes a tabular curve for how the phase angle difference and impedance varies with the tap step. */ - class PhaseTapChangerTable: public IdentifiedObject + class PhaseTapChangerTable : public IdentifiedObject { - public: - std::list PhaseTapChangerTablePoint; /* The points of this table. Default: 0 */ - std::list PhaseTapChangerTabular; /* The phase tap changers to which this phase tap table applies. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerTable(); - virtual ~PhaseTapChangerTable(); - + ~PhaseTapChangerTable() override; + + std::list PhaseTapChangerTablePoint; /* The points of this table. Default: 0 */ + std::list PhaseTapChangerTabular; /* The phase tap changers to which this phase tap table applies. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerTable_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.cpp index 74cf98a22..ac94e617a 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.cpp @@ -1,64 +1,72 @@ -#include -#include "TapChangerTablePoint.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerTablePoint.hpp" -#include "AngleDegrees.hpp" +#include +#include + #include "PhaseTapChangerTable.hpp" +#include "AngleDegrees.hpp" using namespace CIMPP; -PhaseTapChangerTablePoint::PhaseTapChangerTablePoint(): PhaseTapChangerTable(nullptr) {}; - +PhaseTapChangerTablePoint::PhaseTapChangerTablePoint() : PhaseTapChangerTable(nullptr) {}; PhaseTapChangerTablePoint::~PhaseTapChangerTablePoint() {}; -bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass*, BaseClass*); -bool assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->PhaseTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->PhaseTapChangerTable != nullptr) - return assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PhaseTapChangerTablePoint_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->angle; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PhaseTapChangerTablePoint_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->angle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PhaseTapChangerTable != element2) + { + element->PhaseTapChangerTable = element2; + return assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PhaseTapChangerTablePoint_factory() { - return new PhaseTapChangerTablePoint; - } +const char PhaseTapChangerTablePoint::debugName[] = "PhaseTapChangerTablePoint"; +const char* PhaseTapChangerTablePoint::debugString() const +{ + return PhaseTapChangerTablePoint::debugName; } -void PhaseTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint"), &PhaseTapChangerTablePoint_factory)); } -void PhaseTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.angle"), &assign_PhaseTapChangerTablePoint_angle)); - } - -void PhaseTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.PhaseTapChangerTable"), &assign_PhaseTapChangerTablePoint_PhaseTapChangerTable)); } -const char PhaseTapChangerTablePoint::debugName[] = "PhaseTapChangerTablePoint"; -const char* PhaseTapChangerTablePoint::debugString() +void PhaseTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerTablePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.PhaseTapChangerTable"), &assign_PhaseTapChangerTablePoint_PhaseTapChangerTable)); } const BaseClassDefiner PhaseTapChangerTablePoint::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PhaseTapChangerTablePoint::declare() return BaseClassDefiner(PhaseTapChangerTablePoint::addConstructToMap, PhaseTapChangerTablePoint::addPrimitiveAssignFnsToMap, PhaseTapChangerTablePoint::addClassAssignFnsToMap, PhaseTapChangerTablePoint::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerTablePoint_factory() + { + return new PhaseTapChangerTablePoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.hpp index 74899da06..1b17e183c 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTablePoint.hpp @@ -1,40 +1,41 @@ #ifndef PhaseTapChangerTablePoint_H #define PhaseTapChangerTablePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChangerTablePoint.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TapChangerTablePoint.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -namespace CIMPP { +namespace CIMPP +{ + class PhaseTapChangerTable; - -class PhaseTapChangerTable; /* Describes each tap step in the phase tap changer tabular curve. */ - class PhaseTapChangerTablePoint: public TapChangerTablePoint + class PhaseTapChangerTablePoint : public TapChangerTablePoint { - public: - CIMPP::AngleDegrees angle; /* The angle difference in degrees. Default: nullptr */ - CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The table of this point. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerTablePoint(); - virtual ~PhaseTapChangerTablePoint(); - + ~PhaseTapChangerTablePoint() override; + + CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The table of this point. Default: 0 */ + CIMPP::AngleDegrees angle; /* The angle difference in degrees. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerTablePoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.cpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.cpp index af16ab19d..a270307cc 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.cpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.cpp @@ -1,49 +1,56 @@ -#include -#include "PhaseTapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerTabular.hpp" +#include +#include + #include "PhaseTapChangerTable.hpp" using namespace CIMPP; -PhaseTapChangerTabular::PhaseTapChangerTabular(): PhaseTapChangerTable(nullptr) {}; - +PhaseTapChangerTabular::PhaseTapChangerTabular() : PhaseTapChangerTable(nullptr) {}; PhaseTapChangerTabular::~PhaseTapChangerTabular() {}; -bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass*, BaseClass*); -bool assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTabular* element = dynamic_cast(BaseClass_ptr1)) { - element->PhaseTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->PhaseTapChangerTable != nullptr) - return assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* PhaseTapChangerTabular_factory() { - return new PhaseTapChangerTabular; +bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTabular* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PhaseTapChangerTable != element2) + { + element->PhaseTapChangerTable = element2; + return assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PhaseTapChangerTabular::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular"), &PhaseTapChangerTabular_factory)); +const char PhaseTapChangerTabular::debugName[] = "PhaseTapChangerTabular"; +const char* PhaseTapChangerTabular::debugString() const +{ + return PhaseTapChangerTabular::debugName; } -void PhaseTapChangerTabular::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PhaseTapChangerTabular::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular"), &PhaseTapChangerTabular_factory)); +} -void PhaseTapChangerTabular::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular.PhaseTapChangerTable"), &assign_PhaseTapChangerTabular_PhaseTapChangerTable)); +void PhaseTapChangerTabular::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChangerTabular::debugName[] = "PhaseTapChangerTabular"; -const char* PhaseTapChangerTabular::debugString() +void PhaseTapChangerTabular::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerTabular::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular.PhaseTapChangerTable"), &assign_PhaseTapChangerTabular_PhaseTapChangerTable)); } const BaseClassDefiner PhaseTapChangerTabular::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner PhaseTapChangerTabular::declare() return BaseClassDefiner(PhaseTapChangerTabular::addConstructToMap, PhaseTapChangerTabular::addPrimitiveAssignFnsToMap, PhaseTapChangerTabular::addClassAssignFnsToMap, PhaseTapChangerTabular::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerTabular_factory() + { + return new PhaseTapChangerTabular; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.hpp b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.hpp index 8fe254b92..cbcc23f91 100644 --- a/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.hpp +++ b/CGMES_2.4.15_16FEB2016/PhaseTapChangerTabular.hpp @@ -1,38 +1,36 @@ #ifndef PhaseTapChangerTabular_H #define PhaseTapChangerTabular_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "PhaseTapChanger.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class PhaseTapChangerTable; -class PhaseTapChangerTable; - /* - - */ - class PhaseTapChangerTabular: public PhaseTapChanger + class PhaseTapChangerTabular : public PhaseTapChanger { - public: - CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The phase tap changer table for this phase tap changer. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerTabular(); - virtual ~PhaseTapChangerTabular(); - + ~PhaseTapChangerTabular() override; + + CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The phase tap changer table for this phase tap changer. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerTabular_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PositionPoint.cpp b/CGMES_2.4.15_16FEB2016/PositionPoint.cpp index 5bf0de0ad..541093398 100644 --- a/CGMES_2.4.15_16FEB2016/PositionPoint.cpp +++ b/CGMES_2.4.15_16FEB2016/PositionPoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PositionPoint.hpp" +#include +#include + #include "Location.hpp" #include "Integer.hpp" #include "String.hpp" @@ -10,43 +14,30 @@ using namespace CIMPP; -PositionPoint::PositionPoint(): Location(nullptr) {}; - +PositionPoint::PositionPoint() : Location(nullptr) {}; PositionPoint::~PositionPoint() {}; -bool assign_Location_PositionPoints(BaseClass*, BaseClass*); -bool assign_PositionPoint_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->Location = dynamic_cast(BaseClass_ptr2); - if(element->Location != nullptr) - return assign_Location_PositionPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - - - - -bool assign_PositionPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PositionPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PositionPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_PositionPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { element->xPosition = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -54,10 +45,12 @@ bool assign_PositionPoint_xPosition(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_PositionPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_PositionPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { element->yPosition = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -65,10 +58,12 @@ bool assign_PositionPoint_yPosition(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_PositionPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_PositionPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { element->zPosition = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -76,31 +71,50 @@ bool assign_PositionPoint_zPosition(std::stringstream &buffer, BaseClass* BaseCl return false; } -namespace CIMPP { - BaseClass* PositionPoint_factory() { - return new PositionPoint; + +bool assign_Location_PositionPoints(BaseClass*, BaseClass*); +bool assign_PositionPoint_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PositionPoint* element = dynamic_cast(BaseClass_ptr1); + Location* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Location != element2) + { + element->Location = element2; + return assign_Location_PositionPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + +const char PositionPoint::debugName[] = "PositionPoint"; +const char* PositionPoint::debugString() const +{ + return PositionPoint::debugName; } -void PositionPoint::addConstructToMap(std::unordered_map& factory_map) { +void PositionPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PositionPoint"), &PositionPoint_factory)); } -void PositionPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PositionPoint.sequenceNumber"), &assign_PositionPoint_sequenceNumber)); +void PositionPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PositionPoint.sequenceNumber"), &assign_PositionPoint_sequenceNumber)); assign_map.insert(std::make_pair(std::string("cim:PositionPoint.xPosition"), &assign_PositionPoint_xPosition)); assign_map.insert(std::make_pair(std::string("cim:PositionPoint.yPosition"), &assign_PositionPoint_yPosition)); assign_map.insert(std::make_pair(std::string("cim:PositionPoint.zPosition"), &assign_PositionPoint_zPosition)); } -void PositionPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PositionPoint.Location"), &assign_PositionPoint_Location)); - } - -const char PositionPoint::debugName[] = "PositionPoint"; -const char* PositionPoint::debugString() +void PositionPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PositionPoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:PositionPoint.Location"), &assign_PositionPoint_Location)); } const BaseClassDefiner PositionPoint::declare() @@ -108,4 +122,10 @@ const BaseClassDefiner PositionPoint::declare() return BaseClassDefiner(PositionPoint::addConstructToMap, PositionPoint::addPrimitiveAssignFnsToMap, PositionPoint::addClassAssignFnsToMap, PositionPoint::debugName); } - +namespace CIMPP +{ + BaseClass* PositionPoint_factory() + { + return new PositionPoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PositionPoint.hpp b/CGMES_2.4.15_16FEB2016/PositionPoint.hpp index f21450531..47dcc5897 100644 --- a/CGMES_2.4.15_16FEB2016/PositionPoint.hpp +++ b/CGMES_2.4.15_16FEB2016/PositionPoint.hpp @@ -1,44 +1,45 @@ #ifndef PositionPoint_H #define PositionPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Location; - -class Location; /* Set of spatial coordinates that determine a point, defined in the coordinate system specified in 'Location.CoordinateSystem'. Use a single position point instance to desribe a point-oriented location. Use a sequence of position points to describe a line-oriented object (physical location of non-point oriented objects like cables or lines), or area of an object (like a substation or a geographical zone - in this case, have first and last position point with the same values). */ - class PositionPoint: public BaseClass + class PositionPoint : public BaseClass { - public: - CIMPP::Location* Location; /* Location described by this position point. Default: 0 */ - CIMPP::Integer sequenceNumber; /* Zero-relative sequence number of this point within a series of points. Default: 0 */ - CIMPP::String xPosition; /* X axis position. Default: '' */ - CIMPP::String yPosition; /* Y axis position. Default: '' */ - CIMPP::String zPosition; /* (if applicable) Z axis position. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PositionPoint(); - virtual ~PositionPoint(); - + ~PositionPoint() override; + + CIMPP::Location* Location; /* Location described by this position point. Default: 0 */ + CIMPP::Integer sequenceNumber; /* Zero-relative sequence number of this point within a series of points. Default: 0 */ + CIMPP::String xPosition; /* X axis position. Default: '' */ + CIMPP::String yPosition; /* Y axis position. Default: '' */ + CIMPP::String zPosition; /* (if applicable) Z axis position. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PositionPoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PowerSystemResource.cpp b/CGMES_2.4.15_16FEB2016/PowerSystemResource.cpp index 7813a9ce7..26147d3d1 100644 --- a/CGMES_2.4.15_16FEB2016/PowerSystemResource.cpp +++ b/CGMES_2.4.15_16FEB2016/PowerSystemResource.cpp @@ -1,74 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerSystemResource.hpp" +#include +#include + #include "Control.hpp" -#include "Measurement.hpp" #include "Location.hpp" +#include "Measurement.hpp" using namespace CIMPP; -PowerSystemResource::PowerSystemResource(): Location(nullptr) {}; - +PowerSystemResource::PowerSystemResource() : Location(nullptr) {}; PowerSystemResource::~PowerSystemResource() {}; -bool assign_PowerSystemResource_Controls(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemResource* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Controls.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_Control_PowerSystemResource(BaseClass*, BaseClass*); +bool assign_PowerSystemResource_Controls(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemResource* element = dynamic_cast(BaseClass_ptr1); + Control* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Controls.begin(), element->Controls.end(), element2) == element->Controls.end()) + { + element->Controls.push_back(element2); + return assign_Control_PowerSystemResource(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_PowerSystemResource_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemResource* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Location_PowerSystemResources(BaseClass*, BaseClass*); +bool assign_PowerSystemResource_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemResource* element = dynamic_cast(BaseClass_ptr1); + Location* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Location != element2) + { + element->Location = element2; + return assign_Location_PowerSystemResources(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_PowerSystemResource_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemResource* element = dynamic_cast(BaseClass_ptr1)) { - element->Location = dynamic_cast(BaseClass_ptr2); - if(element->Location != nullptr) - return true; - } - return false; +bool assign_Measurement_PowerSystemResource(BaseClass*, BaseClass*); +bool assign_PowerSystemResource_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemResource* element = dynamic_cast(BaseClass_ptr1); + Measurement* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Measurement_PowerSystemResource(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* PowerSystemResource_factory() { - return new PowerSystemResource; - } +const char PowerSystemResource::debugName[] = "PowerSystemResource"; +const char* PowerSystemResource::debugString() const +{ + return PowerSystemResource::debugName; } -void PowerSystemResource::addConstructToMap(std::unordered_map& factory_map) { +void PowerSystemResource::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerSystemResource"), &PowerSystemResource_factory)); } -void PowerSystemResource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PowerSystemResource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Controls"), &assign_PowerSystemResource_Controls)); - assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Measurements"), &assign_PowerSystemResource_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Location"), &assign_PowerSystemResource_Location)); +void PowerSystemResource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PowerSystemResource::debugName[] = "PowerSystemResource"; -const char* PowerSystemResource::debugString() +void PowerSystemResource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerSystemResource::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Controls"), &assign_PowerSystemResource_Controls)); + assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Location"), &assign_PowerSystemResource_Location)); + assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Measurements"), &assign_PowerSystemResource_Measurements)); } const BaseClassDefiner PowerSystemResource::declare() @@ -76,4 +98,10 @@ const BaseClassDefiner PowerSystemResource::declare() return BaseClassDefiner(PowerSystemResource::addConstructToMap, PowerSystemResource::addPrimitiveAssignFnsToMap, PowerSystemResource::addClassAssignFnsToMap, PowerSystemResource::debugName); } - +namespace CIMPP +{ + BaseClass* PowerSystemResource_factory() + { + return new PowerSystemResource; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PowerSystemResource.hpp b/CGMES_2.4.15_16FEB2016/PowerSystemResource.hpp index 68db537eb..2982f8905 100644 --- a/CGMES_2.4.15_16FEB2016/PowerSystemResource.hpp +++ b/CGMES_2.4.15_16FEB2016/PowerSystemResource.hpp @@ -1,42 +1,43 @@ #ifndef PowerSystemResource_H #define PowerSystemResource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Control; + class Location; + class Measurement; -class Control; -class Measurement; -class Location; /* A power system resource can be an item of equipment such as a switch, an equipment container containing many individual items of equipment such as a substation, or an organisational entity such as sub-control area. Power system resources can have measurements associated. */ - class PowerSystemResource: public IdentifiedObject + class PowerSystemResource : public IdentifiedObject { - public: - std::list Controls; /* Regulating device governed by this control output. Default: 0 */ - std::list Measurements; /* The power system resource that contains the measurement. Default: 0 */ - CIMPP::Location* Location; /* Location of this power system resource. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerSystemResource(); - virtual ~PowerSystemResource(); - + ~PowerSystemResource() override; + + std::list Controls; /* Regulating device governed by this control output. Default: 0 */ + CIMPP::Location* Location; /* Location of this power system resource. Default: 0 */ + std::list Measurements; /* The power system resource that contains the measurement. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerSystemResource_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.cpp b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.cpp index 50a9bce48..11444bd4f 100644 --- a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerSystemStabilizerDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -PowerSystemStabilizerDynamics::PowerSystemStabilizerDynamics(): ExcitationSystemDynamics(nullptr) {}; - +PowerSystemStabilizerDynamics::PowerSystemStabilizerDynamics() : ExcitationSystemDynamics(nullptr) {}; PowerSystemStabilizerDynamics::~PowerSystemStabilizerDynamics() {}; -bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RemoteInputSignal.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass*, BaseClass*); +bool assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass*, BaseClass*); -bool assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass*, BaseClass*); +bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RemoteInputSignal.begin(), element->RemoteInputSignal.end(), element2) == element->RemoteInputSignal.end()) + { + element->RemoteInputSignal.push_back(element2); + return assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* PowerSystemStabilizerDynamics_factory() { - return new PowerSystemStabilizerDynamics; - } +const char PowerSystemStabilizerDynamics::debugName[] = "PowerSystemStabilizerDynamics"; +const char* PowerSystemStabilizerDynamics::debugString() const +{ + return PowerSystemStabilizerDynamics::debugName; } -void PowerSystemStabilizerDynamics::addConstructToMap(std::unordered_map& factory_map) { +void PowerSystemStabilizerDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics"), &PowerSystemStabilizerDynamics_factory)); } -void PowerSystemStabilizerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PowerSystemStabilizerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.RemoteInputSignal"), &assign_PowerSystemStabilizerDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.ExcitationSystemDynamics"), &assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics)); +void PowerSystemStabilizerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PowerSystemStabilizerDynamics::debugName[] = "PowerSystemStabilizerDynamics"; -const char* PowerSystemStabilizerDynamics::debugString() +void PowerSystemStabilizerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerSystemStabilizerDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.ExcitationSystemDynamics"), &assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.RemoteInputSignal"), &assign_PowerSystemStabilizerDynamics_RemoteInputSignal)); } const BaseClassDefiner PowerSystemStabilizerDynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner PowerSystemStabilizerDynamics::declare() return BaseClassDefiner(PowerSystemStabilizerDynamics::addConstructToMap, PowerSystemStabilizerDynamics::addPrimitiveAssignFnsToMap, PowerSystemStabilizerDynamics::addClassAssignFnsToMap, PowerSystemStabilizerDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* PowerSystemStabilizerDynamics_factory() + { + return new PowerSystemStabilizerDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.hpp b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.hpp index f636ae567..c337743ac 100644 --- a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerDynamics.hpp @@ -1,40 +1,41 @@ #ifndef PowerSystemStabilizerDynamics_H #define PowerSystemStabilizerDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Power system stabilizer function block whose behaviour is described by reference to a standard model */ - class PowerSystemStabilizerDynamics: public DynamicsFunctionBlock + class PowerSystemStabilizerDynamics : public DynamicsFunctionBlock { - public: - std::list RemoteInputSignal; /* Remote input signal used by this power system stabilizer model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this power system stabilizer model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerSystemStabilizerDynamics(); - virtual ~PowerSystemStabilizerDynamics(); - + ~PowerSystemStabilizerDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this power system stabilizer model is associated. Default: 0 */ + std::list RemoteInputSignal; /* Remote input signal used by this power system stabilizer model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerSystemStabilizerDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.cpp b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.cpp index 9d56aa4ab..06d039cf4 100644 --- a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerSystemStabilizerUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; PowerSystemStabilizerUserDefined::PowerSystemStabilizerUserDefined() {}; - PowerSystemStabilizerUserDefined::~PowerSystemStabilizerUserDefined() {}; -bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PowerSystemStabilizerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PowerSystemStabilizerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass*, BaseClass*); +bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PowerSystemStabilizerUserDefined_factory() { - return new PowerSystemStabilizerUserDefined; - } +const char PowerSystemStabilizerUserDefined::debugName[] = "PowerSystemStabilizerUserDefined"; +const char* PowerSystemStabilizerUserDefined::debugString() const +{ + return PowerSystemStabilizerUserDefined::debugName; } -void PowerSystemStabilizerUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void PowerSystemStabilizerUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined"), &PowerSystemStabilizerUserDefined_factory)); } -void PowerSystemStabilizerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PowerSystemStabilizerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined.proprietary"), &assign_PowerSystemStabilizerUserDefined_proprietary)); - } - -void PowerSystemStabilizerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined.ProprietaryParameterDynamics"), &assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics)); } -const char PowerSystemStabilizerUserDefined::debugName[] = "PowerSystemStabilizerUserDefined"; -const char* PowerSystemStabilizerUserDefined::debugString() +void PowerSystemStabilizerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerSystemStabilizerUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined.ProprietaryParameterDynamics"), &assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner PowerSystemStabilizerUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PowerSystemStabilizerUserDefined::declare() return BaseClassDefiner(PowerSystemStabilizerUserDefined::addConstructToMap, PowerSystemStabilizerUserDefined::addPrimitiveAssignFnsToMap, PowerSystemStabilizerUserDefined::addClassAssignFnsToMap, PowerSystemStabilizerUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* PowerSystemStabilizerUserDefined_factory() + { + return new PowerSystemStabilizerUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.hpp b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.hpp index f2f48070f..2eec1b070 100644 --- a/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/PowerSystemStabilizerUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef PowerSystemStabilizerUserDefined_H #define PowerSystemStabilizerUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* function block whose dynamic behaviour is described by */ - class PowerSystemStabilizerUserDefined: public PowerSystemStabilizerDynamics + class PowerSystemStabilizerUserDefined : public PowerSystemStabilizerDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerSystemStabilizerUserDefined(); - virtual ~PowerSystemStabilizerUserDefined(); - + ~PowerSystemStabilizerUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerSystemStabilizerUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PowerTransformer.cpp b/CGMES_2.4.15_16FEB2016/PowerTransformer.cpp index 72e874b4e..1eda73bf1 100644 --- a/CGMES_2.4.15_16FEB2016/PowerTransformer.cpp +++ b/CGMES_2.4.15_16FEB2016/PowerTransformer.cpp @@ -1,7 +1,11 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerTransformer.hpp" +#include +#include + #include "PowerTransformerEnd.hpp" #include "CurrentFlow.hpp" #include "Voltage.hpp" @@ -13,112 +17,126 @@ using namespace CIMPP; PowerTransformer::PowerTransformer() {}; - PowerTransformer::~PowerTransformer() {}; -bool assign_PowerTransformer_PowerTransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PowerTransformerEnd.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->beforeShCircuitHighestOperatingCurrent; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_PowerTransformer_beforeShCircuitHighestOperatingVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->beforeShCircuitHighestOperatingVoltage; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_beforeShortCircuitAnglePf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->beforeShortCircuitAnglePf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_highSideMinOperatingU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->highSideMinOperatingU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_isPartOfGeneratorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isPartOfGeneratorUnit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_operationalValuesConsidered(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operationalValuesConsidered; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - -bool assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->beforeShCircuitHighestOperatingCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PowerTransformerEnd_PowerTransformer(BaseClass*, BaseClass*); +bool assign_PowerTransformer_PowerTransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerTransformer* element = dynamic_cast(BaseClass_ptr1); + PowerTransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PowerTransformerEnd.begin(), element->PowerTransformerEnd.end(), element2) == element->PowerTransformerEnd.end()) + { + element->PowerTransformerEnd.push_back(element2); + return assign_PowerTransformerEnd_PowerTransformer(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PowerTransformer_beforeShCircuitHighestOperatingVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->beforeShCircuitHighestOperatingVoltage; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_beforeShortCircuitAnglePf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->beforeShortCircuitAnglePf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_highSideMinOperatingU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->highSideMinOperatingU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_isPartOfGeneratorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isPartOfGeneratorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_operationalValuesConsidered(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operationalValuesConsidered; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PowerTransformer_factory() { - return new PowerTransformer; - } + +const char PowerTransformer::debugName[] = "PowerTransformer"; +const char* PowerTransformer::debugString() const +{ + return PowerTransformer::debugName; } -void PowerTransformer::addConstructToMap(std::unordered_map& factory_map) { +void PowerTransformer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerTransformer"), &PowerTransformer_factory)); } -void PowerTransformer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShCircuitHighestOperatingCurrent"), &assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent)); +void PowerTransformer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShCircuitHighestOperatingCurrent"), &assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShCircuitHighestOperatingVoltage"), &assign_PowerTransformer_beforeShCircuitHighestOperatingVoltage)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShortCircuitAnglePf"), &assign_PowerTransformer_beforeShortCircuitAnglePf)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.highSideMinOperatingU"), &assign_PowerTransformer_highSideMinOperatingU)); @@ -126,14 +144,9 @@ void PowerTransformer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.PowerTransformerEnd"), &assign_PowerTransformer_PowerTransformerEnd)); - } - -const char PowerTransformer::debugName[] = "PowerTransformer"; -const char* PowerTransformer::debugString() +void PowerTransformer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerTransformer::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.PowerTransformerEnd"), &assign_PowerTransformer_PowerTransformerEnd)); } const BaseClassDefiner PowerTransformer::declare() @@ -141,4 +154,10 @@ const BaseClassDefiner PowerTransformer::declare() return BaseClassDefiner(PowerTransformer::addConstructToMap, PowerTransformer::addPrimitiveAssignFnsToMap, PowerTransformer::addClassAssignFnsToMap, PowerTransformer::debugName); } - +namespace CIMPP +{ + BaseClass* PowerTransformer_factory() + { + return new PowerTransformer; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PowerTransformer.hpp b/CGMES_2.4.15_16FEB2016/PowerTransformer.hpp index f42eff1d4..56bc0318e 100644 --- a/CGMES_2.4.15_16FEB2016/PowerTransformer.hpp +++ b/CGMES_2.4.15_16FEB2016/PowerTransformer.hpp @@ -1,48 +1,49 @@ #ifndef PowerTransformer_H #define PowerTransformer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "CurrentFlow.hpp" -#include "Voltage.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Boolean.hpp" +#include "CurrentFlow.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PowerTransformerEnd; -class PowerTransformerEnd; /* An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. A power transformer can be modeled with or without tanks and is intended for use in both balanced and unbalanced representations. A power transformer typically has two terminals, but may have one (grounding), three or more terminals. The inherited association ConductingEquipment.BaseVoltage should not be used. The association from TransformerEnd to BaseVoltage should be used instead. */ - class PowerTransformer: public ConductingEquipment + class PowerTransformer : public ConductingEquipment { - public: - std::list PowerTransformerEnd; /* The power transformer of this power transformer end. Default: 0 */ - CIMPP::CurrentFlow beforeShCircuitHighestOperatingCurrent; /* The highest operating current (Ib in the IEC 60909-0) before short circuit (depends on network configuration and relevant reliability philosophy). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. Default: nullptr */ - CIMPP::Voltage beforeShCircuitHighestOperatingVoltage; /* The highest operating voltage (Ub in the IEC 60909-0) before short circuit. It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is worst case voltage on the low side winding (Section 3.7.1 in the standard). Used to define operating conditions. Default: nullptr */ - CIMPP::AngleDegrees beforeShortCircuitAnglePf; /* The angle of power factor before short circuit (phib in the IEC 60909-0). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is the worst case power factor. Used to define operating conditions. Default: nullptr */ - CIMPP::Voltage highSideMinOperatingU; /* The minimum operating voltage (uQmin in the IEC 60909-0) at the high voltage side (Q side) of the unit transformer of the power station unit. A value well established from long-term operating experience of the system. It is used for calculation of the impedance correction factor KG defined in IEC 60909-0 Default: nullptr */ - CIMPP::Boolean isPartOfGeneratorUnit; /* Indicates whether the machine is part of a power station unit. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::Boolean operationalValuesConsidered; /* It is used to define if the data (other attributes related to short circuit data exchange) defines long term operational conditions or not. Used for short circuit data exchange according to IEC 60909. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerTransformer(); - virtual ~PowerTransformer(); - + ~PowerTransformer() override; + + std::list PowerTransformerEnd; /* The power transformer of this power transformer end. Default: 0 */ + CIMPP::CurrentFlow beforeShCircuitHighestOperatingCurrent; /* The highest operating current (Ib in the IEC 60909-0) before short circuit (depends on network configuration and relevant reliability philosophy). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. Default: nullptr */ + CIMPP::Voltage beforeShCircuitHighestOperatingVoltage; /* The highest operating voltage (Ub in the IEC 60909-0) before short circuit. It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is worst case voltage on the low side winding (Section 3.7.1 in the standard). Used to define operating conditions. Default: nullptr */ + CIMPP::AngleDegrees beforeShortCircuitAnglePf; /* The angle of power factor before short circuit (phib in the IEC 60909-0). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is the worst case power factor. Used to define operating conditions. Default: nullptr */ + CIMPP::Voltage highSideMinOperatingU; /* The minimum operating voltage (uQmin in the IEC 60909-0) at the high voltage side (Q side) of the unit transformer of the power station unit. A value well established from long-term operating experience of the system. It is used for calculation of the impedance correction factor KG defined in IEC 60909-0 Default: nullptr */ + CIMPP::Boolean isPartOfGeneratorUnit; /* Indicates whether the machine is part of a power station unit. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::Boolean operationalValuesConsidered; /* It is used to define if the data (other attributes related to short circuit data exchange) defines long term operational conditions or not. Used for short circuit data exchange according to IEC 60909. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerTransformer_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.cpp b/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.cpp index ef11ca4f8..e103ba044 100644 --- a/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.cpp +++ b/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.cpp @@ -1,229 +1,248 @@ -#include -#include "TransformerEnd.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerTransformerEnd.hpp" +#include +#include + +#include "PowerTransformer.hpp" +#include "Susceptance.hpp" #include "Susceptance.hpp" #include "WindingConnection.hpp" -#include "ApparentPower.hpp" #include "Conductance.hpp" -#include "Voltage.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" -#include "PowerTransformer.hpp" -#include "Susceptance.hpp" -#include "Integer.hpp" #include "Conductance.hpp" +#include "Integer.hpp" #include "Resistance.hpp" +#include "Resistance.hpp" +#include "ApparentPower.hpp" +#include "Voltage.hpp" +#include "Reactance.hpp" #include "Reactance.hpp" using namespace CIMPP; -PowerTransformerEnd::PowerTransformerEnd(): PowerTransformer(nullptr) {}; - +PowerTransformerEnd::PowerTransformerEnd() : PowerTransformer(nullptr) {}; PowerTransformerEnd::~PowerTransformerEnd() {}; +bool assign_PowerTransformerEnd_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_connectionKind(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->connectionKind; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformerEnd_phaseAngleClock(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->phaseAngleClock; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedS; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformerEnd_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformerEnd_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformerEnd_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} bool assign_PowerTransformer_PowerTransformerEnd(BaseClass*, BaseClass*); -bool assign_PowerTransformerEnd_PowerTransformer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerTransformer = dynamic_cast(BaseClass_ptr2); - if(element->PowerTransformer != nullptr) - return assign_PowerTransformer_PowerTransformerEnd(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - - - - - -bool assign_PowerTransformerEnd_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_connectionKind(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->connectionKind; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedS; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_PowerTransformerEnd_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_phaseAngleClock(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->phaseAngleClock; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PowerTransformerEnd_factory() { - return new PowerTransformerEnd; +bool assign_PowerTransformerEnd_PowerTransformer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1); + PowerTransformer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerTransformer != element2) + { + element->PowerTransformer = element2; + return assign_PowerTransformer_PowerTransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + + + + + +const char PowerTransformerEnd::debugName[] = "PowerTransformerEnd"; +const char* PowerTransformerEnd::debugString() const +{ + return PowerTransformerEnd::debugName; } -void PowerTransformerEnd::addConstructToMap(std::unordered_map& factory_map) { +void PowerTransformerEnd::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd"), &PowerTransformerEnd_factory)); } -void PowerTransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PowerTransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b"), &assign_PowerTransformerEnd_b)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b0"), &assign_PowerTransformerEnd_b0)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.connectionKind"), &assign_PowerTransformerEnd_connectionKind)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedS"), &assign_PowerTransformerEnd_ratedS)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.g"), &assign_PowerTransformerEnd_g)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedU"), &assign_PowerTransformerEnd_ratedU)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.r"), &assign_PowerTransformerEnd_r)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.x"), &assign_PowerTransformerEnd_x)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b0"), &assign_PowerTransformerEnd_b0)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.phaseAngleClock"), &assign_PowerTransformerEnd_phaseAngleClock)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.g0"), &assign_PowerTransformerEnd_g0)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.phaseAngleClock"), &assign_PowerTransformerEnd_phaseAngleClock)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.r"), &assign_PowerTransformerEnd_r)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.r0"), &assign_PowerTransformerEnd_r0)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedS"), &assign_PowerTransformerEnd_ratedS)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedU"), &assign_PowerTransformerEnd_ratedU)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.x"), &assign_PowerTransformerEnd_x)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.x0"), &assign_PowerTransformerEnd_x0)); } -void PowerTransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.PowerTransformer"), &assign_PowerTransformerEnd_PowerTransformer)); - } - -const char PowerTransformerEnd::debugName[] = "PowerTransformerEnd"; -const char* PowerTransformerEnd::debugString() +void PowerTransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerTransformerEnd::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.PowerTransformer"), &assign_PowerTransformerEnd_PowerTransformer)); } const BaseClassDefiner PowerTransformerEnd::declare() @@ -231,4 +250,10 @@ const BaseClassDefiner PowerTransformerEnd::declare() return BaseClassDefiner(PowerTransformerEnd::addConstructToMap, PowerTransformerEnd::addPrimitiveAssignFnsToMap, PowerTransformerEnd::addClassAssignFnsToMap, PowerTransformerEnd::debugName); } - +namespace CIMPP +{ + BaseClass* PowerTransformerEnd_factory() + { + return new PowerTransformerEnd; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.hpp b/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.hpp index 69282d9d0..916101b87 100644 --- a/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.hpp +++ b/CGMES_2.4.15_16FEB2016/PowerTransformerEnd.hpp @@ -1,58 +1,59 @@ #ifndef PowerTransformerEnd_H #define PowerTransformerEnd_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TransformerEnd.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" -#include "WindingConnection.hpp" +#include "TransformerEnd.hpp" +#include "BaseClassDefiner.hpp" #include "ApparentPower.hpp" #include "Conductance.hpp" -#include "Voltage.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" #include "Integer.hpp" +#include "Reactance.hpp" +#include "Resistance.hpp" +#include "Susceptance.hpp" +#include "Voltage.hpp" +#include "WindingConnection.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PowerTransformer; -class PowerTransformer; /* A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalent as follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers. */ - class PowerTransformerEnd: public TransformerEnd + class PowerTransformerEnd : public TransformerEnd { - public: - CIMPP::Susceptance b; /* Magnetizing branch susceptance (B mag). The value can be positive or negative. Default: nullptr */ - CIMPP::WindingConnection connectionKind; /* Kind of connection. Default: 0 */ - CIMPP::ApparentPower ratedS; /* Normal apparent power rating. The attribute shall be a positive value. For a two-winding transformer the values for the high and low voltage sides shall be identical. Default: nullptr */ - CIMPP::Conductance g; /* Magnetizing branch conductance. Default: nullptr */ - CIMPP::Voltage ratedU; /* Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. A high voltage side, as given by TransformerEnd.endNumber, shall have a ratedU that is greater or equal than ratedU for the lower voltage sides. Default: nullptr */ - CIMPP::Resistance r; /* Resistance (star-model) of the transformer end. The attribute shall be equal or greater than zero for non-equivalent transformers. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence series reactance (star-model) of the transformer end. Default: nullptr */ - CIMPP::PowerTransformer* PowerTransformer; /* The ends of this power transformer. Default: 0 */ - CIMPP::Susceptance b0; /* Zero sequence magnetizing branch susceptance. Default: nullptr */ - CIMPP::Integer phaseAngleClock; /* Terminal voltage phase angle displacement where 360 degrees are represented with clock hours. The valid values are 0 to 11. For example, for the secondary side end of a transformer with vector group code of `Dyn11`, specify the connection kind as wye with neutral and specify the phase angle of the clock as 11. The clock value of the transformer end number specified as 1, is assumed to be zero. Note the transformer end number is not assumed to be the same as the terminal sequence number. Default: 0 */ - CIMPP::Conductance g0; /* Zero sequence magnetizing branch conductance (star-model). Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence series resistance (star-model) of the transformer end. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence series reactance of the transformer end. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerTransformerEnd(); - virtual ~PowerTransformerEnd(); - + ~PowerTransformerEnd() override; + + CIMPP::PowerTransformer* PowerTransformer; /* The ends of this power transformer. Default: 0 */ + CIMPP::Susceptance b; /* Magnetizing branch susceptance (B mag). The value can be positive or negative. Default: nullptr */ + CIMPP::Susceptance b0; /* Zero sequence magnetizing branch susceptance. Default: nullptr */ + CIMPP::WindingConnection connectionKind; /* Kind of connection. Default: 0 */ + CIMPP::Conductance g; /* Magnetizing branch conductance. Default: nullptr */ + CIMPP::Conductance g0; /* Zero sequence magnetizing branch conductance (star-model). Default: nullptr */ + CIMPP::Integer phaseAngleClock; /* Terminal voltage phase angle displacement where 360 degrees are represented with clock hours. The valid values are 0 to 11. For example, for the secondary side end of a transformer with vector group code of `Dyn11`, specify the connection kind as wye with neutral and specify the phase angle of the clock as 11. The clock value of the transformer end number specified as 1, is assumed to be zero. Note the transformer end number is not assumed to be the same as the terminal sequence number. Default: 0 */ + CIMPP::Resistance r; /* Resistance (star-model) of the transformer end. The attribute shall be equal or greater than zero for non-equivalent transformers. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence series resistance (star-model) of the transformer end. Default: nullptr */ + CIMPP::ApparentPower ratedS; /* Normal apparent power rating. The attribute shall be a positive value. For a two-winding transformer the values for the high and low voltage sides shall be identical. Default: nullptr */ + CIMPP::Voltage ratedU; /* Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. A high voltage side, as given by TransformerEnd.endNumber, shall have a ratedU that is greater or equal than ratedU for the lower voltage sides. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence series reactance (star-model) of the transformer end. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence series reactance of the transformer end. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerTransformerEnd_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.cpp b/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.cpp index 889206f83..26aa16fbd 100644 --- a/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.cpp @@ -1,330 +1,460 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ProprietaryParameterDynamics.hpp" -#include "WindPlantUserDefined.hpp" -#include "WindType1or2UserDefined.hpp" -#include "WindType3or4UserDefined.hpp" -#include "SynchronousMachineUserDefined.hpp" +#include +#include + #include "AsynchronousMachineUserDefined.hpp" -#include "TurbineGovernorUserDefined.hpp" -#include "TurbineLoadControllerUserDefined.hpp" -#include "MechanicalLoadUserDefined.hpp" +#include "DiscontinuousExcitationControlUserDefined.hpp" #include "ExcitationSystemUserDefined.hpp" +#include "LoadUserDefined.hpp" +#include "MechanicalLoadUserDefined.hpp" #include "OverexcitationLimiterUserDefined.hpp" -#include "UnderexcitationLimiterUserDefined.hpp" -#include "PowerSystemStabilizerUserDefined.hpp" -#include "DiscontinuousExcitationControlUserDefined.hpp" #include "PFVArControllerType1UserDefined.hpp" -#include "VoltageAdjusterUserDefined.hpp" #include "PFVArControllerType2UserDefined.hpp" +#include "PowerSystemStabilizerUserDefined.hpp" +#include "SynchronousMachineUserDefined.hpp" +#include "TurbineGovernorUserDefined.hpp" +#include "TurbineLoadControllerUserDefined.hpp" +#include "UnderexcitationLimiterUserDefined.hpp" +#include "VoltageAdjusterUserDefined.hpp" #include "VoltageCompensatorUserDefined.hpp" -#include "LoadUserDefined.hpp" -#include "Integer.hpp" +#include "WindPlantUserDefined.hpp" +#include "WindType1or2UserDefined.hpp" +#include "WindType3or4UserDefined.hpp" #include "Boolean.hpp" -#include "Integer.hpp" #include "Simple_Float.hpp" +#include "Integer.hpp" +#include "Integer.hpp" using namespace CIMPP; -ProprietaryParameterDynamics::ProprietaryParameterDynamics(): WindPlantUserDefined(nullptr), WindType1or2UserDefined(nullptr), WindType3or4UserDefined(nullptr), SynchronousMachineUserDefined(nullptr), AsynchronousMachineUserDefined(nullptr), TurbineGovernorUserDefined(nullptr), TurbineLoadControllerUserDefined(nullptr), MechanicalLoadUserDefined(nullptr), ExcitationSystemUserDefined(nullptr), OverexcitationLimiterUserDefined(nullptr), UnderexcitationLimiterUserDefined(nullptr), PowerSystemStabilizerUserDefined(nullptr), DiscontinuousExcitationControlUserDefined(nullptr), PFVArControllerType1UserDefined(nullptr), VoltageAdjusterUserDefined(nullptr), PFVArControllerType2UserDefined(nullptr), VoltageCompensatorUserDefined(nullptr), LoadUserDefined(nullptr) {}; - +ProprietaryParameterDynamics::ProprietaryParameterDynamics() : AsynchronousMachineUserDefined(nullptr), DiscontinuousExcitationControlUserDefined(nullptr), ExcitationSystemUserDefined(nullptr), LoadUserDefined(nullptr), MechanicalLoadUserDefined(nullptr), OverexcitationLimiterUserDefined(nullptr), PFVArControllerType1UserDefined(nullptr), PFVArControllerType2UserDefined(nullptr), PowerSystemStabilizerUserDefined(nullptr), SynchronousMachineUserDefined(nullptr), TurbineGovernorUserDefined(nullptr), TurbineLoadControllerUserDefined(nullptr), UnderexcitationLimiterUserDefined(nullptr), VoltageAdjusterUserDefined(nullptr), VoltageCompensatorUserDefined(nullptr), WindPlantUserDefined(nullptr), WindType1or2UserDefined(nullptr), WindType3or4UserDefined(nullptr) {}; ProprietaryParameterDynamics::~ProprietaryParameterDynamics() {}; -bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantUserDefined != nullptr) - return assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + + + + + + + + + + + + + + + + + + +bool assign_ProprietaryParameterDynamics_booleanParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->booleanParameterValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindType1or2UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->WindType1or2UserDefined != nullptr) - return assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_floatParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->floatParameterValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindType3or4UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->WindType3or4UserDefined != nullptr) - return assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_integerParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->integerParameterValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineUserDefined != nullptr) - return assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_parameterNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->parameterNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; } + bool assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineUserDefined != nullptr) - return assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineUserDefined != element2) + { + element->AsynchronousMachineUserDefined = element2; + return assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineGovernorUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->TurbineGovernorUserDefined != nullptr) - return assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + DiscontinuousExcitationControlUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscontinuousExcitationControlUserDefined != element2) + { + element->DiscontinuousExcitationControlUserDefined = element2; + return assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineLoadControllerUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->TurbineLoadControllerUserDefined != nullptr) - return assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemUserDefined != element2) + { + element->ExcitationSystemUserDefined = element2; + return assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->MechanicalLoadUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->MechanicalLoadUserDefined != nullptr) - return assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + LoadUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadUserDefined != element2) + { + element->LoadUserDefined = element2; + return assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemUserDefined != nullptr) - return assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + MechanicalLoadUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MechanicalLoadUserDefined != element2) + { + element->MechanicalLoadUserDefined = element2; + return assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->OverexcitationLimiterUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->OverexcitationLimiterUserDefined != nullptr) - return assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + OverexcitationLimiterUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OverexcitationLimiterUserDefined != element2) + { + element->OverexcitationLimiterUserDefined = element2; + return assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->UnderexcitationLimiterUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->UnderexcitationLimiterUserDefined != nullptr) - return assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1UserDefined != element2) + { + element->PFVArControllerType1UserDefined = element2; + return assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemStabilizerUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemStabilizerUserDefined != nullptr) - return assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType2UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType2UserDefined != element2) + { + element->PFVArControllerType2UserDefined = element2; + return assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscontinuousExcitationControlUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->DiscontinuousExcitationControlUserDefined != nullptr) - return assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + PowerSystemStabilizerUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemStabilizerUserDefined != element2) + { + element->PowerSystemStabilizerUserDefined = element2; + return assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1UserDefined != nullptr) - return assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineUserDefined != element2) + { + element->SynchronousMachineUserDefined = element2; + return assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageAdjusterUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->VoltageAdjusterUserDefined != nullptr) - return assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineGovernorUserDefined != element2) + { + element->TurbineGovernorUserDefined = element2; + return assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType2UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType2UserDefined != nullptr) - return assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineLoadControllerUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineLoadControllerUserDefined != element2) + { + element->TurbineLoadControllerUserDefined = element2; + return assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageCompensatorUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->VoltageCompensatorUserDefined != nullptr) - return assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + UnderexcitationLimiterUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->UnderexcitationLimiterUserDefined != element2) + { + element->UnderexcitationLimiterUserDefined = element2; + return assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->LoadUserDefined != nullptr) - return assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageAdjusterUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageAdjusterUserDefined != element2) + { + element->VoltageAdjusterUserDefined = element2; + return assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - - - - - - - - - - - - - - - - - - - - -bool assign_ProprietaryParameterDynamics_parameterNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->parameterNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageCompensatorUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageCompensatorUserDefined != element2) + { + element->VoltageCompensatorUserDefined = element2; + return assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ProprietaryParameterDynamics_booleanParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->booleanParameterValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + WindPlantUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantUserDefined != element2) + { + element->WindPlantUserDefined = element2; + return assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ProprietaryParameterDynamics_integerParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->integerParameterValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + WindType1or2UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindType1or2UserDefined != element2) + { + element->WindType1or2UserDefined = element2; + return assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ProprietaryParameterDynamics_floatParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->floatParameterValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + WindType3or4UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindType3or4UserDefined != element2) + { + element->WindType3or4UserDefined = element2; + return assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ProprietaryParameterDynamics_factory() { - return new ProprietaryParameterDynamics; - } + + + + +const char ProprietaryParameterDynamics::debugName[] = "ProprietaryParameterDynamics"; +const char* ProprietaryParameterDynamics::debugString() const +{ + return ProprietaryParameterDynamics::debugName; } -void ProprietaryParameterDynamics::addConstructToMap(std::unordered_map& factory_map) { +void ProprietaryParameterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics"), &ProprietaryParameterDynamics_factory)); } -void ProprietaryParameterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.parameterNumber"), &assign_ProprietaryParameterDynamics_parameterNumber)); +void ProprietaryParameterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.booleanParameterValue"), &assign_ProprietaryParameterDynamics_booleanParameterValue)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.integerParameterValue"), &assign_ProprietaryParameterDynamics_integerParameterValue)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.floatParameterValue"), &assign_ProprietaryParameterDynamics_floatParameterValue)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.integerParameterValue"), &assign_ProprietaryParameterDynamics_integerParameterValue)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.parameterNumber"), &assign_ProprietaryParameterDynamics_parameterNumber)); } -void ProprietaryParameterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindPlantUserDefined"), &assign_ProprietaryParameterDynamics_WindPlantUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType1or2UserDefined"), &assign_ProprietaryParameterDynamics_WindType1or2UserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType3or4UserDefined"), &assign_ProprietaryParameterDynamics_WindType3or4UserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.SynchronousMachineUserDefined"), &assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined)); +void ProprietaryParameterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.AsynchronousMachineUserDefined"), &assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineGovernorUserDefined"), &assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineLoadControllerUserDefined"), &assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.MechanicalLoadUserDefined"), &assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.DiscontinuousExcitationControlUserDefined"), &assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.ExcitationSystemUserDefined"), &assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.LoadUserDefined"), &assign_ProprietaryParameterDynamics_LoadUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.MechanicalLoadUserDefined"), &assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.OverexcitationLimiterUserDefined"), &assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.UnderexcitationLimiterUserDefined"), &assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PowerSystemStabilizerUserDefined"), &assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.DiscontinuousExcitationControlUserDefined"), &assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PFVArControllerType1UserDefined"), &assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.VoltageAdjusterUserDefined"), &assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PFVArControllerType2UserDefined"), &assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PowerSystemStabilizerUserDefined"), &assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.SynchronousMachineUserDefined"), &assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineGovernorUserDefined"), &assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineLoadControllerUserDefined"), &assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.UnderexcitationLimiterUserDefined"), &assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.VoltageAdjusterUserDefined"), &assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.VoltageCompensatorUserDefined"), &assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.LoadUserDefined"), &assign_ProprietaryParameterDynamics_LoadUserDefined)); - } - -const char ProprietaryParameterDynamics::debugName[] = "ProprietaryParameterDynamics"; -const char* ProprietaryParameterDynamics::debugString() -{ - return ProprietaryParameterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindPlantUserDefined"), &assign_ProprietaryParameterDynamics_WindPlantUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType1or2UserDefined"), &assign_ProprietaryParameterDynamics_WindType1or2UserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType3or4UserDefined"), &assign_ProprietaryParameterDynamics_WindType3or4UserDefined)); } const BaseClassDefiner ProprietaryParameterDynamics::declare() @@ -332,4 +462,10 @@ const BaseClassDefiner ProprietaryParameterDynamics::declare() return BaseClassDefiner(ProprietaryParameterDynamics::addConstructToMap, ProprietaryParameterDynamics::addPrimitiveAssignFnsToMap, ProprietaryParameterDynamics::addClassAssignFnsToMap, ProprietaryParameterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* ProprietaryParameterDynamics_factory() + { + return new ProprietaryParameterDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.hpp b/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.hpp index 74d1117d2..658832137 100644 --- a/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/ProprietaryParameterDynamics.hpp @@ -1,79 +1,80 @@ #ifndef ProprietaryParameterDynamics_H #define ProprietaryParameterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class AsynchronousMachineUserDefined; + class DiscontinuousExcitationControlUserDefined; + class ExcitationSystemUserDefined; + class LoadUserDefined; + class MechanicalLoadUserDefined; + class OverexcitationLimiterUserDefined; + class PFVArControllerType1UserDefined; + class PFVArControllerType2UserDefined; + class PowerSystemStabilizerUserDefined; + class SynchronousMachineUserDefined; + class TurbineGovernorUserDefined; + class TurbineLoadControllerUserDefined; + class UnderexcitationLimiterUserDefined; + class VoltageAdjusterUserDefined; + class VoltageCompensatorUserDefined; + class WindPlantUserDefined; + class WindType1or2UserDefined; + class WindType3or4UserDefined; -class WindPlantUserDefined; -class WindType1or2UserDefined; -class WindType3or4UserDefined; -class SynchronousMachineUserDefined; -class AsynchronousMachineUserDefined; -class TurbineGovernorUserDefined; -class TurbineLoadControllerUserDefined; -class MechanicalLoadUserDefined; -class ExcitationSystemUserDefined; -class OverexcitationLimiterUserDefined; -class UnderexcitationLimiterUserDefined; -class PowerSystemStabilizerUserDefined; -class DiscontinuousExcitationControlUserDefined; -class PFVArControllerType1UserDefined; -class VoltageAdjusterUserDefined; -class PFVArControllerType2UserDefined; -class VoltageCompensatorUserDefined; -class LoadUserDefined; /* Supports definition of one or more parameters of several different datatypes for use by proprietary user-defined models. NOTE: This class does not inherit from IdentifiedObject since it is not intended that a single instance of it be referenced by more than one proprietary user-defined model instance. */ - class ProprietaryParameterDynamics: public BaseClass + class ProprietaryParameterDynamics : public BaseClass { - public: - CIMPP::WindPlantUserDefined* WindPlantUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::WindType1or2UserDefined* WindType1or2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::WindType3or4UserDefined* WindType3or4UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::SynchronousMachineUserDefined* SynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::AsynchronousMachineUserDefined* AsynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::TurbineGovernorUserDefined* TurbineGovernorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::TurbineLoadControllerUserDefined* TurbineLoadControllerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::MechanicalLoadUserDefined* MechanicalLoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::ExcitationSystemUserDefined* ExcitationSystemUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::OverexcitationLimiterUserDefined* OverexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::UnderexcitationLimiterUserDefined* UnderexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::PowerSystemStabilizerUserDefined* PowerSystemStabilizerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::DiscontinuousExcitationControlUserDefined* DiscontinuousExcitationControlUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::PFVArControllerType1UserDefined* PFVArControllerType1UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::VoltageAdjusterUserDefined* VoltageAdjusterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::PFVArControllerType2UserDefined* PFVArControllerType2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::VoltageCompensatorUserDefined* VoltageCompensatorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::LoadUserDefined* LoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::Integer parameterNumber; /* Sequence number of the parameter among the set of parameters associated with the related proprietary user-defined model. Default: 0 */ - CIMPP::Boolean booleanParameterValue; /* Used for boolean parameter value. If this attribute is populated, integerParameterValue and floatParameterValue will not be. Default: false */ - CIMPP::Integer integerParameterValue; /* Used for integer parameter value. If this attribute is populated, booleanParameterValue and floatParameterValue will not be. Default: 0 */ - CIMPP::Simple_Float floatParameterValue; /* Used for floating point parameter value. If this attribute is populated, booleanParameterValue and integerParameterValue will not be. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ProprietaryParameterDynamics(); - virtual ~ProprietaryParameterDynamics(); - + ~ProprietaryParameterDynamics() override; + + CIMPP::AsynchronousMachineUserDefined* AsynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::DiscontinuousExcitationControlUserDefined* DiscontinuousExcitationControlUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::ExcitationSystemUserDefined* ExcitationSystemUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::LoadUserDefined* LoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::MechanicalLoadUserDefined* MechanicalLoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::OverexcitationLimiterUserDefined* OverexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::PFVArControllerType1UserDefined* PFVArControllerType1UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::PFVArControllerType2UserDefined* PFVArControllerType2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::PowerSystemStabilizerUserDefined* PowerSystemStabilizerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::SynchronousMachineUserDefined* SynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::TurbineGovernorUserDefined* TurbineGovernorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::TurbineLoadControllerUserDefined* TurbineLoadControllerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::UnderexcitationLimiterUserDefined* UnderexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::VoltageAdjusterUserDefined* VoltageAdjusterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::VoltageCompensatorUserDefined* VoltageCompensatorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::WindPlantUserDefined* WindPlantUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::WindType1or2UserDefined* WindType1or2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::WindType3or4UserDefined* WindType3or4UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::Boolean booleanParameterValue; /* Used for boolean parameter value. If this attribute is populated, integerParameterValue and floatParameterValue will not be. Default: false */ + CIMPP::Simple_Float floatParameterValue; /* Used for floating point parameter value. If this attribute is populated, booleanParameterValue and integerParameterValue will not be. Default: nullptr */ + CIMPP::Integer integerParameterValue; /* Used for integer parameter value. If this attribute is populated, booleanParameterValue and floatParameterValue will not be. Default: 0 */ + CIMPP::Integer parameterNumber; /* Sequence number of the parameter among the set of parameters associated with the related proprietary user-defined model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ProprietaryParameterDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ProtectedSwitch.cpp b/CGMES_2.4.15_16FEB2016/ProtectedSwitch.cpp index c7616980f..f95614e29 100644 --- a/CGMES_2.4.15_16FEB2016/ProtectedSwitch.cpp +++ b/CGMES_2.4.15_16FEB2016/ProtectedSwitch.cpp @@ -1,36 +1,36 @@ -#include -#include "Switch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ProtectedSwitch.hpp" +#include +#include + using namespace CIMPP; ProtectedSwitch::ProtectedSwitch() {}; - ProtectedSwitch::~ProtectedSwitch() {}; -namespace CIMPP { - BaseClass* ProtectedSwitch_factory() { - return new ProtectedSwitch; - } +const char ProtectedSwitch::debugName[] = "ProtectedSwitch"; +const char* ProtectedSwitch::debugString() const +{ + return ProtectedSwitch::debugName; } -void ProtectedSwitch::addConstructToMap(std::unordered_map& factory_map) { +void ProtectedSwitch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ProtectedSwitch"), &ProtectedSwitch_factory)); } -void ProtectedSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void ProtectedSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void ProtectedSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ProtectedSwitch::debugName[] = "ProtectedSwitch"; -const char* ProtectedSwitch::debugString() +void ProtectedSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ProtectedSwitch::debugName; } const BaseClassDefiner ProtectedSwitch::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner ProtectedSwitch::declare() return BaseClassDefiner(ProtectedSwitch::addConstructToMap, ProtectedSwitch::addPrimitiveAssignFnsToMap, ProtectedSwitch::addClassAssignFnsToMap, ProtectedSwitch::debugName); } - +namespace CIMPP +{ + BaseClass* ProtectedSwitch_factory() + { + return new ProtectedSwitch; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ProtectedSwitch.hpp b/CGMES_2.4.15_16FEB2016/ProtectedSwitch.hpp index 0c869db06..8d2eaa266 100644 --- a/CGMES_2.4.15_16FEB2016/ProtectedSwitch.hpp +++ b/CGMES_2.4.15_16FEB2016/ProtectedSwitch.hpp @@ -1,36 +1,37 @@ #ifndef ProtectedSwitch_H #define ProtectedSwitch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Switch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Switch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment. */ - class ProtectedSwitch: public Switch + class ProtectedSwitch : public Switch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ProtectedSwitch(); - virtual ~ProtectedSwitch(); - + ~ProtectedSwitch() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ProtectedSwitch_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Pss1.cpp b/CGMES_2.4.15_16FEB2016/Pss1.cpp index 408478378..fa673e0a4 100644 --- a/CGMES_2.4.15_16FEB2016/Pss1.cpp +++ b/CGMES_2.4.15_16FEB2016/Pss1.cpp @@ -1,14 +1,16 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss1.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" #include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -17,245 +19,258 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; Pss1::Pss1() {}; - Pss1::~Pss1() {}; +bool assign_Pss1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_kw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadat; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss1_kw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadat; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss1_factory() { - return new Pss1; - } +const char Pss1::debugName[] = "Pss1"; +const char* Pss1::debugString() const +{ + return Pss1::debugName; } -void Pss1::addConstructToMap(std::unordered_map& factory_map) { +void Pss1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss1"), &Pss1_factory)); } -void Pss1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Pss1.kw"), &assign_Pss1_kw)); +void Pss1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Pss1.kf"), &assign_Pss1_kf)); assign_map.insert(std::make_pair(std::string("cim:Pss1.kpe"), &assign_Pss1_kpe)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.pmin"), &assign_Pss1_pmin)); assign_map.insert(std::make_pair(std::string("cim:Pss1.ks"), &assign_Pss1_ks)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmn"), &assign_Pss1_vsmn)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmx"), &assign_Pss1_vsmx)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.tpe"), &assign_Pss1_tpe)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.kw"), &assign_Pss1_kw)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.pmin"), &assign_Pss1_pmin)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.t10"), &assign_Pss1_t10)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t5"), &assign_Pss1_t5)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t6"), &assign_Pss1_t6)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t7"), &assign_Pss1_t7)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t8"), &assign_Pss1_t8)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t9"), &assign_Pss1_t9)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.t10"), &assign_Pss1_t10)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.tpe"), &assign_Pss1_tpe)); assign_map.insert(std::make_pair(std::string("cim:Pss1.vadat"), &assign_Pss1_vadat)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmn"), &assign_Pss1_vsmn)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmx"), &assign_Pss1_vsmx)); } -void Pss1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss1::debugName[] = "Pss1"; -const char* Pss1::debugString() +void Pss1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss1::debugName; } const BaseClassDefiner Pss1::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner Pss1::declare() return BaseClassDefiner(Pss1::addConstructToMap, Pss1::addPrimitiveAssignFnsToMap, Pss1::addClassAssignFnsToMap, Pss1::debugName); } - +namespace CIMPP +{ + BaseClass* Pss1_factory() + { + return new Pss1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Pss1.hpp b/CGMES_2.4.15_16FEB2016/Pss1.hpp index 4d9ffbe22..a9ee1a7a2 100644 --- a/CGMES_2.4.15_16FEB2016/Pss1.hpp +++ b/CGMES_2.4.15_16FEB2016/Pss1.hpp @@ -1,55 +1,56 @@ #ifndef Pss1_H #define Pss1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "Simple_Float.hpp" +namespace CIMPP +{ /* Italian PSS - three input PSS (speed, frequency, power). */ - class Pss1: public PowerSystemStabilizerDynamics + class Pss1 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Simple_Float kw; /* Shaft speed power input gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float kf; /* Frequency power input gain (K). Typical Value = 5. Default: nullptr */ - CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU pmin; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ - CIMPP::Simple_Float ks; /* PSS gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.06. Default: nullptr */ - CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.06. Default: nullptr */ - CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t5; /* Washout (T). Typical Value = 3.5. Default: nullptr */ - CIMPP::Seconds t6; /* Filter time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t8; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t9; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t10; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean vadat; /* Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss1(); - virtual ~Pss1(); - + ~Pss1() override; + + CIMPP::Simple_Float kf; /* Frequency power input gain (K). Typical Value = 5. Default: nullptr */ + CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float ks; /* PSS gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float kw; /* Shaft speed power input gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmin; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ + CIMPP::Seconds t10; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t5; /* Washout (T). Typical Value = 3.5. Default: nullptr */ + CIMPP::Seconds t6; /* Filter time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t7; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t8; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t9; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Boolean vadat; /* Default: false */ + CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.06. Default: nullptr */ + CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.06. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Pss1A.cpp b/CGMES_2.4.15_16FEB2016/Pss1A.cpp index b78db3b02..ee79e3569 100644 --- a/CGMES_2.4.15_16FEB2016/Pss1A.cpp +++ b/CGMES_2.4.15_16FEB2016/Pss1A.cpp @@ -1,366 +1,388 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss1A.hpp" -#include "InputSignalKind.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "InputSignalKind.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" using namespace CIMPP; Pss1A::Pss1A() {}; - Pss1A::~Pss1A() {}; +bool assign_Pss1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignalType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_tdelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdelay; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignalType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_tdelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdelay; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss1A_factory() { - return new Pss1A; - } +const char Pss1A::debugName[] = "Pss1A"; +const char* Pss1A::debugString() const +{ + return Pss1A::debugName; } -void Pss1A::addConstructToMap(std::unordered_map& factory_map) { +void Pss1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss1A"), &Pss1A_factory)); } -void Pss1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Pss1A.inputSignalType"), &assign_Pss1A_inputSignalType)); +void Pss1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Pss1A.a1"), &assign_Pss1A_a1)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a2"), &assign_Pss1A_a2)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t1"), &assign_Pss1A_t1)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t2"), &assign_Pss1A_t2)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t3"), &assign_Pss1A_t3)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t4"), &assign_Pss1A_t4)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t5"), &assign_Pss1A_t5)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t6"), &assign_Pss1A_t6)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.ks"), &assign_Pss1A_ks)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmax"), &assign_Pss1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmin"), &assign_Pss1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcu"), &assign_Pss1A_vcu)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcl"), &assign_Pss1A_vcl)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a3"), &assign_Pss1A_a3)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a4"), &assign_Pss1A_a4)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a5"), &assign_Pss1A_a5)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a6"), &assign_Pss1A_a6)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a7"), &assign_Pss1A_a7)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a8"), &assign_Pss1A_a8)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.inputSignalType"), &assign_Pss1A_inputSignalType)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.kd"), &assign_Pss1A_kd)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.ks"), &assign_Pss1A_ks)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t1"), &assign_Pss1A_t1)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t2"), &assign_Pss1A_t2)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t3"), &assign_Pss1A_t3)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t4"), &assign_Pss1A_t4)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t5"), &assign_Pss1A_t5)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t6"), &assign_Pss1A_t6)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.tdelay"), &assign_Pss1A_tdelay)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcl"), &assign_Pss1A_vcl)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcu"), &assign_Pss1A_vcu)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmax"), &assign_Pss1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmin"), &assign_Pss1A_vrmin)); } -void Pss1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss1A::debugName[] = "Pss1A"; -const char* Pss1A::debugString() +void Pss1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss1A::debugName; } const BaseClassDefiner Pss1A::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner Pss1A::declare() return BaseClassDefiner(Pss1A::addConstructToMap, Pss1A::addPrimitiveAssignFnsToMap, Pss1A::addClassAssignFnsToMap, Pss1A::debugName); } - +namespace CIMPP +{ + BaseClass* Pss1A_factory() + { + return new Pss1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Pss1A.hpp b/CGMES_2.4.15_16FEB2016/Pss1A.hpp index 39477bd6b..721f252b4 100644 --- a/CGMES_2.4.15_16FEB2016/Pss1A.hpp +++ b/CGMES_2.4.15_16FEB2016/Pss1A.hpp @@ -1,62 +1,63 @@ #ifndef Pss1A_H #define Pss1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Single input power system stabilizer. It is a modified version in order to allow representation of various vendors' implementations on PSS type 1A. */ - class Pss1A: public PowerSystemStabilizerDynamics + class Pss1A : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Default: 0 */ - CIMPP::PU a1; /* Notch filter parameter (A1). Default: nullptr */ - CIMPP::PU a2; /* Notch filter parameter (A2). Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Default: nullptr */ - CIMPP::Seconds t5; /* Washout time constant (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Transducer time constant (T6). Default: nullptr */ - CIMPP::PU ks; /* Stabilizer gain (Ks). Default: nullptr */ - CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Default: nullptr */ - CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Default: nullptr */ - CIMPP::PU vcu; /* Stabilizer input cutoff threshold (Vcu). Default: nullptr */ - CIMPP::PU vcl; /* Stabilizer input cutoff threshold (Vcl). Default: nullptr */ - CIMPP::PU a3; /* Notch filter parameter (A3). Default: nullptr */ - CIMPP::PU a4; /* Notch filter parameter (A4). Default: nullptr */ - CIMPP::PU a5; /* Notch filter parameter (A5). Default: nullptr */ - CIMPP::PU a6; /* Notch filter parameter (A6). Default: nullptr */ - CIMPP::PU a7; /* Notch filter parameter (A7). Default: nullptr */ - CIMPP::PU a8; /* Notch filter parameter (A8). Default: nullptr */ - CIMPP::Boolean kd; /* Selector (Kd). true = e used false = e not used. Default: false */ - CIMPP::Seconds tdelay; /* Time constant (Tdelay). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss1A(); - virtual ~Pss1A(); - + ~Pss1A() override; + + CIMPP::PU a1; /* Notch filter parameter (A1). Default: nullptr */ + CIMPP::PU a2; /* Notch filter parameter (A2). Default: nullptr */ + CIMPP::PU a3; /* Notch filter parameter (A3). Default: nullptr */ + CIMPP::PU a4; /* Notch filter parameter (A4). Default: nullptr */ + CIMPP::PU a5; /* Notch filter parameter (A5). Default: nullptr */ + CIMPP::PU a6; /* Notch filter parameter (A6). Default: nullptr */ + CIMPP::PU a7; /* Notch filter parameter (A7). Default: nullptr */ + CIMPP::PU a8; /* Notch filter parameter (A8). Default: nullptr */ + CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Default: 0 */ + CIMPP::Boolean kd; /* Selector (Kd). true = e used false = e not used. Default: false */ + CIMPP::PU ks; /* Stabilizer gain (Ks). Default: nullptr */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Washout time constant (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Transducer time constant (T6). Default: nullptr */ + CIMPP::Seconds tdelay; /* Time constant (Tdelay). Default: nullptr */ + CIMPP::PU vcl; /* Stabilizer input cutoff threshold (Vcl). Default: nullptr */ + CIMPP::PU vcu; /* Stabilizer input cutoff threshold (Vcu). Default: nullptr */ + CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Default: nullptr */ + CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Pss2B.cpp b/CGMES_2.4.15_16FEB2016/Pss2B.cpp index 9716156c5..33695f70a 100644 --- a/CGMES_2.4.15_16FEB2016/Pss2B.cpp +++ b/CGMES_2.4.15_16FEB2016/Pss2B.cpp @@ -1,15 +1,24 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss2B.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Integer.hpp" +#include "Integer.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -26,447 +35,475 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Integer.hpp" -#include "Integer.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; Pss2B::Pss2B() {}; - Pss2B::~Pss2B() {}; +bool assign_Pss2B_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->n; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->n; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* Pss2B_factory() { - return new Pss2B; - } + + + + + + + + + + + + + + + + + + + + + + + + + +const char Pss2B::debugName[] = "Pss2B"; +const char* Pss2B::debugString() const +{ + return Pss2B::debugName; } -void Pss2B::addConstructToMap(std::unordered_map& factory_map) { +void Pss2B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss2B"), &Pss2B_factory)); } -void Pss2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Pss2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Pss2B.a"), &assign_Pss2B_a)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.inputSignal1Type"), &assign_Pss2B_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.inputSignal2Type"), &assign_Pss2B_inputSignal2Type)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi1max"), &assign_Pss2B_vsi1max)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi1min"), &assign_Pss2B_vsi1min)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw1"), &assign_Pss2B_tw1)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw2"), &assign_Pss2B_tw2)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi2max"), &assign_Pss2B_vsi2max)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi2min"), &assign_Pss2B_vsi2min)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw3"), &assign_Pss2B_tw3)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw4"), &assign_Pss2B_tw4)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks1"), &assign_Pss2B_ks1)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks2"), &assign_Pss2B_ks2)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks3"), &assign_Pss2B_ks3)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks4"), &assign_Pss2B_ks4)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.m"), &assign_Pss2B_m)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.n"), &assign_Pss2B_n)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t1"), &assign_Pss2B_t1)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.t10"), &assign_Pss2B_t10)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.t11"), &assign_Pss2B_t11)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t2"), &assign_Pss2B_t2)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t3"), &assign_Pss2B_t3)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t4"), &assign_Pss2B_t4)); @@ -474,28 +511,22 @@ void Pss2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss2B::debugName[] = "Pss2B"; -const char* Pss2B::debugString() +void Pss2B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss2B::debugName; } const BaseClassDefiner Pss2B::declare() @@ -503,4 +534,10 @@ const BaseClassDefiner Pss2B::declare() return BaseClassDefiner(Pss2B::addConstructToMap, Pss2B::addPrimitiveAssignFnsToMap, Pss2B::addClassAssignFnsToMap, Pss2B::debugName); } - +namespace CIMPP +{ + BaseClass* Pss2B_factory() + { + return new Pss2B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Pss2B.hpp b/CGMES_2.4.15_16FEB2016/Pss2B.hpp index af58a81df..f2ee1801e 100644 --- a/CGMES_2.4.15_16FEB2016/Pss2B.hpp +++ b/CGMES_2.4.15_16FEB2016/Pss2B.hpp @@ -1,72 +1,73 @@ #ifndef Pss2B_H #define Pss2B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" +#include "Integer.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE PSS2B Model. Extra lead/lag (or rate) block added at end (up to 4 lead/lags total). */ - class Pss2B: public PowerSystemStabilizerDynamics + class Pss2B : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ - CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks4; /* Gain on signal #2 input after ramp-tracking filter (Ks4). Typical Value = 1. Default: nullptr */ - CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ - CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ - CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ - CIMPP::Simple_Float a; /* Numerator constant (a). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ta; /* Lead constant (Ta). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Lag time constant (Tb). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss2B(); - virtual ~Pss2B(); - + ~Pss2B() override; + + CIMPP::Simple_Float a; /* Numerator constant (a). Typical Value = 1. Default: nullptr */ + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ + CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks4; /* Gain on signal #2 input after ramp-tracking filter (Ks4). Typical Value = 1. Default: nullptr */ + CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ + CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ + CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ta; /* Lead constant (Ta). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Lag time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ + CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss2B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Pss2ST.cpp b/CGMES_2.4.15_16FEB2016/Pss2ST.cpp index 27a8ff8a0..b29e480e2 100644 --- a/CGMES_2.4.15_16FEB2016/Pss2ST.cpp +++ b/CGMES_2.4.15_16FEB2016/Pss2ST.cpp @@ -1,11 +1,17 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss2ST.hpp" +#include +#include + #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -18,267 +24,287 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; Pss2ST::Pss2ST() {}; - Pss2ST::~Pss2ST() {}; +bool assign_Pss2ST_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_lsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_lsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss2ST_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_lsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_lsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss2ST_factory() { - return new Pss2ST; - } +const char Pss2ST::debugName[] = "Pss2ST"; +const char* Pss2ST::debugString() const +{ + return Pss2ST::debugName; } -void Pss2ST::addConstructToMap(std::unordered_map& factory_map) { +void Pss2ST::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss2ST"), &Pss2ST_factory)); } -void Pss2ST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Pss2ST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Pss2ST.inputSignal1Type"), &assign_Pss2ST_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.inputSignal2Type"), &assign_Pss2ST_inputSignal2Type)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.k1"), &assign_Pss2ST_k1)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.k2"), &assign_Pss2ST_k2)); + assign_map.insert(std::make_pair(std::string("cim:Pss2ST.lsmax"), &assign_Pss2ST_lsmax)); + assign_map.insert(std::make_pair(std::string("cim:Pss2ST.lsmin"), &assign_Pss2ST_lsmin)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t1"), &assign_Pss2ST_t1)); + assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t10"), &assign_Pss2ST_t10)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t2"), &assign_Pss2ST_t2)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t3"), &assign_Pss2ST_t3)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t4"), &assign_Pss2ST_t4)); @@ -287,20 +313,12 @@ void Pss2ST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss2ST::debugName[] = "Pss2ST"; -const char* Pss2ST::debugString() +void Pss2ST::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss2ST::debugName; } const BaseClassDefiner Pss2ST::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner Pss2ST::declare() return BaseClassDefiner(Pss2ST::addConstructToMap, Pss2ST::addPrimitiveAssignFnsToMap, Pss2ST::addClassAssignFnsToMap, Pss2ST::debugName); } - +namespace CIMPP +{ + BaseClass* Pss2ST_factory() + { + return new Pss2ST; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Pss2ST.hpp b/CGMES_2.4.15_16FEB2016/Pss2ST.hpp index 3ac8add11..56559ab5b 100644 --- a/CGMES_2.4.15_16FEB2016/Pss2ST.hpp +++ b/CGMES_2.4.15_16FEB2016/Pss2ST.hpp @@ -1,57 +1,58 @@ #ifndef Pss2ST_H #define Pss2ST_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PTI Microprocessor-Based Stabilizer type 1. */ - class Pss2ST: public PowerSystemStabilizerDynamics + class Pss2ST : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::PU k1; /* Gain (K1). Default: nullptr */ - CIMPP::PU k2; /* Gain (K2). Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T1). Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T2). Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T4). Default: nullptr */ - CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ - CIMPP::Seconds t7; /* Time constant (T7). Default: nullptr */ - CIMPP::Seconds t8; /* Time constant (T8). Default: nullptr */ - CIMPP::Seconds t9; /* Time constant (T9). Default: nullptr */ - CIMPP::Seconds t10; /* Time constant (T10). Default: nullptr */ - CIMPP::PU lsmax; /* Limiter (Lsmax). Default: nullptr */ - CIMPP::PU lsmin; /* Limiter (Lsmin). Default: nullptr */ - CIMPP::PU vcu; /* Cutoff limiter (Vcu). Default: nullptr */ - CIMPP::PU vcl; /* Cutoff limiter (Vcl). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss2ST(); - virtual ~Pss2ST(); - + ~Pss2ST() override; + + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::PU k1; /* Gain (K1). Default: nullptr */ + CIMPP::PU k2; /* Gain (K2). Default: nullptr */ + CIMPP::PU lsmax; /* Limiter (Lsmax). Default: nullptr */ + CIMPP::PU lsmin; /* Limiter (Lsmin). Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T1). Default: nullptr */ + CIMPP::Seconds t10; /* Time constant (T10). Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T2). Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ + CIMPP::Seconds t7; /* Time constant (T7). Default: nullptr */ + CIMPP::Seconds t8; /* Time constant (T8). Default: nullptr */ + CIMPP::Seconds t9; /* Time constant (T9). Default: nullptr */ + CIMPP::PU vcl; /* Cutoff limiter (Vcl). Default: nullptr */ + CIMPP::PU vcu; /* Cutoff limiter (Vcu). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss2ST_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Pss5.cpp b/CGMES_2.4.15_16FEB2016/Pss5.cpp index 455cfab8e..370b2014f 100644 --- a/CGMES_2.4.15_16FEB2016/Pss5.cpp +++ b/CGMES_2.4.15_16FEB2016/Pss5.cpp @@ -1,291 +1,308 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss5.hpp" +#include +#include + +#include "Boolean.hpp" +#include "PU.hpp" +#include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; Pss5::Pss5() {}; - Pss5::~Pss5() {}; +bool assign_Pss5_ctw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ctw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_deadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->deadband; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_isfreq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isfreq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_kpss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_pmm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadat; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss5_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_isfreq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isfreq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_kpss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_ctw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ctw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_pmm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_deadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->deadband; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadat; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss5_factory() { - return new Pss5; - } +const char Pss5::debugName[] = "Pss5"; +const char* Pss5::debugString() const +{ + return Pss5::debugName; } -void Pss5::addConstructToMap(std::unordered_map& factory_map) { +void Pss5::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss5"), &Pss5_factory)); } -void Pss5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Pss5.kpe"), &assign_Pss5_kpe)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.kf"), &assign_Pss5_kf)); +void Pss5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Pss5.ctw2"), &assign_Pss5_ctw2)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.deadband"), &assign_Pss5_deadband)); assign_map.insert(std::make_pair(std::string("cim:Pss5.isfreq"), &assign_Pss5_isfreq)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.kf"), &assign_Pss5_kf)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.kpe"), &assign_Pss5_kpe)); assign_map.insert(std::make_pair(std::string("cim:Pss5.kpss"), &assign_Pss5_kpss)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.ctw2"), &assign_Pss5_ctw2)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.tw1"), &assign_Pss5_tw1)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.tw2"), &assign_Pss5_tw2)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.pmm"), &assign_Pss5_pmm)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl1"), &assign_Pss5_tl1)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl2"), &assign_Pss5_tl2)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl3"), &assign_Pss5_tl3)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl4"), &assign_Pss5_tl4)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmn"), &assign_Pss5_vsmn)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmx"), &assign_Pss5_vsmx)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tpe"), &assign_Pss5_tpe)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.pmm"), &assign_Pss5_pmm)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.deadband"), &assign_Pss5_deadband)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.tw1"), &assign_Pss5_tw1)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.tw2"), &assign_Pss5_tw2)); assign_map.insert(std::make_pair(std::string("cim:Pss5.vadat"), &assign_Pss5_vadat)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmn"), &assign_Pss5_vsmn)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmx"), &assign_Pss5_vsmx)); } -void Pss5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss5::debugName[] = "Pss5"; -const char* Pss5::debugString() +void Pss5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss5::debugName; } const BaseClassDefiner Pss5::declare() @@ -293,4 +310,10 @@ const BaseClassDefiner Pss5::declare() return BaseClassDefiner(Pss5::addConstructToMap, Pss5::addPrimitiveAssignFnsToMap, Pss5::addClassAssignFnsToMap, Pss5::debugName); } - +namespace CIMPP +{ + BaseClass* Pss5_factory() + { + return new Pss5; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Pss5.hpp b/CGMES_2.4.15_16FEB2016/Pss5.hpp index 4c792ad77..e5bd96947 100644 --- a/CGMES_2.4.15_16FEB2016/Pss5.hpp +++ b/CGMES_2.4.15_16FEB2016/Pss5.hpp @@ -1,57 +1,58 @@ #ifndef Pss5_H #define Pss5_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian PSS - Detailed PSS. */ - class Pss5: public PowerSystemStabilizerDynamics + class Pss5 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float kf; /* Frequency/shaft speed input gain (K). Typical Value = 5. Default: nullptr */ - CIMPP::Boolean isfreq; /* Selector for Frequency/shaft speed input (IsFreq). true = speed false = frequency. Typical Value = true. Default: false */ - CIMPP::Simple_Float kpss; /* PSS gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Boolean ctw2; /* Selector for Second washout enabling (C). true = second washout filter is bypassed false = second washout filter in use. Typical Value = true. Default: false */ - CIMPP::Seconds tw1; /* First WashOut (T). Typical Value = 3.5. Default: nullptr */ - CIMPP::Seconds tw2; /* Second WashOut (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl1; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl2; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl3; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl4; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.1. Default: nullptr */ - CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU pmm; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU deadband; /* Stabilizer output dead band (DeadBand). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean vadat; /* Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss5(); - virtual ~Pss5(); - + ~Pss5() override; + + CIMPP::Boolean ctw2; /* Selector for Second washout enabling (C). true = second washout filter is bypassed false = second washout filter in use. Typical Value = true. Default: false */ + CIMPP::PU deadband; /* Stabilizer output dead band (DeadBand). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean isfreq; /* Selector for Frequency/shaft speed input (IsFreq). true = speed false = frequency. Typical Value = true. Default: false */ + CIMPP::Simple_Float kf; /* Frequency/shaft speed input gain (K). Typical Value = 5. Default: nullptr */ + CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float kpss; /* PSS gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmm; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ + CIMPP::Seconds tl1; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl2; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl3; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl4; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tw1; /* First WashOut (T). Typical Value = 3.5. Default: nullptr */ + CIMPP::Seconds tw2; /* Second WashOut (T). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean vadat; /* Default: false */ + CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.1. Default: nullptr */ + CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss5_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssELIN2.cpp b/CGMES_2.4.15_16FEB2016/PssELIN2.cpp index 703f07db6..0aa111da9 100644 --- a/CGMES_2.4.15_16FEB2016/PssELIN2.cpp +++ b/CGMES_2.4.15_16FEB2016/PssELIN2.cpp @@ -1,201 +1,212 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssELIN2.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; PssELIN2::PssELIN2() {}; - PssELIN2::~PssELIN2() {}; +bool assign_PssELIN2_apss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->apss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ppss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ppss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_psslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->psslim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssELIN2_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssELIN2_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssELIN2_ts3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ts4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ts5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ts6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ppss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ppss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_apss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->apss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_psslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->psslim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssELIN2_factory() { - return new PssELIN2; - } + + + + + + + + + +const char PssELIN2::debugName[] = "PssELIN2"; +const char* PssELIN2::debugString() const +{ + return PssELIN2::debugName; } -void PssELIN2::addConstructToMap(std::unordered_map& factory_map) { +void PssELIN2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssELIN2"), &PssELIN2_factory)); } -void PssELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.apss"), &assign_PssELIN2_apss)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks1"), &assign_PssELIN2_ks1)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks2"), &assign_PssELIN2_ks2)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ppss"), &assign_PssELIN2_ppss)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.psslim"), &assign_PssELIN2_psslim)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts1"), &assign_PssELIN2_ts1)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts2"), &assign_PssELIN2_ts2)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts3"), &assign_PssELIN2_ts3)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts4"), &assign_PssELIN2_ts4)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts5"), &assign_PssELIN2_ts5)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts6"), &assign_PssELIN2_ts6)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks1"), &assign_PssELIN2_ks1)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks2"), &assign_PssELIN2_ks2)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ppss"), &assign_PssELIN2_ppss)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.apss"), &assign_PssELIN2_apss)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.psslim"), &assign_PssELIN2_psslim)); } -void PssELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssELIN2::debugName[] = "PssELIN2"; -const char* PssELIN2::debugString() +void PssELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssELIN2::debugName; } const BaseClassDefiner PssELIN2::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssELIN2::declare() return BaseClassDefiner(PssELIN2::addConstructToMap, PssELIN2::addPrimitiveAssignFnsToMap, PssELIN2::addClassAssignFnsToMap, PssELIN2::debugName); } - +namespace CIMPP +{ + BaseClass* PssELIN2_factory() + { + return new PssELIN2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssELIN2.hpp b/CGMES_2.4.15_16FEB2016/PssELIN2.hpp index ef2c9d869..7335abe02 100644 --- a/CGMES_2.4.15_16FEB2016/PssELIN2.hpp +++ b/CGMES_2.4.15_16FEB2016/PssELIN2.hpp @@ -1,49 +1,50 @@ #ifndef PssELIN2_H #define PssELIN2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Power system stabilizer typically associated with ExcELIN2 (though PssIEEE2B or Pss2B can also be used). */ - class PssELIN2: public PowerSystemStabilizerDynamics + class PssELIN2 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Seconds ts1; /* Time constant (Ts1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ts2; /* Time constant (Ts2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ts3; /* Time constant (Ts3). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ts4; /* Time constant (Ts4). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ts5; /* Time constant (Ts5). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ts6; /* Time constant (Ts6). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks1; /* Gain (Ks1). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks2; /* Gain (Ks2). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ppss; /* Coefficient (p_PSS) (>=0 and <=4). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU apss; /* Coefficient (a_PSS). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU psslim; /* PSS limiter (psslim). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssELIN2(); - virtual ~PssELIN2(); - + ~PssELIN2() override; + + CIMPP::PU apss; /* Coefficient (a_PSS). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ks1; /* Gain (Ks1). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks2; /* Gain (Ks2). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ppss; /* Coefficient (p_PSS) (>=0 and <=4). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU psslim; /* PSS limiter (psslim). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ts1; /* Time constant (Ts1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ts2; /* Time constant (Ts2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ts3; /* Time constant (Ts3). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ts4; /* Time constant (Ts4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ts5; /* Time constant (Ts5). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ts6; /* Time constant (Ts6). Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssELIN2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE1A.cpp b/CGMES_2.4.15_16FEB2016/PssIEEE1A.cpp index ae260b910..7613a5c13 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE1A.cpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE1A.cpp @@ -1,9 +1,14 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE1A.hpp" -#include "InputSignalKind.hpp" +#include +#include + +#include "PU.hpp" #include "PU.hpp" +#include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -13,204 +18,211 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; PssIEEE1A::PssIEEE1A() {}; - PssIEEE1A::~PssIEEE1A() {}; +bool assign_PssIEEE1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignalType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignalType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssIEEE1A_factory() { - return new PssIEEE1A; - } + + + + + + + + + +const char PssIEEE1A::debugName[] = "PssIEEE1A"; +const char* PssIEEE1A::debugString() const +{ + return PssIEEE1A::debugName; } -void PssIEEE1A::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE1A"), &PssIEEE1A_factory)); } -void PssIEEE1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.inputSignalType"), &assign_PssIEEE1A_inputSignalType)); +void PssIEEE1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.a1"), &assign_PssIEEE1A_a1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.a2"), &assign_PssIEEE1A_a2)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.inputSignalType"), &assign_PssIEEE1A_inputSignalType)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.ks"), &assign_PssIEEE1A_ks)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t1"), &assign_PssIEEE1A_t1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t2"), &assign_PssIEEE1A_t2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t3"), &assign_PssIEEE1A_t3)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t4"), &assign_PssIEEE1A_t4)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t5"), &assign_PssIEEE1A_t5)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t6"), &assign_PssIEEE1A_t6)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.ks"), &assign_PssIEEE1A_ks)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.vrmax"), &assign_PssIEEE1A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.vrmin"), &assign_PssIEEE1A_vrmin)); } -void PssIEEE1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE1A::debugName[] = "PssIEEE1A"; -const char* PssIEEE1A::debugString() +void PssIEEE1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE1A::debugName; } const BaseClassDefiner PssIEEE1A::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner PssIEEE1A::declare() return BaseClassDefiner(PssIEEE1A::addConstructToMap, PssIEEE1A::addPrimitiveAssignFnsToMap, PssIEEE1A::addClassAssignFnsToMap, PssIEEE1A::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE1A_factory() + { + return new PssIEEE1A; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE1A.hpp b/CGMES_2.4.15_16FEB2016/PssIEEE1A.hpp index b25b525b7..0d4b1471d 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE1A.hpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE1A.hpp @@ -1,51 +1,52 @@ #ifndef PssIEEE1A_H #define PssIEEE1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS1A power system stabilizer model. PSS1A is the generalized form of a PSS with a single input. Some common stabilizer input signals are speed, frequency, and power. Reference: IEEE 1A 421.5-2005 Section 8.1. */ - class PssIEEE1A: public PowerSystemStabilizerDynamics + class PssIEEE1A : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ - CIMPP::PU a1; /* PSS signal conditioning frequency filter constant (A1). Typical Value = 0.061. Default: nullptr */ - CIMPP::PU a2; /* PSS signal conditioning frequency filter constant (A2). Typical Value = 0.0017. Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds t5; /* Washout time constant (T5). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds t6; /* Transducer time constant (T6). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU ks; /* Stabilizer gain (Ks). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Typical Value = -0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE1A(); - virtual ~PssIEEE1A(); - + ~PssIEEE1A() override; + + CIMPP::PU a1; /* PSS signal conditioning frequency filter constant (A1). Typical Value = 0.061. Default: nullptr */ + CIMPP::PU a2; /* PSS signal conditioning frequency filter constant (A2). Typical Value = 0.0017. Default: nullptr */ + CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ + CIMPP::PU ks; /* Stabilizer gain (Ks). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds t5; /* Washout time constant (T5). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds t6; /* Transducer time constant (T6). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Typical Value = -0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE1A_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE2B.cpp b/CGMES_2.4.15_16FEB2016/PssIEEE2B.cpp index dc56df282..c896be757 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE2B.cpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE2B.cpp @@ -1,15 +1,20 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE2B.hpp" +#include +#include + #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "Integer.hpp" +#include "Integer.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -25,392 +30,418 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Integer.hpp" -#include "Integer.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; PssIEEE2B::PssIEEE2B() {}; - PssIEEE2B::~PssIEEE2B() {}; +bool assign_PssIEEE2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->n; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->n; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssIEEE2B_factory() { - return new PssIEEE2B; - } + + + + + + + + + + + + + + + + + + + + + +const char PssIEEE2B::debugName[] = "PssIEEE2B"; +const char* PssIEEE2B::debugString() const +{ + return PssIEEE2B::debugName; } -void PssIEEE2B::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE2B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE2B"), &PssIEEE2B_factory)); } -void PssIEEE2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssIEEE2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.inputSignal1Type"), &assign_PssIEEE2B_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.inputSignal2Type"), &assign_PssIEEE2B_inputSignal2Type)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi1max"), &assign_PssIEEE2B_vsi1max)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi1min"), &assign_PssIEEE2B_vsi1min)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw1"), &assign_PssIEEE2B_tw1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw2"), &assign_PssIEEE2B_tw2)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi2max"), &assign_PssIEEE2B_vsi2max)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi2min"), &assign_PssIEEE2B_vsi2min)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw3"), &assign_PssIEEE2B_tw3)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw4"), &assign_PssIEEE2B_tw4)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.ks1"), &assign_PssIEEE2B_ks1)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.ks2"), &assign_PssIEEE2B_ks2)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.ks3"), &assign_PssIEEE2B_ks3)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.m"), &assign_PssIEEE2B_m)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.n"), &assign_PssIEEE2B_n)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t1"), &assign_PssIEEE2B_t1)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t10"), &assign_PssIEEE2B_t10)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t11"), &assign_PssIEEE2B_t11)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t2"), &assign_PssIEEE2B_t2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t3"), &assign_PssIEEE2B_t3)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t4"), &assign_PssIEEE2B_t4)); @@ -418,24 +449,20 @@ void PssIEEE2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE2B::debugName[] = "PssIEEE2B"; -const char* PssIEEE2B::debugString() +void PssIEEE2B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE2B::debugName; } const BaseClassDefiner PssIEEE2B::declare() @@ -443,4 +470,10 @@ const BaseClassDefiner PssIEEE2B::declare() return BaseClassDefiner(PssIEEE2B::addConstructToMap, PssIEEE2B::addPrimitiveAssignFnsToMap, PssIEEE2B::addClassAssignFnsToMap, PssIEEE2B::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE2B_factory() + { + return new PssIEEE2B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE2B.hpp b/CGMES_2.4.15_16FEB2016/PssIEEE2B.hpp index 7cdf57c4e..d08edd8fe 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE2B.hpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE2B.hpp @@ -1,67 +1,68 @@ #ifndef PssIEEE2B_H #define PssIEEE2B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" +#include "Integer.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS2B power system stabilizer model. This stabilizer model is designed to represent a variety of dual-input stabilizers, which normally use combinations of power and speed or frequency to derive the stabilizing signal. Reference: IEEE 2B 421.5-2005 Section 8.2. */ - class PssIEEE2B: public PowerSystemStabilizerDynamics + class PssIEEE2B : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ - CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ - CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ - CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ - CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE2B(); - virtual ~PssIEEE2B(); - + ~PssIEEE2B() override; + + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ + CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ + CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ + CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ + CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ + CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE2B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE3B.cpp b/CGMES_2.4.15_16FEB2016/PssIEEE3B.cpp index 905f9274c..30e610d2a 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE3B.cpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE3B.cpp @@ -1,14 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE3B.hpp" -#include "InputSignalKind.hpp" -#include "InputSignalKind.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,286 +14,304 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "InputSignalKind.hpp" +#include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; PssIEEE3B::PssIEEE3B() {}; - PssIEEE3B::~PssIEEE3B() {}; +bool assign_PssIEEE3B_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE3B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PssIEEE3B_factory() { - return new PssIEEE3B; - } +const char PssIEEE3B::debugName[] = "PssIEEE3B"; +const char* PssIEEE3B::debugString() const +{ + return PssIEEE3B::debugName; } -void PssIEEE3B::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE3B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE3B"), &PssIEEE3B_factory)); } -void PssIEEE3B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.inputSignal1Type"), &assign_PssIEEE3B_inputSignal1Type)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.inputSignal2Type"), &assign_PssIEEE3B_inputSignal2Type)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.t1"), &assign_PssIEEE3B_t1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.t2"), &assign_PssIEEE3B_t2)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.tw1"), &assign_PssIEEE3B_tw1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.tw2"), &assign_PssIEEE3B_tw2)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.tw3"), &assign_PssIEEE3B_tw3)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.ks1"), &assign_PssIEEE3B_ks1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.ks2"), &assign_PssIEEE3B_ks2)); +void PssIEEE3B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.a1"), &assign_PssIEEE3B_a1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.a2"), &assign_PssIEEE3B_a2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.a3"), &assign_PssIEEE3B_a3)); @@ -305,17 +320,21 @@ void PssIEEE3B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE3B::debugName[] = "PssIEEE3B"; -const char* PssIEEE3B::debugString() +void PssIEEE3B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE3B::debugName; } const BaseClassDefiner PssIEEE3B::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner PssIEEE3B::declare() return BaseClassDefiner(PssIEEE3B::addConstructToMap, PssIEEE3B::addPrimitiveAssignFnsToMap, PssIEEE3B::addClassAssignFnsToMap, PssIEEE3B::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE3B_factory() + { + return new PssIEEE3B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE3B.hpp b/CGMES_2.4.15_16FEB2016/PssIEEE3B.hpp index 7b8c2d367..80ca94ed5 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE3B.hpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE3B.hpp @@ -1,58 +1,59 @@ #ifndef PssIEEE3B_H #define PssIEEE3B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS3B power system stabilizer model. The PSS model PSS3B has dual inputs of electrical power and rotor angular frequency deviation. The signals are used to derive an equivalent mechanical power signal. Reference: IEEE 3B 421.5-2005 Section 8.3. */ - class PssIEEE3B: public PowerSystemStabilizerDynamics + class PssIEEE3B : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = rotorSpeed. Default: 0 */ - CIMPP::Seconds t1; /* Transducer time constant (T1). Typical Value = 0.012. Default: nullptr */ - CIMPP::Seconds t2; /* Transducer time constant (T2). Typical Value = 0.012. Default: nullptr */ - CIMPP::Seconds tw1; /* Washout time constant (Tw1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tw2; /* Washout time constant (Tw2). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tw3; /* Washout time constant (Tw3). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU ks1; /* Gain on signal # 1 (Ks1). Typical Value = -0.602. Default: nullptr */ - CIMPP::PU ks2; /* Gain on signal # 2 (Ks2). Typical Value = 30.12. Default: nullptr */ - CIMPP::PU a1; /* Notch filter parameter (A1). Typical Value = 0.359. Default: nullptr */ - CIMPP::PU a2; /* Notch filter parameter (A2). Typical Value = 0.586. Default: nullptr */ - CIMPP::PU a3; /* Notch filter parameter (A3). Typical Value = 0.429. Default: nullptr */ - CIMPP::PU a4; /* Notch filter parameter (A4). Typical Value = 0.564. Default: nullptr */ - CIMPP::PU a5; /* Notch filter parameter (A5). Typical Value = 0.001. Default: nullptr */ - CIMPP::PU a6; /* Notch filter parameter (A6). Typical Value = 0. Default: nullptr */ - CIMPP::PU a7; /* Notch filter parameter (A7). Typical Value = 0.031. Default: nullptr */ - CIMPP::PU a8; /* Notch filter parameter (A8). Typical Value = 0. Default: nullptr */ - CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE3B(); - virtual ~PssIEEE3B(); - + ~PssIEEE3B() override; + + CIMPP::PU a1; /* Notch filter parameter (A1). Typical Value = 0.359. Default: nullptr */ + CIMPP::PU a2; /* Notch filter parameter (A2). Typical Value = 0.586. Default: nullptr */ + CIMPP::PU a3; /* Notch filter parameter (A3). Typical Value = 0.429. Default: nullptr */ + CIMPP::PU a4; /* Notch filter parameter (A4). Typical Value = 0.564. Default: nullptr */ + CIMPP::PU a5; /* Notch filter parameter (A5). Typical Value = 0.001. Default: nullptr */ + CIMPP::PU a6; /* Notch filter parameter (A6). Typical Value = 0. Default: nullptr */ + CIMPP::PU a7; /* Notch filter parameter (A7). Typical Value = 0.031. Default: nullptr */ + CIMPP::PU a8; /* Notch filter parameter (A8). Typical Value = 0. Default: nullptr */ + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = rotorSpeed. Default: 0 */ + CIMPP::PU ks1; /* Gain on signal # 1 (Ks1). Typical Value = -0.602. Default: nullptr */ + CIMPP::PU ks2; /* Gain on signal # 2 (Ks2). Typical Value = 30.12. Default: nullptr */ + CIMPP::Seconds t1; /* Transducer time constant (T1). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds t2; /* Transducer time constant (T2). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds tw1; /* Washout time constant (Tw1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tw2; /* Washout time constant (Tw2). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tw3; /* Washout time constant (Tw3). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE3B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE4B.cpp b/CGMES_2.4.15_16FEB2016/PssIEEE4B.cpp index b745b73d1..696becf72 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE4B.cpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE4B.cpp @@ -1,7 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE4B.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -73,893 +77,961 @@ using namespace CIMPP; PssIEEE4B::PssIEEE4B() {}; - PssIEEE4B::~PssIEEE4B() {}; +bool assign_PssIEEE4B_bwh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_bwh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwh2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_bwl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_bwl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh17; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki17; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl17; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganh2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssIEEE4B_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssIEEE4B_tl10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssIEEE4B_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vhmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vlmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vlmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE4B_bwh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_bwh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwh2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_bwl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_bwl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_kh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_kh11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kh17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh17; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki17; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl17; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganh2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vhmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vlmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vlmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssIEEE4B_factory() { - return new PssIEEE4B; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char PssIEEE4B::debugName[] = "PssIEEE4B"; +const char* PssIEEE4B::debugString() const +{ + return PssIEEE4B::debugName; } -void PssIEEE4B::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE4B"), &PssIEEE4B_factory)); } -void PssIEEE4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssIEEE4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE4B.bwh1"), &assign_PssIEEE4B_bwh1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE4B.bwh2"), &assign_PssIEEE4B_bwh2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE4B.bwl1"), &assign_PssIEEE4B_bwl1)); @@ -1029,13 +1101,8 @@ void PssIEEE4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE4B::debugName[] = "PssIEEE4B"; -const char* PssIEEE4B::debugString() +void PssIEEE4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE4B::debugName; } const BaseClassDefiner PssIEEE4B::declare() @@ -1043,4 +1110,10 @@ const BaseClassDefiner PssIEEE4B::declare() return BaseClassDefiner(PssIEEE4B::addConstructToMap, PssIEEE4B::addPrimitiveAssignFnsToMap, PssIEEE4B::addClassAssignFnsToMap, PssIEEE4B::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE4B_factory() + { + return new PssIEEE4B; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssIEEE4B.hpp b/CGMES_2.4.15_16FEB2016/PssIEEE4B.hpp index 76fc604fc..f72ebfc7e 100644 --- a/CGMES_2.4.15_16FEB2016/PssIEEE4B.hpp +++ b/CGMES_2.4.15_16FEB2016/PssIEEE4B.hpp @@ -1,106 +1,107 @@ #ifndef PssIEEE4B_H #define PssIEEE4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS2B power system stabilizer model. The PSS4B model represents a structure based on multiple working frequency bands. Three separate bands, respectively dedicated to the low-, intermediate- and high-frequency modes of oscillations, are used in this delta-omega (speed input) PSS. Reference: IEEE 4B 421.5-2005 Section 8.4. */ - class PssIEEE4B: public PowerSystemStabilizerDynamics + class PssIEEE4B : public PowerSystemStabilizerDynamics { - public: - CIMPP::Simple_Float bwh1; /* Notch filter 1 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::Simple_Float bwh2; /* Notch filter 2 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::Simple_Float bwl1; /* Notch filter 1 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::Simple_Float bwl2; /* Notch filter 2 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::PU kh; /* High band gain (K). Typical Value = 120. Default: nullptr */ - CIMPP::PU kh1; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU kh11; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh17; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh2; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU ki; /* Intermediate band gain (K). Typical Value = 30. Default: nullptr */ - CIMPP::PU ki1; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU ki11; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ki17; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ki2; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU kl; /* Low band gain (K). Typical Value = 7.5. Default: nullptr */ - CIMPP::PU kl1; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU kl11; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl17; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl2; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::Simple_Float omeganh1; /* Notch filter 1 (high-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Simple_Float omeganh2; /* Notch filter 2 (high-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Simple_Float omeganl1; /* Notch filter 1 (low-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Simple_Float omeganl2; /* Notch filter 2 (low-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Seconds th1; /* High band time constant (T). Typical Value = 0.01513. Default: nullptr */ - CIMPP::Seconds th10; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th11; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th12; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th2; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ - CIMPP::Seconds th3; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th4; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th5; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th6; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th7; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ - CIMPP::Seconds th8; /* High band time constant (T). Typical Value = 0.02179. Default: nullptr */ - CIMPP::Seconds th9; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti1; /* Intermediate band time constant (T). Typical Value = 0.173. Default: nullptr */ - CIMPP::Seconds ti10; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti11; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti12; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti2; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ - CIMPP::Seconds ti3; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti4; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti5; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti6; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti7; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ - CIMPP::Seconds ti8; /* Intermediate band time constant (T). Typical Value = 0.2491. Default: nullptr */ - CIMPP::Seconds ti9; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl1; /* Low band time constant (T). Typical Value = 1.73. Default: nullptr */ - CIMPP::Seconds tl10; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl11; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl12; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl2; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ - CIMPP::Seconds tl3; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl4; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl5; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl6; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl7; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ - CIMPP::Seconds tl8; /* Low band time constant (T). Typical Value = 2.491. Default: nullptr */ - CIMPP::Seconds tl9; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vhmax; /* High band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vhmin; /* High band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ - CIMPP::PU vimax; /* Intermediate band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vimin; /* Intermediate band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ - CIMPP::PU vlmax; /* Low band output maximum limit (V). Typical Value = 0.075. Default: nullptr */ - CIMPP::PU vlmin; /* Low band output minimum limit (V). Typical Value = -0.075. Default: nullptr */ - CIMPP::PU vstmax; /* PSS output maximum limit (V). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU vstmin; /* PSS output minimum limit (V). Typical Value = -0.15. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE4B(); - virtual ~PssIEEE4B(); - + ~PssIEEE4B() override; + + CIMPP::Simple_Float bwh1; /* Notch filter 1 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::Simple_Float bwh2; /* Notch filter 2 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::Simple_Float bwl1; /* Notch filter 1 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::Simple_Float bwl2; /* Notch filter 2 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::PU kh; /* High band gain (K). Typical Value = 120. Default: nullptr */ + CIMPP::PU kh1; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU kh11; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kh17; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kh2; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU ki; /* Intermediate band gain (K). Typical Value = 30. Default: nullptr */ + CIMPP::PU ki1; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU ki11; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki17; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki2; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU kl; /* Low band gain (K). Typical Value = 7.5. Default: nullptr */ + CIMPP::PU kl1; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU kl11; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl17; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl2; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::Simple_Float omeganh1; /* Notch filter 1 (high-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Simple_Float omeganh2; /* Notch filter 2 (high-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Simple_Float omeganl1; /* Notch filter 1 (low-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Simple_Float omeganl2; /* Notch filter 2 (low-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Seconds th1; /* High band time constant (T). Typical Value = 0.01513. Default: nullptr */ + CIMPP::Seconds th10; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th11; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th12; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th2; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ + CIMPP::Seconds th3; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th4; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th5; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th6; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th7; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ + CIMPP::Seconds th8; /* High band time constant (T). Typical Value = 0.02179. Default: nullptr */ + CIMPP::Seconds th9; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti1; /* Intermediate band time constant (T). Typical Value = 0.173. Default: nullptr */ + CIMPP::Seconds ti10; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti11; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti12; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti2; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ + CIMPP::Seconds ti3; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti4; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti5; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti6; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti7; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ + CIMPP::Seconds ti8; /* Intermediate band time constant (T). Typical Value = 0.2491. Default: nullptr */ + CIMPP::Seconds ti9; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl1; /* Low band time constant (T). Typical Value = 1.73. Default: nullptr */ + CIMPP::Seconds tl10; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl11; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl12; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl2; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ + CIMPP::Seconds tl3; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl4; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl5; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl6; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl7; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ + CIMPP::Seconds tl8; /* Low band time constant (T). Typical Value = 2.491. Default: nullptr */ + CIMPP::Seconds tl9; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::PU vhmax; /* High band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU vhmin; /* High band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ + CIMPP::PU vimax; /* Intermediate band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU vimin; /* Intermediate band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ + CIMPP::PU vlmax; /* Low band output maximum limit (V). Typical Value = 0.075. Default: nullptr */ + CIMPP::PU vlmin; /* Low band output minimum limit (V). Typical Value = -0.075. Default: nullptr */ + CIMPP::PU vstmax; /* PSS output maximum limit (V). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU vstmin; /* PSS output minimum limit (V). Typical Value = -0.15. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE4B_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssPTIST1.cpp b/CGMES_2.4.15_16FEB2016/PssPTIST1.cpp index 9e2f9ee94..c7bd7baeb 100644 --- a/CGMES_2.4.15_16FEB2016/PssPTIST1.cpp +++ b/CGMES_2.4.15_16FEB2016/PssPTIST1.cpp @@ -1,15 +1,19 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssPTIST1.hpp" -#include "PU.hpp" +#include +#include + #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -17,185 +21,192 @@ using namespace CIMPP; PssPTIST1::PssPTIST1() {}; - PssPTIST1::~PssPTIST1() {}; +bool assign_PssPTIST1_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssPTIST1_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST1_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssPTIST1_factory() { - return new PssPTIST1; - } + + + + + + + + + +const char PssPTIST1::debugName[] = "PssPTIST1"; +const char* PssPTIST1::debugString() const +{ + return PssPTIST1::debugName; } -void PssPTIST1::addConstructToMap(std::unordered_map& factory_map) { +void PssPTIST1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssPTIST1"), &PssPTIST1_factory)); } -void PssPTIST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssPTIST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtc"), &assign_PssPTIST1_dtc)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtf"), &assign_PssPTIST1_dtf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtp"), &assign_PssPTIST1_dtp)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.k"), &assign_PssPTIST1_k)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.m"), &assign_PssPTIST1_m)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tf"), &assign_PssPTIST1_tf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tp"), &assign_PssPTIST1_tp)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t1"), &assign_PssPTIST1_t1)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t2"), &assign_PssPTIST1_t2)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t3"), &assign_PssPTIST1_t3)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t4"), &assign_PssPTIST1_t4)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.k"), &assign_PssPTIST1_k)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtf"), &assign_PssPTIST1_dtf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtc"), &assign_PssPTIST1_dtc)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtp"), &assign_PssPTIST1_dtp)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tf"), &assign_PssPTIST1_tf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tp"), &assign_PssPTIST1_tp)); } -void PssPTIST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssPTIST1::debugName[] = "PssPTIST1"; -const char* PssPTIST1::debugString() +void PssPTIST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssPTIST1::debugName; } const BaseClassDefiner PssPTIST1::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssPTIST1::declare() return BaseClassDefiner(PssPTIST1::addConstructToMap, PssPTIST1::addPrimitiveAssignFnsToMap, PssPTIST1::addClassAssignFnsToMap, PssPTIST1::debugName); } - +namespace CIMPP +{ + BaseClass* PssPTIST1_factory() + { + return new PssPTIST1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssPTIST1.hpp b/CGMES_2.4.15_16FEB2016/PssPTIST1.hpp index 6e8f9983b..40174cc49 100644 --- a/CGMES_2.4.15_16FEB2016/PssPTIST1.hpp +++ b/CGMES_2.4.15_16FEB2016/PssPTIST1.hpp @@ -1,49 +1,50 @@ #ifndef PssPTIST1_H #define PssPTIST1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PTI Microprocessor-Based Stabilizer type 1. */ - class PssPTIST1: public PowerSystemStabilizerDynamics + class PssPTIST1 : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds dtf; /* Time step frequency calculation (Dtf). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtc; /* Time step related to activation of controls (Dtc). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtp; /* Time step active power calculation (Dtp). Typical Value = 0.0125. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssPTIST1(); - virtual ~PssPTIST1(); - + ~PssPTIST1() override; + + CIMPP::Seconds dtc; /* Time step related to activation of controls (Dtc). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtf; /* Time step frequency calculation (Dtf). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtp; /* Time step active power calculation (Dtp). Typical Value = 0.0125. Default: nullptr */ + CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ + CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssPTIST1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssPTIST3.cpp b/CGMES_2.4.15_16FEB2016/PssPTIST3.cpp index 21f6c7999..bdb5b8ad3 100644 --- a/CGMES_2.4.15_16FEB2016/PssPTIST3.cpp +++ b/CGMES_2.4.15_16FEB2016/PssPTIST3.cpp @@ -1,20 +1,12 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssPTIST3.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -29,518 +21,560 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; PssPTIST3::PssPTIST3() {}; - PssPTIST3::~PssPTIST3() {}; +bool assign_PssPTIST3_a0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_al(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->al; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_athres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->athres; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_isw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_lthres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lthres; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_nav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nav; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_ncl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ncl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_ncr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ncr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssPTIST3_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_athres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->athres; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_al(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->al; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_lthres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lthres; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_isw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_nav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nav; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_ncl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ncl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_ncr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ncr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssPTIST3_factory() { - return new PssPTIST3; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char PssPTIST3::debugName[] = "PssPTIST3"; +const char* PssPTIST3::debugString() const +{ + return PssPTIST3::debugName; } -void PssPTIST3::addConstructToMap(std::unordered_map& factory_map) { +void PssPTIST3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssPTIST3"), &PssPTIST3_factory)); } -void PssPTIST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.m"), &assign_PssPTIST3_m)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tf"), &assign_PssPTIST3_tf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tp"), &assign_PssPTIST3_tp)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t1"), &assign_PssPTIST3_t1)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t2"), &assign_PssPTIST3_t2)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t3"), &assign_PssPTIST3_t3)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t4"), &assign_PssPTIST3_t4)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.k"), &assign_PssPTIST3_k)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtf"), &assign_PssPTIST3_dtf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtc"), &assign_PssPTIST3_dtc)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtp"), &assign_PssPTIST3_dtp)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t5"), &assign_PssPTIST3_t5)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t6"), &assign_PssPTIST3_t6)); +void PssPTIST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a0"), &assign_PssPTIST3_a0)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a1"), &assign_PssPTIST3_a1)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a2"), &assign_PssPTIST3_a2)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b0"), &assign_PssPTIST3_b0)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b1"), &assign_PssPTIST3_b1)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b2"), &assign_PssPTIST3_b2)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a3"), &assign_PssPTIST3_a3)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a4"), &assign_PssPTIST3_a4)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a5"), &assign_PssPTIST3_a5)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.al"), &assign_PssPTIST3_al)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.athres"), &assign_PssPTIST3_athres)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b0"), &assign_PssPTIST3_b0)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b1"), &assign_PssPTIST3_b1)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b2"), &assign_PssPTIST3_b2)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b3"), &assign_PssPTIST3_b3)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b4"), &assign_PssPTIST3_b4)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b5"), &assign_PssPTIST3_b5)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.athres"), &assign_PssPTIST3_athres)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dl"), &assign_PssPTIST3_dl)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.al"), &assign_PssPTIST3_al)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.lthres"), &assign_PssPTIST3_lthres)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.pmin"), &assign_PssPTIST3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtc"), &assign_PssPTIST3_dtc)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtf"), &assign_PssPTIST3_dtf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtp"), &assign_PssPTIST3_dtp)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.isw"), &assign_PssPTIST3_isw)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.k"), &assign_PssPTIST3_k)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.lthres"), &assign_PssPTIST3_lthres)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.m"), &assign_PssPTIST3_m)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.nav"), &assign_PssPTIST3_nav)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.ncl"), &assign_PssPTIST3_ncl)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.ncr"), &assign_PssPTIST3_ncr)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.pmin"), &assign_PssPTIST3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t1"), &assign_PssPTIST3_t1)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t2"), &assign_PssPTIST3_t2)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t3"), &assign_PssPTIST3_t3)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t4"), &assign_PssPTIST3_t4)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t5"), &assign_PssPTIST3_t5)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t6"), &assign_PssPTIST3_t6)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tf"), &assign_PssPTIST3_tf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tp"), &assign_PssPTIST3_tp)); } -void PssPTIST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssPTIST3::debugName[] = "PssPTIST3"; -const char* PssPTIST3::debugString() +void PssPTIST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssPTIST3::debugName; } const BaseClassDefiner PssPTIST3::declare() @@ -548,4 +582,10 @@ const BaseClassDefiner PssPTIST3::declare() return BaseClassDefiner(PssPTIST3::addConstructToMap, PssPTIST3::addPrimitiveAssignFnsToMap, PssPTIST3::addClassAssignFnsToMap, PssPTIST3::debugName); } - +namespace CIMPP +{ + BaseClass* PssPTIST3_factory() + { + return new PssPTIST3; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssPTIST3.hpp b/CGMES_2.4.15_16FEB2016/PssPTIST3.hpp index 77bed928c..72f604647 100644 --- a/CGMES_2.4.15_16FEB2016/PssPTIST3.hpp +++ b/CGMES_2.4.15_16FEB2016/PssPTIST3.hpp @@ -1,74 +1,75 @@ #ifndef PssPTIST3_H #define PssPTIST3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PTI Microprocessor-Based Stabilizer type 3. */ - class PssPTIST3: public PowerSystemStabilizerDynamics + class PssPTIST3 : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds dtf; /* Time step frequency calculation (0.03 for 50 Hz) (Dtf). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtc; /* Time step related to activation of controls (0.03 for 50 Hz) (Dtc). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtp; /* Time step active power calculation (0.015 for 50 Hz) (Dtp). Typical Value = 0.0125. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ - CIMPP::PU a0; /* Filter coefficient (A0). Default: nullptr */ - CIMPP::PU a1; /* Limiter (Al). Default: nullptr */ - CIMPP::PU a2; /* Filter coefficient (A2). Default: nullptr */ - CIMPP::PU b0; /* Filter coefficient (B0). Default: nullptr */ - CIMPP::PU b1; /* Filter coefficient (B1). Default: nullptr */ - CIMPP::PU b2; /* Filter coefficient (B2). Default: nullptr */ - CIMPP::PU a3; /* Filter coefficient (A3). Default: nullptr */ - CIMPP::PU a4; /* Filter coefficient (A4). Default: nullptr */ - CIMPP::PU a5; /* Filter coefficient (A5). Default: nullptr */ - CIMPP::PU b3; /* Filter coefficient (B3). Default: nullptr */ - CIMPP::PU b4; /* Filter coefficient (B4). Default: nullptr */ - CIMPP::PU b5; /* Filter coefficient (B5). Default: nullptr */ - CIMPP::PU athres; /* Threshold value above which output averaging will be bypassed (Athres). Typical Value = 0.005. Default: nullptr */ - CIMPP::PU dl; /* Limiter (Dl). Default: nullptr */ - CIMPP::PU al; /* Limiter (Al). Default: nullptr */ - CIMPP::PU lthres; /* Threshold value (Lthres). Default: nullptr */ - CIMPP::PU pmin; /* (Pmin). Default: nullptr */ - CIMPP::Boolean isw; /* Digital/analog output switch (Isw). true = produce analog output false = convert to digital output, using tap selection table. Default: false */ - CIMPP::Simple_Float nav; /* Number of control outputs to average (Nav) (1 <= Nav <= 16). Typical Value = 4. Default: nullptr */ - CIMPP::Simple_Float ncl; /* Number of counts at limit to active limit function (Ncl) (>0). Default: nullptr */ - CIMPP::Simple_Float ncr; /* Number of counts until reset after limit function is triggered (Ncr). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssPTIST3(); - virtual ~PssPTIST3(); - + ~PssPTIST3() override; + + CIMPP::PU a0; /* Filter coefficient (A0). Default: nullptr */ + CIMPP::PU a1; /* Limiter (Al). Default: nullptr */ + CIMPP::PU a2; /* Filter coefficient (A2). Default: nullptr */ + CIMPP::PU a3; /* Filter coefficient (A3). Default: nullptr */ + CIMPP::PU a4; /* Filter coefficient (A4). Default: nullptr */ + CIMPP::PU a5; /* Filter coefficient (A5). Default: nullptr */ + CIMPP::PU al; /* Limiter (Al). Default: nullptr */ + CIMPP::PU athres; /* Threshold value above which output averaging will be bypassed (Athres). Typical Value = 0.005. Default: nullptr */ + CIMPP::PU b0; /* Filter coefficient (B0). Default: nullptr */ + CIMPP::PU b1; /* Filter coefficient (B1). Default: nullptr */ + CIMPP::PU b2; /* Filter coefficient (B2). Default: nullptr */ + CIMPP::PU b3; /* Filter coefficient (B3). Default: nullptr */ + CIMPP::PU b4; /* Filter coefficient (B4). Default: nullptr */ + CIMPP::PU b5; /* Filter coefficient (B5). Default: nullptr */ + CIMPP::PU dl; /* Limiter (Dl). Default: nullptr */ + CIMPP::Seconds dtc; /* Time step related to activation of controls (0.03 for 50 Hz) (Dtc). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtf; /* Time step frequency calculation (0.03 for 50 Hz) (Dtf). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtp; /* Time step active power calculation (0.015 for 50 Hz) (Dtp). Typical Value = 0.0125. Default: nullptr */ + CIMPP::Boolean isw; /* Digital/analog output switch (Isw). true = produce analog output false = convert to digital output, using tap selection table. Default: false */ + CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ + CIMPP::PU lthres; /* Threshold value (Lthres). Default: nullptr */ + CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ + CIMPP::Simple_Float nav; /* Number of control outputs to average (Nav) (1 <= Nav <= 16). Typical Value = 4. Default: nullptr */ + CIMPP::Simple_Float ncl; /* Number of counts at limit to active limit function (Ncl) (>0). Default: nullptr */ + CIMPP::Simple_Float ncr; /* Number of counts until reset after limit function is triggered (Ncr). Default: nullptr */ + CIMPP::PU pmin; /* (Pmin). Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ + CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssPTIST3_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssSB4.cpp b/CGMES_2.4.15_16FEB2016/PssSB4.cpp index 94f0a847c..f6dca8bb3 100644 --- a/CGMES_2.4.15_16FEB2016/PssSB4.cpp +++ b/CGMES_2.4.15_16FEB2016/PssSB4.cpp @@ -1,8 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssSB4.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -11,191 +14,199 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; PssSB4::PssSB4() {}; - PssSB4::~PssSB4() {}; +bool assign_PssSB4_kx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tx1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tx2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssSB4_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSB4_kx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSB4_tx2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_tx1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssSB4_factory() { - return new PssSB4; - } + + + + + + + + + +const char PssSB4::debugName[] = "PssSB4"; +const char* PssSB4::debugString() const +{ + return PssSB4::debugName; } -void PssSB4::addConstructToMap(std::unordered_map& factory_map) { +void PssSB4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssSB4"), &PssSB4_factory)); } -void PssSB4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssSB4.tt"), &assign_PssSB4_tt)); +void PssSB4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssSB4.kx"), &assign_PssSB4_kx)); - assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx2"), &assign_PssSB4_tx2)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.ta"), &assign_PssSB4_ta)); - assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx1"), &assign_PssSB4_tx1)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.tb"), &assign_PssSB4_tb)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.tc"), &assign_PssSB4_tc)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.td"), &assign_PssSB4_td)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.te"), &assign_PssSB4_te)); + assign_map.insert(std::make_pair(std::string("cim:PssSB4.tt"), &assign_PssSB4_tt)); + assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx1"), &assign_PssSB4_tx1)); + assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx2"), &assign_PssSB4_tx2)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.vsmax"), &assign_PssSB4_vsmax)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.vsmin"), &assign_PssSB4_vsmin)); } -void PssSB4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssSB4::debugName[] = "PssSB4"; -const char* PssSB4::debugString() +void PssSB4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssSB4::debugName; } const BaseClassDefiner PssSB4::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssSB4::declare() return BaseClassDefiner(PssSB4::addConstructToMap, PssSB4::addPrimitiveAssignFnsToMap, PssSB4::addClassAssignFnsToMap, PssSB4::debugName); } - +namespace CIMPP +{ + BaseClass* PssSB4_factory() + { + return new PssSB4; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssSB4.hpp b/CGMES_2.4.15_16FEB2016/PssSB4.hpp index 31f1ed9c7..a18083e3c 100644 --- a/CGMES_2.4.15_16FEB2016/PssSB4.hpp +++ b/CGMES_2.4.15_16FEB2016/PssSB4.hpp @@ -1,49 +1,50 @@ #ifndef PssSB4_H #define PssSB4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Power sensitive stabilizer model. */ - class PssSB4: public PowerSystemStabilizerDynamics + class PssSB4 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Seconds tt; /* Time constant (Tt). Default: nullptr */ - CIMPP::PU kx; /* Gain (Kx). Default: nullptr */ - CIMPP::Seconds tx2; /* Time constant (Tx2). Default: nullptr */ - CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ - CIMPP::Seconds tx1; /* Reset time constant (Tx1). Default: nullptr */ - CIMPP::Seconds tb; /* Time constant (Tb). Default: nullptr */ - CIMPP::Seconds tc; /* Time constant (Tc). Default: nullptr */ - CIMPP::Seconds td; /* Time constant (Td). Default: nullptr */ - CIMPP::Seconds te; /* Time constant (Te). Default: nullptr */ - CIMPP::PU vsmax; /* Limiter (Vsmax). Default: nullptr */ - CIMPP::PU vsmin; /* Limiter (Vsmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssSB4(); - virtual ~PssSB4(); - + ~PssSB4() override; + + CIMPP::PU kx; /* Gain (Kx). Default: nullptr */ + CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ + CIMPP::Seconds tb; /* Time constant (Tb). Default: nullptr */ + CIMPP::Seconds tc; /* Time constant (Tc). Default: nullptr */ + CIMPP::Seconds td; /* Time constant (Td). Default: nullptr */ + CIMPP::Seconds te; /* Time constant (Te). Default: nullptr */ + CIMPP::Seconds tt; /* Time constant (Tt). Default: nullptr */ + CIMPP::Seconds tx1; /* Reset time constant (Tx1). Default: nullptr */ + CIMPP::Seconds tx2; /* Time constant (Tx2). Default: nullptr */ + CIMPP::PU vsmax; /* Limiter (Vsmax). Default: nullptr */ + CIMPP::PU vsmin; /* Limiter (Vsmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssSB4_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssSH.cpp b/CGMES_2.4.15_16FEB2016/PssSH.cpp index ffb22736d..e8b98edbd 100644 --- a/CGMES_2.4.15_16FEB2016/PssSH.cpp +++ b/CGMES_2.4.15_16FEB2016/PssSH.cpp @@ -1,7 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssSH.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -19,13 +23,177 @@ using namespace CIMPP; PssSH::PssSH() {}; - PssSH::~PssSH() {}; +bool assign_PssSH_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSH_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSH_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +205,40 @@ PssSH::~PssSH() {}; -bool assign_PssSH_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSH_k0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSH_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSH_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssSH_factory() { - return new PssSH; - } + +const char PssSH::debugName[] = "PssSH"; +const char* PssSH::debugString() const +{ + return PssSH::debugName; } -void PssSH::addConstructToMap(std::unordered_map& factory_map) { +void PssSH::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssSH"), &PssSH_factory)); } -void PssSH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssSH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssSH.k"), &assign_PssSH_k)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k0"), &assign_PssSH_k0)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k1"), &assign_PssSH_k1)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k2"), &assign_PssSH_k2)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k3"), &assign_PssSH_k3)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k4"), &assign_PssSH_k4)); - assign_map.insert(std::make_pair(std::string("cim:PssSH.td"), &assign_PssSH_td)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t1"), &assign_PssSH_t1)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t2"), &assign_PssSH_t2)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t3"), &assign_PssSH_t3)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t4"), &assign_PssSH_t4)); + assign_map.insert(std::make_pair(std::string("cim:PssSH.td"), &assign_PssSH_td)); assign_map.insert(std::make_pair(std::string("cim:PssSH.vsmax"), &assign_PssSH_vsmax)); assign_map.insert(std::make_pair(std::string("cim:PssSH.vsmin"), &assign_PssSH_vsmin)); } -void PssSH::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssSH::debugName[] = "PssSH"; -const char* PssSH::debugString() +void PssSH::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssSH::debugName; } const BaseClassDefiner PssSH::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner PssSH::declare() return BaseClassDefiner(PssSH::addConstructToMap, PssSH::addPrimitiveAssignFnsToMap, PssSH::addClassAssignFnsToMap, PssSH::debugName); } - +namespace CIMPP +{ + BaseClass* PssSH_factory() + { + return new PssSH; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssSH.hpp b/CGMES_2.4.15_16FEB2016/PssSH.hpp index dd728e153..72614d6c4 100644 --- a/CGMES_2.4.15_16FEB2016/PssSH.hpp +++ b/CGMES_2.4.15_16FEB2016/PssSH.hpp @@ -1,51 +1,52 @@ #ifndef PssSH_H #define PssSH_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Model for Siemens "H infinity" power system stabilizer with generator electrical power input. */ - class PssSH: public PowerSystemStabilizerDynamics + class PssSH : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU k; /* Main gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU k0; /* Gain 0 (K0). Typical Value = 0.012. Default: nullptr */ - CIMPP::PU k1; /* Gain 1 (K1). Typical Value = 0.488. Default: nullptr */ - CIMPP::PU k2; /* Gain 2 (K2). Typical Value = 0.064. Default: nullptr */ - CIMPP::PU k3; /* Gain 3 (K3). Typical Value = 0.224. Default: nullptr */ - CIMPP::PU k4; /* Gain 4 (K4). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds td; /* Input time constant (Td). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant 1 (T1). Typical Value = 0.076. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant 2 (T2). Typical Value = 0.086. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant 3 (T3). Typical Value = 1.068. Default: nullptr */ - CIMPP::Seconds t4; /* Time constant 4 (T4). Typical Value = 1.913. Default: nullptr */ - CIMPP::PU vsmax; /* Output maximum limit (Vsmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vsmin; /* Output minimum limit (Vsmin). Typical Value = -0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssSH(); - virtual ~PssSH(); - + ~PssSH() override; + + CIMPP::PU k; /* Main gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU k0; /* Gain 0 (K0). Typical Value = 0.012. Default: nullptr */ + CIMPP::PU k1; /* Gain 1 (K1). Typical Value = 0.488. Default: nullptr */ + CIMPP::PU k2; /* Gain 2 (K2). Typical Value = 0.064. Default: nullptr */ + CIMPP::PU k3; /* Gain 3 (K3). Typical Value = 0.224. Default: nullptr */ + CIMPP::PU k4; /* Gain 4 (K4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t1; /* Time constant 1 (T1). Typical Value = 0.076. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant 2 (T2). Typical Value = 0.086. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant 3 (T3). Typical Value = 1.068. Default: nullptr */ + CIMPP::Seconds t4; /* Time constant 4 (T4). Typical Value = 1.913. Default: nullptr */ + CIMPP::Seconds td; /* Input time constant (Td). Typical Value = 10. Default: nullptr */ + CIMPP::PU vsmax; /* Output maximum limit (Vsmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vsmin; /* Output minimum limit (Vsmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssSH_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssSK.cpp b/CGMES_2.4.15_16FEB2016/PssSK.cpp index 3ce8b4a2c..cff220b90 100644 --- a/CGMES_2.4.15_16FEB2016/PssSK.cpp +++ b/CGMES_2.4.15_16FEB2016/PssSK.cpp @@ -1,7 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssSK.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,165 +21,177 @@ using namespace CIMPP; PssSK::PssSK() {}; - PssSK::~PssSK() {}; +bool assign_PssSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSK_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssSK_factory() { - return new PssSK; - } + + + + + + + + + +const char PssSK::debugName[] = "PssSK"; +const char* PssSK::debugString() const +{ + return PssSK::debugName; } -void PssSK::addConstructToMap(std::unordered_map& factory_map) { +void PssSK::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssSK"), &PssSK_factory)); } -void PssSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssSK.k1"), &assign_PssSK_k1)); assign_map.insert(std::make_pair(std::string("cim:PssSK.k2"), &assign_PssSK_k2)); assign_map.insert(std::make_pair(std::string("cim:PssSK.k3"), &assign_PssSK_k3)); @@ -189,13 +205,8 @@ void PssSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssSK::debugName[] = "PssSK"; -const char* PssSK::debugString() +void PssSK::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssSK::debugName; } const BaseClassDefiner PssSK::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssSK::declare() return BaseClassDefiner(PssSK::addConstructToMap, PssSK::addPrimitiveAssignFnsToMap, PssSK::addClassAssignFnsToMap, PssSK::debugName); } - +namespace CIMPP +{ + BaseClass* PssSK_factory() + { + return new PssSK; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssSK.hpp b/CGMES_2.4.15_16FEB2016/PssSK.hpp index d1951bedb..767897b2b 100644 --- a/CGMES_2.4.15_16FEB2016/PssSK.hpp +++ b/CGMES_2.4.15_16FEB2016/PssSK.hpp @@ -1,49 +1,50 @@ #ifndef PssSK_H #define PssSK_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PSS Slovakian type - three inputs. */ - class PssSK: public PowerSystemStabilizerDynamics + class PssSK : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU k1; /* Gain P (K1). Typical Value = -0.3. Default: nullptr */ - CIMPP::PU k2; /* Gain fe (K2). Typical Value = -0.15. Default: nullptr */ - CIMPP::PU k3; /* Gain If (K3). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds t1; /* Denominator time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Filter time constant (T2). Typical Value = 0.35. Default: nullptr */ - CIMPP::Seconds t3; /* Denominator time constant (T3). Typical Value = 0.22. Default: nullptr */ - CIMPP::Seconds t4; /* Filter time constant (T4). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t5; /* Denominator time constant (T5). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t6; /* Filter time constant (T6). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vsmax; /* Stabilizer output max limit (Vsmax). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU vsmin; /* Stabilizer output min limit (Vsmin). Typical Value = -0.4. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssSK(); - virtual ~PssSK(); - + ~PssSK() override; + + CIMPP::PU k1; /* Gain P (K1). Typical Value = -0.3. Default: nullptr */ + CIMPP::PU k2; /* Gain fe (K2). Typical Value = -0.15. Default: nullptr */ + CIMPP::PU k3; /* Gain If (K3). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds t1; /* Denominator time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Filter time constant (T2). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds t3; /* Denominator time constant (T3). Typical Value = 0.22. Default: nullptr */ + CIMPP::Seconds t4; /* Filter time constant (T4). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t5; /* Denominator time constant (T5). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t6; /* Filter time constant (T6). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU vsmax; /* Stabilizer output max limit (Vsmax). Typical Value = 0.4. Default: nullptr */ + CIMPP::PU vsmin; /* Stabilizer output min limit (Vsmin). Typical Value = -0.4. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssSK_factory(); diff --git a/CGMES_2.4.15_16FEB2016/PssWECC.cpp b/CGMES_2.4.15_16FEB2016/PssWECC.cpp index fee24fae9..92f2fc3c1 100644 --- a/CGMES_2.4.15_16FEB2016/PssWECC.cpp +++ b/CGMES_2.4.15_16FEB2016/PssWECC.cpp @@ -1,11 +1,14 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssWECC.hpp" +#include +#include + #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -16,6 +19,7 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -24,261 +28,281 @@ using namespace CIMPP; PssWECC::PssWECC() {}; - PssWECC::~PssWECC() {}; +bool assign_PssWECC_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssWECC_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PssWECC_factory() { - return new PssWECC; - } +const char PssWECC::debugName[] = "PssWECC"; +const char* PssWECC::debugString() const +{ + return PssWECC::debugName; } -void PssWECC::addConstructToMap(std::unordered_map& factory_map) { +void PssWECC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssWECC"), &PssWECC_factory)); } -void PssWECC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssWECC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssWECC.inputSignal1Type"), &assign_PssWECC_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.inputSignal2Type"), &assign_PssWECC_inputSignal2Type)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.k1"), &assign_PssWECC_k1)); - assign_map.insert(std::make_pair(std::string("cim:PssWECC.t1"), &assign_PssWECC_t1)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.k2"), &assign_PssWECC_k2)); + assign_map.insert(std::make_pair(std::string("cim:PssWECC.t1"), &assign_PssWECC_t1)); + assign_map.insert(std::make_pair(std::string("cim:PssWECC.t10"), &assign_PssWECC_t10)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.t2"), &assign_PssWECC_t2)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.t3"), &assign_PssWECC_t3)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.t4"), &assign_PssWECC_t4)); @@ -286,21 +310,15 @@ void PssWECC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssWECC::debugName[] = "PssWECC"; -const char* PssWECC::debugString() +void PssWECC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssWECC::debugName; } const BaseClassDefiner PssWECC::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner PssWECC::declare() return BaseClassDefiner(PssWECC::addConstructToMap, PssWECC::addPrimitiveAssignFnsToMap, PssWECC::addClassAssignFnsToMap, PssWECC::debugName); } - +namespace CIMPP +{ + BaseClass* PssWECC_factory() + { + return new PssWECC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/PssWECC.hpp b/CGMES_2.4.15_16FEB2016/PssWECC.hpp index 56daeaa51..f1e2066e4 100644 --- a/CGMES_2.4.15_16FEB2016/PssWECC.hpp +++ b/CGMES_2.4.15_16FEB2016/PssWECC.hpp @@ -1,57 +1,58 @@ #ifndef PssWECC_H #define PssWECC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Dual input Power System Stabilizer, based on IEEE type 2, with modified output limiter defined by WECC (Western Electricity Coordinating Council, USA). */ - class PssWECC: public PowerSystemStabilizerDynamics + class PssWECC : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Default: 0 */ - CIMPP::PU k1; /* Input signal 1 gain (K). Default: nullptr */ - CIMPP::Seconds t1; /* Input signal 1 transducer time constant (T). Default: nullptr */ - CIMPP::PU k2; /* Input signal 2 gain (K). Default: nullptr */ - CIMPP::Seconds t2; /* Input signal 2 transducer time constant (T). Default: nullptr */ - CIMPP::Seconds t3; /* Stabilizer washout time constant (T). Default: nullptr */ - CIMPP::Seconds t4; /* Stabilizer washout time lag constant (T) (>0). Default: nullptr */ - CIMPP::Seconds t5; /* Lead time constant (T). Default: nullptr */ - CIMPP::Seconds t6; /* Lag time constant (T). Default: nullptr */ - CIMPP::Seconds t7; /* Lead time constant (T). Default: nullptr */ - CIMPP::Seconds t8; /* Lag time constant (T). Default: nullptr */ - CIMPP::Seconds t10; /* Lag time constant (T). Default: nullptr */ - CIMPP::Seconds t9; /* Lead time constant (T). Default: nullptr */ - CIMPP::PU vsmax; /* Maximum output signal (Vsmax). Default: nullptr */ - CIMPP::PU vsmin; /* Minimum output signal (Vsmin). Default: nullptr */ - CIMPP::PU vcu; /* Maximum value for voltage compensator output (V). Default: nullptr */ - CIMPP::PU vcl; /* Minimum value for voltage compensator output (V). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssWECC(); - virtual ~PssWECC(); - + ~PssWECC() override; + + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Default: 0 */ + CIMPP::PU k1; /* Input signal 1 gain (K). Default: nullptr */ + CIMPP::PU k2; /* Input signal 2 gain (K). Default: nullptr */ + CIMPP::Seconds t1; /* Input signal 1 transducer time constant (T). Default: nullptr */ + CIMPP::Seconds t10; /* Lag time constant (T). Default: nullptr */ + CIMPP::Seconds t2; /* Input signal 2 transducer time constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Stabilizer washout time constant (T). Default: nullptr */ + CIMPP::Seconds t4; /* Stabilizer washout time lag constant (T) (>0). Default: nullptr */ + CIMPP::Seconds t5; /* Lead time constant (T). Default: nullptr */ + CIMPP::Seconds t6; /* Lag time constant (T). Default: nullptr */ + CIMPP::Seconds t7; /* Lead time constant (T). Default: nullptr */ + CIMPP::Seconds t8; /* Lag time constant (T). Default: nullptr */ + CIMPP::Seconds t9; /* Lead time constant (T). Default: nullptr */ + CIMPP::PU vcl; /* Minimum value for voltage compensator output (V). Default: nullptr */ + CIMPP::PU vcu; /* Maximum value for voltage compensator output (V). Default: nullptr */ + CIMPP::PU vsmax; /* Maximum output signal (Vsmax). Default: nullptr */ + CIMPP::PU vsmin; /* Minimum output signal (Vsmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssWECC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Quality61850.cpp b/CGMES_2.4.15_16FEB2016/Quality61850.cpp index 882cf9b2b..ac78a9b84 100644 --- a/CGMES_2.4.15_16FEB2016/Quality61850.cpp +++ b/CGMES_2.4.15_16FEB2016/Quality61850.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Quality61850.hpp" +#include +#include + #include "Boolean.hpp" #include "Boolean.hpp" #include "Boolean.hpp" @@ -18,178 +22,191 @@ using namespace CIMPP; Quality61850::Quality61850() {}; - Quality61850::~Quality61850() {}; +bool assign_Quality61850_badReference(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->badReference; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_estimatorReplaced(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->estimatorReplaced; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_failure(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->failure; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_oldData(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oldData; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_operatorBlocked(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operatorBlocked; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_oscillatory(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oscillatory; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_outOfRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->outOfRange; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_overFlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->overFlow; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_source(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->source; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_suspect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->suspect; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_test(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->test; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_validity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->validity; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Quality61850_badReference(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->badReference; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Quality61850_estimatorReplaced(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->estimatorReplaced; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Quality61850_failure(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->failure; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Quality61850_oldData(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oldData; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_operatorBlocked(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operatorBlocked; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_oscillatory(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oscillatory; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_outOfRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->outOfRange; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_overFlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->overFlow; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_source(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->source; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_suspect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->suspect; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_test(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->test; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_validity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->validity; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* Quality61850_factory() { - return new Quality61850; - } + + + + + + + + + +const char Quality61850::debugName[] = "Quality61850"; +const char* Quality61850::debugString() const +{ + return Quality61850::debugName; } -void Quality61850::addConstructToMap(std::unordered_map& factory_map) { +void Quality61850::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Quality61850"), &Quality61850_factory)); } -void Quality61850::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Quality61850::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Quality61850.badReference"), &assign_Quality61850_badReference)); assign_map.insert(std::make_pair(std::string("cim:Quality61850.estimatorReplaced"), &assign_Quality61850_estimatorReplaced)); assign_map.insert(std::make_pair(std::string("cim:Quality61850.failure"), &assign_Quality61850_failure)); @@ -204,13 +221,8 @@ void Quality61850::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Quality61850::debugName[] = "Quality61850"; -const char* Quality61850::debugString() +void Quality61850::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Quality61850::debugName; } const BaseClassDefiner Quality61850::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner Quality61850::declare() return BaseClassDefiner(Quality61850::addConstructToMap, Quality61850::addPrimitiveAssignFnsToMap, Quality61850::addClassAssignFnsToMap, Quality61850::debugName); } - +namespace CIMPP +{ + BaseClass* Quality61850_factory() + { + return new Quality61850; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Quality61850.hpp b/CGMES_2.4.15_16FEB2016/Quality61850.hpp index 6e6d4eb6a..fb8336676 100644 --- a/CGMES_2.4.15_16FEB2016/Quality61850.hpp +++ b/CGMES_2.4.15_16FEB2016/Quality61850.hpp @@ -1,51 +1,52 @@ #ifndef Quality61850_H #define Quality61850_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "Source.hpp" #include "Validity.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in this class for convenience. */ - class Quality61850: public BaseClass + class Quality61850 : public BaseClass { - public: - CIMPP::Boolean badReference; /* Measurement value may be incorrect due to a reference being out of calibration. Default: false */ - CIMPP::Boolean estimatorReplaced; /* Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience. Default: false */ - CIMPP::Boolean failure; /* This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure. Default: false */ - CIMPP::Boolean oldData; /* Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval. Default: false */ - CIMPP::Boolean operatorBlocked; /* Measurement value is blocked and hence unavailable for transmission. Default: false */ - CIMPP::Boolean oscillatory; /* To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier `oscillatory` is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status `questionable` is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status `questionable` is reset and `invalid` is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status `invalid` is set immediately in addition to the detail quality identifier `oscillatory` (used for status information only). Default: false */ - CIMPP::Boolean outOfRange; /* Measurement value is beyond a predefined range of value. Default: false */ - CIMPP::Boolean overFlow; /* Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero. Default: false */ - CIMPP::Source source; /* Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Default: 0 */ - CIMPP::Boolean suspect; /* A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator. Default: false */ - CIMPP::Boolean test; /* Measurement value is transmitted for test purposes. Default: false */ - CIMPP::Validity validity; /* Validity of the measurement value. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Quality61850(); - virtual ~Quality61850(); - + ~Quality61850() override; + + CIMPP::Boolean badReference; /* Measurement value may be incorrect due to a reference being out of calibration. Default: false */ + CIMPP::Boolean estimatorReplaced; /* Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience. Default: false */ + CIMPP::Boolean failure; /* This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure. Default: false */ + CIMPP::Boolean oldData; /* Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval. Default: false */ + CIMPP::Boolean operatorBlocked; /* Measurement value is blocked and hence unavailable for transmission. Default: false */ + CIMPP::Boolean oscillatory; /* To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier `oscillatory` is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status `questionable` is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status `questionable` is reset and `invalid` is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status `invalid` is set immediately in addition to the detail quality identifier `oscillatory` (used for status information only). Default: false */ + CIMPP::Boolean outOfRange; /* Measurement value is beyond a predefined range of value. Default: false */ + CIMPP::Boolean overFlow; /* Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero. Default: false */ + CIMPP::Source source; /* Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Default: 0 */ + CIMPP::Boolean suspect; /* A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator. Default: false */ + CIMPP::Boolean test; /* Measurement value is transmitted for test purposes. Default: false */ + CIMPP::Validity validity; /* Validity of the measurement value. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Quality61850_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.cpp b/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.cpp index 96b62d8dc..066aa79a7 100644 --- a/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.cpp +++ b/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.cpp @@ -1,49 +1,56 @@ -#include -#include "AnalogControl.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RaiseLowerCommand.hpp" +#include +#include + #include "ValueAliasSet.hpp" using namespace CIMPP; -RaiseLowerCommand::RaiseLowerCommand(): ValueAliasSet(nullptr) {}; - +RaiseLowerCommand::RaiseLowerCommand() : ValueAliasSet(nullptr) {}; RaiseLowerCommand::~RaiseLowerCommand() {}; -bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass*, BaseClass*); -bool assign_RaiseLowerCommand_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RaiseLowerCommand* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_RaiseLowerCommands(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* RaiseLowerCommand_factory() { - return new RaiseLowerCommand; +bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass*, BaseClass*); +bool assign_RaiseLowerCommand_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RaiseLowerCommand* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_RaiseLowerCommands(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void RaiseLowerCommand::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand"), &RaiseLowerCommand_factory)); +const char RaiseLowerCommand::debugName[] = "RaiseLowerCommand"; +const char* RaiseLowerCommand::debugString() const +{ + return RaiseLowerCommand::debugName; } -void RaiseLowerCommand::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void RaiseLowerCommand::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand"), &RaiseLowerCommand_factory)); +} -void RaiseLowerCommand::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand.ValueAliasSet"), &assign_RaiseLowerCommand_ValueAliasSet)); +void RaiseLowerCommand::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RaiseLowerCommand::debugName[] = "RaiseLowerCommand"; -const char* RaiseLowerCommand::debugString() +void RaiseLowerCommand::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RaiseLowerCommand::debugName; + assign_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand.ValueAliasSet"), &assign_RaiseLowerCommand_ValueAliasSet)); } const BaseClassDefiner RaiseLowerCommand::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner RaiseLowerCommand::declare() return BaseClassDefiner(RaiseLowerCommand::addConstructToMap, RaiseLowerCommand::addPrimitiveAssignFnsToMap, RaiseLowerCommand::addClassAssignFnsToMap, RaiseLowerCommand::debugName); } - +namespace CIMPP +{ + BaseClass* RaiseLowerCommand_factory() + { + return new RaiseLowerCommand; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.hpp b/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.hpp index 98c85b0ac..a64ed8aa0 100644 --- a/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.hpp +++ b/CGMES_2.4.15_16FEB2016/RaiseLowerCommand.hpp @@ -1,38 +1,39 @@ #ifndef RaiseLowerCommand_H #define RaiseLowerCommand_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AnalogControl.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "AnalogControl.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ValueAliasSet; -class ValueAliasSet; /* An analog control that increase or decrease a set point value with pulses. */ - class RaiseLowerCommand: public AnalogControl + class RaiseLowerCommand : public AnalogControl { - public: - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RaiseLowerCommand(); - virtual ~RaiseLowerCommand(); - + ~RaiseLowerCommand() override; + + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RaiseLowerCommand_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RatioTapChanger.cpp b/CGMES_2.4.15_16FEB2016/RatioTapChanger.cpp index f584544c0..a6b71a322 100644 --- a/CGMES_2.4.15_16FEB2016/RatioTapChanger.cpp +++ b/CGMES_2.4.15_16FEB2016/RatioTapChanger.cpp @@ -1,92 +1,108 @@ -#include -#include "TapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RatioTapChanger.hpp" -#include "TransformerControlMode.hpp" -#include "PerCent.hpp" +#include +#include + #include "RatioTapChangerTable.hpp" #include "TransformerEnd.hpp" +#include "PerCent.hpp" +#include "TransformerControlMode.hpp" using namespace CIMPP; -RatioTapChanger::RatioTapChanger(): RatioTapChangerTable(nullptr), TransformerEnd(nullptr) {}; - +RatioTapChanger::RatioTapChanger() : RatioTapChangerTable(nullptr), TransformerEnd(nullptr) {}; RatioTapChanger::~RatioTapChanger() {}; -bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass*, BaseClass*); -bool assign_RatioTapChanger_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->RatioTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->RatioTapChangerTable != nullptr) - return assign_RatioTapChangerTable_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RatioTapChanger_stepVoltageIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->stepVoltageIncrement; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_TransformerEnd_RatioTapChanger(BaseClass*, BaseClass*); -bool assign_RatioTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->TransformerEnd = dynamic_cast(BaseClass_ptr2); - if(element->TransformerEnd != nullptr) - return assign_TransformerEnd_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RatioTapChanger_tculControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tculControlMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_RatioTapChanger_tculControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tculControlMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass*, BaseClass*); +bool assign_RatioTapChanger_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChanger* element = dynamic_cast(BaseClass_ptr1); + RatioTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RatioTapChangerTable != element2) + { + element->RatioTapChangerTable = element2; + return assign_RatioTapChangerTable_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RatioTapChanger_stepVoltageIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->stepVoltageIncrement; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TransformerEnd_RatioTapChanger(BaseClass*, BaseClass*); +bool assign_RatioTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChanger* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TransformerEnd != element2) + { + element->TransformerEnd = element2; + return assign_TransformerEnd_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* RatioTapChanger_factory() { - return new RatioTapChanger; - } +const char RatioTapChanger::debugName[] = "RatioTapChanger"; +const char* RatioTapChanger::debugString() const +{ + return RatioTapChanger::debugName; } -void RatioTapChanger::addConstructToMap(std::unordered_map& factory_map) { +void RatioTapChanger::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RatioTapChanger"), &RatioTapChanger_factory)); } -void RatioTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.tculControlMode"), &assign_RatioTapChanger_tculControlMode)); +void RatioTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.stepVoltageIncrement"), &assign_RatioTapChanger_stepVoltageIncrement)); - } - -void RatioTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.RatioTapChangerTable"), &assign_RatioTapChanger_RatioTapChangerTable)); - assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.TransformerEnd"), &assign_RatioTapChanger_TransformerEnd)); + assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.tculControlMode"), &assign_RatioTapChanger_tculControlMode)); } -const char RatioTapChanger::debugName[] = "RatioTapChanger"; -const char* RatioTapChanger::debugString() +void RatioTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RatioTapChanger::debugName; + assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.RatioTapChangerTable"), &assign_RatioTapChanger_RatioTapChangerTable)); + assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.TransformerEnd"), &assign_RatioTapChanger_TransformerEnd)); } const BaseClassDefiner RatioTapChanger::declare() @@ -94,4 +110,10 @@ const BaseClassDefiner RatioTapChanger::declare() return BaseClassDefiner(RatioTapChanger::addConstructToMap, RatioTapChanger::addPrimitiveAssignFnsToMap, RatioTapChanger::addClassAssignFnsToMap, RatioTapChanger::debugName); } - +namespace CIMPP +{ + BaseClass* RatioTapChanger_factory() + { + return new RatioTapChanger; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RatioTapChanger.hpp b/CGMES_2.4.15_16FEB2016/RatioTapChanger.hpp index f4de91f70..522680ece 100644 --- a/CGMES_2.4.15_16FEB2016/RatioTapChanger.hpp +++ b/CGMES_2.4.15_16FEB2016/RatioTapChanger.hpp @@ -1,44 +1,45 @@ #ifndef RatioTapChanger_H #define RatioTapChanger_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "TransformerControlMode.hpp" +#include "TapChanger.hpp" +#include "BaseClassDefiner.hpp" #include "PerCent.hpp" +#include "TransformerControlMode.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class RatioTapChangerTable; + class TransformerEnd; -class RatioTapChangerTable; -class TransformerEnd; /* A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the transformer. */ - class RatioTapChanger: public TapChanger + class RatioTapChanger : public TapChanger { - public: - CIMPP::TransformerControlMode tculControlMode; /* Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Default: 0 */ - CIMPP::PerCent stepVoltageIncrement; /* Tap step increment, in per cent of nominal voltage, per step position. Default: nullptr */ - CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* The ratio tap changer of this tap ratio table. Default: 0 */ - CIMPP::TransformerEnd* TransformerEnd; /* Ratio tap changer associated with this transformer end. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RatioTapChanger(); - virtual ~RatioTapChanger(); - + ~RatioTapChanger() override; + + CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* The ratio tap changer of this tap ratio table. Default: 0 */ + CIMPP::TransformerEnd* TransformerEnd; /* Ratio tap changer associated with this transformer end. Default: 0 */ + CIMPP::PerCent stepVoltageIncrement; /* Tap step increment, in per cent of nominal voltage, per step position. Default: nullptr */ + CIMPP::TransformerControlMode tculControlMode; /* Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RatioTapChanger_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.cpp b/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.cpp index d61eef797..ee5dac524 100644 --- a/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.cpp +++ b/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RatioTapChangerTable.hpp" +#include +#include + #include "RatioTapChanger.hpp" #include "RatioTapChangerTablePoint.hpp" using namespace CIMPP; RatioTapChangerTable::RatioTapChangerTable() {}; - RatioTapChangerTable::~RatioTapChangerTable() {}; -bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RatioTapChanger.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_RatioTapChanger_RatioTapChangerTable(BaseClass*, BaseClass*); +bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + RatioTapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RatioTapChanger.begin(), element->RatioTapChanger.end(), element2) == element->RatioTapChanger.end()) + { + element->RatioTapChanger.push_back(element2); + return assign_RatioTapChanger_RatioTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RatioTapChangerTablePoint.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass*, BaseClass*); +bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + RatioTapChangerTablePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RatioTapChangerTablePoint.begin(), element->RatioTapChangerTablePoint.end(), element2) == element->RatioTapChangerTablePoint.end()) + { + element->RatioTapChangerTablePoint.push_back(element2); + return assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* RatioTapChangerTable_factory() { - return new RatioTapChangerTable; - } +const char RatioTapChangerTable::debugName[] = "RatioTapChangerTable"; +const char* RatioTapChangerTable::debugString() const +{ + return RatioTapChangerTable::debugName; } -void RatioTapChangerTable::addConstructToMap(std::unordered_map& factory_map) { +void RatioTapChangerTable::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable"), &RatioTapChangerTable_factory)); } -void RatioTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void RatioTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChanger"), &assign_RatioTapChangerTable_RatioTapChanger)); - assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChangerTablePoint"), &assign_RatioTapChangerTable_RatioTapChangerTablePoint)); +void RatioTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RatioTapChangerTable::debugName[] = "RatioTapChangerTable"; -const char* RatioTapChangerTable::debugString() +void RatioTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RatioTapChangerTable::debugName; + assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChanger"), &assign_RatioTapChangerTable_RatioTapChanger)); + assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChangerTablePoint"), &assign_RatioTapChangerTable_RatioTapChangerTablePoint)); } const BaseClassDefiner RatioTapChangerTable::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner RatioTapChangerTable::declare() return BaseClassDefiner(RatioTapChangerTable::addConstructToMap, RatioTapChangerTable::addPrimitiveAssignFnsToMap, RatioTapChangerTable::addClassAssignFnsToMap, RatioTapChangerTable::debugName); } - +namespace CIMPP +{ + BaseClass* RatioTapChangerTable_factory() + { + return new RatioTapChangerTable; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.hpp b/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.hpp index 6bfa9abad..e3677c982 100644 --- a/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.hpp +++ b/CGMES_2.4.15_16FEB2016/RatioTapChangerTable.hpp @@ -1,40 +1,41 @@ #ifndef RatioTapChangerTable_H #define RatioTapChangerTable_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RatioTapChanger; + class RatioTapChangerTablePoint; -class RatioTapChanger; -class RatioTapChangerTablePoint; /* Describes a curve for how the voltage magnitude and impedance varies with the tap step. */ - class RatioTapChangerTable: public IdentifiedObject + class RatioTapChangerTable : public IdentifiedObject { - public: - std::list RatioTapChanger; /* The tap ratio table for this ratio tap changer. Default: 0 */ - std::list RatioTapChangerTablePoint; /* Table of this point. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RatioTapChangerTable(); - virtual ~RatioTapChangerTable(); - + ~RatioTapChangerTable() override; + + std::list RatioTapChanger; /* The tap ratio table for this ratio tap changer. Default: 0 */ + std::list RatioTapChangerTablePoint; /* Table of this point. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RatioTapChangerTable_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.cpp b/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.cpp index 0a258a916..4253a4d8b 100644 --- a/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.cpp +++ b/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.cpp @@ -1,49 +1,56 @@ -#include -#include "TapChangerTablePoint.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RatioTapChangerTablePoint.hpp" +#include +#include + #include "RatioTapChangerTable.hpp" using namespace CIMPP; -RatioTapChangerTablePoint::RatioTapChangerTablePoint(): RatioTapChangerTable(nullptr) {}; - +RatioTapChangerTablePoint::RatioTapChangerTablePoint() : RatioTapChangerTable(nullptr) {}; RatioTapChangerTablePoint::~RatioTapChangerTablePoint() {}; -bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass*, BaseClass*); -bool assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->RatioTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->RatioTapChangerTable != nullptr) - return assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* RatioTapChangerTablePoint_factory() { - return new RatioTapChangerTablePoint; +bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass*, BaseClass*); +bool assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1); + RatioTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RatioTapChangerTable != element2) + { + element->RatioTapChangerTable = element2; + return assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void RatioTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint"), &RatioTapChangerTablePoint_factory)); +const char RatioTapChangerTablePoint::debugName[] = "RatioTapChangerTablePoint"; +const char* RatioTapChangerTablePoint::debugString() const +{ + return RatioTapChangerTablePoint::debugName; } -void RatioTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void RatioTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint"), &RatioTapChangerTablePoint_factory)); +} -void RatioTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint.RatioTapChangerTable"), &assign_RatioTapChangerTablePoint_RatioTapChangerTable)); +void RatioTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RatioTapChangerTablePoint::debugName[] = "RatioTapChangerTablePoint"; -const char* RatioTapChangerTablePoint::debugString() +void RatioTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RatioTapChangerTablePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint.RatioTapChangerTable"), &assign_RatioTapChangerTablePoint_RatioTapChangerTable)); } const BaseClassDefiner RatioTapChangerTablePoint::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner RatioTapChangerTablePoint::declare() return BaseClassDefiner(RatioTapChangerTablePoint::addConstructToMap, RatioTapChangerTablePoint::addPrimitiveAssignFnsToMap, RatioTapChangerTablePoint::addClassAssignFnsToMap, RatioTapChangerTablePoint::debugName); } - +namespace CIMPP +{ + BaseClass* RatioTapChangerTablePoint_factory() + { + return new RatioTapChangerTablePoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.hpp b/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.hpp index 3750262d1..07c7889db 100644 --- a/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.hpp +++ b/CGMES_2.4.15_16FEB2016/RatioTapChangerTablePoint.hpp @@ -1,38 +1,39 @@ #ifndef RatioTapChangerTablePoint_H #define RatioTapChangerTablePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChangerTablePoint.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "TapChangerTablePoint.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RatioTapChangerTable; -class RatioTapChangerTable; /* Describes each tap step in the ratio tap changer tabular curve. */ - class RatioTapChangerTablePoint: public TapChangerTablePoint + class RatioTapChangerTablePoint : public TapChangerTablePoint { - public: - CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* Points of this table. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RatioTapChangerTablePoint(); - virtual ~RatioTapChangerTablePoint(); - + ~RatioTapChangerTablePoint() override; + + CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* Points of this table. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RatioTapChangerTablePoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Reactance.cpp b/CGMES_2.4.15_16FEB2016/Reactance.cpp index e5ea380cd..6b2d635d6 100644 --- a/CGMES_2.4.15_16FEB2016/Reactance.cpp +++ b/CGMES_2.4.15_16FEB2016/Reactance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Reactance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Reactance::Reactance() {} -Reactance::~Reactance(){} +#include -Reactance::Reactance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Reactance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Reactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Reactance& Reactance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Reactance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Reactance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Reactance::debugName[] = "Reactance"; -const char* Reactance::debugString() { +const char* Reactance::debugString() const +{ return Reactance::debugName; } - -const BaseClassDefiner Reactance::declare() { - return BaseClassDefiner(Reactance::addConstructToMap, Reactance::addPrimitiveAssignFnsToMap, Reactance::addClassAssignFnsToMap, Reactance::debugName); +Reactance& Reactance::operator+=(const Reactance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Reactance& Reactance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Reactance& Reactance::operator-=(const Reactance& rhs) { - value -= rhs.value; - return *this; - } - - Reactance& Reactance::operator*=(const Reactance& rhs) { - value *= rhs.value; - return *this; - } - - Reactance& Reactance::operator/=(const Reactance& rhs) { - value /= rhs.value; - return *this; - } +Reactance& Reactance::operator-=(const Reactance& rhs) +{ + value -= rhs.value; + return *this; +} - Reactance& Reactance::operator+=(const Reactance& rhs) { - value += rhs.value; - return *this; - } +Reactance& Reactance::operator*=(const Reactance& rhs) +{ + value *= rhs.value; + return *this; +} - Reactance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Reactance& Reactance::operator/=(const Reactance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Reactance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Reactance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Reactance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Reactance.hpp b/CGMES_2.4.15_16FEB2016/Reactance.hpp index ba0ae3f00..a811d499a 100644 --- a/CGMES_2.4.15_16FEB2016/Reactance.hpp +++ b/CGMES_2.4.15_16FEB2016/Reactance.hpp @@ -1,38 +1,39 @@ #ifndef Reactance_H #define Reactance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Reactance : public BaseClass + /* + Reactance (imaginary part of impedance), at rated frequency. + */ + class Reactance { - public: - Reactance(); - virtual ~Reactance(); - Reactance(long double value); - static const BaseClassDefiner declare(); - Reactance& operator=(long double &rop); + Reactance() : value(0.0), initialized(false) {} + Reactance(long double value) : value(value), initialized(true) {} + + Reactance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Reactance& operator+=(const Reactance& rhs); Reactance& operator-=(const Reactance& rhs); Reactance& operator*=(const Reactance& rhs); Reactance& operator/=(const Reactance& rhs); + friend std::istream& operator>>(std::istream& lop, Reactance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Reactance& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.cpp b/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.cpp index 1e25f308d..493bd8bf5 100644 --- a/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.cpp +++ b/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.cpp @@ -1,62 +1,76 @@ -#include -#include "Curve.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ReactiveCapabilityCurve.hpp" +#include +#include + #include "EquivalentInjection.hpp" #include "SynchronousMachine.hpp" using namespace CIMPP; ReactiveCapabilityCurve::ReactiveCapabilityCurve() {}; - ReactiveCapabilityCurve::~ReactiveCapabilityCurve() {}; -bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EquivalentInjection.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass*, BaseClass*); +bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1); + EquivalentInjection* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EquivalentInjection.begin(), element->EquivalentInjection.end(), element2) == element->EquivalentInjection.end()) + { + element->EquivalentInjection.push_back(element2); + return assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->InitiallyUsedBySynchronousMachines.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass*, BaseClass*); +bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->InitiallyUsedBySynchronousMachines.begin(), element->InitiallyUsedBySynchronousMachines.end(), element2) == element->InitiallyUsedBySynchronousMachines.end()) + { + element->InitiallyUsedBySynchronousMachines.push_back(element2); + return assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ReactiveCapabilityCurve_factory() { - return new ReactiveCapabilityCurve; - } +const char ReactiveCapabilityCurve::debugName[] = "ReactiveCapabilityCurve"; +const char* ReactiveCapabilityCurve::debugString() const +{ + return ReactiveCapabilityCurve::debugName; } -void ReactiveCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) { +void ReactiveCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve"), &ReactiveCapabilityCurve_factory)); } -void ReactiveCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ReactiveCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.EquivalentInjection"), &assign_ReactiveCapabilityCurve_EquivalentInjection)); - assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines"), &assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines)); +void ReactiveCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ReactiveCapabilityCurve::debugName[] = "ReactiveCapabilityCurve"; -const char* ReactiveCapabilityCurve::debugString() +void ReactiveCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ReactiveCapabilityCurve::debugName; + assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.EquivalentInjection"), &assign_ReactiveCapabilityCurve_EquivalentInjection)); + assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines"), &assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines)); } const BaseClassDefiner ReactiveCapabilityCurve::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ReactiveCapabilityCurve::declare() return BaseClassDefiner(ReactiveCapabilityCurve::addConstructToMap, ReactiveCapabilityCurve::addPrimitiveAssignFnsToMap, ReactiveCapabilityCurve::addClassAssignFnsToMap, ReactiveCapabilityCurve::debugName); } - +namespace CIMPP +{ + BaseClass* ReactiveCapabilityCurve_factory() + { + return new ReactiveCapabilityCurve; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.hpp b/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.hpp index c81f39345..95cefa865 100644 --- a/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.hpp +++ b/CGMES_2.4.15_16FEB2016/ReactiveCapabilityCurve.hpp @@ -1,40 +1,41 @@ #ifndef ReactiveCapabilityCurve_H #define ReactiveCapabilityCurve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Curve.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Curve.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EquivalentInjection; + class SynchronousMachine; -class EquivalentInjection; -class SynchronousMachine; /* Reactive power rating envelope versus the synchronous machine's active power, in both the generating and motoring modes. For each active power value there is a corresponding high and low reactive power limit value. Typically there will be a separate curve for each coolant condition, such as hydrogen pressure. The Y1 axis values represent reactive minimum and the Y2 axis values represent reactive maximum. */ - class ReactiveCapabilityCurve: public Curve + class ReactiveCapabilityCurve : public Curve { - public: - std::list EquivalentInjection; /* The reactive capability curve used by this equivalent injection. Default: 0 */ - std::list InitiallyUsedBySynchronousMachines; /* The default reactive capability curve for use by a synchronous machine. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ReactiveCapabilityCurve(); - virtual ~ReactiveCapabilityCurve(); - + ~ReactiveCapabilityCurve() override; + + std::list EquivalentInjection; /* The reactive capability curve used by this equivalent injection. Default: 0 */ + std::list InitiallyUsedBySynchronousMachines; /* The default reactive capability curve for use by a synchronous machine. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ReactiveCapabilityCurve_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ReactivePower.cpp b/CGMES_2.4.15_16FEB2016/ReactivePower.cpp index 45b4344f3..568f514f7 100644 --- a/CGMES_2.4.15_16FEB2016/ReactivePower.cpp +++ b/CGMES_2.4.15_16FEB2016/ReactivePower.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ReactivePower.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -ReactivePower::ReactivePower() {} -ReactivePower::~ReactivePower(){} +#include -ReactivePower::ReactivePower(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void ReactivePower::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void ReactivePower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +ReactivePower& ReactivePower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void ReactivePower::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +ReactivePower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char ReactivePower::debugName[] = "ReactivePower"; -const char* ReactivePower::debugString() { +const char* ReactivePower::debugString() const +{ return ReactivePower::debugName; } - -const BaseClassDefiner ReactivePower::declare() { - return BaseClassDefiner(ReactivePower::addConstructToMap, ReactivePower::addPrimitiveAssignFnsToMap, ReactivePower::addClassAssignFnsToMap, ReactivePower::debugName); +ReactivePower& ReactivePower::operator+=(const ReactivePower& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - ReactivePower& ReactivePower::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - ReactivePower& ReactivePower::operator-=(const ReactivePower& rhs) { - value -= rhs.value; - return *this; - } - - ReactivePower& ReactivePower::operator*=(const ReactivePower& rhs) { - value *= rhs.value; - return *this; - } - - ReactivePower& ReactivePower::operator/=(const ReactivePower& rhs) { - value /= rhs.value; - return *this; - } +ReactivePower& ReactivePower::operator-=(const ReactivePower& rhs) +{ + value -= rhs.value; + return *this; +} - ReactivePower& ReactivePower::operator+=(const ReactivePower& rhs) { - value += rhs.value; - return *this; - } +ReactivePower& ReactivePower::operator*=(const ReactivePower& rhs) +{ + value *= rhs.value; + return *this; +} - ReactivePower::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +ReactivePower& ReactivePower::operator/=(const ReactivePower& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, ReactivePower& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ReactivePower& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const ReactivePower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/ReactivePower.hpp b/CGMES_2.4.15_16FEB2016/ReactivePower.hpp index 0b22e461b..e80659b92 100644 --- a/CGMES_2.4.15_16FEB2016/ReactivePower.hpp +++ b/CGMES_2.4.15_16FEB2016/ReactivePower.hpp @@ -1,38 +1,39 @@ #ifndef ReactivePower_H #define ReactivePower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class ReactivePower : public BaseClass + /* + Product of RMS value of the voltage and the RMS value of the quadrature component of the current. + */ + class ReactivePower { - public: - ReactivePower(); - virtual ~ReactivePower(); - ReactivePower(long double value); - static const BaseClassDefiner declare(); - ReactivePower& operator=(long double &rop); + ReactivePower() : value(0.0), initialized(false) {} + ReactivePower(long double value) : value(value), initialized(true) {} + + ReactivePower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + ReactivePower& operator+=(const ReactivePower& rhs); ReactivePower& operator-=(const ReactivePower& rhs); ReactivePower& operator*=(const ReactivePower& rhs); ReactivePower& operator/=(const ReactivePower& rhs); + friend std::istream& operator>>(std::istream& lop, ReactivePower& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const ReactivePower& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.cpp b/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.cpp index d887a2de7..b6a466799 100644 --- a/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.cpp @@ -1,76 +1,88 @@ -#include -#include "BasicIntervalSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegularIntervalSchedule.hpp" -#include "Seconds.hpp" -#include "DateTime.hpp" +#include +#include + #include "RegularTimePoint.hpp" +#include "DateTime.hpp" +#include "Seconds.hpp" using namespace CIMPP; -RegularIntervalSchedule::RegularIntervalSchedule(): endTime(nullptr) {}; - +RegularIntervalSchedule::RegularIntervalSchedule() {}; RegularIntervalSchedule::~RegularIntervalSchedule() {}; -bool assign_RegularIntervalSchedule_endTime(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->endTime = dynamic_cast(BaseClass_ptr2); - if(element->endTime != nullptr) - return true; - } - return false; +bool assign_RegularIntervalSchedule_endTime(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + element->endTime = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_RegularIntervalSchedule_TimePoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TimePoints.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_RegularIntervalSchedule_timeStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->timeStep; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_RegularIntervalSchedule_timeStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->timeStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegularTimePoint_IntervalSchedule(BaseClass*, BaseClass*); +bool assign_RegularIntervalSchedule_TimePoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1); + RegularTimePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TimePoints.begin(), element->TimePoints.end(), element2) == element->TimePoints.end()) + { + element->TimePoints.push_back(element2); + return assign_RegularTimePoint_IntervalSchedule(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* RegularIntervalSchedule_factory() { - return new RegularIntervalSchedule; - } +const char RegularIntervalSchedule::debugName[] = "RegularIntervalSchedule"; +const char* RegularIntervalSchedule::debugString() const +{ + return RegularIntervalSchedule::debugName; } -void RegularIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) { +void RegularIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule"), &RegularIntervalSchedule_factory)); } -void RegularIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void RegularIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.endTime"), &assign_RegularIntervalSchedule_endTime)); assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.timeStep"), &assign_RegularIntervalSchedule_timeStep)); - } - -void RegularIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.endTime"), &assign_RegularIntervalSchedule_endTime)); - assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.TimePoints"), &assign_RegularIntervalSchedule_TimePoints)); } -const char RegularIntervalSchedule::debugName[] = "RegularIntervalSchedule"; -const char* RegularIntervalSchedule::debugString() +void RegularIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegularIntervalSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.TimePoints"), &assign_RegularIntervalSchedule_TimePoints)); } const BaseClassDefiner RegularIntervalSchedule::declare() @@ -78,4 +90,10 @@ const BaseClassDefiner RegularIntervalSchedule::declare() return BaseClassDefiner(RegularIntervalSchedule::addConstructToMap, RegularIntervalSchedule::addPrimitiveAssignFnsToMap, RegularIntervalSchedule::addClassAssignFnsToMap, RegularIntervalSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* RegularIntervalSchedule_factory() + { + return new RegularIntervalSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.hpp b/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.hpp index de8973301..6b57324c8 100644 --- a/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/RegularIntervalSchedule.hpp @@ -1,42 +1,43 @@ #ifndef RegularIntervalSchedule_H #define RegularIntervalSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BasicIntervalSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BasicIntervalSchedule.hpp" +#include "BaseClassDefiner.hpp" +#include "DateTime.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class RegularTimePoint; - -class DateTime; -class RegularTimePoint; /* The schedule has time points where the time between them is constant. */ - class RegularIntervalSchedule: public BasicIntervalSchedule + class RegularIntervalSchedule : public BasicIntervalSchedule { - public: - CIMPP::Seconds timeStep; /* The time between each pair of subsequent regular time points in sequence order. Default: nullptr */ - CIMPP::DateTime* endTime; /* The time for the last time point. Default: '' */ - std::list TimePoints; /* The regular interval time point data values that define this schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegularIntervalSchedule(); - virtual ~RegularIntervalSchedule(); - + ~RegularIntervalSchedule() override; + + std::list TimePoints; /* The regular interval time point data values that define this schedule. Default: 0 */ + CIMPP::DateTime endTime; /* The time for the last time point. Default: '' */ + CIMPP::Seconds timeStep; /* The time between each pair of subsequent regular time points in sequence order. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegularIntervalSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RegularTimePoint.cpp b/CGMES_2.4.15_16FEB2016/RegularTimePoint.cpp index 33e56c754..e5733a393 100644 --- a/CGMES_2.4.15_16FEB2016/RegularTimePoint.cpp +++ b/CGMES_2.4.15_16FEB2016/RegularTimePoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegularTimePoint.hpp" +#include +#include + #include "RegularIntervalSchedule.hpp" #include "Integer.hpp" #include "Simple_Float.hpp" @@ -9,86 +13,92 @@ using namespace CIMPP; -RegularTimePoint::RegularTimePoint(): IntervalSchedule(nullptr) {}; - +RegularTimePoint::RegularTimePoint() : IntervalSchedule(nullptr) {}; RegularTimePoint::~RegularTimePoint() {}; -bool assign_RegularIntervalSchedule_TimePoints(BaseClass*, BaseClass*); -bool assign_RegularTimePoint_IntervalSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->IntervalSchedule = dynamic_cast(BaseClass_ptr2); - if(element->IntervalSchedule != nullptr) - return assign_RegularIntervalSchedule_TimePoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_RegularTimePoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegularTimePoint_value1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegularTimePoint_value2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RegularTimePoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegularIntervalSchedule_TimePoints(BaseClass*, BaseClass*); +bool assign_RegularTimePoint_IntervalSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegularTimePoint* element = dynamic_cast(BaseClass_ptr1); + RegularIntervalSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->IntervalSchedule != element2) + { + element->IntervalSchedule = element2; + return assign_RegularIntervalSchedule_TimePoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RegularTimePoint_value1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegularTimePoint_value2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RegularTimePoint_factory() { - return new RegularTimePoint; - } + +const char RegularTimePoint::debugName[] = "RegularTimePoint"; +const char* RegularTimePoint::debugString() const +{ + return RegularTimePoint::debugName; } -void RegularTimePoint::addConstructToMap(std::unordered_map& factory_map) { +void RegularTimePoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegularTimePoint"), &RegularTimePoint_factory)); } -void RegularTimePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.sequenceNumber"), &assign_RegularTimePoint_sequenceNumber)); +void RegularTimePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.sequenceNumber"), &assign_RegularTimePoint_sequenceNumber)); assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.value1"), &assign_RegularTimePoint_value1)); assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.value2"), &assign_RegularTimePoint_value2)); } -void RegularTimePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.IntervalSchedule"), &assign_RegularTimePoint_IntervalSchedule)); - } - -const char RegularTimePoint::debugName[] = "RegularTimePoint"; -const char* RegularTimePoint::debugString() +void RegularTimePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegularTimePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.IntervalSchedule"), &assign_RegularTimePoint_IntervalSchedule)); } const BaseClassDefiner RegularTimePoint::declare() @@ -96,4 +106,10 @@ const BaseClassDefiner RegularTimePoint::declare() return BaseClassDefiner(RegularTimePoint::addConstructToMap, RegularTimePoint::addPrimitiveAssignFnsToMap, RegularTimePoint::addClassAssignFnsToMap, RegularTimePoint::debugName); } - +namespace CIMPP +{ + BaseClass* RegularTimePoint_factory() + { + return new RegularTimePoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RegularTimePoint.hpp b/CGMES_2.4.15_16FEB2016/RegularTimePoint.hpp index a313cfc35..3d8667b37 100644 --- a/CGMES_2.4.15_16FEB2016/RegularTimePoint.hpp +++ b/CGMES_2.4.15_16FEB2016/RegularTimePoint.hpp @@ -1,43 +1,44 @@ #ifndef RegularTimePoint_H #define RegularTimePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class RegularIntervalSchedule; - -class RegularIntervalSchedule; /* Time point for a schedule where the time between the consecutive points is constant. */ - class RegularTimePoint: public BaseClass + class RegularTimePoint : public BaseClass { - public: - CIMPP::RegularIntervalSchedule* IntervalSchedule; /* Regular interval schedule containing this time point. Default: 0 */ - CIMPP::Integer sequenceNumber; /* The position of the regular time point in the sequence. Note that time points don`t have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the associated regular interval schedule`s time step with the regular time point sequence number and adding the associated schedules start time. Default: 0 */ - CIMPP::Simple_Float value1; /* The first value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ - CIMPP::Simple_Float value2; /* The second value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegularTimePoint(); - virtual ~RegularTimePoint(); - + ~RegularTimePoint() override; + + CIMPP::RegularIntervalSchedule* IntervalSchedule; /* Regular interval schedule containing this time point. Default: 0 */ + CIMPP::Integer sequenceNumber; /* The position of the regular time point in the sequence. Note that time points don`t have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the associated regular interval schedule`s time step with the regular time point sequence number and adding the associated schedules start time. Default: 0 */ + CIMPP::Simple_Float value1; /* The first value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ + CIMPP::Simple_Float value2; /* The second value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegularTimePoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RegulatingCondEq.cpp b/CGMES_2.4.15_16FEB2016/RegulatingCondEq.cpp index a2dbb3cd1..19bb9d5eb 100644 --- a/CGMES_2.4.15_16FEB2016/RegulatingCondEq.cpp +++ b/CGMES_2.4.15_16FEB2016/RegulatingCondEq.cpp @@ -1,64 +1,72 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulatingCondEq.hpp" +#include +#include + #include "RegulatingControl.hpp" #include "Boolean.hpp" using namespace CIMPP; -RegulatingCondEq::RegulatingCondEq(): RegulatingControl(nullptr) {}; - +RegulatingCondEq::RegulatingCondEq() : RegulatingControl(nullptr) {}; RegulatingCondEq::~RegulatingCondEq() {}; -bool assign_RegulatingControl_RegulatingCondEq(BaseClass*, BaseClass*); -bool assign_RegulatingCondEq_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1)) { - element->RegulatingControl = dynamic_cast(BaseClass_ptr2); - if(element->RegulatingControl != nullptr) - return assign_RegulatingControl_RegulatingCondEq(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_RegulatingCondEq_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->controlEnabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RegulatingCondEq_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->controlEnabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegulatingControl_RegulatingCondEq(BaseClass*, BaseClass*); +bool assign_RegulatingCondEq_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1); + RegulatingControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RegulatingControl != element2) + { + element->RegulatingControl = element2; + return assign_RegulatingControl_RegulatingCondEq(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* RegulatingCondEq_factory() { - return new RegulatingCondEq; - } + +const char RegulatingCondEq::debugName[] = "RegulatingCondEq"; +const char* RegulatingCondEq::debugString() const +{ + return RegulatingCondEq::debugName; } -void RegulatingCondEq::addConstructToMap(std::unordered_map& factory_map) { +void RegulatingCondEq::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegulatingCondEq"), &RegulatingCondEq_factory)); } -void RegulatingCondEq::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.controlEnabled"), &assign_RegulatingCondEq_controlEnabled)); +void RegulatingCondEq::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.controlEnabled"), &assign_RegulatingCondEq_controlEnabled)); } -void RegulatingCondEq::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.RegulatingControl"), &assign_RegulatingCondEq_RegulatingControl)); - } - -const char RegulatingCondEq::debugName[] = "RegulatingCondEq"; -const char* RegulatingCondEq::debugString() +void RegulatingCondEq::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegulatingCondEq::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.RegulatingControl"), &assign_RegulatingCondEq_RegulatingControl)); } const BaseClassDefiner RegulatingCondEq::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner RegulatingCondEq::declare() return BaseClassDefiner(RegulatingCondEq::addConstructToMap, RegulatingCondEq::addPrimitiveAssignFnsToMap, RegulatingCondEq::addClassAssignFnsToMap, RegulatingCondEq::debugName); } - +namespace CIMPP +{ + BaseClass* RegulatingCondEq_factory() + { + return new RegulatingCondEq; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RegulatingCondEq.hpp b/CGMES_2.4.15_16FEB2016/RegulatingCondEq.hpp index d468fd9ab..4540114e0 100644 --- a/CGMES_2.4.15_16FEB2016/RegulatingCondEq.hpp +++ b/CGMES_2.4.15_16FEB2016/RegulatingCondEq.hpp @@ -1,40 +1,41 @@ #ifndef RegulatingCondEq_H #define RegulatingCondEq_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class RegulatingControl; -class RegulatingControl; /* A type of conducting equipment that can regulate a quantity (i.e. voltage or flow) at a specific point in the network. */ - class RegulatingCondEq: public ConductingEquipment + class RegulatingCondEq : public ConductingEquipment { - public: - CIMPP::RegulatingControl* RegulatingControl; /* The regulating control scheme in which this equipment participates. Default: 0 */ - CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegulatingCondEq(); - virtual ~RegulatingCondEq(); - + ~RegulatingCondEq() override; + + CIMPP::RegulatingControl* RegulatingControl; /* The regulating control scheme in which this equipment participates. Default: 0 */ + CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegulatingCondEq_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RegulatingControl.cpp b/CGMES_2.4.15_16FEB2016/RegulatingControl.cpp index ca48ae3bb..8516c962f 100644 --- a/CGMES_2.4.15_16FEB2016/RegulatingControl.cpp +++ b/CGMES_2.4.15_16FEB2016/RegulatingControl.cpp @@ -1,165 +1,192 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulatingControl.hpp" -#include "RegulatingControlModeKind.hpp" +#include +#include + +#include "RegulatingCondEq.hpp" #include "RegulationSchedule.hpp" #include "Terminal.hpp" -#include "RegulatingCondEq.hpp" #include "Boolean.hpp" #include "Boolean.hpp" +#include "RegulatingControlModeKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "UnitMultiplier.hpp" using namespace CIMPP; -RegulatingControl::RegulatingControl(): Terminal(nullptr) {}; - +RegulatingControl::RegulatingControl() : Terminal(nullptr) {}; RegulatingControl::~RegulatingControl() {}; -bool assign_RegulatingControl_RegulationSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RegulationSchedule.push_back(dynamic_cast(BaseClass_ptr2)); + + +bool assign_RegulatingControl_discrete(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->discrete; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Terminal_RegulatingControl(BaseClass*, BaseClass*); -bool assign_RegulatingControl_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RegulatingControl_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->enabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_RegulatingControl_RegulatingCondEq(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RegulatingCondEq.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_RegulatingControl_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mode; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_RegulatingControl_targetDeadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetDeadband; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegulatingControl_targetValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegulatingControl_targetValueUnitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetValueUnitMultiplier; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - -bool assign_RegulatingControl_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegulatingCondEq_RegulatingControl(BaseClass*, BaseClass*); +bool assign_RegulatingControl_RegulatingCondEq(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingControl* element = dynamic_cast(BaseClass_ptr1); + RegulatingCondEq* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RegulatingCondEq.begin(), element->RegulatingCondEq.end(), element2) == element->RegulatingCondEq.end()) + { + element->RegulatingCondEq.push_back(element2); + return assign_RegulatingCondEq_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_RegulationSchedule_RegulatingControl(BaseClass*, BaseClass*); +bool assign_RegulatingControl_RegulationSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingControl* element = dynamic_cast(BaseClass_ptr1); + RegulationSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RegulationSchedule.begin(), element->RegulationSchedule.end(), element2) == element->RegulationSchedule.end()) + { + element->RegulationSchedule.push_back(element2); + return assign_RegulationSchedule_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_Terminal_RegulatingControl(BaseClass*, BaseClass*); +bool assign_RegulatingControl_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingControl* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_RegulatingControl_discrete(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->discrete; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->enabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_targetDeadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetDeadband; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_targetValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_targetValueUnitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetValueUnitMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RegulatingControl_factory() { - return new RegulatingControl; - } +const char RegulatingControl::debugName[] = "RegulatingControl"; +const char* RegulatingControl::debugString() const +{ + return RegulatingControl::debugName; } -void RegulatingControl::addConstructToMap(std::unordered_map& factory_map) { +void RegulatingControl::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegulatingControl"), &RegulatingControl_factory)); } -void RegulatingControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.mode"), &assign_RegulatingControl_mode)); - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.discrete"), &assign_RegulatingControl_discrete)); +void RegulatingControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.discrete"), &assign_RegulatingControl_discrete)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.enabled"), &assign_RegulatingControl_enabled)); + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.mode"), &assign_RegulatingControl_mode)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.targetDeadband"), &assign_RegulatingControl_targetDeadband)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.targetValue"), &assign_RegulatingControl_targetValue)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.targetValueUnitMultiplier"), &assign_RegulatingControl_targetValueUnitMultiplier)); } -void RegulatingControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulationSchedule"), &assign_RegulatingControl_RegulationSchedule)); - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.Terminal"), &assign_RegulatingControl_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulatingCondEq"), &assign_RegulatingControl_RegulatingCondEq)); - } - -const char RegulatingControl::debugName[] = "RegulatingControl"; -const char* RegulatingControl::debugString() +void RegulatingControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegulatingControl::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulatingCondEq"), &assign_RegulatingControl_RegulatingCondEq)); + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulationSchedule"), &assign_RegulatingControl_RegulationSchedule)); + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.Terminal"), &assign_RegulatingControl_Terminal)); } const BaseClassDefiner RegulatingControl::declare() @@ -167,4 +194,10 @@ const BaseClassDefiner RegulatingControl::declare() return BaseClassDefiner(RegulatingControl::addConstructToMap, RegulatingControl::addPrimitiveAssignFnsToMap, RegulatingControl::addClassAssignFnsToMap, RegulatingControl::debugName); } - +namespace CIMPP +{ + BaseClass* RegulatingControl_factory() + { + return new RegulatingControl; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RegulatingControl.hpp b/CGMES_2.4.15_16FEB2016/RegulatingControl.hpp index 9a3846033..6053d20d9 100644 --- a/CGMES_2.4.15_16FEB2016/RegulatingControl.hpp +++ b/CGMES_2.4.15_16FEB2016/RegulatingControl.hpp @@ -1,52 +1,53 @@ #ifndef RegulatingControl_H #define RegulatingControl_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "RegulatingControlModeKind.hpp" +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "RegulatingControlModeKind.hpp" #include "Simple_Float.hpp" #include "UnitMultiplier.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class RegulatingCondEq; + class RegulationSchedule; + class Terminal; -class RegulationSchedule; -class Terminal; -class RegulatingCondEq; /* Specifies a set of equipment that works together to control a power system quantity such as voltage or flow. Remote bus voltage control is possible by specifying the controlled terminal located at some place remote from the controlling equipment. In case multiple equipment, possibly of different types, control same terminal there must be only one RegulatingControl at that terminal. The most specific subtype of RegulatingControl shall be used in case such equipment participate in the control, e.g. TapChangerControl for tap changers. For flow control load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. */ - class RegulatingControl: public PowerSystemResource + class RegulatingControl : public PowerSystemResource { - public: - CIMPP::RegulatingControlModeKind mode; /* The regulating control mode presently available. This specification allows for determining the kind of regulation without need for obtaining the units from a schedule. Default: 0 */ - std::list RegulationSchedule; /* Schedule for this Regulating regulating control. Default: 0 */ - CIMPP::Terminal* Terminal; /* The controls regulating this terminal. Default: 0 */ - std::list RegulatingCondEq; /* The equipment that participates in this regulating control scheme. Default: 0 */ - CIMPP::Boolean discrete; /* The regulation is performed in a discrete mode. This applies to equipment with discrete controls, e.g. tap changers and shunt compensators. Default: false */ - CIMPP::Boolean enabled; /* The flag tells if regulation is enabled. Default: false */ - CIMPP::Simple_Float targetDeadband; /* This is a deadband used with discrete control to avoid excessive update of controls like tap changers and shunt compensator banks while regulating. The units of those appropriate for the mode. Default: nullptr */ - CIMPP::Simple_Float targetValue; /* The target value specified for case input. This value can be used for the target value without the use of schedules. The value has the units appropriate to the mode attribute. Default: nullptr */ - CIMPP::UnitMultiplier targetValueUnitMultiplier; /* Specify the multiplier for used for the targetValue. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegulatingControl(); - virtual ~RegulatingControl(); - + ~RegulatingControl() override; + + std::list RegulatingCondEq; /* The equipment that participates in this regulating control scheme. Default: 0 */ + std::list RegulationSchedule; /* Schedule for this Regulating regulating control. Default: 0 */ + CIMPP::Terminal* Terminal; /* The controls regulating this terminal. Default: 0 */ + CIMPP::Boolean discrete; /* The regulation is performed in a discrete mode. This applies to equipment with discrete controls, e.g. tap changers and shunt compensators. Default: false */ + CIMPP::Boolean enabled; /* The flag tells if regulation is enabled. Default: false */ + CIMPP::RegulatingControlModeKind mode; /* The regulating control mode presently available. This specification allows for determining the kind of regulation without need for obtaining the units from a schedule. Default: 0 */ + CIMPP::Simple_Float targetDeadband; /* This is a deadband used with discrete control to avoid excessive update of controls like tap changers and shunt compensator banks while regulating. The units of those appropriate for the mode. Default: nullptr */ + CIMPP::Simple_Float targetValue; /* The target value specified for case input. This value can be used for the target value without the use of schedules. The value has the units appropriate to the mode attribute. Default: nullptr */ + CIMPP::UnitMultiplier targetValueUnitMultiplier; /* Specify the multiplier for used for the targetValue. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegulatingControl_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.cpp b/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.cpp index 36d62b3f6..7ac923d24 100644 --- a/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.cpp +++ b/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulatingControlModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::RegulatingControlModeKind& rop) +RegulatingControlModeKind& RegulatingControlModeKind::operator=(RegulatingControlModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +RegulatingControlModeKind::operator RegulatingControlModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char RegulatingControlModeKind::debugName[] = "RegulatingControlModeKind"; +const char* RegulatingControlModeKind::debugString() const +{ + return RegulatingControlModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RegulatingControlModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -63,5 +94,51 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const RegulatingControlModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == RegulatingControlModeKind::voltage) + { + EnumSymbol = "voltage"; + } + if (obj.value == RegulatingControlModeKind::activePower) + { + EnumSymbol = "activePower"; + } + if (obj.value == RegulatingControlModeKind::reactivePower) + { + EnumSymbol = "reactivePower"; + } + if (obj.value == RegulatingControlModeKind::currentFlow) + { + EnumSymbol = "currentFlow"; + } + if (obj.value == RegulatingControlModeKind::admittance) + { + EnumSymbol = "admittance"; + } + if (obj.value == RegulatingControlModeKind::timeScheduled) + { + EnumSymbol = "timeScheduled"; + } + if (obj.value == RegulatingControlModeKind::temperature) + { + EnumSymbol = "temperature"; + } + if (obj.value == RegulatingControlModeKind::powerFactor) + { + EnumSymbol = "powerFactor"; + } + + if (!EnumSymbol.empty()) + { + os << "RegulatingControlModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.hpp b/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.hpp index fc671981d..ed5351e3e 100644 --- a/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.hpp +++ b/CGMES_2.4.15_16FEB2016/RegulatingControlModeKind.hpp @@ -1,45 +1,70 @@ #ifndef RegulatingControlModeKind_H #define RegulatingControlModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The kind of regulation model. For example regulating voltage, reactive power, active power, etc. */ - enum class RegulatingControlModeKind + class RegulatingControlModeKind { - /** - * Voltage is specified. - */ - voltage, - /** - * Active power is specified. - */ - activePower, - /** - * Reactive power is specified. - */ - reactivePower, - /** - * Current flow is specified. - */ - currentFlow, - /** - * Admittance is specified. - */ - admittance, - /** - * Control switches on/off by time of day. The times may change on the weekend, or in different seasons. - */ - timeScheduled, - /** - * Control switches on/off based on the local temperature (i.e., a thermostat). - */ - temperature, - /** - * Power factor is specified. - */ - powerFactor, + public: + enum RegulatingControlModeKind_ENUM + { + /** + * Voltage is specified. + */ + voltage, + /** + * Active power is specified. + */ + activePower, + /** + * Reactive power is specified. + */ + reactivePower, + /** + * Current flow is specified. + */ + currentFlow, + /** + * Admittance is specified. + */ + admittance, + /** + * Control switches on/off by time of day. The times may change on the weekend, or in different seasons. + */ + timeScheduled, + /** + * Control switches on/off based on the local temperature (i.e., a thermostat). + */ + temperature, + /** + * Power factor is specified. + */ + powerFactor, + }; + + RegulatingControlModeKind() : value(), initialized(false) {} + RegulatingControlModeKind(RegulatingControlModeKind_ENUM value) : value(value), initialized(true) {} + + RegulatingControlModeKind& operator=(RegulatingControlModeKind_ENUM rop); + operator RegulatingControlModeKind_ENUM() const; + + RegulatingControlModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, RegulatingControlModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const RegulatingControlModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::RegulatingControlModeKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/RegulationSchedule.cpp b/CGMES_2.4.15_16FEB2016/RegulationSchedule.cpp index 74a4e7b8f..71c2e0c89 100644 --- a/CGMES_2.4.15_16FEB2016/RegulationSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/RegulationSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulationSchedule.hpp" +#include +#include + #include "RegulatingControl.hpp" using namespace CIMPP; -RegulationSchedule::RegulationSchedule(): RegulatingControl(nullptr) {}; - +RegulationSchedule::RegulationSchedule() : RegulatingControl(nullptr) {}; RegulationSchedule::~RegulationSchedule() {}; -bool assign_RegulatingControl_RegulationSchedule(BaseClass*, BaseClass*); -bool assign_RegulationSchedule_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulationSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->RegulatingControl = dynamic_cast(BaseClass_ptr2); - if(element->RegulatingControl != nullptr) - return assign_RegulatingControl_RegulationSchedule(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* RegulationSchedule_factory() { - return new RegulationSchedule; +bool assign_RegulatingControl_RegulationSchedule(BaseClass*, BaseClass*); +bool assign_RegulationSchedule_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulationSchedule* element = dynamic_cast(BaseClass_ptr1); + RegulatingControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RegulatingControl != element2) + { + element->RegulatingControl = element2; + return assign_RegulatingControl_RegulationSchedule(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void RegulationSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RegulationSchedule"), &RegulationSchedule_factory)); +const char RegulationSchedule::debugName[] = "RegulationSchedule"; +const char* RegulationSchedule::debugString() const +{ + return RegulationSchedule::debugName; } -void RegulationSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void RegulationSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:RegulationSchedule"), &RegulationSchedule_factory)); +} -void RegulationSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulationSchedule.RegulatingControl"), &assign_RegulationSchedule_RegulatingControl)); +void RegulationSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RegulationSchedule::debugName[] = "RegulationSchedule"; -const char* RegulationSchedule::debugString() +void RegulationSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegulationSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegulationSchedule.RegulatingControl"), &assign_RegulationSchedule_RegulatingControl)); } const BaseClassDefiner RegulationSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner RegulationSchedule::declare() return BaseClassDefiner(RegulationSchedule::addConstructToMap, RegulationSchedule::addPrimitiveAssignFnsToMap, RegulationSchedule::addClassAssignFnsToMap, RegulationSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* RegulationSchedule_factory() + { + return new RegulationSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RegulationSchedule.hpp b/CGMES_2.4.15_16FEB2016/RegulationSchedule.hpp index 0d8fed494..5b8a56428 100644 --- a/CGMES_2.4.15_16FEB2016/RegulationSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/RegulationSchedule.hpp @@ -1,38 +1,39 @@ #ifndef RegulationSchedule_H #define RegulationSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RegulatingControl; -class RegulatingControl; /* A pre-established pattern over time for a controlled variable, e.g., busbar voltage. */ - class RegulationSchedule: public SeasonDayTypeSchedule + class RegulationSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::RegulatingControl* RegulatingControl; /* Regulating controls that have this Schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegulationSchedule(); - virtual ~RegulationSchedule(); - + ~RegulationSchedule() override; + + CIMPP::RegulatingControl* RegulatingControl; /* Regulating controls that have this Schedule. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegulationSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RemoteInputSignal.cpp b/CGMES_2.4.15_16FEB2016/RemoteInputSignal.cpp index 217f515ba..30f558ba0 100644 --- a/CGMES_2.4.15_16FEB2016/RemoteInputSignal.cpp +++ b/CGMES_2.4.15_16FEB2016/RemoteInputSignal.cpp @@ -1,165 +1,232 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RemoteInputSignal.hpp" -#include "Terminal.hpp" -#include "RemoteSignalKind.hpp" +#include +#include + +#include "DiscontinuousExcitationControlDynamics.hpp" #include "PFVArControllerType1Dynamics.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "Terminal.hpp" #include "UnderexcitationLimiterDynamics.hpp" -#include "WindTurbineType1or2Dynamics.hpp" #include "VoltageCompensatorDynamics.hpp" -#include "PowerSystemStabilizerDynamics.hpp" -#include "DiscontinuousExcitationControlDynamics.hpp" -#include "WindTurbineType3or4Dynamics.hpp" #include "WindPlantDynamics.hpp" +#include "WindTurbineType1or2Dynamics.hpp" +#include "WindTurbineType3or4Dynamics.hpp" +#include "RemoteSignalKind.hpp" using namespace CIMPP; -RemoteInputSignal::RemoteInputSignal(): Terminal(nullptr), PFVArControllerType1Dynamics(nullptr), UnderexcitationLimiterDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr), VoltageCompensatorDynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), DiscontinuousExcitationControlDynamics(nullptr), WindTurbineType3or4Dynamics(nullptr), WindPlantDynamics(nullptr) {}; - +RemoteInputSignal::RemoteInputSignal() : DiscontinuousExcitationControlDynamics(nullptr), PFVArControllerType1Dynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), Terminal(nullptr), UnderexcitationLimiterDynamics(nullptr), VoltageCompensatorDynamics(nullptr), WindPlantDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr), WindTurbineType3or4Dynamics(nullptr) {}; RemoteInputSignal::~RemoteInputSignal() {}; -bool assign_Terminal_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1Dynamics != nullptr) - return assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->UnderexcitationLimiterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->UnderexcitationLimiterDynamics != nullptr) - return assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2Dynamics != nullptr) - return true; - } - return false; -} -bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageCompensatorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->VoltageCompensatorDynamics != nullptr) - return assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemStabilizerDynamics = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemStabilizerDynamics != nullptr) - return assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscontinuousExcitationControlDynamics = dynamic_cast(BaseClass_ptr2); - if(element->DiscontinuousExcitationControlDynamics != nullptr) - return assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4Dynamics != nullptr) - return true; - } - return false; -} -bool assign_RemoteInputSignal_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantDynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantDynamics != nullptr) - return true; - } - return false; +bool assign_RemoteInputSignal_remoteSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->remoteSignalType; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + DiscontinuousExcitationControlDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscontinuousExcitationControlDynamics != element2) + { + element->DiscontinuousExcitationControlDynamics = element2; + return assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_RemoteInputSignal_remoteSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->remoteSignalType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1Dynamics != element2) + { + element->PFVArControllerType1Dynamics = element2; + return assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + PowerSystemStabilizerDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemStabilizerDynamics != element2) + { + element->PowerSystemStabilizerDynamics = element2; + return assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_Terminal_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + UnderexcitationLimiterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->UnderexcitationLimiterDynamics != element2) + { + element->UnderexcitationLimiterDynamics = element2; + return assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + VoltageCompensatorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageCompensatorDynamics != element2) + { + element->VoltageCompensatorDynamics = element2; + return assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindPlantDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + WindPlantDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantDynamics != element2) + { + element->WindPlantDynamics = element2; + return assign_WindPlantDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2Dynamics != element2) + { + element->WindTurbineType1or2Dynamics = element2; + return assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4Dynamics != element2) + { + element->WindTurbineType3or4Dynamics = element2; + return assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* RemoteInputSignal_factory() { - return new RemoteInputSignal; - } +const char RemoteInputSignal::debugName[] = "RemoteInputSignal"; +const char* RemoteInputSignal::debugString() const +{ + return RemoteInputSignal::debugName; } -void RemoteInputSignal::addConstructToMap(std::unordered_map& factory_map) { +void RemoteInputSignal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RemoteInputSignal"), &RemoteInputSignal_factory)); } -void RemoteInputSignal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.remoteSignalType"), &assign_RemoteInputSignal_remoteSignalType)); - } +void RemoteInputSignal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.remoteSignalType"), &assign_RemoteInputSignal_remoteSignalType)); +} -void RemoteInputSignal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void RemoteInputSignal::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.DiscontinuousExcitationControlDynamics"), &assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics)); + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PFVArControllerType1Dynamics"), &assign_RemoteInputSignal_PFVArControllerType1Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PowerSystemStabilizerDynamics"), &assign_RemoteInputSignal_PowerSystemStabilizerDynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.Terminal"), &assign_RemoteInputSignal_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PFVArControllerType1Dynamics"), &assign_RemoteInputSignal_PFVArControllerType1Dynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.UnderexcitationLimiterDynamics"), &assign_RemoteInputSignal_UnderexcitationLimiterDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType1or2Dynamics"), &assign_RemoteInputSignal_WindTurbineType1or2Dynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.VoltageCompensatorDynamics"), &assign_RemoteInputSignal_VoltageCompensatorDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PowerSystemStabilizerDynamics"), &assign_RemoteInputSignal_PowerSystemStabilizerDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.DiscontinuousExcitationControlDynamics"), &assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType3or4Dynamics"), &assign_RemoteInputSignal_WindTurbineType3or4Dynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindPlantDynamics"), &assign_RemoteInputSignal_WindPlantDynamics)); -} - -const char RemoteInputSignal::debugName[] = "RemoteInputSignal"; -const char* RemoteInputSignal::debugString() -{ - return RemoteInputSignal::debugName; + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType1or2Dynamics"), &assign_RemoteInputSignal_WindTurbineType1or2Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType3or4Dynamics"), &assign_RemoteInputSignal_WindTurbineType3or4Dynamics)); } const BaseClassDefiner RemoteInputSignal::declare() @@ -167,4 +234,10 @@ const BaseClassDefiner RemoteInputSignal::declare() return BaseClassDefiner(RemoteInputSignal::addConstructToMap, RemoteInputSignal::addPrimitiveAssignFnsToMap, RemoteInputSignal::addClassAssignFnsToMap, RemoteInputSignal::debugName); } - +namespace CIMPP +{ + BaseClass* RemoteInputSignal_factory() + { + return new RemoteInputSignal; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RemoteInputSignal.hpp b/CGMES_2.4.15_16FEB2016/RemoteInputSignal.hpp index 908d89be5..6f856860e 100644 --- a/CGMES_2.4.15_16FEB2016/RemoteInputSignal.hpp +++ b/CGMES_2.4.15_16FEB2016/RemoteInputSignal.hpp @@ -1,56 +1,57 @@ #ifndef RemoteInputSignal_H #define RemoteInputSignal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "RemoteSignalKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiscontinuousExcitationControlDynamics; + class PFVArControllerType1Dynamics; + class PowerSystemStabilizerDynamics; + class Terminal; + class UnderexcitationLimiterDynamics; + class VoltageCompensatorDynamics; + class WindPlantDynamics; + class WindTurbineType1or2Dynamics; + class WindTurbineType3or4Dynamics; - -class Terminal; -class PFVArControllerType1Dynamics; -class UnderexcitationLimiterDynamics; -class WindTurbineType1or2Dynamics; -class VoltageCompensatorDynamics; -class PowerSystemStabilizerDynamics; -class DiscontinuousExcitationControlDynamics; -class WindTurbineType3or4Dynamics; -class WindPlantDynamics; /* Supports connection to a terminal associated with a remote bus from which an input signal of a specific type is coming. */ - class RemoteInputSignal: public IdentifiedObject + class RemoteInputSignal : public IdentifiedObject { - public: - CIMPP::Terminal* Terminal; /* Remote terminal with which this input signal is associated. Default: 0 */ - CIMPP::RemoteSignalKind remoteSignalType; /* Type of input signal. Default: 0 */ - CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model using this remote input signal. Default: 0 */ - CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Underexcitation limiter model using this remote input signal. Default: 0 */ - CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator Type 1 or Type 2 model using this remote input signal. Default: 0 */ - CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model using this remote input signal. Default: 0 */ - CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model using this remote input signal. Default: 0 */ - CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model using this remote input signal. Default: 0 */ - CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Remote input signal used by these wind turbine Type 3 or 4 models. Default: 0 */ - CIMPP::WindPlantDynamics* WindPlantDynamics; /* The remote signal with which this power plant is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RemoteInputSignal(); - virtual ~RemoteInputSignal(); - + ~RemoteInputSignal() override; + + CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model using this remote input signal. Default: 0 */ + CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model using this remote input signal. Default: 0 */ + CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model using this remote input signal. Default: 0 */ + CIMPP::Terminal* Terminal; /* Remote terminal with which this input signal is associated. Default: 0 */ + CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Underexcitation limiter model using this remote input signal. Default: 0 */ + CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model using this remote input signal. Default: 0 */ + CIMPP::WindPlantDynamics* WindPlantDynamics; /* The remote signal with which this power plant is associated. Default: 0 */ + CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator Type 1 or Type 2 model using this remote input signal. Default: 0 */ + CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Remote input signal used by these wind turbine Type 3 or 4 models. Default: 0 */ + CIMPP::RemoteSignalKind remoteSignalType; /* Type of input signal. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RemoteInputSignal_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RemoteSignalKind.cpp b/CGMES_2.4.15_16FEB2016/RemoteSignalKind.cpp index 9909a7ec1..e1cd4d2e7 100644 --- a/CGMES_2.4.15_16FEB2016/RemoteSignalKind.cpp +++ b/CGMES_2.4.15_16FEB2016/RemoteSignalKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RemoteSignalKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::RemoteSignalKind& rop) +RemoteSignalKind& RemoteSignalKind::operator=(RemoteSignalKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +RemoteSignalKind::operator RemoteSignalKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char RemoteSignalKind::debugName[] = "RemoteSignalKind"; +const char* RemoteSignalKind::debugString() const +{ + return RemoteSignalKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RemoteSignalKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -68,5 +99,55 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const RemoteSignalKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == RemoteSignalKind::remoteBusVoltageFrequency) + { + EnumSymbol = "remoteBusVoltageFrequency"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltageFrequencyDeviation) + { + EnumSymbol = "remoteBusVoltageFrequencyDeviation"; + } + if (obj.value == RemoteSignalKind::remoteBusFrequency) + { + EnumSymbol = "remoteBusFrequency"; + } + if (obj.value == RemoteSignalKind::remoteBusFrequencyDeviation) + { + EnumSymbol = "remoteBusFrequencyDeviation"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltageAmplitude) + { + EnumSymbol = "remoteBusVoltageAmplitude"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltage) + { + EnumSymbol = "remoteBusVoltage"; + } + if (obj.value == RemoteSignalKind::remoteBranchCurrentAmplitude) + { + EnumSymbol = "remoteBranchCurrentAmplitude"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltageAmplitudeDerivative) + { + EnumSymbol = "remoteBusVoltageAmplitudeDerivative"; + } + if (obj.value == RemoteSignalKind::remotePuBusVoltageDerivative) + { + EnumSymbol = "remotePuBusVoltageDerivative"; + } + + if (!EnumSymbol.empty()) + { + os << "RemoteSignalKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RemoteSignalKind.hpp b/CGMES_2.4.15_16FEB2016/RemoteSignalKind.hpp index 007451b50..17a1358d3 100644 --- a/CGMES_2.4.15_16FEB2016/RemoteSignalKind.hpp +++ b/CGMES_2.4.15_16FEB2016/RemoteSignalKind.hpp @@ -1,49 +1,74 @@ #ifndef RemoteSignalKind_H #define RemoteSignalKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of input signal coming from remote bus. */ - enum class RemoteSignalKind + class RemoteSignalKind { - /** - * Input is voltage frequency from remote terminal bus. - */ - remoteBusVoltageFrequency, - /** - * Input is voltage frequency deviation from remote terminal bus. - */ - remoteBusVoltageFrequencyDeviation, - /** - * Input is frequency from remote terminal bus. - */ - remoteBusFrequency, - /** - * Input is frequency deviation from remote terminal bus. - */ - remoteBusFrequencyDeviation, - /** - * Input is voltage amplitude from remote terminal bus. - */ - remoteBusVoltageAmplitude, - /** - * Input is voltage from remote terminal bus. - */ - remoteBusVoltage, - /** - * Input is branch current amplitude from remote terminal bus. - */ - remoteBranchCurrentAmplitude, - /** - * Input is branch current amplitude derivative from remote terminal bus. - */ - remoteBusVoltageAmplitudeDerivative, - /** - * Input is PU voltage derivative from remote terminal bus. - */ - remotePuBusVoltageDerivative, + public: + enum RemoteSignalKind_ENUM + { + /** + * Input is voltage frequency from remote terminal bus. + */ + remoteBusVoltageFrequency, + /** + * Input is voltage frequency deviation from remote terminal bus. + */ + remoteBusVoltageFrequencyDeviation, + /** + * Input is frequency from remote terminal bus. + */ + remoteBusFrequency, + /** + * Input is frequency deviation from remote terminal bus. + */ + remoteBusFrequencyDeviation, + /** + * Input is voltage amplitude from remote terminal bus. + */ + remoteBusVoltageAmplitude, + /** + * Input is voltage from remote terminal bus. + */ + remoteBusVoltage, + /** + * Input is branch current amplitude from remote terminal bus. + */ + remoteBranchCurrentAmplitude, + /** + * Input is branch current amplitude derivative from remote terminal bus. + */ + remoteBusVoltageAmplitudeDerivative, + /** + * Input is PU voltage derivative from remote terminal bus. + */ + remotePuBusVoltageDerivative, + }; + + RemoteSignalKind() : value(), initialized(false) {} + RemoteSignalKind(RemoteSignalKind_ENUM value) : value(value), initialized(true) {} + + RemoteSignalKind& operator=(RemoteSignalKind_ENUM rop); + operator RemoteSignalKind_ENUM() const; + + RemoteSignalKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, RemoteSignalKind& rop); + friend std::ostream& operator<<(std::ostream& os, const RemoteSignalKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::RemoteSignalKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ReportingGroup.cpp b/CGMES_2.4.15_16FEB2016/ReportingGroup.cpp index b42bf9cec..c453a2c6f 100644 --- a/CGMES_2.4.15_16FEB2016/ReportingGroup.cpp +++ b/CGMES_2.4.15_16FEB2016/ReportingGroup.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ReportingGroup.hpp" +#include +#include + #include "BusNameMarker.hpp" #include "TopologicalNode.hpp" using namespace CIMPP; ReportingGroup::ReportingGroup() {}; - ReportingGroup::~ReportingGroup() {}; -bool assign_ReportingGroup_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReportingGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->BusNameMarker.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_BusNameMarker_ReportingGroup(BaseClass*, BaseClass*); +bool assign_ReportingGroup_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReportingGroup* element = dynamic_cast(BaseClass_ptr1); + BusNameMarker* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->BusNameMarker.begin(), element->BusNameMarker.end(), element2) == element->BusNameMarker.end()) + { + element->BusNameMarker.push_back(element2); + return assign_BusNameMarker_ReportingGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ReportingGroup_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReportingGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_ReportingGroup(BaseClass*, BaseClass*); +bool assign_ReportingGroup_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReportingGroup* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNode.begin(), element->TopologicalNode.end(), element2) == element->TopologicalNode.end()) + { + element->TopologicalNode.push_back(element2); + return assign_TopologicalNode_ReportingGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ReportingGroup_factory() { - return new ReportingGroup; - } +const char ReportingGroup::debugName[] = "ReportingGroup"; +const char* ReportingGroup::debugString() const +{ + return ReportingGroup::debugName; } -void ReportingGroup::addConstructToMap(std::unordered_map& factory_map) { +void ReportingGroup::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ReportingGroup"), &ReportingGroup_factory)); } -void ReportingGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ReportingGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.BusNameMarker"), &assign_ReportingGroup_BusNameMarker)); - assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.TopologicalNode"), &assign_ReportingGroup_TopologicalNode)); +void ReportingGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ReportingGroup::debugName[] = "ReportingGroup"; -const char* ReportingGroup::debugString() +void ReportingGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ReportingGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.BusNameMarker"), &assign_ReportingGroup_BusNameMarker)); + assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.TopologicalNode"), &assign_ReportingGroup_TopologicalNode)); } const BaseClassDefiner ReportingGroup::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ReportingGroup::declare() return BaseClassDefiner(ReportingGroup::addConstructToMap, ReportingGroup::addPrimitiveAssignFnsToMap, ReportingGroup::addClassAssignFnsToMap, ReportingGroup::debugName); } - +namespace CIMPP +{ + BaseClass* ReportingGroup_factory() + { + return new ReportingGroup; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ReportingGroup.hpp b/CGMES_2.4.15_16FEB2016/ReportingGroup.hpp index 0cb6eab61..66fb1b9e2 100644 --- a/CGMES_2.4.15_16FEB2016/ReportingGroup.hpp +++ b/CGMES_2.4.15_16FEB2016/ReportingGroup.hpp @@ -1,40 +1,41 @@ #ifndef ReportingGroup_H #define ReportingGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class BusNameMarker; + class TopologicalNode; -class BusNameMarker; -class TopologicalNode; /* A reporting group is used for various ad-hoc groupings used for reporting. */ - class ReportingGroup: public IdentifiedObject + class ReportingGroup : public IdentifiedObject { - public: - std::list BusNameMarker; /* The reporting group to which this bus name marker belongs. Default: 0 */ - std::list TopologicalNode; /* The reporting group to which the topological node belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ReportingGroup(); - virtual ~ReportingGroup(); - + ~ReportingGroup() override; + + std::list BusNameMarker; /* The reporting group to which this bus name marker belongs. Default: 0 */ + std::list TopologicalNode; /* The reporting group to which the topological node belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ReportingGroup_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Resistance.cpp b/CGMES_2.4.15_16FEB2016/Resistance.cpp index e588088c7..4686fd861 100644 --- a/CGMES_2.4.15_16FEB2016/Resistance.cpp +++ b/CGMES_2.4.15_16FEB2016/Resistance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Resistance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Resistance::Resistance() {} -Resistance::~Resistance(){} +#include -Resistance::Resistance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Resistance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Resistance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Resistance& Resistance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Resistance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Resistance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Resistance::debugName[] = "Resistance"; -const char* Resistance::debugString() { +const char* Resistance::debugString() const +{ return Resistance::debugName; } - -const BaseClassDefiner Resistance::declare() { - return BaseClassDefiner(Resistance::addConstructToMap, Resistance::addPrimitiveAssignFnsToMap, Resistance::addClassAssignFnsToMap, Resistance::debugName); +Resistance& Resistance::operator+=(const Resistance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Resistance& Resistance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Resistance& Resistance::operator-=(const Resistance& rhs) { - value -= rhs.value; - return *this; - } - - Resistance& Resistance::operator*=(const Resistance& rhs) { - value *= rhs.value; - return *this; - } - - Resistance& Resistance::operator/=(const Resistance& rhs) { - value /= rhs.value; - return *this; - } +Resistance& Resistance::operator-=(const Resistance& rhs) +{ + value -= rhs.value; + return *this; +} - Resistance& Resistance::operator+=(const Resistance& rhs) { - value += rhs.value; - return *this; - } +Resistance& Resistance::operator*=(const Resistance& rhs) +{ + value *= rhs.value; + return *this; +} - Resistance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Resistance& Resistance::operator/=(const Resistance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Resistance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Resistance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Resistance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Resistance.hpp b/CGMES_2.4.15_16FEB2016/Resistance.hpp index f8f3b51fa..cd68a214f 100644 --- a/CGMES_2.4.15_16FEB2016/Resistance.hpp +++ b/CGMES_2.4.15_16FEB2016/Resistance.hpp @@ -1,38 +1,39 @@ #ifndef Resistance_H #define Resistance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Resistance : public BaseClass + /* + Resistance (real part of impedance). + */ + class Resistance { - public: - Resistance(); - virtual ~Resistance(); - Resistance(long double value); - static const BaseClassDefiner declare(); - Resistance& operator=(long double &rop); + Resistance() : value(0.0), initialized(false) {} + Resistance(long double value) : value(value), initialized(true) {} + + Resistance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Resistance& operator+=(const Resistance& rhs); Resistance& operator-=(const Resistance& rhs); Resistance& operator*=(const Resistance& rhs); Resistance& operator/=(const Resistance& rhs); + friend std::istream& operator>>(std::istream& lop, Resistance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Resistance& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/ResistancePerLength.cpp b/CGMES_2.4.15_16FEB2016/ResistancePerLength.cpp index 306291ec7..4fb05fd6b 100644 --- a/CGMES_2.4.15_16FEB2016/ResistancePerLength.cpp +++ b/CGMES_2.4.15_16FEB2016/ResistancePerLength.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ResistancePerLength.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -ResistancePerLength::ResistancePerLength(): value(nullptr) {}; - -ResistancePerLength::~ResistancePerLength() {}; - - -bool assign_ResistancePerLength_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_ResistancePerLength_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ResistancePerLength_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_ResistancePerLength_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_ResistancePerLength_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +ResistancePerLength& ResistancePerLength::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* ResistancePerLength_factory() { - return new ResistancePerLength; +ResistancePerLength::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void ResistancePerLength::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ResistancePerLength"), &ResistancePerLength_factory)); +const char ResistancePerLength::debugName[] = "ResistancePerLength"; +const char* ResistancePerLength::debugString() const +{ + return ResistancePerLength::debugName; } -void ResistancePerLength::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.unit"), &assign_ResistancePerLength_unit)); - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.multiplier"), &assign_ResistancePerLength_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.denominatorUnit"), &assign_ResistancePerLength_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.denominatorMultiplier"), &assign_ResistancePerLength_denominatorMultiplier)); +ResistancePerLength& ResistancePerLength::operator+=(const ResistancePerLength& rhs) +{ + value += rhs.value; + return *this; } -void ResistancePerLength::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.value"), &assign_ResistancePerLength_value)); - } +ResistancePerLength& ResistancePerLength::operator-=(const ResistancePerLength& rhs) +{ + value -= rhs.value; + return *this; +} -const char ResistancePerLength::debugName[] = "ResistancePerLength"; -const char* ResistancePerLength::debugString() +ResistancePerLength& ResistancePerLength::operator*=(const ResistancePerLength& rhs) { - return ResistancePerLength::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner ResistancePerLength::declare() +ResistancePerLength& ResistancePerLength::operator/=(const ResistancePerLength& rhs) { - return BaseClassDefiner(ResistancePerLength::addConstructToMap, ResistancePerLength::addPrimitiveAssignFnsToMap, ResistancePerLength::addClassAssignFnsToMap, ResistancePerLength::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ResistancePerLength& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const ResistancePerLength& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ResistancePerLength.hpp b/CGMES_2.4.15_16FEB2016/ResistancePerLength.hpp index ffcd9b0f9..dc8f5da8d 100644 --- a/CGMES_2.4.15_16FEB2016/ResistancePerLength.hpp +++ b/CGMES_2.4.15_16FEB2016/ResistancePerLength.hpp @@ -1,46 +1,39 @@ #ifndef ResistancePerLength_H #define ResistancePerLength_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Resistance (real part of impedance) per unit of length. */ - class ResistancePerLength: public BaseClass + class ResistancePerLength { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + ResistancePerLength() : value(0.0), initialized(false) {} + ResistancePerLength(long double value) : value(value), initialized(true) {} + + ResistancePerLength& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - ResistancePerLength(); - virtual ~ResistancePerLength(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + ResistancePerLength& operator+=(const ResistancePerLength& rhs); + ResistancePerLength& operator-=(const ResistancePerLength& rhs); + ResistancePerLength& operator*=(const ResistancePerLength& rhs); + ResistancePerLength& operator/=(const ResistancePerLength& rhs); - BaseClass* ResistancePerLength_factory(); + friend std::istream& operator>>(std::istream& lop, ResistancePerLength& rop); + friend std::ostream& operator<<(std::ostream& os, const ResistancePerLength& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/RotatingMachine.cpp b/CGMES_2.4.15_16FEB2016/RotatingMachine.cpp index 07cc9dea0..8943d68a5 100644 --- a/CGMES_2.4.15_16FEB2016/RotatingMachine.cpp +++ b/CGMES_2.4.15_16FEB2016/RotatingMachine.cpp @@ -1,136 +1,156 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotatingMachine.hpp" -#include "Simple_Float.hpp" -#include "ApparentPower.hpp" -#include "Voltage.hpp" +#include +#include + #include "GeneratingUnit.hpp" #include "HydroPump.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" +#include "Simple_Float.hpp" +#include "ApparentPower.hpp" +#include "Voltage.hpp" using namespace CIMPP; -RotatingMachine::RotatingMachine(): GeneratingUnit(nullptr), HydroPump(nullptr) {}; - +RotatingMachine::RotatingMachine() : GeneratingUnit(nullptr), HydroPump(nullptr) {}; RotatingMachine::~RotatingMachine() {}; +bool assign_RotatingMachine_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeneratingUnit_RotatingMachine(BaseClass*, BaseClass*); -bool assign_RotatingMachine_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->GeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->GeneratingUnit != nullptr) - return assign_GeneratingUnit_RotatingMachine(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RotatingMachine_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_RotatingMachine_HydroPump(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->HydroPump = dynamic_cast(BaseClass_ptr2); - if(element->HydroPump != nullptr) - return true; - } - return false; +bool assign_RotatingMachine_ratedPowerFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedPowerFactor; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_RotatingMachine_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedS; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachine_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RotatingMachine_ratedPowerFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedPowerFactor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_GeneratingUnit_RotatingMachine(BaseClass*, BaseClass*); +bool assign_RotatingMachine_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RotatingMachine* element = dynamic_cast(BaseClass_ptr1); + GeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->GeneratingUnit != element2) + { + element->GeneratingUnit = element2; + return assign_GeneratingUnit_RotatingMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RotatingMachine_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedS; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_HydroPump_RotatingMachine(BaseClass*, BaseClass*); +bool assign_RotatingMachine_HydroPump(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RotatingMachine* element = dynamic_cast(BaseClass_ptr1); + HydroPump* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->HydroPump != element2) + { + element->HydroPump = element2; + return assign_HydroPump_RotatingMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RotatingMachine_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachine_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachine_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RotatingMachine_factory() { - return new RotatingMachine; - } +const char RotatingMachine::debugName[] = "RotatingMachine"; +const char* RotatingMachine::debugString() const +{ + return RotatingMachine::debugName; } -void RotatingMachine::addConstructToMap(std::unordered_map& factory_map) { +void RotatingMachine::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RotatingMachine"), &RotatingMachine_factory)); } -void RotatingMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void RotatingMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.p"), &assign_RotatingMachine_p)); + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.q"), &assign_RotatingMachine_q)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedPowerFactor"), &assign_RotatingMachine_ratedPowerFactor)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedS"), &assign_RotatingMachine_ratedS)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedU"), &assign_RotatingMachine_ratedU)); - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.p"), &assign_RotatingMachine_p)); - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.q"), &assign_RotatingMachine_q)); } -void RotatingMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.GeneratingUnit"), &assign_RotatingMachine_GeneratingUnit)); - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.HydroPump"), &assign_RotatingMachine_HydroPump)); - } - -const char RotatingMachine::debugName[] = "RotatingMachine"; -const char* RotatingMachine::debugString() +void RotatingMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RotatingMachine::debugName; + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.GeneratingUnit"), &assign_RotatingMachine_GeneratingUnit)); + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.HydroPump"), &assign_RotatingMachine_HydroPump)); } const BaseClassDefiner RotatingMachine::declare() @@ -138,4 +158,10 @@ const BaseClassDefiner RotatingMachine::declare() return BaseClassDefiner(RotatingMachine::addConstructToMap, RotatingMachine::addPrimitiveAssignFnsToMap, RotatingMachine::addClassAssignFnsToMap, RotatingMachine::debugName); } - +namespace CIMPP +{ + BaseClass* RotatingMachine_factory() + { + return new RotatingMachine; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RotatingMachine.hpp b/CGMES_2.4.15_16FEB2016/RotatingMachine.hpp index b739e28d9..52b9d80da 100644 --- a/CGMES_2.4.15_16FEB2016/RotatingMachine.hpp +++ b/CGMES_2.4.15_16FEB2016/RotatingMachine.hpp @@ -1,50 +1,51 @@ #ifndef RotatingMachine_H #define RotatingMachine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "ApparentPower.hpp" -#include "Voltage.hpp" +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "ApparentPower.hpp" #include "ReactivePower.hpp" +#include "Simple_Float.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class GeneratingUnit; + class HydroPump; -class GeneratingUnit; -class HydroPump; /* A rotating machine which may be used as a generator or motor. */ - class RotatingMachine: public RegulatingCondEq + class RotatingMachine : public RegulatingCondEq { - public: - CIMPP::Simple_Float ratedPowerFactor; /* Power factor (nameplate data). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ - CIMPP::ApparentPower ratedS; /* Nameplate apparent power rating for the unit. The attribute shall have a positive value. Default: nullptr */ - CIMPP::Voltage ratedU; /* Rated voltage (nameplate data, Ur in IEC 60909-0). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ - CIMPP::GeneratingUnit* GeneratingUnit; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ - CIMPP::HydroPump* HydroPump; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ - CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RotatingMachine(); - virtual ~RotatingMachine(); - + ~RotatingMachine() override; + + CIMPP::GeneratingUnit* GeneratingUnit; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ + CIMPP::HydroPump* HydroPump; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ + CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ + CIMPP::Simple_Float ratedPowerFactor; /* Power factor (nameplate data). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ + CIMPP::ApparentPower ratedS; /* Nameplate apparent power rating for the unit. The attribute shall have a positive value. Default: nullptr */ + CIMPP::Voltage ratedU; /* Rated voltage (nameplate data, Ur in IEC 60909-0). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RotatingMachine_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.cpp b/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.cpp index ea42560c6..8714af2c3 100644 --- a/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.cpp @@ -1,7 +1,11 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotatingMachineDynamics.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" @@ -12,100 +16,107 @@ using namespace CIMPP; RotatingMachineDynamics::RotatingMachineDynamics() {}; - RotatingMachineDynamics::~RotatingMachineDynamics() {}; +bool assign_RotatingMachineDynamics_damping(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->damping; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_inertia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inertia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_saturationFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_saturationFactor120(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactor120; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_statorLeakageReactance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->statorLeakageReactance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_statorResistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->statorResistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RotatingMachineDynamics_damping(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->damping; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_inertia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inertia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_saturationFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_saturationFactor120(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactor120; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_statorLeakageReactance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->statorLeakageReactance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_statorResistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->statorResistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RotatingMachineDynamics_factory() { - return new RotatingMachineDynamics; - } +const char RotatingMachineDynamics::debugName[] = "RotatingMachineDynamics"; +const char* RotatingMachineDynamics::debugString() const +{ + return RotatingMachineDynamics::debugName; } -void RotatingMachineDynamics::addConstructToMap(std::unordered_map& factory_map) { +void RotatingMachineDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics"), &RotatingMachineDynamics_factory)); } -void RotatingMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void RotatingMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics.damping"), &assign_RotatingMachineDynamics_damping)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics.inertia"), &assign_RotatingMachineDynamics_inertia)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics.saturationFactor"), &assign_RotatingMachineDynamics_saturationFactor)); @@ -114,13 +125,8 @@ void RotatingMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char RotatingMachineDynamics::debugName[] = "RotatingMachineDynamics"; -const char* RotatingMachineDynamics::debugString() +void RotatingMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RotatingMachineDynamics::debugName; } const BaseClassDefiner RotatingMachineDynamics::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner RotatingMachineDynamics::declare() return BaseClassDefiner(RotatingMachineDynamics::addConstructToMap, RotatingMachineDynamics::addPrimitiveAssignFnsToMap, RotatingMachineDynamics::addClassAssignFnsToMap, RotatingMachineDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* RotatingMachineDynamics_factory() + { + return new RotatingMachineDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.hpp b/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.hpp index 013a8be45..adebde499 100644 --- a/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/RotatingMachineDynamics.hpp @@ -1,45 +1,46 @@ #ifndef RotatingMachineDynamics_H #define RotatingMachineDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Abstract parent class for all synchronous and asynchronous machine standard models. */ - class RotatingMachineDynamics: public DynamicsFunctionBlock + class RotatingMachineDynamics : public DynamicsFunctionBlock { - public: - CIMPP::Simple_Float damping; /* Damping torque coefficient (D). A proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque. This value is often zero when the sources of damping torques (generator damper windings, load damping effects, etc.) are modelled in detail. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds inertia; /* Inertia constant of generator or motor and mechanical load (H) (>0). This is the specification for the stored energy in the rotating mass when operating at rated speed. For a generator, this includes the generator plus all other elements (turbine, exciter) on the same shaft and has units of MW*sec. For a motor, it includes the motor plus its mechanical load. Conventional units are per unit on the generator MVA base, usually expressed as MW*second/MVA or just second. This value is used in the accelerating power reference frame for operator training simulator solutions. Typical Value = 3. Default: nullptr */ - CIMPP::Simple_Float saturationFactor; /* Saturation factor at rated terminal voltage (S1) (> or =0). Not used by simplified model. Defined by defined by S(E1) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.02. Default: nullptr */ - CIMPP::Simple_Float saturationFactor120; /* Saturation factor at 120% of rated terminal voltage (S12) (> or =S1). Not used by the simplified model, defined by S(E2) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.12. Default: nullptr */ - CIMPP::PU statorLeakageReactance; /* Stator leakage reactance (Xl) (> or =0). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU statorResistance; /* Stator (armature) resistance (Rs) (> or =0). Typical Value = 0.005. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RotatingMachineDynamics(); - virtual ~RotatingMachineDynamics(); - + ~RotatingMachineDynamics() override; + + CIMPP::Simple_Float damping; /* Damping torque coefficient (D). A proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque. This value is often zero when the sources of damping torques (generator damper windings, load damping effects, etc.) are modelled in detail. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds inertia; /* Inertia constant of generator or motor and mechanical load (H) (>0). This is the specification for the stored energy in the rotating mass when operating at rated speed. For a generator, this includes the generator plus all other elements (turbine, exciter) on the same shaft and has units of MW*sec. For a motor, it includes the motor plus its mechanical load. Conventional units are per unit on the generator MVA base, usually expressed as MW*second/MVA or just second. This value is used in the accelerating power reference frame for operator training simulator solutions. Typical Value = 3. Default: nullptr */ + CIMPP::Simple_Float saturationFactor; /* Saturation factor at rated terminal voltage (S1) (> or =0). Not used by simplified model. Defined by defined by S(E1) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.02. Default: nullptr */ + CIMPP::Simple_Float saturationFactor120; /* Saturation factor at 120% of rated terminal voltage (S12) (> or =S1). Not used by the simplified model, defined by S(E2) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.12. Default: nullptr */ + CIMPP::PU statorLeakageReactance; /* Stator leakage reactance (Xl) (> or =0). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU statorResistance; /* Stator (armature) resistance (Rs) (> or =0). Typical Value = 0.005. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RotatingMachineDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/RotationSpeed.cpp b/CGMES_2.4.15_16FEB2016/RotationSpeed.cpp index b9797951b..a0e1b9953 100644 --- a/CGMES_2.4.15_16FEB2016/RotationSpeed.cpp +++ b/CGMES_2.4.15_16FEB2016/RotationSpeed.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotationSpeed.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -RotationSpeed::RotationSpeed(): value(nullptr) {}; - -RotationSpeed::~RotationSpeed() {}; - - -bool assign_RotationSpeed_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_RotationSpeed_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_RotationSpeed_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_RotationSpeed_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_RotationSpeed_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +RotationSpeed& RotationSpeed::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* RotationSpeed_factory() { - return new RotationSpeed; +RotationSpeed::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void RotationSpeed::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RotationSpeed"), &RotationSpeed_factory)); +const char RotationSpeed::debugName[] = "RotationSpeed"; +const char* RotationSpeed::debugString() const +{ + return RotationSpeed::debugName; } -void RotationSpeed::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.unit"), &assign_RotationSpeed_unit)); - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.multiplier"), &assign_RotationSpeed_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.denominatorUnit"), &assign_RotationSpeed_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.denominatorMultiplier"), &assign_RotationSpeed_denominatorMultiplier)); +RotationSpeed& RotationSpeed::operator+=(const RotationSpeed& rhs) +{ + value += rhs.value; + return *this; } -void RotationSpeed::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.value"), &assign_RotationSpeed_value)); - } +RotationSpeed& RotationSpeed::operator-=(const RotationSpeed& rhs) +{ + value -= rhs.value; + return *this; +} -const char RotationSpeed::debugName[] = "RotationSpeed"; -const char* RotationSpeed::debugString() +RotationSpeed& RotationSpeed::operator*=(const RotationSpeed& rhs) { - return RotationSpeed::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner RotationSpeed::declare() +RotationSpeed& RotationSpeed::operator/=(const RotationSpeed& rhs) { - return BaseClassDefiner(RotationSpeed::addConstructToMap, RotationSpeed::addPrimitiveAssignFnsToMap, RotationSpeed::addClassAssignFnsToMap, RotationSpeed::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RotationSpeed& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const RotationSpeed& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RotationSpeed.hpp b/CGMES_2.4.15_16FEB2016/RotationSpeed.hpp index 6baff3f75..20dae4027 100644 --- a/CGMES_2.4.15_16FEB2016/RotationSpeed.hpp +++ b/CGMES_2.4.15_16FEB2016/RotationSpeed.hpp @@ -1,46 +1,39 @@ #ifndef RotationSpeed_H #define RotationSpeed_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Number of revolutions per second. */ - class RotationSpeed: public BaseClass + class RotationSpeed { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + RotationSpeed() : value(0.0), initialized(false) {} + RotationSpeed(long double value) : value(value), initialized(true) {} + + RotationSpeed& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - RotationSpeed(); - virtual ~RotationSpeed(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + RotationSpeed& operator+=(const RotationSpeed& rhs); + RotationSpeed& operator-=(const RotationSpeed& rhs); + RotationSpeed& operator*=(const RotationSpeed& rhs); + RotationSpeed& operator/=(const RotationSpeed& rhs); - BaseClass* RotationSpeed_factory(); + friend std::istream& operator>>(std::istream& lop, RotationSpeed& rop); + friend std::ostream& operator<<(std::ostream& os, const RotationSpeed& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/RotorKind.cpp b/CGMES_2.4.15_16FEB2016/RotorKind.cpp index 154709fe1..155faceec 100644 --- a/CGMES_2.4.15_16FEB2016/RotorKind.cpp +++ b/CGMES_2.4.15_16FEB2016/RotorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::RotorKind& rop) +RotorKind& RotorKind::operator=(RotorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +RotorKind::operator RotorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char RotorKind::debugName[] = "RotorKind"; +const char* RotorKind::debugString() const +{ + return RotorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RotorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const RotorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == RotorKind::roundRotor) + { + EnumSymbol = "roundRotor"; + } + if (obj.value == RotorKind::salientPole) + { + EnumSymbol = "salientPole"; + } + + if (!EnumSymbol.empty()) + { + os << "RotorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/RotorKind.hpp b/CGMES_2.4.15_16FEB2016/RotorKind.hpp index f531247aa..d86eccaa1 100644 --- a/CGMES_2.4.15_16FEB2016/RotorKind.hpp +++ b/CGMES_2.4.15_16FEB2016/RotorKind.hpp @@ -1,21 +1,46 @@ #ifndef RotorKind_H #define RotorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of rotor on physical machine. */ - enum class RotorKind + class RotorKind { - /** - * Round rotor type of synchronous machine. - */ - roundRotor, - /** - * Salient pole type of synchronous machine. - */ - salientPole, + public: + enum RotorKind_ENUM + { + /** + * Round rotor type of synchronous machine. + */ + roundRotor, + /** + * Salient pole type of synchronous machine. + */ + salientPole, + }; + + RotorKind() : value(), initialized(false) {} + RotorKind(RotorKind_ENUM value) : value(value), initialized(true) {} + + RotorKind& operator=(RotorKind_ENUM rop); + operator RotorKind_ENUM() const; + + RotorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, RotorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const RotorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::RotorKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/SVCControlMode.cpp b/CGMES_2.4.15_16FEB2016/SVCControlMode.cpp index 3b920e5f2..4ccad37d6 100644 --- a/CGMES_2.4.15_16FEB2016/SVCControlMode.cpp +++ b/CGMES_2.4.15_16FEB2016/SVCControlMode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SVCControlMode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SVCControlMode& rop) +SVCControlMode& SVCControlMode::operator=(SVCControlMode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SVCControlMode::operator SVCControlMode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SVCControlMode::debugName[] = "SVCControlMode"; +const char* SVCControlMode::debugString() const +{ + return SVCControlMode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SVCControlMode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SVCControlMode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SVCControlMode::reactivePower) + { + EnumSymbol = "reactivePower"; + } + if (obj.value == SVCControlMode::voltage) + { + EnumSymbol = "voltage"; + } + + if (!EnumSymbol.empty()) + { + os << "SVCControlMode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SVCControlMode.hpp b/CGMES_2.4.15_16FEB2016/SVCControlMode.hpp index 8884a84af..52da28bad 100644 --- a/CGMES_2.4.15_16FEB2016/SVCControlMode.hpp +++ b/CGMES_2.4.15_16FEB2016/SVCControlMode.hpp @@ -1,21 +1,40 @@ #ifndef SVCControlMode_H #define SVCControlMode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Static VAr Compensator control mode. */ - enum class SVCControlMode + class SVCControlMode { - /** - * - */ - reactivePower, - /** - * - */ - voltage, + public: + enum SVCControlMode_ENUM + { + reactivePower, + voltage, + }; + + SVCControlMode() : value(), initialized(false) {} + SVCControlMode(SVCControlMode_ENUM value) : value(value), initialized(true) {} + + SVCControlMode& operator=(SVCControlMode_ENUM rop); + operator SVCControlMode_ENUM() const; + + SVCControlMode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SVCControlMode& rop); + friend std::ostream& operator<<(std::ostream& os, const SVCControlMode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SVCControlMode& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/Season.cpp b/CGMES_2.4.15_16FEB2016/Season.cpp index 2b3829758..aa28cae01 100644 --- a/CGMES_2.4.15_16FEB2016/Season.cpp +++ b/CGMES_2.4.15_16FEB2016/Season.cpp @@ -1,73 +1,88 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Season.hpp" +#include +#include + +#include "SeasonDayTypeSchedule.hpp" #include "MonthDay.hpp" #include "MonthDay.hpp" -#include "SeasonDayTypeSchedule.hpp" using namespace CIMPP; -Season::Season(): endDate(nullptr), startDate(nullptr) {}; - +Season::Season() {}; Season::~Season() {}; -bool assign_Season_endDate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Season* element = dynamic_cast(BaseClass_ptr1)) { - element->endDate = dynamic_cast(BaseClass_ptr2); - if(element->endDate != nullptr) - return true; - } - return false; -} -bool assign_Season_startDate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Season* element = dynamic_cast(BaseClass_ptr1)) { - element->startDate = dynamic_cast(BaseClass_ptr2); - if(element->startDate != nullptr) - return true; - } - return false; +bool assign_Season_endDate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Season* element = dynamic_cast(BaseClass_ptr1)) + { + element->endDate = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Season_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Season* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SeasonDayTypeSchedules.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Season_startDate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Season* element = dynamic_cast(BaseClass_ptr1)) + { + element->startDate = buffer.str(); + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_SeasonDayTypeSchedule_Season(BaseClass*, BaseClass*); +bool assign_Season_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Season* element = dynamic_cast(BaseClass_ptr1); + SeasonDayTypeSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SeasonDayTypeSchedules.begin(), element->SeasonDayTypeSchedules.end(), element2) == element->SeasonDayTypeSchedules.end()) + { + element->SeasonDayTypeSchedules.push_back(element2); + return assign_SeasonDayTypeSchedule_Season(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* Season_factory() { - return new Season; - } +const char Season::debugName[] = "Season"; +const char* Season::debugString() const +{ + return Season::debugName; } -void Season::addConstructToMap(std::unordered_map& factory_map) { +void Season::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Season"), &Season_factory)); } -void Season::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Season::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Season::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Season.endDate"), &assign_Season_endDate)); assign_map.insert(std::make_pair(std::string("cim:Season.startDate"), &assign_Season_startDate)); - assign_map.insert(std::make_pair(std::string("cim:Season.SeasonDayTypeSchedules"), &assign_Season_SeasonDayTypeSchedules)); } -const char Season::debugName[] = "Season"; -const char* Season::debugString() +void Season::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Season::debugName; + assign_map.insert(std::make_pair(std::string("cim:Season.SeasonDayTypeSchedules"), &assign_Season_SeasonDayTypeSchedules)); } const BaseClassDefiner Season::declare() @@ -75,4 +90,10 @@ const BaseClassDefiner Season::declare() return BaseClassDefiner(Season::addConstructToMap, Season::addPrimitiveAssignFnsToMap, Season::addClassAssignFnsToMap, Season::debugName); } - +namespace CIMPP +{ + BaseClass* Season_factory() + { + return new Season; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Season.hpp b/CGMES_2.4.15_16FEB2016/Season.hpp index 3372a6d21..31957d835 100644 --- a/CGMES_2.4.15_16FEB2016/Season.hpp +++ b/CGMES_2.4.15_16FEB2016/Season.hpp @@ -1,41 +1,42 @@ #ifndef Season_H #define Season_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "MonthDay.hpp" +namespace CIMPP +{ + class SeasonDayTypeSchedule; -class MonthDay; -class SeasonDayTypeSchedule; /* A specified time period of the year. */ - class Season: public IdentifiedObject + class Season : public IdentifiedObject { - public: - CIMPP::MonthDay* endDate; /* Date season ends. Default: nullptr */ - CIMPP::MonthDay* startDate; /* Date season starts. Default: nullptr */ - std::list SeasonDayTypeSchedules; /* Season for the Schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Season(); - virtual ~Season(); - + ~Season() override; + + std::list SeasonDayTypeSchedules; /* Season for the Schedule. Default: 0 */ + CIMPP::MonthDay endDate; /* Date season ends. Default: nullptr */ + CIMPP::MonthDay startDate; /* Date season starts. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Season_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.cpp b/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.cpp index 73e3f63cd..0827e77ed 100644 --- a/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.cpp @@ -1,62 +1,76 @@ -#include -#include "RegularIntervalSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SeasonDayTypeSchedule.hpp" +#include +#include + #include "DayType.hpp" #include "Season.hpp" using namespace CIMPP; -SeasonDayTypeSchedule::SeasonDayTypeSchedule(): DayType(nullptr), Season(nullptr) {}; - +SeasonDayTypeSchedule::SeasonDayTypeSchedule() : DayType(nullptr), Season(nullptr) {}; SeasonDayTypeSchedule::~SeasonDayTypeSchedule() {}; + + + bool assign_DayType_SeasonDayTypeSchedules(BaseClass*, BaseClass*); -bool assign_SeasonDayTypeSchedule_DayType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->DayType = dynamic_cast(BaseClass_ptr2); - if(element->DayType != nullptr) - return assign_DayType_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SeasonDayTypeSchedule_DayType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1); + DayType* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DayType != element2) + { + element->DayType = element2; + return assign_DayType_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_Season_SeasonDayTypeSchedules(BaseClass*, BaseClass*); -bool assign_SeasonDayTypeSchedule_Season(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->Season = dynamic_cast(BaseClass_ptr2); - if(element->Season != nullptr) - return assign_Season_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SeasonDayTypeSchedule_Season(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1); + Season* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Season != element2) + { + element->Season = element2; + return assign_Season_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* SeasonDayTypeSchedule_factory() { - return new SeasonDayTypeSchedule; - } +const char SeasonDayTypeSchedule::debugName[] = "SeasonDayTypeSchedule"; +const char* SeasonDayTypeSchedule::debugString() const +{ + return SeasonDayTypeSchedule::debugName; } -void SeasonDayTypeSchedule::addConstructToMap(std::unordered_map& factory_map) { +void SeasonDayTypeSchedule::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule"), &SeasonDayTypeSchedule_factory)); } -void SeasonDayTypeSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void SeasonDayTypeSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.DayType"), &assign_SeasonDayTypeSchedule_DayType)); - assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.Season"), &assign_SeasonDayTypeSchedule_Season)); +void SeasonDayTypeSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SeasonDayTypeSchedule::debugName[] = "SeasonDayTypeSchedule"; -const char* SeasonDayTypeSchedule::debugString() +void SeasonDayTypeSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SeasonDayTypeSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.DayType"), &assign_SeasonDayTypeSchedule_DayType)); + assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.Season"), &assign_SeasonDayTypeSchedule_Season)); } const BaseClassDefiner SeasonDayTypeSchedule::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner SeasonDayTypeSchedule::declare() return BaseClassDefiner(SeasonDayTypeSchedule::addConstructToMap, SeasonDayTypeSchedule::addPrimitiveAssignFnsToMap, SeasonDayTypeSchedule::addClassAssignFnsToMap, SeasonDayTypeSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* SeasonDayTypeSchedule_factory() + { + return new SeasonDayTypeSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.hpp b/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.hpp index 06ac128af..ee9830d7b 100644 --- a/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/SeasonDayTypeSchedule.hpp @@ -1,40 +1,41 @@ #ifndef SeasonDayTypeSchedule_H #define SeasonDayTypeSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegularIntervalSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RegularIntervalSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DayType; + class Season; -class DayType; -class Season; /* A time schedule covering a 24 hour period, with curve data for a specific type of season and day. */ - class SeasonDayTypeSchedule: public RegularIntervalSchedule + class SeasonDayTypeSchedule : public RegularIntervalSchedule { - public: - CIMPP::DayType* DayType; /* Schedules that use this DayType. Default: 0 */ - CIMPP::Season* Season; /* Schedules that use this Season. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SeasonDayTypeSchedule(); - virtual ~SeasonDayTypeSchedule(); - + ~SeasonDayTypeSchedule() override; + + CIMPP::DayType* DayType; /* Schedules that use this DayType. Default: 0 */ + CIMPP::Season* Season; /* Schedules that use this Season. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SeasonDayTypeSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Seconds.cpp b/CGMES_2.4.15_16FEB2016/Seconds.cpp index 7d5d3e99e..31ff76a12 100644 --- a/CGMES_2.4.15_16FEB2016/Seconds.cpp +++ b/CGMES_2.4.15_16FEB2016/Seconds.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Seconds.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Seconds::Seconds() {} -Seconds::~Seconds(){} +#include -Seconds::Seconds(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Seconds::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Seconds::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Seconds& Seconds::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Seconds::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Seconds::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Seconds::debugName[] = "Seconds"; -const char* Seconds::debugString() { +const char* Seconds::debugString() const +{ return Seconds::debugName; } - -const BaseClassDefiner Seconds::declare() { - return BaseClassDefiner(Seconds::addConstructToMap, Seconds::addPrimitiveAssignFnsToMap, Seconds::addClassAssignFnsToMap, Seconds::debugName); +Seconds& Seconds::operator+=(const Seconds& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Seconds& Seconds::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Seconds& Seconds::operator-=(const Seconds& rhs) { - value -= rhs.value; - return *this; - } - - Seconds& Seconds::operator*=(const Seconds& rhs) { - value *= rhs.value; - return *this; - } - - Seconds& Seconds::operator/=(const Seconds& rhs) { - value /= rhs.value; - return *this; - } +Seconds& Seconds::operator-=(const Seconds& rhs) +{ + value -= rhs.value; + return *this; +} - Seconds& Seconds::operator+=(const Seconds& rhs) { - value += rhs.value; - return *this; - } +Seconds& Seconds::operator*=(const Seconds& rhs) +{ + value *= rhs.value; + return *this; +} - Seconds::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Seconds& Seconds::operator/=(const Seconds& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Seconds& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Seconds& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Seconds& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Seconds.hpp b/CGMES_2.4.15_16FEB2016/Seconds.hpp index 7e1278190..60e9a668b 100644 --- a/CGMES_2.4.15_16FEB2016/Seconds.hpp +++ b/CGMES_2.4.15_16FEB2016/Seconds.hpp @@ -1,38 +1,39 @@ #ifndef Seconds_H #define Seconds_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Seconds : public BaseClass + /* + Time, in seconds. + */ + class Seconds { - public: - Seconds(); - virtual ~Seconds(); - Seconds(long double value); - static const BaseClassDefiner declare(); - Seconds& operator=(long double &rop); + Seconds() : value(0.0), initialized(false) {} + Seconds(long double value) : value(value), initialized(true) {} + + Seconds& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Seconds& operator+=(const Seconds& rhs); Seconds& operator-=(const Seconds& rhs); Seconds& operator*=(const Seconds& rhs); Seconds& operator/=(const Seconds& rhs); + friend std::istream& operator>>(std::istream& lop, Seconds& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Seconds& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/SeriesCompensator.cpp b/CGMES_2.4.15_16FEB2016/SeriesCompensator.cpp index 373f6a42d..3c0a3d55b 100644 --- a/CGMES_2.4.15_16FEB2016/SeriesCompensator.cpp +++ b/CGMES_2.4.15_16FEB2016/SeriesCompensator.cpp @@ -1,141 +1,148 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SeriesCompensator.hpp" +#include +#include + +#include "Resistance.hpp" #include "Resistance.hpp" -#include "Reactance.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" #include "Voltage.hpp" -#include "Resistance.hpp" +#include "Reactance.hpp" #include "Reactance.hpp" using namespace CIMPP; SeriesCompensator::SeriesCompensator() {}; - SeriesCompensator::~SeriesCompensator() {}; +bool assign_SeriesCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_varistorPresent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->varistorPresent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_varistorRatedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->varistorRatedCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_varistorVoltageThreshold(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->varistorVoltageThreshold; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SeriesCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_varistorPresent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->varistorPresent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_varistorRatedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->varistorRatedCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_varistorVoltageThreshold(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->varistorVoltageThreshold; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SeriesCompensator_factory() { - return new SeriesCompensator; - } +const char SeriesCompensator::debugName[] = "SeriesCompensator"; +const char* SeriesCompensator::debugString() const +{ + return SeriesCompensator::debugName; } -void SeriesCompensator::addConstructToMap(std::unordered_map& factory_map) { +void SeriesCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SeriesCompensator"), &SeriesCompensator_factory)); } -void SeriesCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SeriesCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.r"), &assign_SeriesCompensator_r)); - assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.x"), &assign_SeriesCompensator_x)); + assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.r0"), &assign_SeriesCompensator_r0)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.varistorPresent"), &assign_SeriesCompensator_varistorPresent)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.varistorRatedCurrent"), &assign_SeriesCompensator_varistorRatedCurrent)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.varistorVoltageThreshold"), &assign_SeriesCompensator_varistorVoltageThreshold)); - assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.r0"), &assign_SeriesCompensator_r0)); + assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.x"), &assign_SeriesCompensator_x)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.x0"), &assign_SeriesCompensator_x0)); } -void SeriesCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SeriesCompensator::debugName[] = "SeriesCompensator"; -const char* SeriesCompensator::debugString() +void SeriesCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SeriesCompensator::debugName; } const BaseClassDefiner SeriesCompensator::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner SeriesCompensator::declare() return BaseClassDefiner(SeriesCompensator::addConstructToMap, SeriesCompensator::addPrimitiveAssignFnsToMap, SeriesCompensator::addClassAssignFnsToMap, SeriesCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* SeriesCompensator_factory() + { + return new SeriesCompensator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SeriesCompensator.hpp b/CGMES_2.4.15_16FEB2016/SeriesCompensator.hpp index 112833df4..513d29359 100644 --- a/CGMES_2.4.15_16FEB2016/SeriesCompensator.hpp +++ b/CGMES_2.4.15_16FEB2016/SeriesCompensator.hpp @@ -1,48 +1,49 @@ #ifndef SeriesCompensator_H #define SeriesCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Resistance.hpp" -#include "Reactance.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" +#include "Reactance.hpp" +#include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. */ - class SeriesCompensator: public ConductingEquipment + class SeriesCompensator : public ConductingEquipment { - public: - CIMPP::Resistance r; /* Positive sequence resistance. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence reactance. Default: nullptr */ - CIMPP::Boolean varistorPresent; /* Describe if a metal oxide varistor (mov) for over voltage protection is configured at the series compensator. Default: false */ - CIMPP::CurrentFlow varistorRatedCurrent; /* The maximum current the varistor is designed to handle at specified duration. Default: nullptr */ - CIMPP::Voltage varistorVoltageThreshold; /* The dc voltage at which the varistor start conducting. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence resistance. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SeriesCompensator(); - virtual ~SeriesCompensator(); - + ~SeriesCompensator() override; + + CIMPP::Resistance r; /* Positive sequence resistance. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence resistance. Default: nullptr */ + CIMPP::Boolean varistorPresent; /* Describe if a metal oxide varistor (mov) for over voltage protection is configured at the series compensator. Default: false */ + CIMPP::CurrentFlow varistorRatedCurrent; /* The maximum current the varistor is designed to handle at specified duration. Default: nullptr */ + CIMPP::Voltage varistorVoltageThreshold; /* The dc voltage at which the varistor start conducting. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence reactance. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SeriesCompensator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SetPoint.cpp b/CGMES_2.4.15_16FEB2016/SetPoint.cpp index 7ff0d8d24..3a8c53288 100644 --- a/CGMES_2.4.15_16FEB2016/SetPoint.cpp +++ b/CGMES_2.4.15_16FEB2016/SetPoint.cpp @@ -1,66 +1,68 @@ -#include -#include "AnalogControl.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SetPoint.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" using namespace CIMPP; SetPoint::SetPoint() {}; - SetPoint::~SetPoint() {}; +bool assign_SetPoint_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SetPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SetPoint_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SetPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SetPoint_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SetPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SetPoint_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SetPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SetPoint_factory() { - return new SetPoint; - } +const char SetPoint::debugName[] = "SetPoint"; +const char* SetPoint::debugString() const +{ + return SetPoint::debugName; } -void SetPoint::addConstructToMap(std::unordered_map& factory_map) { +void SetPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SetPoint"), &SetPoint_factory)); } -void SetPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SetPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SetPoint.normalValue"), &assign_SetPoint_normalValue)); assign_map.insert(std::make_pair(std::string("cim:SetPoint.value"), &assign_SetPoint_value)); } -void SetPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SetPoint::debugName[] = "SetPoint"; -const char* SetPoint::debugString() +void SetPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SetPoint::debugName; } const BaseClassDefiner SetPoint::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner SetPoint::declare() return BaseClassDefiner(SetPoint::addConstructToMap, SetPoint::addPrimitiveAssignFnsToMap, SetPoint::addClassAssignFnsToMap, SetPoint::debugName); } - +namespace CIMPP +{ + BaseClass* SetPoint_factory() + { + return new SetPoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SetPoint.hpp b/CGMES_2.4.15_16FEB2016/SetPoint.hpp index a0b6d6322..28ebed07c 100644 --- a/CGMES_2.4.15_16FEB2016/SetPoint.hpp +++ b/CGMES_2.4.15_16FEB2016/SetPoint.hpp @@ -1,39 +1,40 @@ #ifndef SetPoint_H #define SetPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AnalogControl.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AnalogControl.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* An analog control that issue a set point value. */ - class SetPoint: public AnalogControl + class SetPoint : public AnalogControl { - public: - CIMPP::Simple_Float normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: nullptr */ - CIMPP::Simple_Float value; /* The value representing the actuator output. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SetPoint(); - virtual ~SetPoint(); - + ~SetPoint() override; + + CIMPP::Simple_Float normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: nullptr */ + CIMPP::Simple_Float value; /* The value representing the actuator output. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SetPoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.cpp b/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.cpp index dbd0a619b..9e7ea1852 100644 --- a/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.cpp +++ b/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ShortCircuitRotorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ShortCircuitRotorKind& rop) +ShortCircuitRotorKind& ShortCircuitRotorKind::operator=(ShortCircuitRotorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ShortCircuitRotorKind::operator ShortCircuitRotorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ShortCircuitRotorKind::debugName[] = "ShortCircuitRotorKind"; +const char* ShortCircuitRotorKind::debugString() const +{ + return ShortCircuitRotorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ShortCircuitRotorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ShortCircuitRotorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ShortCircuitRotorKind::salientPole1) + { + EnumSymbol = "salientPole1"; + } + if (obj.value == ShortCircuitRotorKind::salientPole2) + { + EnumSymbol = "salientPole2"; + } + if (obj.value == ShortCircuitRotorKind::turboSeries1) + { + EnumSymbol = "turboSeries1"; + } + if (obj.value == ShortCircuitRotorKind::turboSeries2) + { + EnumSymbol = "turboSeries2"; + } + + if (!EnumSymbol.empty()) + { + os << "ShortCircuitRotorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.hpp b/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.hpp index 0da968334..76f473214 100644 --- a/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.hpp +++ b/CGMES_2.4.15_16FEB2016/ShortCircuitRotorKind.hpp @@ -1,29 +1,54 @@ #ifndef ShortCircuitRotorKind_H #define ShortCircuitRotorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of rotor, used by short circuit applications. */ - enum class ShortCircuitRotorKind + class ShortCircuitRotorKind { - /** - * Salient pole 1 in the IEC 60909 - */ - salientPole1, - /** - * Salient pole 2 in IEC 60909 - */ - salientPole2, - /** - * Turbo Series 1 in the IEC 60909 - */ - turboSeries1, - /** - * Turbo series 2 in IEC 60909 - */ - turboSeries2, + public: + enum ShortCircuitRotorKind_ENUM + { + /** + * Salient pole 1 in the IEC 60909 + */ + salientPole1, + /** + * Salient pole 2 in IEC 60909 + */ + salientPole2, + /** + * Turbo Series 1 in the IEC 60909 + */ + turboSeries1, + /** + * Turbo series 2 in IEC 60909 + */ + turboSeries2, + }; + + ShortCircuitRotorKind() : value(), initialized(false) {} + ShortCircuitRotorKind(ShortCircuitRotorKind_ENUM value) : value(value), initialized(true) {} + + ShortCircuitRotorKind& operator=(ShortCircuitRotorKind_ENUM rop); + operator ShortCircuitRotorKind_ENUM() const; + + ShortCircuitRotorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ShortCircuitRotorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ShortCircuitRotorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ShortCircuitRotorKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ShuntCompensator.cpp b/CGMES_2.4.15_16FEB2016/ShuntCompensator.cpp index 56e807af8..b205bfc3b 100644 --- a/CGMES_2.4.15_16FEB2016/ShuntCompensator.cpp +++ b/CGMES_2.4.15_16FEB2016/ShuntCompensator.cpp @@ -1,177 +1,200 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ShuntCompensator.hpp" +#include +#include + +#include "SvShuntCompensatorSections.hpp" #include "Seconds.hpp" #include "Boolean.hpp" #include "Integer.hpp" #include "Voltage.hpp" #include "Integer.hpp" +#include "Simple_Float.hpp" #include "Integer.hpp" #include "DateTime.hpp" #include "VoltagePerReactivePower.hpp" -#include "SvShuntCompensatorSections.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; -ShuntCompensator::ShuntCompensator(): switchOnDate(nullptr), voltageSensitivity(nullptr), SvShuntCompensatorSections(nullptr) {}; - +ShuntCompensator::ShuntCompensator() : SvShuntCompensatorSections(nullptr) {}; ShuntCompensator::~ShuntCompensator() {}; +bool assign_ShuntCompensator_aVRDelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aVRDelay; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->grounded; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_maximumSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maximumSections; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_nomU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nomU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_normalSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalSections; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ShuntCompensator_switchOnDate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->switchOnDate = dynamic_cast(BaseClass_ptr2); - if(element->switchOnDate != nullptr) - return true; - } - return false; +bool assign_ShuntCompensator_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sections; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ShuntCompensator_voltageSensitivity(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->voltageSensitivity = dynamic_cast(BaseClass_ptr2); - if(element->voltageSensitivity != nullptr) - return true; - } - return false; +bool assign_ShuntCompensator_switchOnCount(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->switchOnCount; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->SvShuntCompensatorSections = dynamic_cast(BaseClass_ptr2); - if(element->SvShuntCompensatorSections != nullptr) - return true; - } - return false; +bool assign_ShuntCompensator_switchOnDate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + element->switchOnDate = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ShuntCompensator_voltageSensitivity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageSensitivity; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ShuntCompensator_aVRDelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aVRDelay; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass*, BaseClass*); +bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ShuntCompensator* element = dynamic_cast(BaseClass_ptr1); + SvShuntCompensatorSections* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvShuntCompensatorSections != element2) + { + element->SvShuntCompensatorSections = element2; + return assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ShuntCompensator_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->grounded; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_maximumSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maximumSections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_nomU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nomU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_normalSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalSections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_switchOnCount(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->switchOnCount; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - - -bool assign_ShuntCompensator_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ShuntCompensator_factory() { - return new ShuntCompensator; - } + + + + + +const char ShuntCompensator::debugName[] = "ShuntCompensator"; +const char* ShuntCompensator::debugString() const +{ + return ShuntCompensator::debugName; } -void ShuntCompensator::addConstructToMap(std::unordered_map& factory_map) { +void ShuntCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ShuntCompensator"), &ShuntCompensator_factory)); } -void ShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.aVRDelay"), &assign_ShuntCompensator_aVRDelay)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.grounded"), &assign_ShuntCompensator_grounded)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.maximumSections"), &assign_ShuntCompensator_maximumSections)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.nomU"), &assign_ShuntCompensator_nomU)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.normalSections"), &assign_ShuntCompensator_normalSections)); + assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.sections"), &assign_ShuntCompensator_sections)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.switchOnCount"), &assign_ShuntCompensator_switchOnCount)); - assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.sections"), &assign_ShuntCompensator_sections)); -} - -void ShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.switchOnDate"), &assign_ShuntCompensator_switchOnDate)); + assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.switchOnDate"), &assign_ShuntCompensator_switchOnDate)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.voltageSensitivity"), &assign_ShuntCompensator_voltageSensitivity)); - assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.SvShuntCompensatorSections"), &assign_ShuntCompensator_SvShuntCompensatorSections)); - } +} -const char ShuntCompensator::debugName[] = "ShuntCompensator"; -const char* ShuntCompensator::debugString() +void ShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ShuntCompensator::debugName; + assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.SvShuntCompensatorSections"), &assign_ShuntCompensator_SvShuntCompensatorSections)); } const BaseClassDefiner ShuntCompensator::declare() @@ -179,4 +202,10 @@ const BaseClassDefiner ShuntCompensator::declare() return BaseClassDefiner(ShuntCompensator::addConstructToMap, ShuntCompensator::addPrimitiveAssignFnsToMap, ShuntCompensator::addClassAssignFnsToMap, ShuntCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* ShuntCompensator_factory() + { + return new ShuntCompensator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ShuntCompensator.hpp b/CGMES_2.4.15_16FEB2016/ShuntCompensator.hpp index e32ddbea9..9285b79ef 100644 --- a/CGMES_2.4.15_16FEB2016/ShuntCompensator.hpp +++ b/CGMES_2.4.15_16FEB2016/ShuntCompensator.hpp @@ -1,54 +1,55 @@ #ifndef ShuntCompensator_H #define ShuntCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "DateTime.hpp" #include "Integer.hpp" -#include "Voltage.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" +#include "Voltage.hpp" +#include "VoltagePerReactivePower.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class SvShuntCompensatorSections; -class DateTime; -class VoltagePerReactivePower; -class SvShuntCompensatorSections; /* A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. */ - class ShuntCompensator: public RegulatingCondEq + class ShuntCompensator : public RegulatingCondEq { - public: - CIMPP::Seconds aVRDelay; /* Time delay required for the device to be connected or disconnected by automatic voltage regulation (AVR). Default: nullptr */ - CIMPP::Boolean grounded; /* Used for Yn and Zn connections. True if the neutral is solidly grounded. Default: false */ - CIMPP::Integer maximumSections; /* The maximum number of sections that may be switched in. Default: 0 */ - CIMPP::Voltage nomU; /* The voltage at which the nominal reactive power may be calculated. This should normally be within 10% of the voltage at which the capacitor is connected to the network. Default: nullptr */ - CIMPP::Integer normalSections; /* The normal number of sections switched in. Default: 0 */ - CIMPP::Integer switchOnCount; /* The switch on count since the capacitor count was last reset or initialized. Default: 0 */ - CIMPP::DateTime* switchOnDate; /* The date and time when the capacitor bank was last switched on. Default: '' */ - CIMPP::VoltagePerReactivePower* voltageSensitivity; /* Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. Default: nullptr */ - CIMPP::SvShuntCompensatorSections* SvShuntCompensatorSections; /* The state for the number of shunt compensator sections in service. Default: 0 */ - CIMPP::Simple_Float sections; /* Shunt compensator sections in use. Starting value for steady state solution. Non integer values are allowed to support continuous variables. The reasons for continuous value are to support study cases where no discrete shunt compensators has yet been designed, a solutions where a narrow voltage band force the sections to oscillate or accommodate for a continuous solution as input. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ShuntCompensator(); - virtual ~ShuntCompensator(); - + ~ShuntCompensator() override; + + CIMPP::SvShuntCompensatorSections* SvShuntCompensatorSections; /* The state for the number of shunt compensator sections in service. Default: 0 */ + CIMPP::Seconds aVRDelay; /* Time delay required for the device to be connected or disconnected by automatic voltage regulation (AVR). Default: nullptr */ + CIMPP::Boolean grounded; /* Used for Yn and Zn connections. True if the neutral is solidly grounded. Default: false */ + CIMPP::Integer maximumSections; /* The maximum number of sections that may be switched in. Default: 0 */ + CIMPP::Voltage nomU; /* The voltage at which the nominal reactive power may be calculated. This should normally be within 10% of the voltage at which the capacitor is connected to the network. Default: nullptr */ + CIMPP::Integer normalSections; /* The normal number of sections switched in. Default: 0 */ + CIMPP::Simple_Float sections; /* Shunt compensator sections in use. Starting value for steady state solution. Non integer values are allowed to support continuous variables. The reasons for continuous value are to support study cases where no discrete shunt compensators has yet been designed, a solutions where a narrow voltage band force the sections to oscillate or accommodate for a continuous solution as input. Default: nullptr */ + CIMPP::Integer switchOnCount; /* The switch on count since the capacitor count was last reset or initialized. Default: 0 */ + CIMPP::DateTime switchOnDate; /* The date and time when the capacitor bank was last switched on. Default: '' */ + CIMPP::VoltagePerReactivePower voltageSensitivity; /* Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ShuntCompensator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Simple_Float.cpp b/CGMES_2.4.15_16FEB2016/Simple_Float.cpp index 58f419031..447282928 100644 --- a/CGMES_2.4.15_16FEB2016/Simple_Float.cpp +++ b/CGMES_2.4.15_16FEB2016/Simple_Float.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Simple_Float.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Simple_Float::Simple_Float() {} -Simple_Float::~Simple_Float(){} +#include -Simple_Float::Simple_Float(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Simple_Float::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Simple_Float::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Simple_Float& Simple_Float::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Simple_Float::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Simple_Float::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Simple_Float::debugName[] = "Simple_Float"; -const char* Simple_Float::debugString() { +const char* Simple_Float::debugString() const +{ return Simple_Float::debugName; } - -const BaseClassDefiner Simple_Float::declare() { - return BaseClassDefiner(Simple_Float::addConstructToMap, Simple_Float::addPrimitiveAssignFnsToMap, Simple_Float::addClassAssignFnsToMap, Simple_Float::debugName); +Simple_Float& Simple_Float::operator+=(const Simple_Float& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Simple_Float& Simple_Float::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Simple_Float& Simple_Float::operator-=(const Simple_Float& rhs) { - value -= rhs.value; - return *this; - } - - Simple_Float& Simple_Float::operator*=(const Simple_Float& rhs) { - value *= rhs.value; - return *this; - } - - Simple_Float& Simple_Float::operator/=(const Simple_Float& rhs) { - value /= rhs.value; - return *this; - } +Simple_Float& Simple_Float::operator-=(const Simple_Float& rhs) +{ + value -= rhs.value; + return *this; +} - Simple_Float& Simple_Float::operator+=(const Simple_Float& rhs) { - value += rhs.value; - return *this; - } +Simple_Float& Simple_Float::operator*=(const Simple_Float& rhs) +{ + value *= rhs.value; + return *this; +} - Simple_Float::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Simple_Float& Simple_Float::operator/=(const Simple_Float& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Simple_Float& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Simple_Float& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Simple_Float& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Simple_Float.hpp b/CGMES_2.4.15_16FEB2016/Simple_Float.hpp index c56e4bb97..58d48ce8f 100644 --- a/CGMES_2.4.15_16FEB2016/Simple_Float.hpp +++ b/CGMES_2.4.15_16FEB2016/Simple_Float.hpp @@ -1,38 +1,39 @@ #ifndef Simple_Float_H #define Simple_Float_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Simple_Float : public BaseClass + /* + A floating point number. The range is unspecified and not limited. + */ + class Simple_Float { - public: - Simple_Float(); - virtual ~Simple_Float(); - Simple_Float(long double value); - static const BaseClassDefiner declare(); - Simple_Float& operator=(long double &rop); + Simple_Float() : value(0.0), initialized(false) {} + Simple_Float(long double value) : value(value), initialized(true) {} + + Simple_Float& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Simple_Float& operator+=(const Simple_Float& rhs); Simple_Float& operator-=(const Simple_Float& rhs); Simple_Float& operator*=(const Simple_Float& rhs); Simple_Float& operator/=(const Simple_Float& rhs); + friend std::istream& operator>>(std::istream& lop, Simple_Float& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Simple_Float& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.cpp index 2ef7948ba..729d7b8ce 100644 --- a/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.cpp @@ -1,36 +1,36 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SolarGeneratingUnit.hpp" +#include +#include + using namespace CIMPP; SolarGeneratingUnit::SolarGeneratingUnit() {}; - SolarGeneratingUnit::~SolarGeneratingUnit() {}; -namespace CIMPP { - BaseClass* SolarGeneratingUnit_factory() { - return new SolarGeneratingUnit; - } +const char SolarGeneratingUnit::debugName[] = "SolarGeneratingUnit"; +const char* SolarGeneratingUnit::debugString() const +{ + return SolarGeneratingUnit::debugName; } -void SolarGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void SolarGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SolarGeneratingUnit"), &SolarGeneratingUnit_factory)); } -void SolarGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void SolarGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void SolarGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SolarGeneratingUnit::debugName[] = "SolarGeneratingUnit"; -const char* SolarGeneratingUnit::debugString() +void SolarGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SolarGeneratingUnit::debugName; } const BaseClassDefiner SolarGeneratingUnit::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner SolarGeneratingUnit::declare() return BaseClassDefiner(SolarGeneratingUnit::addConstructToMap, SolarGeneratingUnit::addPrimitiveAssignFnsToMap, SolarGeneratingUnit::addClassAssignFnsToMap, SolarGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* SolarGeneratingUnit_factory() + { + return new SolarGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.hpp index 497cbea6a..0fa75b7ac 100644 --- a/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/SolarGeneratingUnit.hpp @@ -1,36 +1,37 @@ #ifndef SolarGeneratingUnit_H #define SolarGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A solar thermal generating unit. */ - class SolarGeneratingUnit: public GeneratingUnit + class SolarGeneratingUnit : public GeneratingUnit { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SolarGeneratingUnit(); - virtual ~SolarGeneratingUnit(); - + ~SolarGeneratingUnit() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SolarGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Source.cpp b/CGMES_2.4.15_16FEB2016/Source.cpp index 1a37656e9..54f9266b5 100644 --- a/CGMES_2.4.15_16FEB2016/Source.cpp +++ b/CGMES_2.4.15_16FEB2016/Source.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Source.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::Source& rop) +Source& Source::operator=(Source_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +Source::operator Source_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Source::debugName[] = "Source"; +const char* Source::debugString() const +{ + return Source::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Source& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const Source& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == Source::PROCESS) + { + EnumSymbol = "PROCESS"; + } + if (obj.value == Source::DEFAULTED) + { + EnumSymbol = "DEFAULTED"; + } + if (obj.value == Source::SUBSTITUTED) + { + EnumSymbol = "SUBSTITUTED"; + } + + if (!EnumSymbol.empty()) + { + os << "Source." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Source.hpp b/CGMES_2.4.15_16FEB2016/Source.hpp index bff597490..0cbf17fb0 100644 --- a/CGMES_2.4.15_16FEB2016/Source.hpp +++ b/CGMES_2.4.15_16FEB2016/Source.hpp @@ -1,25 +1,50 @@ #ifndef Source_H #define Source_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Source gives information related to the origin of a value. */ - enum class Source + class Source { - /** - * The value is provided by input from the process I/O or being calculated from some function. - */ - PROCESS, - /** - * The value contains a default value. - */ - DEFAULTED, - /** - * The value is provided by input of an operator or by an automatic source. - */ - SUBSTITUTED, + public: + enum Source_ENUM + { + /** + * The value is provided by input from the process I/O or being calculated from some function. + */ + PROCESS, + /** + * The value contains a default value. + */ + DEFAULTED, + /** + * The value is provided by input of an operator or by an automatic source. + */ + SUBSTITUTED, + }; + + Source() : value(), initialized(false) {} + Source(Source_ENUM value) : value(value), initialized(true) {} + + Source& operator=(Source_ENUM rop); + operator Source_ENUM() const; + + Source_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Source& rop); + friend std::ostream& operator<<(std::ostream& os, const Source& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::Source& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/StateVariablesVersion.cpp b/CGMES_2.4.15_16FEB2016/StateVariablesVersion.cpp index ac589b5ae..4ec1e2cae 100644 --- a/CGMES_2.4.15_16FEB2016/StateVariablesVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/StateVariablesVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StateVariablesVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -StateVariablesVersion::StateVariablesVersion(): date(nullptr) {}; - +StateVariablesVersion::StateVariablesVersion() {}; StateVariablesVersion::~StateVariablesVersion() {}; - - -bool assign_StateVariablesVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_StateVariablesVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_StateVariablesVersion_baseUML(std::stringstream &buffer, BaseClass* return false; } -bool assign_StateVariablesVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_StateVariablesVersion_baseURI(std::stringstream &buffer, BaseClass* return false; } +bool assign_StateVariablesVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_StateVariablesVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_StateVariablesVersion_differenceModelURI(std::stringstream &buffer, return false; } -bool assign_StateVariablesVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_StateVariablesVersion_entsoeUML(std::stringstream &buffer, BaseClass return false; } -bool assign_StateVariablesVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_StateVariablesVersion_entsoeURI(std::stringstream &buffer, BaseClass return false; } -bool assign_StateVariablesVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_StateVariablesVersion_modelDescriptionURI(std::stringstream &buffer, return false; } -bool assign_StateVariablesVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_StateVariablesVersion_namespaceRDF(std::stringstream &buffer, BaseCl return false; } -bool assign_StateVariablesVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_StateVariablesVersion_namespaceUML(std::stringstream &buffer, BaseCl return false; } -bool assign_StateVariablesVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_StateVariablesVersion_shortName(std::stringstream &buffer, BaseClass return false; } -namespace CIMPP { - BaseClass* StateVariablesVersion_factory() { - return new StateVariablesVersion; - } + + + + + + + + + + + +const char StateVariablesVersion::debugName[] = "StateVariablesVersion"; +const char* StateVariablesVersion::debugString() const +{ + return StateVariablesVersion::debugName; } -void StateVariablesVersion::addConstructToMap(std::unordered_map& factory_map) { +void StateVariablesVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StateVariablesVersion"), &StateVariablesVersion_factory)); } -void StateVariablesVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void StateVariablesVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.baseUML"), &assign_StateVariablesVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.baseURI"), &assign_StateVariablesVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.differenceModelURI"), &assign_StateVariablesVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.date"), &assign_StateVariablesVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.differenceModelURI"), &assign_StateVariablesVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.entsoeUML"), &assign_StateVariablesVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.entsoeURI"), &assign_StateVariablesVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.modelDescriptionURI"), &assign_StateVariablesVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void StateVariablesVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.date"), &assign_StateVariablesVersion_date)); - } - -const char StateVariablesVersion::debugName[] = "StateVariablesVersion"; -const char* StateVariablesVersion::debugString() +void StateVariablesVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StateVariablesVersion::debugName; } const BaseClassDefiner StateVariablesVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner StateVariablesVersion::declare() return BaseClassDefiner(StateVariablesVersion::addConstructToMap, StateVariablesVersion::addPrimitiveAssignFnsToMap, StateVariablesVersion::addClassAssignFnsToMap, StateVariablesVersion::debugName); } - +namespace CIMPP +{ + BaseClass* StateVariablesVersion_factory() + { + return new StateVariablesVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/StateVariablesVersion.hpp b/CGMES_2.4.15_16FEB2016/StateVariablesVersion.hpp index 604650d9a..adc7bfe6d 100644 --- a/CGMES_2.4.15_16FEB2016/StateVariablesVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/StateVariablesVersion.hpp @@ -1,48 +1,49 @@ #ifndef StateVariablesVersion_H #define StateVariablesVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class StateVariablesVersion: public BaseClass + class StateVariablesVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/StateVariables/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StateVariablesVersion(); - virtual ~StateVariablesVersion(); - + ~StateVariablesVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/StateVariables/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StateVariablesVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.cpp b/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.cpp index c845ea521..e3d149299 100644 --- a/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.cpp +++ b/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StaticLoadModelKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::StaticLoadModelKind& rop) +StaticLoadModelKind& StaticLoadModelKind::operator=(StaticLoadModelKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +StaticLoadModelKind::operator StaticLoadModelKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char StaticLoadModelKind::debugName[] = "StaticLoadModelKind"; +const char* StaticLoadModelKind::debugString() const +{ + return StaticLoadModelKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, StaticLoadModelKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const StaticLoadModelKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == StaticLoadModelKind::exponential) + { + EnumSymbol = "exponential"; + } + if (obj.value == StaticLoadModelKind::zIP1) + { + EnumSymbol = "zIP1"; + } + if (obj.value == StaticLoadModelKind::zIP2) + { + EnumSymbol = "zIP2"; + } + if (obj.value == StaticLoadModelKind::constantZ) + { + EnumSymbol = "constantZ"; + } + + if (!EnumSymbol.empty()) + { + os << "StaticLoadModelKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.hpp b/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.hpp index ecb0dd9b5..362cca7ea 100644 --- a/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.hpp +++ b/CGMES_2.4.15_16FEB2016/StaticLoadModelKind.hpp @@ -1,29 +1,54 @@ #ifndef StaticLoadModelKind_H #define StaticLoadModelKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of static load model. */ - enum class StaticLoadModelKind + class StaticLoadModelKind { - /** - * Exponential P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf, ep1, ep2, ep3 kq1, kq2, kq3, kqf, eq1, eq2, eq3. - */ - exponential, - /** - * ZIP1 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf kq1, kq2, kq3, kqf. - */ - zIP1, - /** - * This model separates the frequency-dependent load (primarily motors) from other load. ZIP2 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kq4, kpf kq1, kq2, kq3, kq4, kqf. - */ - zIP2, - /** - * The load is represented as a constant impedance. ConstantZ P and Q equations are used and no attributes are required. - */ - constantZ, + public: + enum StaticLoadModelKind_ENUM + { + /** + * Exponential P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf, ep1, ep2, ep3 kq1, kq2, kq3, kqf, eq1, eq2, eq3. + */ + exponential, + /** + * ZIP1 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf kq1, kq2, kq3, kqf. + */ + zIP1, + /** + * This model separates the frequency-dependent load (primarily motors) from other load. ZIP2 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kq4, kpf kq1, kq2, kq3, kq4, kqf. + */ + zIP2, + /** + * The load is represented as a constant impedance. ConstantZ P and Q equations are used and no attributes are required. + */ + constantZ, + }; + + StaticLoadModelKind() : value(), initialized(false) {} + StaticLoadModelKind(StaticLoadModelKind_ENUM value) : value(value), initialized(true) {} + + StaticLoadModelKind& operator=(StaticLoadModelKind_ENUM rop); + operator StaticLoadModelKind_ENUM() const; + + StaticLoadModelKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, StaticLoadModelKind& rop); + friend std::ostream& operator<<(std::ostream& os, const StaticLoadModelKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::StaticLoadModelKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/StaticVarCompensator.cpp b/CGMES_2.4.15_16FEB2016/StaticVarCompensator.cpp index 76bede8d6..46d3ed25b 100644 --- a/CGMES_2.4.15_16FEB2016/StaticVarCompensator.cpp +++ b/CGMES_2.4.15_16FEB2016/StaticVarCompensator.cpp @@ -1,123 +1,132 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StaticVarCompensator.hpp" +#include +#include + #include "Reactance.hpp" #include "Reactance.hpp" -#include "VoltagePerReactivePower.hpp" +#include "ReactivePower.hpp" #include "SVCControlMode.hpp" +#include "VoltagePerReactivePower.hpp" #include "Voltage.hpp" -#include "ReactivePower.hpp" using namespace CIMPP; -StaticVarCompensator::StaticVarCompensator(): slope(nullptr) {}; - +StaticVarCompensator::StaticVarCompensator() {}; StaticVarCompensator::~StaticVarCompensator() {}; +bool assign_StaticVarCompensator_capacitiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitiveRating; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_StaticVarCompensator_inductiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductiveRating; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_StaticVarCompensator_slope(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->slope = dynamic_cast(BaseClass_ptr2); - if(element->slope != nullptr) - return true; - } - return false; +bool assign_StaticVarCompensator_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_StaticVarCompensator_sVCControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sVCControlMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_StaticVarCompensator_slope(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->slope; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_StaticVarCompensator_voltageSetPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageSetPoint; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_StaticVarCompensator_capacitiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->capacitiveRating; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_inductiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductiveRating; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_sVCControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sVCControlMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_voltageSetPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageSetPoint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* StaticVarCompensator_factory() { - return new StaticVarCompensator; - } +const char StaticVarCompensator::debugName[] = "StaticVarCompensator"; +const char* StaticVarCompensator::debugString() const +{ + return StaticVarCompensator::debugName; } -void StaticVarCompensator::addConstructToMap(std::unordered_map& factory_map) { +void StaticVarCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StaticVarCompensator"), &StaticVarCompensator_factory)); } -void StaticVarCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void StaticVarCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.capacitiveRating"), &assign_StaticVarCompensator_capacitiveRating)); assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.inductiveRating"), &assign_StaticVarCompensator_inductiveRating)); - assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.sVCControlMode"), &assign_StaticVarCompensator_sVCControlMode)); - assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.voltageSetPoint"), &assign_StaticVarCompensator_voltageSetPoint)); assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.q"), &assign_StaticVarCompensator_q)); + assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.sVCControlMode"), &assign_StaticVarCompensator_sVCControlMode)); + assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.slope"), &assign_StaticVarCompensator_slope)); + assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.voltageSetPoint"), &assign_StaticVarCompensator_voltageSetPoint)); } -void StaticVarCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.slope"), &assign_StaticVarCompensator_slope)); - } - -const char StaticVarCompensator::debugName[] = "StaticVarCompensator"; -const char* StaticVarCompensator::debugString() +void StaticVarCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StaticVarCompensator::debugName; } const BaseClassDefiner StaticVarCompensator::declare() @@ -125,4 +134,10 @@ const BaseClassDefiner StaticVarCompensator::declare() return BaseClassDefiner(StaticVarCompensator::addConstructToMap, StaticVarCompensator::addPrimitiveAssignFnsToMap, StaticVarCompensator::addClassAssignFnsToMap, StaticVarCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* StaticVarCompensator_factory() + { + return new StaticVarCompensator; + } +} diff --git a/CGMES_2.4.15_16FEB2016/StaticVarCompensator.hpp b/CGMES_2.4.15_16FEB2016/StaticVarCompensator.hpp index 55b2947df..f42209f24 100644 --- a/CGMES_2.4.15_16FEB2016/StaticVarCompensator.hpp +++ b/CGMES_2.4.15_16FEB2016/StaticVarCompensator.hpp @@ -1,47 +1,48 @@ #ifndef StaticVarCompensator_H #define StaticVarCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "Reactance.hpp" +#include "ReactivePower.hpp" #include "SVCControlMode.hpp" #include "Voltage.hpp" -#include "ReactivePower.hpp" - -namespace CIMPP { +#include "VoltagePerReactivePower.hpp" +namespace CIMPP +{ -class VoltagePerReactivePower; /* A facility for providing variable and controllable shunt reactive power. The SVC typically consists of a stepdown transformer, filter, thyristor-controlled reactor, and thyristor-switched capacitor arms. The SVC may operate in fixed MVar output mode or in voltage control mode. When in voltage control mode, the output of the SVC will be proportional to the deviation of voltage at the controlled bus from the voltage setpoint. The SVC characteristic slope defines the proportion. If the voltage at the controlled bus is equal to the voltage setpoint, the SVC MVar output is zero. */ - class StaticVarCompensator: public RegulatingCondEq + class StaticVarCompensator : public RegulatingCondEq { - public: - CIMPP::Reactance capacitiveRating; /* Maximum available capacitive reactance. Default: nullptr */ - CIMPP::Reactance inductiveRating; /* Maximum available inductive reactance. Default: nullptr */ - CIMPP::VoltagePerReactivePower* slope; /* The characteristics slope of an SVC defines how the reactive power output changes in proportion to the difference between the regulated bus voltage and the voltage setpoint. Default: nullptr */ - CIMPP::SVCControlMode sVCControlMode; /* SVC control mode. Default: 0 */ - CIMPP::Voltage voltageSetPoint; /* The reactive power output of the SVC is proportional to the difference between the voltage at the regulated bus and the voltage setpoint. When the regulated bus voltage is equal to the voltage setpoint, the reactive power output is zero. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StaticVarCompensator(); - virtual ~StaticVarCompensator(); - + ~StaticVarCompensator() override; + + CIMPP::Reactance capacitiveRating; /* Maximum available capacitive reactance. Default: nullptr */ + CIMPP::Reactance inductiveRating; /* Maximum available inductive reactance. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ + CIMPP::SVCControlMode sVCControlMode; /* SVC control mode. Default: 0 */ + CIMPP::VoltagePerReactivePower slope; /* The characteristics slope of an SVC defines how the reactive power output changes in proportion to the difference between the regulated bus voltage and the voltage setpoint. Default: nullptr */ + CIMPP::Voltage voltageSetPoint; /* The reactive power output of the SVC is proportional to the difference between the voltage at the regulated bus and the voltage setpoint. When the regulated bus voltage is equal to the voltage setpoint, the reactive power output is zero. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StaticVarCompensator_factory(); diff --git a/CGMES_2.4.15_16FEB2016/StationSupply.cpp b/CGMES_2.4.15_16FEB2016/StationSupply.cpp index fe0641442..ba3e084c7 100644 --- a/CGMES_2.4.15_16FEB2016/StationSupply.cpp +++ b/CGMES_2.4.15_16FEB2016/StationSupply.cpp @@ -1,36 +1,36 @@ -#include -#include "EnergyConsumer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StationSupply.hpp" +#include +#include + using namespace CIMPP; StationSupply::StationSupply() {}; - StationSupply::~StationSupply() {}; -namespace CIMPP { - BaseClass* StationSupply_factory() { - return new StationSupply; - } +const char StationSupply::debugName[] = "StationSupply"; +const char* StationSupply::debugString() const +{ + return StationSupply::debugName; } -void StationSupply::addConstructToMap(std::unordered_map& factory_map) { +void StationSupply::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StationSupply"), &StationSupply_factory)); } -void StationSupply::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void StationSupply::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void StationSupply::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char StationSupply::debugName[] = "StationSupply"; -const char* StationSupply::debugString() +void StationSupply::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StationSupply::debugName; } const BaseClassDefiner StationSupply::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner StationSupply::declare() return BaseClassDefiner(StationSupply::addConstructToMap, StationSupply::addPrimitiveAssignFnsToMap, StationSupply::addClassAssignFnsToMap, StationSupply::debugName); } - +namespace CIMPP +{ + BaseClass* StationSupply_factory() + { + return new StationSupply; + } +} diff --git a/CGMES_2.4.15_16FEB2016/StationSupply.hpp b/CGMES_2.4.15_16FEB2016/StationSupply.hpp index a974df9de..e8dad59fe 100644 --- a/CGMES_2.4.15_16FEB2016/StationSupply.hpp +++ b/CGMES_2.4.15_16FEB2016/StationSupply.hpp @@ -1,36 +1,37 @@ #ifndef StationSupply_H #define StationSupply_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyConsumer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyConsumer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Station supply with load derived from the station output. */ - class StationSupply: public EnergyConsumer + class StationSupply : public EnergyConsumer { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StationSupply(); - virtual ~StationSupply(); - + ~StationSupply() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StationSupply_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.cpp b/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.cpp index 2c3ac7407..2533eb481 100644 --- a/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SteadyStateHypothesisVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -SteadyStateHypothesisVersion::SteadyStateHypothesisVersion(): date(nullptr) {}; - +SteadyStateHypothesisVersion::SteadyStateHypothesisVersion() {}; SteadyStateHypothesisVersion::~SteadyStateHypothesisVersion() {}; - - -bool assign_SteadyStateHypothesisVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_SteadyStateHypothesisVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_SteadyStateHypothesisVersion_baseUML(std::stringstream &buffer, Base return false; } -bool assign_SteadyStateHypothesisVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_SteadyStateHypothesisVersion_baseURI(std::stringstream &buffer, Base return false; } +bool assign_SteadyStateHypothesisVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SteadyStateHypothesisVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_SteadyStateHypothesisVersion_differenceModelURI(std::stringstream &b return false; } -bool assign_SteadyStateHypothesisVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_SteadyStateHypothesisVersion_entsoeUML(std::stringstream &buffer, Ba return false; } -bool assign_SteadyStateHypothesisVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_SteadyStateHypothesisVersion_entsoeURI(std::stringstream &buffer, Ba return false; } -bool assign_SteadyStateHypothesisVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_SteadyStateHypothesisVersion_modelDescriptionURI(std::stringstream & return false; } -bool assign_SteadyStateHypothesisVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_SteadyStateHypothesisVersion_namespaceRDF(std::stringstream &buffer, return false; } -bool assign_SteadyStateHypothesisVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_SteadyStateHypothesisVersion_namespaceUML(std::stringstream &buffer, return false; } -bool assign_SteadyStateHypothesisVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_SteadyStateHypothesisVersion_shortName(std::stringstream &buffer, Ba return false; } -namespace CIMPP { - BaseClass* SteadyStateHypothesisVersion_factory() { - return new SteadyStateHypothesisVersion; - } + + + + + + + + + + + +const char SteadyStateHypothesisVersion::debugName[] = "SteadyStateHypothesisVersion"; +const char* SteadyStateHypothesisVersion::debugString() const +{ + return SteadyStateHypothesisVersion::debugName; } -void SteadyStateHypothesisVersion::addConstructToMap(std::unordered_map& factory_map) { +void SteadyStateHypothesisVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion"), &SteadyStateHypothesisVersion_factory)); } -void SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.baseUML"), &assign_SteadyStateHypothesisVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.baseURI"), &assign_SteadyStateHypothesisVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.differenceModelURI"), &assign_SteadyStateHypothesisVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.date"), &assign_SteadyStateHypothesisVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.differenceModelURI"), &assign_SteadyStateHypothesisVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.entsoeUML"), &assign_SteadyStateHypothesisVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.entsoeURI"), &assign_SteadyStateHypothesisVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.modelDescriptionURI"), &assign_SteadyStateHypothesisVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap(std::unordered_map assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.shortName"), &assign_SteadyStateHypothesisVersion_shortName)); } -void SteadyStateHypothesisVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.date"), &assign_SteadyStateHypothesisVersion_date)); - } - -const char SteadyStateHypothesisVersion::debugName[] = "SteadyStateHypothesisVersion"; -const char* SteadyStateHypothesisVersion::debugString() +void SteadyStateHypothesisVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SteadyStateHypothesisVersion::debugName; } const BaseClassDefiner SteadyStateHypothesisVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner SteadyStateHypothesisVersion::declare() return BaseClassDefiner(SteadyStateHypothesisVersion::addConstructToMap, SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap, SteadyStateHypothesisVersion::addClassAssignFnsToMap, SteadyStateHypothesisVersion::debugName); } - +namespace CIMPP +{ + BaseClass* SteadyStateHypothesisVersion_factory() + { + return new SteadyStateHypothesisVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.hpp b/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.hpp index 79fde578d..7eeaa2af7 100644 --- a/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/SteadyStateHypothesisVersion.hpp @@ -1,48 +1,49 @@ #ifndef SteadyStateHypothesisVersion_H #define SteadyStateHypothesisVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class SteadyStateHypothesisVersion: public BaseClass + class SteadyStateHypothesisVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/SteadyStateHypothesis/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SteadyStateHypothesisVersion(); - virtual ~SteadyStateHypothesisVersion(); - + ~SteadyStateHypothesisVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/SteadyStateHypothesis/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SteadyStateHypothesisVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/String.cpp b/CGMES_2.4.15_16FEB2016/String.cpp new file mode 100644 index 000000000..e39ff2f00 --- /dev/null +++ b/CGMES_2.4.15_16FEB2016/String.cpp @@ -0,0 +1,49 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ +#include "String.hpp" + +#include "../src/CIMExceptions.hpp" + +using namespace CIMPP; + +String& String::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; +} + +String::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char String::debugName[] = "String"; +const char* String::debugString() const +{ + return String::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, String& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + + std::ostream& operator<<(std::ostream& os, const String& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/String.hpp b/CGMES_2.4.15_16FEB2016/String.hpp new file mode 100644 index 000000000..60fcbbbc0 --- /dev/null +++ b/CGMES_2.4.15_16FEB2016/String.hpp @@ -0,0 +1,35 @@ +#ifndef String_H +#define String_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + +#include +#include +#include + +namespace CIMPP +{ + /* + A string consisting of a sequence of characters. The character encoding is UTF-8. The string length is unspecified and unlimited. + */ + class String + { + public: + String() : initialized(false) {} + String(const std::string& value) : value(value), initialized(true) {} + + String& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, String& rop); + friend std::ostream& operator<<(std::ostream& os, const String& obj); + }; +} +#endif diff --git a/CGMES_2.4.15_16FEB2016/StringMeasurement.cpp b/CGMES_2.4.15_16FEB2016/StringMeasurement.cpp index 84ffd2b8d..1eb7acf05 100644 --- a/CGMES_2.4.15_16FEB2016/StringMeasurement.cpp +++ b/CGMES_2.4.15_16FEB2016/StringMeasurement.cpp @@ -1,49 +1,56 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StringMeasurement.hpp" +#include +#include + #include "StringMeasurementValue.hpp" using namespace CIMPP; StringMeasurement::StringMeasurement() {}; - StringMeasurement::~StringMeasurement() {}; -bool assign_StringMeasurement_StringMeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StringMeasurement* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->StringMeasurementValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_StringMeasurementValue_StringMeasurement(BaseClass*, BaseClass*); +bool assign_StringMeasurement_StringMeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + StringMeasurement* element = dynamic_cast(BaseClass_ptr1); + StringMeasurementValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->StringMeasurementValues.begin(), element->StringMeasurementValues.end(), element2) == element->StringMeasurementValues.end()) + { + element->StringMeasurementValues.push_back(element2); + return assign_StringMeasurementValue_StringMeasurement(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* StringMeasurement_factory() { - return new StringMeasurement; - } +const char StringMeasurement::debugName[] = "StringMeasurement"; +const char* StringMeasurement::debugString() const +{ + return StringMeasurement::debugName; } -void StringMeasurement::addConstructToMap(std::unordered_map& factory_map) { +void StringMeasurement::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StringMeasurement"), &StringMeasurement_factory)); } -void StringMeasurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void StringMeasurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StringMeasurement.StringMeasurementValues"), &assign_StringMeasurement_StringMeasurementValues)); +void StringMeasurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char StringMeasurement::debugName[] = "StringMeasurement"; -const char* StringMeasurement::debugString() +void StringMeasurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StringMeasurement::debugName; + assign_map.insert(std::make_pair(std::string("cim:StringMeasurement.StringMeasurementValues"), &assign_StringMeasurement_StringMeasurementValues)); } const BaseClassDefiner StringMeasurement::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner StringMeasurement::declare() return BaseClassDefiner(StringMeasurement::addConstructToMap, StringMeasurement::addPrimitiveAssignFnsToMap, StringMeasurement::addClassAssignFnsToMap, StringMeasurement::debugName); } - +namespace CIMPP +{ + BaseClass* StringMeasurement_factory() + { + return new StringMeasurement; + } +} diff --git a/CGMES_2.4.15_16FEB2016/StringMeasurement.hpp b/CGMES_2.4.15_16FEB2016/StringMeasurement.hpp index c95a15cf6..dbe295067 100644 --- a/CGMES_2.4.15_16FEB2016/StringMeasurement.hpp +++ b/CGMES_2.4.15_16FEB2016/StringMeasurement.hpp @@ -1,38 +1,39 @@ #ifndef StringMeasurement_H #define StringMeasurement_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class StringMeasurementValue; -class StringMeasurementValue; /* StringMeasurement represents a measurement with values of type string. */ - class StringMeasurement: public Measurement + class StringMeasurement : public Measurement { - public: - std::list StringMeasurementValues; /* The values connected to this measurement. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StringMeasurement(); - virtual ~StringMeasurement(); - + ~StringMeasurement() override; + + std::list StringMeasurementValues; /* The values connected to this measurement. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StringMeasurement_factory(); diff --git a/CGMES_2.4.15_16FEB2016/StringMeasurementValue.cpp b/CGMES_2.4.15_16FEB2016/StringMeasurementValue.cpp index e4a525151..68102fc0e 100644 --- a/CGMES_2.4.15_16FEB2016/StringMeasurementValue.cpp +++ b/CGMES_2.4.15_16FEB2016/StringMeasurementValue.cpp @@ -1,34 +1,27 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StringMeasurementValue.hpp" +#include +#include + #include "StringMeasurement.hpp" #include "String.hpp" using namespace CIMPP; -StringMeasurementValue::StringMeasurementValue(): StringMeasurement(nullptr) {}; - +StringMeasurementValue::StringMeasurementValue() : StringMeasurement(nullptr) {}; StringMeasurementValue::~StringMeasurementValue() {}; -bool assign_StringMeasurement_StringMeasurementValues(BaseClass*, BaseClass*); -bool assign_StringMeasurementValue_StringMeasurement(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->StringMeasurement = dynamic_cast(BaseClass_ptr2); - if(element->StringMeasurement != nullptr) - return assign_StringMeasurement_StringMeasurementValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - -bool assign_StringMeasurementValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StringMeasurementValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1)) + { element->value = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -36,28 +29,44 @@ bool assign_StringMeasurementValue_value(std::stringstream &buffer, BaseClass* B return false; } -namespace CIMPP { - BaseClass* StringMeasurementValue_factory() { - return new StringMeasurementValue; + +bool assign_StringMeasurement_StringMeasurementValues(BaseClass*, BaseClass*); +bool assign_StringMeasurementValue_StringMeasurement(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1); + StringMeasurement* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->StringMeasurement != element2) + { + element->StringMeasurement = element2; + return assign_StringMeasurement_StringMeasurementValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void StringMeasurementValue::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:StringMeasurementValue"), &StringMeasurementValue_factory)); + +const char StringMeasurementValue::debugName[] = "StringMeasurementValue"; +const char* StringMeasurementValue::debugString() const +{ + return StringMeasurementValue::debugName; } -void StringMeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.value"), &assign_StringMeasurementValue_value)); +void StringMeasurementValue::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:StringMeasurementValue"), &StringMeasurementValue_factory)); } -void StringMeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.StringMeasurement"), &assign_StringMeasurementValue_StringMeasurement)); - } +void StringMeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.value"), &assign_StringMeasurementValue_value)); +} -const char StringMeasurementValue::debugName[] = "StringMeasurementValue"; -const char* StringMeasurementValue::debugString() +void StringMeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StringMeasurementValue::debugName; + assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.StringMeasurement"), &assign_StringMeasurementValue_StringMeasurement)); } const BaseClassDefiner StringMeasurementValue::declare() @@ -65,4 +74,10 @@ const BaseClassDefiner StringMeasurementValue::declare() return BaseClassDefiner(StringMeasurementValue::addConstructToMap, StringMeasurementValue::addPrimitiveAssignFnsToMap, StringMeasurementValue::addClassAssignFnsToMap, StringMeasurementValue::debugName); } - +namespace CIMPP +{ + BaseClass* StringMeasurementValue_factory() + { + return new StringMeasurementValue; + } +} diff --git a/CGMES_2.4.15_16FEB2016/StringMeasurementValue.hpp b/CGMES_2.4.15_16FEB2016/StringMeasurementValue.hpp index 9d1533ae8..415428c41 100644 --- a/CGMES_2.4.15_16FEB2016/StringMeasurementValue.hpp +++ b/CGMES_2.4.15_16FEB2016/StringMeasurementValue.hpp @@ -1,40 +1,41 @@ #ifndef StringMeasurementValue_H #define StringMeasurementValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class StringMeasurement; - -class StringMeasurement; /* StringMeasurementValue represents a measurement value of type string. */ - class StringMeasurementValue: public MeasurementValue + class StringMeasurementValue : public MeasurementValue { - public: - CIMPP::StringMeasurement* StringMeasurement; /* Measurement to which this value is connected. Default: 0 */ - CIMPP::String value; /* The value to supervise. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StringMeasurementValue(); - virtual ~StringMeasurementValue(); - + ~StringMeasurementValue() override; + + CIMPP::StringMeasurement* StringMeasurement; /* Measurement to which this value is connected. Default: 0 */ + CIMPP::String value; /* The value to supervise. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StringMeasurementValue_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.cpp b/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.cpp index 0cf95c61a..f16780fa0 100644 --- a/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.cpp +++ b/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.cpp @@ -1,93 +1,127 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SubGeographicalRegion.hpp" +#include +#include + #include "DCLine.hpp" -#include "GeographicalRegion.hpp" #include "Line.hpp" +#include "GeographicalRegion.hpp" #include "Substation.hpp" using namespace CIMPP; -SubGeographicalRegion::SubGeographicalRegion(): Region(nullptr) {}; - +SubGeographicalRegion::SubGeographicalRegion() : Region(nullptr) {}; SubGeographicalRegion::~SubGeographicalRegion() {}; -bool assign_SubGeographicalRegion_DCLines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCLines.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + + +bool assign_DCLine_Region(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_DCLines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + DCLine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCLines.begin(), element->DCLines.end(), element2) == element->DCLines.end()) + { + element->DCLines.push_back(element2); + return assign_DCLine_Region(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_GeographicalRegion_Regions(BaseClass*, BaseClass*); -bool assign_SubGeographicalRegion_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_GeographicalRegion_Regions(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Line_Region(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_Lines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + Line* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Lines.begin(), element->Lines.end(), element2) == element->Lines.end()) + { + element->Lines.push_back(element2); + return assign_Line_Region(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SubGeographicalRegion_Lines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Lines.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_GeographicalRegion_Regions(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + GeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_GeographicalRegion_Regions(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_SubGeographicalRegion_Substations(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Substations.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Substation_Region(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_Substations(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + Substation* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Substations.begin(), element->Substations.end(), element2) == element->Substations.end()) + { + element->Substations.push_back(element2); + return assign_Substation_Region(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - -namespace CIMPP { - BaseClass* SubGeographicalRegion_factory() { - return new SubGeographicalRegion; - } +const char SubGeographicalRegion::debugName[] = "SubGeographicalRegion"; +const char* SubGeographicalRegion::debugString() const +{ + return SubGeographicalRegion::debugName; } -void SubGeographicalRegion::addConstructToMap(std::unordered_map& factory_map) { +void SubGeographicalRegion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion"), &SubGeographicalRegion_factory)); } -void SubGeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void SubGeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void SubGeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void SubGeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.DCLines"), &assign_SubGeographicalRegion_DCLines)); - assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Region"), &assign_SubGeographicalRegion_Region)); assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Lines"), &assign_SubGeographicalRegion_Lines)); + assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Region"), &assign_SubGeographicalRegion_Region)); assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Substations"), &assign_SubGeographicalRegion_Substations)); } -const char SubGeographicalRegion::debugName[] = "SubGeographicalRegion"; -const char* SubGeographicalRegion::debugString() -{ - return SubGeographicalRegion::debugName; -} - const BaseClassDefiner SubGeographicalRegion::declare() { return BaseClassDefiner(SubGeographicalRegion::addConstructToMap, SubGeographicalRegion::addPrimitiveAssignFnsToMap, SubGeographicalRegion::addClassAssignFnsToMap, SubGeographicalRegion::debugName); } - +namespace CIMPP +{ + BaseClass* SubGeographicalRegion_factory() + { + return new SubGeographicalRegion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.hpp b/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.hpp index 9ea5e6a4d..99e296385 100644 --- a/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.hpp +++ b/CGMES_2.4.15_16FEB2016/SubGeographicalRegion.hpp @@ -1,44 +1,45 @@ #ifndef SubGeographicalRegion_H #define SubGeographicalRegion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCLine; + class GeographicalRegion; + class Line; + class Substation; -class DCLine; -class GeographicalRegion; -class Line; -class Substation; /* A subset of a geographical region of a power system network model. */ - class SubGeographicalRegion: public IdentifiedObject + class SubGeographicalRegion : public IdentifiedObject { - public: - std::list DCLines; /* Default: 0 */ - CIMPP::GeographicalRegion* Region; /* The geographical region to which this sub-geographical region is within. Default: 0 */ - std::list Lines; /* The lines within the sub-geographical region. Default: 0 */ - std::list Substations; /* The substations in this sub-geographical region. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SubGeographicalRegion(); - virtual ~SubGeographicalRegion(); - + ~SubGeographicalRegion() override; + + std::list DCLines; /* Default: 0 */ + std::list Lines; /* The sub-geographical region of the line. Default: 0 */ + CIMPP::GeographicalRegion* Region; /* The geographical region to which this sub-geographical region is within. Default: 0 */ + std::list Substations; /* The substations in this sub-geographical region. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SubGeographicalRegion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SubLoadArea.cpp b/CGMES_2.4.15_16FEB2016/SubLoadArea.cpp index caa12cdf0..d52b226c0 100644 --- a/CGMES_2.4.15_16FEB2016/SubLoadArea.cpp +++ b/CGMES_2.4.15_16FEB2016/SubLoadArea.cpp @@ -1,62 +1,76 @@ -#include -#include "EnergyArea.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SubLoadArea.hpp" +#include +#include + #include "LoadArea.hpp" #include "LoadGroup.hpp" using namespace CIMPP; -SubLoadArea::SubLoadArea(): LoadArea(nullptr) {}; - +SubLoadArea::SubLoadArea() : LoadArea(nullptr) {}; SubLoadArea::~SubLoadArea() {}; + + + bool assign_LoadArea_SubLoadAreas(BaseClass*, BaseClass*); -bool assign_SubLoadArea_LoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubLoadArea* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadArea = dynamic_cast(BaseClass_ptr2); - if(element->LoadArea != nullptr) - return assign_LoadArea_SubLoadAreas(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SubLoadArea_LoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubLoadArea* element = dynamic_cast(BaseClass_ptr1); + LoadArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadArea != element2) + { + element->LoadArea = element2; + return assign_LoadArea_SubLoadAreas(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SubLoadArea_LoadGroups(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubLoadArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->LoadGroups.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_LoadGroup_SubLoadArea(BaseClass*, BaseClass*); +bool assign_SubLoadArea_LoadGroups(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubLoadArea* element = dynamic_cast(BaseClass_ptr1); + LoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->LoadGroups.begin(), element->LoadGroups.end(), element2) == element->LoadGroups.end()) + { + element->LoadGroups.push_back(element2); + return assign_LoadGroup_SubLoadArea(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* SubLoadArea_factory() { - return new SubLoadArea; - } +const char SubLoadArea::debugName[] = "SubLoadArea"; +const char* SubLoadArea::debugString() const +{ + return SubLoadArea::debugName; } -void SubLoadArea::addConstructToMap(std::unordered_map& factory_map) { +void SubLoadArea::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SubLoadArea"), &SubLoadArea_factory)); } -void SubLoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void SubLoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadArea"), &assign_SubLoadArea_LoadArea)); - assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadGroups"), &assign_SubLoadArea_LoadGroups)); +void SubLoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SubLoadArea::debugName[] = "SubLoadArea"; -const char* SubLoadArea::debugString() +void SubLoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SubLoadArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadArea"), &assign_SubLoadArea_LoadArea)); + assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadGroups"), &assign_SubLoadArea_LoadGroups)); } const BaseClassDefiner SubLoadArea::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner SubLoadArea::declare() return BaseClassDefiner(SubLoadArea::addConstructToMap, SubLoadArea::addPrimitiveAssignFnsToMap, SubLoadArea::addClassAssignFnsToMap, SubLoadArea::debugName); } - +namespace CIMPP +{ + BaseClass* SubLoadArea_factory() + { + return new SubLoadArea; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SubLoadArea.hpp b/CGMES_2.4.15_16FEB2016/SubLoadArea.hpp index 23effe803..344ee5c42 100644 --- a/CGMES_2.4.15_16FEB2016/SubLoadArea.hpp +++ b/CGMES_2.4.15_16FEB2016/SubLoadArea.hpp @@ -1,40 +1,41 @@ #ifndef SubLoadArea_H #define SubLoadArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyArea.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyArea.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class LoadArea; + class LoadGroup; -class LoadArea; -class LoadGroup; /* The class is the second level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. */ - class SubLoadArea: public EnergyArea + class SubLoadArea : public EnergyArea { - public: - CIMPP::LoadArea* LoadArea; /* The LoadArea where the SubLoadArea belongs. Default: 0 */ - std::list LoadGroups; /* The Loadgroups in the SubLoadArea. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SubLoadArea(); - virtual ~SubLoadArea(); - + ~SubLoadArea() override; + + CIMPP::LoadArea* LoadArea; /* The LoadArea where the SubLoadArea belongs. Default: 0 */ + std::list LoadGroups; /* The Loadgroups in the SubLoadArea. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SubLoadArea_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Substation.cpp b/CGMES_2.4.15_16FEB2016/Substation.cpp index 42d61f23a..1184170ee 100644 --- a/CGMES_2.4.15_16FEB2016/Substation.cpp +++ b/CGMES_2.4.15_16FEB2016/Substation.cpp @@ -1,80 +1,107 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Substation.hpp" +#include +#include + #include "DCConverterUnit.hpp" #include "SubGeographicalRegion.hpp" #include "VoltageLevel.hpp" using namespace CIMPP; -Substation::Substation(): Region(nullptr) {}; - +Substation::Substation() : Region(nullptr) {}; Substation::~Substation() {}; -bool assign_Substation_DCConverterUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Substation* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCConverterUnit.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_DCConverterUnit_Substation(BaseClass*, BaseClass*); +bool assign_Substation_DCConverterUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Substation* element = dynamic_cast(BaseClass_ptr1); + DCConverterUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCConverterUnit.begin(), element->DCConverterUnit.end(), element2) == element->DCConverterUnit.end()) + { + element->DCConverterUnit.push_back(element2); + return assign_DCConverterUnit_Substation(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_SubGeographicalRegion_Substations(BaseClass*, BaseClass*); -bool assign_Substation_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Substation* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_SubGeographicalRegion_Substations(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Substation_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Substation* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_SubGeographicalRegion_Substations(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Substation_VoltageLevels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Substation* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VoltageLevels.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_VoltageLevel_Substation(BaseClass*, BaseClass*); +bool assign_Substation_VoltageLevels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Substation* element = dynamic_cast(BaseClass_ptr1); + VoltageLevel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VoltageLevels.begin(), element->VoltageLevels.end(), element2) == element->VoltageLevels.end()) + { + element->VoltageLevels.push_back(element2); + return assign_VoltageLevel_Substation(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - -namespace CIMPP { - BaseClass* Substation_factory() { - return new Substation; - } +const char Substation::debugName[] = "Substation"; +const char* Substation::debugString() const +{ + return Substation::debugName; } -void Substation::addConstructToMap(std::unordered_map& factory_map) { +void Substation::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Substation"), &Substation_factory)); } -void Substation::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void Substation::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void Substation::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Substation::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Substation.DCConverterUnit"), &assign_Substation_DCConverterUnit)); assign_map.insert(std::make_pair(std::string("cim:Substation.Region"), &assign_Substation_Region)); assign_map.insert(std::make_pair(std::string("cim:Substation.VoltageLevels"), &assign_Substation_VoltageLevels)); } -const char Substation::debugName[] = "Substation"; -const char* Substation::debugString() -{ - return Substation::debugName; -} - const BaseClassDefiner Substation::declare() { return BaseClassDefiner(Substation::addConstructToMap, Substation::addPrimitiveAssignFnsToMap, Substation::addClassAssignFnsToMap, Substation::debugName); } - +namespace CIMPP +{ + BaseClass* Substation_factory() + { + return new Substation; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Substation.hpp b/CGMES_2.4.15_16FEB2016/Substation.hpp index 9309a7e14..a1a9e6881 100644 --- a/CGMES_2.4.15_16FEB2016/Substation.hpp +++ b/CGMES_2.4.15_16FEB2016/Substation.hpp @@ -1,42 +1,43 @@ #ifndef Substation_H #define Substation_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCConverterUnit; + class SubGeographicalRegion; + class VoltageLevel; -class DCConverterUnit; -class SubGeographicalRegion; -class VoltageLevel; /* A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics. */ - class Substation: public EquipmentContainer + class Substation : public EquipmentContainer { - public: - std::list DCConverterUnit; /* Default: 0 */ - CIMPP::SubGeographicalRegion* Region; /* The SubGeographicalRegion containing the substation. Default: 0 */ - std::list VoltageLevels; /* The voltage levels within this substation. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Substation(); - virtual ~Substation(); - + ~Substation() override; + + std::list DCConverterUnit; /* Default: 0 */ + CIMPP::SubGeographicalRegion* Region; /* The SubGeographicalRegion containing the substation. Default: 0 */ + std::list VoltageLevels; /* The voltage levels within this substation. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Substation_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Susceptance.cpp b/CGMES_2.4.15_16FEB2016/Susceptance.cpp index 965ca66b4..2c15bc914 100644 --- a/CGMES_2.4.15_16FEB2016/Susceptance.cpp +++ b/CGMES_2.4.15_16FEB2016/Susceptance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Susceptance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Susceptance::Susceptance() {} -Susceptance::~Susceptance(){} +#include -Susceptance::Susceptance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Susceptance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Susceptance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Susceptance& Susceptance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Susceptance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Susceptance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Susceptance::debugName[] = "Susceptance"; -const char* Susceptance::debugString() { +const char* Susceptance::debugString() const +{ return Susceptance::debugName; } - -const BaseClassDefiner Susceptance::declare() { - return BaseClassDefiner(Susceptance::addConstructToMap, Susceptance::addPrimitiveAssignFnsToMap, Susceptance::addClassAssignFnsToMap, Susceptance::debugName); +Susceptance& Susceptance::operator+=(const Susceptance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Susceptance& Susceptance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Susceptance& Susceptance::operator-=(const Susceptance& rhs) { - value -= rhs.value; - return *this; - } - - Susceptance& Susceptance::operator*=(const Susceptance& rhs) { - value *= rhs.value; - return *this; - } - - Susceptance& Susceptance::operator/=(const Susceptance& rhs) { - value /= rhs.value; - return *this; - } +Susceptance& Susceptance::operator-=(const Susceptance& rhs) +{ + value -= rhs.value; + return *this; +} - Susceptance& Susceptance::operator+=(const Susceptance& rhs) { - value += rhs.value; - return *this; - } +Susceptance& Susceptance::operator*=(const Susceptance& rhs) +{ + value *= rhs.value; + return *this; +} - Susceptance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Susceptance& Susceptance::operator/=(const Susceptance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Susceptance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Susceptance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Susceptance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Susceptance.hpp b/CGMES_2.4.15_16FEB2016/Susceptance.hpp index f4c64d673..c213337b1 100644 --- a/CGMES_2.4.15_16FEB2016/Susceptance.hpp +++ b/CGMES_2.4.15_16FEB2016/Susceptance.hpp @@ -1,38 +1,39 @@ #ifndef Susceptance_H #define Susceptance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Susceptance : public BaseClass + /* + Imaginary part of admittance. + */ + class Susceptance { - public: - Susceptance(); - virtual ~Susceptance(); - Susceptance(long double value); - static const BaseClassDefiner declare(); - Susceptance& operator=(long double &rop); + Susceptance() : value(0.0), initialized(false) {} + Susceptance(long double value) : value(value), initialized(true) {} + + Susceptance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Susceptance& operator+=(const Susceptance& rhs); Susceptance& operator-=(const Susceptance& rhs); Susceptance& operator*=(const Susceptance& rhs); Susceptance& operator/=(const Susceptance& rhs); + friend std::istream& operator>>(std::istream& lop, Susceptance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Susceptance& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/SvInjection.cpp b/CGMES_2.4.15_16FEB2016/SvInjection.cpp index fb6fffeb8..bed4c3d82 100644 --- a/CGMES_2.4.15_16FEB2016/SvInjection.cpp +++ b/CGMES_2.4.15_16FEB2016/SvInjection.cpp @@ -1,79 +1,88 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvInjection.hpp" +#include +#include + +#include "TopologicalNode.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -#include "TopologicalNode.hpp" using namespace CIMPP; -SvInjection::SvInjection(): TopologicalNode(nullptr) {}; - +SvInjection::SvInjection() : TopologicalNode(nullptr) {}; SvInjection::~SvInjection() {}; +bool assign_SvInjection_pInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pInjection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologicalNode_SvInjection(BaseClass*, BaseClass*); -bool assign_SvInjection_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvInjection* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_SvInjection(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvInjection_qInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qInjection; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvInjection_pInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pInjection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TopologicalNode_SvInjection(BaseClass*, BaseClass*); +bool assign_SvInjection_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvInjection* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_SvInjection(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SvInjection_qInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qInjection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SvInjection_factory() { - return new SvInjection; - } +const char SvInjection::debugName[] = "SvInjection"; +const char* SvInjection::debugString() const +{ + return SvInjection::debugName; } -void SvInjection::addConstructToMap(std::unordered_map& factory_map) { +void SvInjection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvInjection"), &SvInjection_factory)); } -void SvInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvInjection.pInjection"), &assign_SvInjection_pInjection)); assign_map.insert(std::make_pair(std::string("cim:SvInjection.qInjection"), &assign_SvInjection_qInjection)); - } - -void SvInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvInjection.TopologicalNode"), &assign_SvInjection_TopologicalNode)); } -const char SvInjection::debugName[] = "SvInjection"; -const char* SvInjection::debugString() +void SvInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvInjection::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvInjection.TopologicalNode"), &assign_SvInjection_TopologicalNode)); } const BaseClassDefiner SvInjection::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner SvInjection::declare() return BaseClassDefiner(SvInjection::addConstructToMap, SvInjection::addPrimitiveAssignFnsToMap, SvInjection::addClassAssignFnsToMap, SvInjection::debugName); } - +namespace CIMPP +{ + BaseClass* SvInjection_factory() + { + return new SvInjection; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SvInjection.hpp b/CGMES_2.4.15_16FEB2016/SvInjection.hpp index a272c3211..cc2f21267 100644 --- a/CGMES_2.4.15_16FEB2016/SvInjection.hpp +++ b/CGMES_2.4.15_16FEB2016/SvInjection.hpp @@ -1,42 +1,43 @@ #ifndef SvInjection_H #define SvInjection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class TopologicalNode; - -class TopologicalNode; /* The SvInjection is reporting the calculated bus injection minus the sum of the terminal flows. The terminal flow is positive out from the bus (load sign convention) and bus injection has positive flow into the bus. SvInjection may have the remainder after state estimation or slack after power flow calculation. */ - class SvInjection: public BaseClass + class SvInjection : public BaseClass { - public: - CIMPP::ActivePower pInjection; /* The active power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ - CIMPP::ReactivePower qInjection; /* The reactive power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ - CIMPP::TopologicalNode* TopologicalNode; /* The injection flows state variables associated with the topological node. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvInjection(); - virtual ~SvInjection(); - + ~SvInjection() override; + + CIMPP::TopologicalNode* TopologicalNode; /* The injection flows state variables associated with the topological node. Default: 0 */ + CIMPP::ActivePower pInjection; /* The active power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ + CIMPP::ReactivePower qInjection; /* The reactive power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvInjection_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SvPowerFlow.cpp b/CGMES_2.4.15_16FEB2016/SvPowerFlow.cpp index c71367f35..96125e597 100644 --- a/CGMES_2.4.15_16FEB2016/SvPowerFlow.cpp +++ b/CGMES_2.4.15_16FEB2016/SvPowerFlow.cpp @@ -1,79 +1,88 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvPowerFlow.hpp" +#include +#include + #include "Terminal.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" using namespace CIMPP; -SvPowerFlow::SvPowerFlow(): Terminal(nullptr) {}; - +SvPowerFlow::SvPowerFlow() : Terminal(nullptr) {}; SvPowerFlow::~SvPowerFlow() {}; -bool assign_Terminal_SvPowerFlow(BaseClass*, BaseClass*); -bool assign_SvPowerFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_SvPowerFlow(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_SvPowerFlow_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SvPowerFlow_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SvPowerFlow_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_SvPowerFlow(BaseClass*, BaseClass*); +bool assign_SvPowerFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvPowerFlow* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_SvPowerFlow(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SvPowerFlow_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SvPowerFlow_factory() { - return new SvPowerFlow; - } + +const char SvPowerFlow::debugName[] = "SvPowerFlow"; +const char* SvPowerFlow::debugString() const +{ + return SvPowerFlow::debugName; } -void SvPowerFlow::addConstructToMap(std::unordered_map& factory_map) { +void SvPowerFlow::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvPowerFlow"), &SvPowerFlow_factory)); } -void SvPowerFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.p"), &assign_SvPowerFlow_p)); +void SvPowerFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.p"), &assign_SvPowerFlow_p)); assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.q"), &assign_SvPowerFlow_q)); } -void SvPowerFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.Terminal"), &assign_SvPowerFlow_Terminal)); - } - -const char SvPowerFlow::debugName[] = "SvPowerFlow"; -const char* SvPowerFlow::debugString() +void SvPowerFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvPowerFlow::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.Terminal"), &assign_SvPowerFlow_Terminal)); } const BaseClassDefiner SvPowerFlow::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner SvPowerFlow::declare() return BaseClassDefiner(SvPowerFlow::addConstructToMap, SvPowerFlow::addPrimitiveAssignFnsToMap, SvPowerFlow::addClassAssignFnsToMap, SvPowerFlow::debugName); } - +namespace CIMPP +{ + BaseClass* SvPowerFlow_factory() + { + return new SvPowerFlow; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SvPowerFlow.hpp b/CGMES_2.4.15_16FEB2016/SvPowerFlow.hpp index 5ef4b3afd..a5075dfae 100644 --- a/CGMES_2.4.15_16FEB2016/SvPowerFlow.hpp +++ b/CGMES_2.4.15_16FEB2016/SvPowerFlow.hpp @@ -1,42 +1,43 @@ #ifndef SvPowerFlow_H #define SvPowerFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Terminal; - -class Terminal; /* State variable for power flow. Load convention is used for flow direction. This means flow out from the TopologicalNode into the equipment is positive. */ - class SvPowerFlow: public BaseClass + class SvPowerFlow : public BaseClass { - public: - CIMPP::Terminal* Terminal; /* The terminal associated with the power flow state variable. Default: 0 */ - CIMPP::ActivePower p; /* The active power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ - CIMPP::ReactivePower q; /* The reactive power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvPowerFlow(); - virtual ~SvPowerFlow(); - + ~SvPowerFlow() override; + + CIMPP::Terminal* Terminal; /* The terminal associated with the power flow state variable. Default: 0 */ + CIMPP::ActivePower p; /* The active power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ + CIMPP::ReactivePower q; /* The reactive power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvPowerFlow_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.cpp b/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.cpp index 934385944..11f0ceeb5 100644 --- a/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.cpp +++ b/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.cpp @@ -1,64 +1,72 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvShuntCompensatorSections.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "ShuntCompensator.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; -SvShuntCompensatorSections::SvShuntCompensatorSections(): ShuntCompensator(nullptr) {}; - +SvShuntCompensatorSections::SvShuntCompensatorSections() : ShuntCompensator(nullptr) {}; SvShuntCompensatorSections::~SvShuntCompensatorSections() {}; -bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass*, BaseClass*); -bool assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1)) { - element->ShuntCompensator = dynamic_cast(BaseClass_ptr2); - if(element->ShuntCompensator != nullptr) - return assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvShuntCompensatorSections_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sections; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvShuntCompensatorSections_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass*, BaseClass*); +bool assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1); + ShuntCompensator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ShuntCompensator != element2) + { + element->ShuntCompensator = element2; + return assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SvShuntCompensatorSections_factory() { - return new SvShuntCompensatorSections; - } +const char SvShuntCompensatorSections::debugName[] = "SvShuntCompensatorSections"; +const char* SvShuntCompensatorSections::debugString() const +{ + return SvShuntCompensatorSections::debugName; } -void SvShuntCompensatorSections::addConstructToMap(std::unordered_map& factory_map) { +void SvShuntCompensatorSections::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections"), &SvShuntCompensatorSections_factory)); } -void SvShuntCompensatorSections::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvShuntCompensatorSections::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections.sections"), &assign_SvShuntCompensatorSections_sections)); - } - -void SvShuntCompensatorSections::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections.ShuntCompensator"), &assign_SvShuntCompensatorSections_ShuntCompensator)); } -const char SvShuntCompensatorSections::debugName[] = "SvShuntCompensatorSections"; -const char* SvShuntCompensatorSections::debugString() +void SvShuntCompensatorSections::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvShuntCompensatorSections::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections.ShuntCompensator"), &assign_SvShuntCompensatorSections_ShuntCompensator)); } const BaseClassDefiner SvShuntCompensatorSections::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SvShuntCompensatorSections::declare() return BaseClassDefiner(SvShuntCompensatorSections::addConstructToMap, SvShuntCompensatorSections::addPrimitiveAssignFnsToMap, SvShuntCompensatorSections::addClassAssignFnsToMap, SvShuntCompensatorSections::debugName); } - +namespace CIMPP +{ + BaseClass* SvShuntCompensatorSections_factory() + { + return new SvShuntCompensatorSections; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.hpp b/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.hpp index bffb9e15d..0541b7d9b 100644 --- a/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.hpp +++ b/CGMES_2.4.15_16FEB2016/SvShuntCompensatorSections.hpp @@ -1,40 +1,41 @@ #ifndef SvShuntCompensatorSections_H #define SvShuntCompensatorSections_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ShuntCompensator; - -class ShuntCompensator; /* State variable for the number of sections in service for a shunt compensator. */ - class SvShuntCompensatorSections: public BaseClass + class SvShuntCompensatorSections : public BaseClass { - public: - CIMPP::Simple_Float sections; /* The number of sections in service as a continous variable. To get integer value scale with ShuntCompensator.bPerSection. Default: nullptr */ - CIMPP::ShuntCompensator* ShuntCompensator; /* The shunt compensator for which the state applies. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvShuntCompensatorSections(); - virtual ~SvShuntCompensatorSections(); - + ~SvShuntCompensatorSections() override; + + CIMPP::ShuntCompensator* ShuntCompensator; /* The shunt compensator for which the state applies. Default: 0 */ + CIMPP::Simple_Float sections; /* The number of sections in service as a continous variable. To get integer value scale with ShuntCompensator.bPerSection. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvShuntCompensatorSections_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SvStatus.cpp b/CGMES_2.4.15_16FEB2016/SvStatus.cpp index 3d89ab4cb..57825fc15 100644 --- a/CGMES_2.4.15_16FEB2016/SvStatus.cpp +++ b/CGMES_2.4.15_16FEB2016/SvStatus.cpp @@ -1,64 +1,72 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvStatus.hpp" +#include +#include + #include "ConductingEquipment.hpp" #include "Boolean.hpp" using namespace CIMPP; -SvStatus::SvStatus(): ConductingEquipment(nullptr) {}; - +SvStatus::SvStatus() : ConductingEquipment(nullptr) {}; SvStatus::~SvStatus() {}; -bool assign_ConductingEquipment_SvStatus(BaseClass*, BaseClass*); -bool assign_SvStatus_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvStatus* element = dynamic_cast(BaseClass_ptr1)) { - element->ConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->ConductingEquipment != nullptr) - return assign_ConductingEquipment_SvStatus(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_SvStatus_inService(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvStatus* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inService; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SvStatus_inService(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvStatus* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inService; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ConductingEquipment_SvStatus(BaseClass*, BaseClass*); +bool assign_SvStatus_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvStatus* element = dynamic_cast(BaseClass_ptr1); + ConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConductingEquipment != element2) + { + element->ConductingEquipment = element2; + return assign_ConductingEquipment_SvStatus(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SvStatus_factory() { - return new SvStatus; - } + +const char SvStatus::debugName[] = "SvStatus"; +const char* SvStatus::debugString() const +{ + return SvStatus::debugName; } -void SvStatus::addConstructToMap(std::unordered_map& factory_map) { +void SvStatus::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvStatus"), &SvStatus_factory)); } -void SvStatus::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvStatus.inService"), &assign_SvStatus_inService)); +void SvStatus::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:SvStatus.inService"), &assign_SvStatus_inService)); } -void SvStatus::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvStatus.ConductingEquipment"), &assign_SvStatus_ConductingEquipment)); - } - -const char SvStatus::debugName[] = "SvStatus"; -const char* SvStatus::debugString() +void SvStatus::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvStatus::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvStatus.ConductingEquipment"), &assign_SvStatus_ConductingEquipment)); } const BaseClassDefiner SvStatus::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SvStatus::declare() return BaseClassDefiner(SvStatus::addConstructToMap, SvStatus::addPrimitiveAssignFnsToMap, SvStatus::addClassAssignFnsToMap, SvStatus::debugName); } - +namespace CIMPP +{ + BaseClass* SvStatus_factory() + { + return new SvStatus; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SvStatus.hpp b/CGMES_2.4.15_16FEB2016/SvStatus.hpp index 242b1a277..6c2d2d10e 100644 --- a/CGMES_2.4.15_16FEB2016/SvStatus.hpp +++ b/CGMES_2.4.15_16FEB2016/SvStatus.hpp @@ -1,40 +1,41 @@ #ifndef SvStatus_H #define SvStatus_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ConductingEquipment; -class ConductingEquipment; /* State variable for status. */ - class SvStatus: public BaseClass + class SvStatus : public BaseClass { - public: - CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment associated with the status state variable. Default: 0 */ - CIMPP::Boolean inService; /* The in service status as a result of topology processing. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvStatus(); - virtual ~SvStatus(); - + ~SvStatus() override; + + CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment associated with the status state variable. Default: 0 */ + CIMPP::Boolean inService; /* The in service status as a result of topology processing. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvStatus_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SvTapStep.cpp b/CGMES_2.4.15_16FEB2016/SvTapStep.cpp index e9a367cf3..e828dc3e3 100644 --- a/CGMES_2.4.15_16FEB2016/SvTapStep.cpp +++ b/CGMES_2.4.15_16FEB2016/SvTapStep.cpp @@ -1,64 +1,72 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvTapStep.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "TapChanger.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; -SvTapStep::SvTapStep(): TapChanger(nullptr) {}; - +SvTapStep::SvTapStep() : TapChanger(nullptr) {}; SvTapStep::~SvTapStep() {}; -bool assign_TapChanger_SvTapStep(BaseClass*, BaseClass*); -bool assign_SvTapStep_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvTapStep* element = dynamic_cast(BaseClass_ptr1)) { - element->TapChanger = dynamic_cast(BaseClass_ptr2); - if(element->TapChanger != nullptr) - return assign_TapChanger_SvTapStep(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvTapStep_position(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvTapStep* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->position; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvTapStep_position(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvTapStep* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->position; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TapChanger_SvTapStep(BaseClass*, BaseClass*); +bool assign_SvTapStep_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvTapStep* element = dynamic_cast(BaseClass_ptr1); + TapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TapChanger != element2) + { + element->TapChanger = element2; + return assign_TapChanger_SvTapStep(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SvTapStep_factory() { - return new SvTapStep; - } +const char SvTapStep::debugName[] = "SvTapStep"; +const char* SvTapStep::debugString() const +{ + return SvTapStep::debugName; } -void SvTapStep::addConstructToMap(std::unordered_map& factory_map) { +void SvTapStep::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvTapStep"), &SvTapStep_factory)); } -void SvTapStep::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvTapStep::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvTapStep.position"), &assign_SvTapStep_position)); - } - -void SvTapStep::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvTapStep.TapChanger"), &assign_SvTapStep_TapChanger)); } -const char SvTapStep::debugName[] = "SvTapStep"; -const char* SvTapStep::debugString() +void SvTapStep::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvTapStep::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvTapStep.TapChanger"), &assign_SvTapStep_TapChanger)); } const BaseClassDefiner SvTapStep::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SvTapStep::declare() return BaseClassDefiner(SvTapStep::addConstructToMap, SvTapStep::addPrimitiveAssignFnsToMap, SvTapStep::addClassAssignFnsToMap, SvTapStep::debugName); } - +namespace CIMPP +{ + BaseClass* SvTapStep_factory() + { + return new SvTapStep; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SvTapStep.hpp b/CGMES_2.4.15_16FEB2016/SvTapStep.hpp index dccf76782..74a224484 100644 --- a/CGMES_2.4.15_16FEB2016/SvTapStep.hpp +++ b/CGMES_2.4.15_16FEB2016/SvTapStep.hpp @@ -1,40 +1,41 @@ #ifndef SvTapStep_H #define SvTapStep_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class TapChanger; - -class TapChanger; /* State variable for transformer tap step. This class is to be used for taps of LTC (load tap changing) transformers, not fixed tap transformers. */ - class SvTapStep: public BaseClass + class SvTapStep : public BaseClass { - public: - CIMPP::Simple_Float position; /* The floating point tap position. This is not the tap ratio, but rather the tap step position as defined by the related tap changer model and normally is constrained to be within the range of minimum and maximum tap positions. Default: nullptr */ - CIMPP::TapChanger* TapChanger; /* The tap changer associated with the tap step state. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvTapStep(); - virtual ~SvTapStep(); - + ~SvTapStep() override; + + CIMPP::TapChanger* TapChanger; /* The tap changer associated with the tap step state. Default: 0 */ + CIMPP::Simple_Float position; /* The floating point tap position. This is not the tap ratio, but rather the tap step position as defined by the related tap changer model and normally is constrained to be within the range of minimum and maximum tap positions. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvTapStep_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SvVoltage.cpp b/CGMES_2.4.15_16FEB2016/SvVoltage.cpp index 627dd3cac..95b8265ea 100644 --- a/CGMES_2.4.15_16FEB2016/SvVoltage.cpp +++ b/CGMES_2.4.15_16FEB2016/SvVoltage.cpp @@ -1,79 +1,88 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvVoltage.hpp" +#include +#include + +#include "TopologicalNode.hpp" #include "AngleDegrees.hpp" #include "Voltage.hpp" -#include "TopologicalNode.hpp" using namespace CIMPP; -SvVoltage::SvVoltage(): TopologicalNode(nullptr) {}; - +SvVoltage::SvVoltage() : TopologicalNode(nullptr) {}; SvVoltage::~SvVoltage() {}; +bool assign_SvVoltage_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvVoltage* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->angle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologicalNode_SvVoltage(BaseClass*, BaseClass*); -bool assign_SvVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvVoltage* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_SvVoltage(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvVoltage_v(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvVoltage* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->v; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvVoltage_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvVoltage* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->angle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TopologicalNode_SvVoltage(BaseClass*, BaseClass*); +bool assign_SvVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvVoltage* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_SvVoltage(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SvVoltage_v(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvVoltage* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->v; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SvVoltage_factory() { - return new SvVoltage; - } +const char SvVoltage::debugName[] = "SvVoltage"; +const char* SvVoltage::debugString() const +{ + return SvVoltage::debugName; } -void SvVoltage::addConstructToMap(std::unordered_map& factory_map) { +void SvVoltage::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvVoltage"), &SvVoltage_factory)); } -void SvVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvVoltage.angle"), &assign_SvVoltage_angle)); assign_map.insert(std::make_pair(std::string("cim:SvVoltage.v"), &assign_SvVoltage_v)); - } - -void SvVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvVoltage.TopologicalNode"), &assign_SvVoltage_TopologicalNode)); } -const char SvVoltage::debugName[] = "SvVoltage"; -const char* SvVoltage::debugString() +void SvVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvVoltage::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvVoltage.TopologicalNode"), &assign_SvVoltage_TopologicalNode)); } const BaseClassDefiner SvVoltage::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner SvVoltage::declare() return BaseClassDefiner(SvVoltage::addConstructToMap, SvVoltage::addPrimitiveAssignFnsToMap, SvVoltage::addClassAssignFnsToMap, SvVoltage::debugName); } - +namespace CIMPP +{ + BaseClass* SvVoltage_factory() + { + return new SvVoltage; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SvVoltage.hpp b/CGMES_2.4.15_16FEB2016/SvVoltage.hpp index 0b1341e75..f70a44314 100644 --- a/CGMES_2.4.15_16FEB2016/SvVoltage.hpp +++ b/CGMES_2.4.15_16FEB2016/SvVoltage.hpp @@ -1,42 +1,43 @@ #ifndef SvVoltage_H #define SvVoltage_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class TopologicalNode; - -class TopologicalNode; /* State variable for voltage. */ - class SvVoltage: public BaseClass + class SvVoltage : public BaseClass { - public: - CIMPP::AngleDegrees angle; /* The voltage angle of the topological node complex voltage with respect to system reference. Default: nullptr */ - CIMPP::Voltage v; /* The voltage magnitude of the topological node. Default: nullptr */ - CIMPP::TopologicalNode* TopologicalNode; /* The state voltage associated with the topological node. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvVoltage(); - virtual ~SvVoltage(); - + ~SvVoltage() override; + + CIMPP::TopologicalNode* TopologicalNode; /* The state voltage associated with the topological node. Default: 0 */ + CIMPP::AngleDegrees angle; /* The voltage angle of the topological node complex voltage with respect to system reference. Default: nullptr */ + CIMPP::Voltage v; /* The voltage magnitude of the topological node. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvVoltage_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Switch.cpp b/CGMES_2.4.15_16FEB2016/Switch.cpp index 7e57a3daf..dc1be1a67 100644 --- a/CGMES_2.4.15_16FEB2016/Switch.cpp +++ b/CGMES_2.4.15_16FEB2016/Switch.cpp @@ -1,109 +1,120 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Switch.hpp" +#include +#include + +#include "SwitchSchedule.hpp" #include "Boolean.hpp" -#include "CurrentFlow.hpp" #include "Boolean.hpp" -#include "SwitchSchedule.hpp" +#include "CurrentFlow.hpp" #include "Boolean.hpp" using namespace CIMPP; Switch::Switch() {}; - Switch::~Switch() {}; +bool assign_Switch_normalOpen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalOpen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Switch_open(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->open; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Switch_SwitchSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SwitchSchedules.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Switch_ratedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedCurrent; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_Switch_retained(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->retained; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Switch_normalOpen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalOpen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SwitchSchedule_Switch(BaseClass*, BaseClass*); +bool assign_Switch_SwitchSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Switch* element = dynamic_cast(BaseClass_ptr1); + SwitchSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SwitchSchedules.begin(), element->SwitchSchedules.end(), element2) == element->SwitchSchedules.end()) + { + element->SwitchSchedules.push_back(element2); + return assign_SwitchSchedule_Switch(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Switch_ratedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Switch_retained(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->retained; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Switch_open(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->open; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Switch_factory() { - return new Switch; - } +const char Switch::debugName[] = "Switch"; +const char* Switch::debugString() const +{ + return Switch::debugName; } -void Switch::addConstructToMap(std::unordered_map& factory_map) { +void Switch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Switch"), &Switch_factory)); } -void Switch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Switch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Switch.normalOpen"), &assign_Switch_normalOpen)); + assign_map.insert(std::make_pair(std::string("cim:Switch.open"), &assign_Switch_open)); assign_map.insert(std::make_pair(std::string("cim:Switch.ratedCurrent"), &assign_Switch_ratedCurrent)); assign_map.insert(std::make_pair(std::string("cim:Switch.retained"), &assign_Switch_retained)); - assign_map.insert(std::make_pair(std::string("cim:Switch.open"), &assign_Switch_open)); } -void Switch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Switch.SwitchSchedules"), &assign_Switch_SwitchSchedules)); - } - -const char Switch::debugName[] = "Switch"; -const char* Switch::debugString() +void Switch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Switch::debugName; + assign_map.insert(std::make_pair(std::string("cim:Switch.SwitchSchedules"), &assign_Switch_SwitchSchedules)); } const BaseClassDefiner Switch::declare() @@ -111,4 +122,10 @@ const BaseClassDefiner Switch::declare() return BaseClassDefiner(Switch::addConstructToMap, Switch::addPrimitiveAssignFnsToMap, Switch::addClassAssignFnsToMap, Switch::debugName); } - +namespace CIMPP +{ + BaseClass* Switch_factory() + { + return new Switch; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Switch.hpp b/CGMES_2.4.15_16FEB2016/Switch.hpp index 5cf0ca21e..431a0db40 100644 --- a/CGMES_2.4.15_16FEB2016/Switch.hpp +++ b/CGMES_2.4.15_16FEB2016/Switch.hpp @@ -1,44 +1,45 @@ #ifndef Switch_H #define Switch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class SwitchSchedule; -class SwitchSchedule; /* A generic device designed to close, or open, or both, one or more electric circuits. All switches are two terminal devices including grounding switches. */ - class Switch: public ConductingEquipment + class Switch : public ConductingEquipment { - public: - CIMPP::Boolean normalOpen; /* The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurement the Discrete.normalValue is expected to match with the Switch.normalOpen. Default: false */ - CIMPP::CurrentFlow ratedCurrent; /* The maximum continuous current carrying capacity in amps governed by the device material and construction. Default: nullptr */ - CIMPP::Boolean retained; /* Branch is retained in a bus branch model. The flow through retained switches will normally be calculated in power flow. Default: false */ - std::list SwitchSchedules; /* A SwitchSchedule is associated with a Switch. Default: 0 */ - CIMPP::Boolean open; /* The attribute tells if the switch is considered open when used as input to topology processing. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Switch(); - virtual ~Switch(); - + ~Switch() override; + + std::list SwitchSchedules; /* A SwitchSchedule is associated with a Switch. Default: 0 */ + CIMPP::Boolean normalOpen; /* The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurement the Discrete.normalValue is expected to match with the Switch.normalOpen. Default: false */ + CIMPP::Boolean open; /* The attribute tells if the switch is considered open when used as input to topology processing. Default: false */ + CIMPP::CurrentFlow ratedCurrent; /* The maximum continuous current carrying capacity in amps governed by the device material and construction. Default: nullptr */ + CIMPP::Boolean retained; /* Branch is retained in a bus branch model. The flow through retained switches will normally be calculated in power flow. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Switch_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SwitchSchedule.cpp b/CGMES_2.4.15_16FEB2016/SwitchSchedule.cpp index faa15f446..2181dfba6 100644 --- a/CGMES_2.4.15_16FEB2016/SwitchSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/SwitchSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SwitchSchedule.hpp" +#include +#include + #include "Switch.hpp" using namespace CIMPP; -SwitchSchedule::SwitchSchedule(): Switch(nullptr) {}; - +SwitchSchedule::SwitchSchedule() : Switch(nullptr) {}; SwitchSchedule::~SwitchSchedule() {}; -bool assign_Switch_SwitchSchedules(BaseClass*, BaseClass*); -bool assign_SwitchSchedule_Switch(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SwitchSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->Switch = dynamic_cast(BaseClass_ptr2); - if(element->Switch != nullptr) - return assign_Switch_SwitchSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* SwitchSchedule_factory() { - return new SwitchSchedule; +bool assign_Switch_SwitchSchedules(BaseClass*, BaseClass*); +bool assign_SwitchSchedule_Switch(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SwitchSchedule* element = dynamic_cast(BaseClass_ptr1); + Switch* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Switch != element2) + { + element->Switch = element2; + return assign_Switch_SwitchSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void SwitchSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:SwitchSchedule"), &SwitchSchedule_factory)); +const char SwitchSchedule::debugName[] = "SwitchSchedule"; +const char* SwitchSchedule::debugString() const +{ + return SwitchSchedule::debugName; } -void SwitchSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void SwitchSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:SwitchSchedule"), &SwitchSchedule_factory)); +} -void SwitchSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SwitchSchedule.Switch"), &assign_SwitchSchedule_Switch)); +void SwitchSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SwitchSchedule::debugName[] = "SwitchSchedule"; -const char* SwitchSchedule::debugString() +void SwitchSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SwitchSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:SwitchSchedule.Switch"), &assign_SwitchSchedule_Switch)); } const BaseClassDefiner SwitchSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner SwitchSchedule::declare() return BaseClassDefiner(SwitchSchedule::addConstructToMap, SwitchSchedule::addPrimitiveAssignFnsToMap, SwitchSchedule::addClassAssignFnsToMap, SwitchSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* SwitchSchedule_factory() + { + return new SwitchSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SwitchSchedule.hpp b/CGMES_2.4.15_16FEB2016/SwitchSchedule.hpp index cdddbe7d7..91f5fe1aa 100644 --- a/CGMES_2.4.15_16FEB2016/SwitchSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/SwitchSchedule.hpp @@ -1,38 +1,39 @@ #ifndef SwitchSchedule_H #define SwitchSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Switch; -class Switch; /* A schedule of switch positions. If RegularTimePoint.value1 is 0, the switch is open. If 1, the switch is closed. */ - class SwitchSchedule: public SeasonDayTypeSchedule + class SwitchSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::Switch* Switch; /* A Switch can be associated with SwitchSchedules. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SwitchSchedule(); - virtual ~SwitchSchedule(); - + ~SwitchSchedule() override; + + CIMPP::Switch* Switch; /* A Switch can be associated with SwitchSchedules. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SwitchSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachine.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachine.cpp index 6c9aecad7..0de495d1b 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachine.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachine.cpp @@ -1,376 +1,412 @@ -#include -#include "RotatingMachine.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachine.hpp" -#include "SynchronousMachineDynamics.hpp" -#include "ReactivePower.hpp" -#include "ReactivePower.hpp" -#include "PerCent.hpp" -#include "SynchronousMachineKind.hpp" +#include +#include + #include "ReactiveCapabilityCurve.hpp" +#include "SynchronousMachineDynamics.hpp" #include "Boolean.hpp" #include "Resistance.hpp" #include "Reactance.hpp" #include "CurrentFlow.hpp" +#include "ReactivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" +#include "SynchronousMachineOperatingMode.hpp" +#include "PerCent.hpp" +#include "Resistance.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Integer.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "ShortCircuitRotorKind.hpp" +#include "SynchronousMachineKind.hpp" #include "PerCent.hpp" -#include "Resistance.hpp" #include "PU.hpp" #include "PU.hpp" -#include "SynchronousMachineOperatingMode.hpp" -#include "Integer.hpp" using namespace CIMPP; -SynchronousMachine::SynchronousMachine(): SynchronousMachineDynamics(nullptr), InitialReactiveCapabilityCurve(nullptr) {}; - +SynchronousMachine::SynchronousMachine() : InitialReactiveCapabilityCurve(nullptr), SynchronousMachineDynamics(nullptr) {}; SynchronousMachine::~SynchronousMachine() {}; -bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return true; - } - return false; -} - +bool assign_SynchronousMachine_earthing(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->earthing; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_earthingStarPointR(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->earthingStarPointR; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass*, BaseClass*); -bool assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->InitialReactiveCapabilityCurve = dynamic_cast(BaseClass_ptr2); - if(element->InitialReactiveCapabilityCurve != nullptr) - return assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SynchronousMachine_earthingStarPointX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->earthingStarPointX; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_SynchronousMachine_ikk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ikk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_mu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operatingMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_qPercent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qPercent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->referencePriority; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_satDirectSubtransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->satDirectSubtransX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_satDirectSyncX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->satDirectSyncX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_satDirectTransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->satDirectTransX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_shortCircuitRotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->shortCircuitRotorType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_voltageRegulationRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageRegulationRange; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachine_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass*, BaseClass*); +bool assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachine* element = dynamic_cast(BaseClass_ptr1); + ReactiveCapabilityCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->InitialReactiveCapabilityCurve != element2) + { + element->InitialReactiveCapabilityCurve = element2; + return assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachine_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass*, BaseClass*); +bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachine* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachine_qPercent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qPercent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_earthing(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->earthing; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_earthingStarPointR(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->earthingStarPointR; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_earthingStarPointX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->earthingStarPointX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_ikk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ikk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_mu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_satDirectSubtransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->satDirectSubtransX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_satDirectSyncX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->satDirectSyncX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_satDirectTransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->satDirectTransX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_shortCircuitRotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->shortCircuitRotorType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_voltageRegulationRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageRegulationRange; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operatingMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->referencePriority; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SynchronousMachine_factory() { - return new SynchronousMachine; - } + +const char SynchronousMachine::debugName[] = "SynchronousMachine"; +const char* SynchronousMachine::debugString() const +{ + return SynchronousMachine::debugName; } -void SynchronousMachine::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachine::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachine"), &SynchronousMachine_factory)); } -void SynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.maxQ"), &assign_SynchronousMachine_maxQ)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.minQ"), &assign_SynchronousMachine_minQ)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.qPercent"), &assign_SynchronousMachine_qPercent)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.type"), &assign_SynchronousMachine_type)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthing"), &assign_SynchronousMachine_earthing)); +void SynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthing"), &assign_SynchronousMachine_earthing)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthingStarPointR"), &assign_SynchronousMachine_earthingStarPointR)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthingStarPointX"), &assign_SynchronousMachine_earthingStarPointX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.ikk"), &assign_SynchronousMachine_ikk)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.maxQ"), &assign_SynchronousMachine_maxQ)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.minQ"), &assign_SynchronousMachine_minQ)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.mu"), &assign_SynchronousMachine_mu)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.operatingMode"), &assign_SynchronousMachine_operatingMode)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.qPercent"), &assign_SynchronousMachine_qPercent)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r"), &assign_SynchronousMachine_r)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r0"), &assign_SynchronousMachine_r0)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r2"), &assign_SynchronousMachine_r2)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.referencePriority"), &assign_SynchronousMachine_referencePriority)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.satDirectSubtransX"), &assign_SynchronousMachine_satDirectSubtransX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.satDirectSyncX"), &assign_SynchronousMachine_satDirectSyncX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.satDirectTransX"), &assign_SynchronousMachine_satDirectTransX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.shortCircuitRotorType"), &assign_SynchronousMachine_shortCircuitRotorType)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.type"), &assign_SynchronousMachine_type)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.voltageRegulationRange"), &assign_SynchronousMachine_voltageRegulationRange)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r"), &assign_SynchronousMachine_r)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.x0"), &assign_SynchronousMachine_x0)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.x2"), &assign_SynchronousMachine_x2)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.operatingMode"), &assign_SynchronousMachine_operatingMode)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.referencePriority"), &assign_SynchronousMachine_referencePriority)); } -void SynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.SynchronousMachineDynamics"), &assign_SynchronousMachine_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.InitialReactiveCapabilityCurve"), &assign_SynchronousMachine_InitialReactiveCapabilityCurve)); - } - -const char SynchronousMachine::debugName[] = "SynchronousMachine"; -const char* SynchronousMachine::debugString() +void SynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachine::debugName; + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.InitialReactiveCapabilityCurve"), &assign_SynchronousMachine_InitialReactiveCapabilityCurve)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.SynchronousMachineDynamics"), &assign_SynchronousMachine_SynchronousMachineDynamics)); } const BaseClassDefiner SynchronousMachine::declare() @@ -378,4 +414,10 @@ const BaseClassDefiner SynchronousMachine::declare() return BaseClassDefiner(SynchronousMachine::addConstructToMap, SynchronousMachine::addPrimitiveAssignFnsToMap, SynchronousMachine::addClassAssignFnsToMap, SynchronousMachine::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachine_factory() + { + return new SynchronousMachine; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachine.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachine.hpp index b4d41250c..4c5f7ed12 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachine.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachine.hpp @@ -1,73 +1,74 @@ #ifndef SynchronousMachine_H #define SynchronousMachine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachine.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "ReactivePower.hpp" -#include "PerCent.hpp" -#include "SynchronousMachineKind.hpp" +#include "RotatingMachine.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" #include "CurrentFlow.hpp" -#include "Simple_Float.hpp" +#include "Integer.hpp" #include "PU.hpp" +#include "PerCent.hpp" +#include "Reactance.hpp" +#include "ReactivePower.hpp" +#include "Resistance.hpp" #include "ShortCircuitRotorKind.hpp" +#include "Simple_Float.hpp" +#include "SynchronousMachineKind.hpp" #include "SynchronousMachineOperatingMode.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class ReactiveCapabilityCurve; + class SynchronousMachineDynamics; -class SynchronousMachineDynamics; -class ReactiveCapabilityCurve; /* An electromechanical device that operates with shaft rotating synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. */ - class SynchronousMachine: public RotatingMachine + class SynchronousMachine : public RotatingMachine { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine dynamics model used to describe dynamic behavior of this synchronous machine. Default: 0 */ - CIMPP::ReactivePower maxQ; /* Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. Default: nullptr */ - CIMPP::ReactivePower minQ; /* Minimum reactive power limit for the unit. Default: nullptr */ - CIMPP::PerCent qPercent; /* Percent of the coordinated reactive control that comes from this machine. Default: nullptr */ - CIMPP::SynchronousMachineKind type; /* Modes that this synchronous machine can operate in. Default: 0 */ - CIMPP::ReactiveCapabilityCurve* InitialReactiveCapabilityCurve; /* Synchronous machines using this curve as default. Default: 0 */ - CIMPP::Boolean earthing; /* Indicates whether or not the generator is earthed. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::Resistance earthingStarPointR; /* Generator star point earthing resistance (Re). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Reactance earthingStarPointX; /* Generator star point earthing reactance (Xe). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::CurrentFlow ikk; /* Steady-state short-circuit current (in A for the profile) of generator with compound excitation during 3-phase short circuit. - Ikk=0: Generator with no compound excitation. - Ikk?0: Generator with compound excitation. Ikk is used to calculate the minimum steady-state short-circuit current for generators with compound excitation (Section 4.6.1.2 in the IEC 60909-0) Used only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0) Default: nullptr */ - CIMPP::Simple_Float mu; /* Factor to calculate the breaking current (Section 4.5.2.1 in the IEC 60909-0). Used only for single fed short circuit on a generator (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ - CIMPP::PU r0; /* Zero sequence resistance of the synchronous machine. Default: nullptr */ - CIMPP::PU r2; /* Negative sequence resistance. Default: nullptr */ - CIMPP::PU satDirectSubtransX; /* Direct-axis subtransient reactance saturated, also known as Xd`sat. Default: nullptr */ - CIMPP::PU satDirectSyncX; /* Direct-axes saturated synchronous reactance (xdsat); reciprocal of short-circuit ration. Used for short circuit data exchange, only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ - CIMPP::PU satDirectTransX; /* Saturated Direct-axis transient reactance. The attribute is primarily used for short circuit calculations according to ANSI. Default: nullptr */ - CIMPP::ShortCircuitRotorKind shortCircuitRotorType; /* Type of rotor, used by short circuit applications, only for single fed short circuit according to IEC 60909. Default: 0 */ - CIMPP::PerCent voltageRegulationRange; /* Range of generator voltage regulation (PG in the IEC 60909-0) used for calculation of the impedance correction factor KG defined in IEC 60909-0 This attribute is used to describe the operating voltage of the generating unit. Default: nullptr */ - CIMPP::Resistance r; /* Equivalent resistance (RG) of generator. RG is considered for the calculation of all currents, except for the calculation of the peak current ip. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::PU x0; /* Zero sequence reactance of the synchronous machine. Default: nullptr */ - CIMPP::PU x2; /* Negative sequence reactance. Default: nullptr */ - CIMPP::SynchronousMachineOperatingMode operatingMode; /* Current mode of operation. Default: 0 */ - CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachine(); - virtual ~SynchronousMachine(); - + ~SynchronousMachine() override; + + CIMPP::ReactiveCapabilityCurve* InitialReactiveCapabilityCurve; /* Synchronous machines using this curve as default. Default: 0 */ + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine dynamics model used to describe dynamic behavior of this synchronous machine. Default: 0 */ + CIMPP::Boolean earthing; /* Indicates whether or not the generator is earthed. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::Resistance earthingStarPointR; /* Generator star point earthing resistance (Re). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Reactance earthingStarPointX; /* Generator star point earthing reactance (Xe). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::CurrentFlow ikk; /* Steady-state short-circuit current (in A for the profile) of generator with compound excitation during 3-phase short circuit. - Ikk=0: Generator with no compound excitation. - Ikk?0: Generator with compound excitation. Ikk is used to calculate the minimum steady-state short-circuit current for generators with compound excitation (Section 4.6.1.2 in the IEC 60909-0) Used only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0) Default: nullptr */ + CIMPP::ReactivePower maxQ; /* Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. Default: nullptr */ + CIMPP::ReactivePower minQ; /* Minimum reactive power limit for the unit. Default: nullptr */ + CIMPP::Simple_Float mu; /* Factor to calculate the breaking current (Section 4.5.2.1 in the IEC 60909-0). Used only for single fed short circuit on a generator (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ + CIMPP::SynchronousMachineOperatingMode operatingMode; /* Current mode of operation. Default: 0 */ + CIMPP::PerCent qPercent; /* Percent of the coordinated reactive control that comes from this machine. Default: nullptr */ + CIMPP::Resistance r; /* Equivalent resistance (RG) of generator. RG is considered for the calculation of all currents, except for the calculation of the peak current ip. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::PU r0; /* Zero sequence resistance of the synchronous machine. Default: nullptr */ + CIMPP::PU r2; /* Negative sequence resistance. Default: nullptr */ + CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ + CIMPP::PU satDirectSubtransX; /* Direct-axis subtransient reactance saturated, also known as Xd`sat. Default: nullptr */ + CIMPP::PU satDirectSyncX; /* Direct-axes saturated synchronous reactance (xdsat); reciprocal of short-circuit ration. Used for short circuit data exchange, only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ + CIMPP::PU satDirectTransX; /* Saturated Direct-axis transient reactance. The attribute is primarily used for short circuit calculations according to ANSI. Default: nullptr */ + CIMPP::ShortCircuitRotorKind shortCircuitRotorType; /* Type of rotor, used by short circuit applications, only for single fed short circuit according to IEC 60909. Default: 0 */ + CIMPP::SynchronousMachineKind type; /* Modes that this synchronous machine can operate in. Default: 0 */ + CIMPP::PerCent voltageRegulationRange; /* Range of generator voltage regulation (PG in the IEC 60909-0) used for calculation of the impedance correction factor KG defined in IEC 60909-0 This attribute is used to describe the operating voltage of the generating unit. Default: nullptr */ + CIMPP::PU x0; /* Zero sequence reactance of the synchronous machine. Default: nullptr */ + CIMPP::PU x2; /* Negative sequence reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachine_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.cpp index f9d3a71c3..7d74fe85f 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.cpp @@ -1,111 +1,116 @@ -#include -#include "SynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineDetailed.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "Simple_Float.hpp" #include "IfdBaseKind.hpp" #include "CurrentFlow.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; SynchronousMachineDetailed::SynchronousMachineDetailed() {}; - SynchronousMachineDetailed::~SynchronousMachineDetailed() {}; +bool assign_SynchronousMachineDetailed_efdBaseRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdBaseRatio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_ifdBaseType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdBaseType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_ifdBaseValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdBaseValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_saturationFactor120QAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactor120QAxis; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_saturationFactorQAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactorQAxis; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachineDetailed_saturationFactorQAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactorQAxis; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_saturationFactor120QAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactor120QAxis; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_efdBaseRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdBaseRatio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_ifdBaseType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdBaseType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_ifdBaseValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdBaseValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SynchronousMachineDetailed_factory() { - return new SynchronousMachineDetailed; - } +const char SynchronousMachineDetailed::debugName[] = "SynchronousMachineDetailed"; +const char* SynchronousMachineDetailed::debugString() const +{ + return SynchronousMachineDetailed::debugName; } -void SynchronousMachineDetailed::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineDetailed::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed"), &SynchronousMachineDetailed_factory)); } -void SynchronousMachineDetailed::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactorQAxis"), &assign_SynchronousMachineDetailed_saturationFactorQAxis)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactor120QAxis"), &assign_SynchronousMachineDetailed_saturationFactor120QAxis)); +void SynchronousMachineDetailed::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.efdBaseRatio"), &assign_SynchronousMachineDetailed_efdBaseRatio)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.ifdBaseType"), &assign_SynchronousMachineDetailed_ifdBaseType)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.ifdBaseValue"), &assign_SynchronousMachineDetailed_ifdBaseValue)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactor120QAxis"), &assign_SynchronousMachineDetailed_saturationFactor120QAxis)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactorQAxis"), &assign_SynchronousMachineDetailed_saturationFactorQAxis)); } -void SynchronousMachineDetailed::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SynchronousMachineDetailed::debugName[] = "SynchronousMachineDetailed"; -const char* SynchronousMachineDetailed::debugString() +void SynchronousMachineDetailed::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineDetailed::debugName; } const BaseClassDefiner SynchronousMachineDetailed::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner SynchronousMachineDetailed::declare() return BaseClassDefiner(SynchronousMachineDetailed::addConstructToMap, SynchronousMachineDetailed::addPrimitiveAssignFnsToMap, SynchronousMachineDetailed::addClassAssignFnsToMap, SynchronousMachineDetailed::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineDetailed_factory() + { + return new SynchronousMachineDetailed; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.hpp index cabf4cb8b..3d7c37290 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineDetailed.hpp @@ -1,44 +1,45 @@ #ifndef SynchronousMachineDetailed_H #define SynchronousMachineDetailed_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "IfdBaseKind.hpp" +#include "SynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" +#include "IfdBaseKind.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* All synchronous machine detailed types use a subset of the same data parameters and input/output variables. The several variations differ in the following ways: It is not necessary for each simulation tool to have separate models for each of the model types. The same model can often be used for several types by alternative logic within the model. Also, differences in saturation representation may not result in significant model performance differences so model substitutions are often acceptable. */ - class SynchronousMachineDetailed: public SynchronousMachineDynamics + class SynchronousMachineDetailed : public SynchronousMachineDynamics { - public: - CIMPP::Simple_Float saturationFactorQAxis; /* Q-axis saturation factor at rated terminal voltage (S1q) (>= 0). Typical Value = 0.02. Default: nullptr */ - CIMPP::Simple_Float saturationFactor120QAxis; /* Q-axis saturation factor at 120% of rated terminal voltage (S12q) (>=S1q). Typical Value = 0.12. Default: nullptr */ - CIMPP::Simple_Float efdBaseRatio; /* Ratio of Efd bases of exciter and generator models. Typical Value = 1. Default: nullptr */ - CIMPP::IfdBaseKind ifdBaseType; /* Excitation base system mode. Typical Value = ifag. Default: 0 */ - CIMPP::CurrentFlow ifdBaseValue; /* Ifd base current if .ifdBaseType = other. Not needed if .ifdBaseType not = other. Unit = A. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineDetailed(); - virtual ~SynchronousMachineDetailed(); - + ~SynchronousMachineDetailed() override; + + CIMPP::Simple_Float efdBaseRatio; /* Ratio of Efd bases of exciter and generator models. Typical Value = 1. Default: nullptr */ + CIMPP::IfdBaseKind ifdBaseType; /* Excitation base system mode. Typical Value = ifag. Default: 0 */ + CIMPP::CurrentFlow ifdBaseValue; /* Ifd base current if .ifdBaseType = other. Not needed if .ifdBaseType not = other. Unit = A. Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float saturationFactor120QAxis; /* Q-axis saturation factor at 120% of rated terminal voltage (S12q) (>=S1q). Typical Value = 0.12. Default: nullptr */ + CIMPP::Simple_Float saturationFactorQAxis; /* Q-axis saturation factor at rated terminal voltage (S1q) (>= 0). Typical Value = 0.02. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineDetailed_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.cpp index f6d915cfd..9ef4f1aca 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.cpp @@ -1,99 +1,136 @@ -#include -#include "RotatingMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineDynamics.hpp" -#include "SynchronousMachine.hpp" -#include "TurbineGovernorDynamics.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" -#include "MechanicalLoadDynamics.hpp" #include "GenICompensationForGenJ.hpp" +#include "MechanicalLoadDynamics.hpp" +#include "SynchronousMachine.hpp" +#include "TurbineGovernorDynamics.hpp" using namespace CIMPP; -SynchronousMachineDynamics::SynchronousMachineDynamics(): SynchronousMachine(nullptr), ExcitationSystemDynamics(nullptr), MechanicalLoadDynamics(nullptr) {}; - +SynchronousMachineDynamics::SynchronousMachineDynamics() : ExcitationSystemDynamics(nullptr), MechanicalLoadDynamics(nullptr), SynchronousMachine(nullptr) {}; SynchronousMachineDynamics::~SynchronousMachineDynamics() {}; -bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass*, BaseClass*); -bool assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachine = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachine != nullptr) - return assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TurbineGovernorDynamics.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + + +bool assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return true; - } - return false; +bool assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + GenICompensationForGenJ* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->GenICompensationForGenJ.begin(), element->GenICompensationForGenJ.end(), element2) == element->GenICompensationForGenJ.end()) + { + element->GenICompensationForGenJ.push_back(element2); + return assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->MechanicalLoadDynamics = dynamic_cast(BaseClass_ptr2); - if(element->MechanicalLoadDynamics != nullptr) - return true; - } - return false; +bool assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + MechanicalLoadDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MechanicalLoadDynamics != element2) + { + element->MechanicalLoadDynamics = element2; + return assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->GenICompensationForGenJ.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachine != element2) + { + element->SynchronousMachine = element2; + return assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - - -namespace CIMPP { - BaseClass* SynchronousMachineDynamics_factory() { - return new SynchronousMachineDynamics; +bool assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TurbineGovernorDynamics.begin(), element->TurbineGovernorDynamics.end(), element2) == element->TurbineGovernorDynamics.end()) + { + element->TurbineGovernorDynamics.push_back(element2); + return assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void SynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics"), &SynchronousMachineDynamics_factory)); +const char SynchronousMachineDynamics::debugName[] = "SynchronousMachineDynamics"; +const char* SynchronousMachineDynamics::debugString() const +{ + return SynchronousMachineDynamics::debugName; } -void SynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void SynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics"), &SynchronousMachineDynamics_factory)); +} -void SynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.SynchronousMachine"), &assign_SynchronousMachineDynamics_SynchronousMachine)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.TurbineGovernorDynamics"), &assign_SynchronousMachineDynamics_TurbineGovernorDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.ExcitationSystemDynamics"), &assign_SynchronousMachineDynamics_ExcitationSystemDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.MechanicalLoadDynamics"), &assign_SynchronousMachineDynamics_MechanicalLoadDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.GenICompensationForGenJ"), &assign_SynchronousMachineDynamics_GenICompensationForGenJ)); +void SynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SynchronousMachineDynamics::debugName[] = "SynchronousMachineDynamics"; -const char* SynchronousMachineDynamics::debugString() +void SynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.ExcitationSystemDynamics"), &assign_SynchronousMachineDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.GenICompensationForGenJ"), &assign_SynchronousMachineDynamics_GenICompensationForGenJ)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.MechanicalLoadDynamics"), &assign_SynchronousMachineDynamics_MechanicalLoadDynamics)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.SynchronousMachine"), &assign_SynchronousMachineDynamics_SynchronousMachine)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.TurbineGovernorDynamics"), &assign_SynchronousMachineDynamics_TurbineGovernorDynamics)); } const BaseClassDefiner SynchronousMachineDynamics::declare() @@ -101,4 +138,10 @@ const BaseClassDefiner SynchronousMachineDynamics::declare() return BaseClassDefiner(SynchronousMachineDynamics::addConstructToMap, SynchronousMachineDynamics::addPrimitiveAssignFnsToMap, SynchronousMachineDynamics::addClassAssignFnsToMap, SynchronousMachineDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineDynamics_factory() + { + return new SynchronousMachineDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.hpp index e51934ac7..ee5e3e2cf 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineDynamics.hpp @@ -1,46 +1,47 @@ #ifndef SynchronousMachineDynamics_H #define SynchronousMachineDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RotatingMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class GenICompensationForGenJ; + class MechanicalLoadDynamics; + class SynchronousMachine; + class TurbineGovernorDynamics; -class SynchronousMachine; -class TurbineGovernorDynamics; -class ExcitationSystemDynamics; -class MechanicalLoadDynamics; -class GenICompensationForGenJ; /* Synchronous machine whose behaviour is described by reference to a standard model expressed in one of the following forms: */ - class SynchronousMachineDynamics: public RotatingMachineDynamics + class SynchronousMachineDynamics : public RotatingMachineDynamics { - public: - CIMPP::SynchronousMachine* SynchronousMachine; /* Synchronous machine to which synchronous machine dynamics model applies. Default: 0 */ - std::list TurbineGovernorDynamics; /* Synchronous machine model with which this turbine-governor model is associated. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model associated with this synchronous machine model. Default: 0 */ - CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this synchronous machine model. Default: 0 */ - std::list GenICompensationForGenJ; /* Compensation of voltage compensator`s generator for current flow out of this generator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineDynamics(); - virtual ~SynchronousMachineDynamics(); - + ~SynchronousMachineDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model associated with this synchronous machine model. Default: 0 */ + std::list GenICompensationForGenJ; /* Compensation of voltage compensator`s generator for current flow out of this generator. Default: 0 */ + CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this synchronous machine model. Default: 0 */ + CIMPP::SynchronousMachine* SynchronousMachine; /* Synchronous machine to which synchronous machine dynamics model applies. Default: 0 */ + std::list TurbineGovernorDynamics; /* Synchronous machine model with which this turbine-governor model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.cpp index 32f5cf134..a228afafe 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.cpp @@ -1,7 +1,11 @@ -#include -#include "SynchronousMachineDetailed.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineEquivalentCircuit.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,185 +21,192 @@ using namespace CIMPP; SynchronousMachineEquivalentCircuit::SynchronousMachineEquivalentCircuit() {}; - SynchronousMachineEquivalentCircuit::~SynchronousMachineEquivalentCircuit() {}; +bool assign_SynchronousMachineEquivalentCircuit_r1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r1d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_r1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r1q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_r2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r2q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_rfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_x1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x1d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_x1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x1q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_x2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xad(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xad; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xaq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xaq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xf1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xf1d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachineEquivalentCircuit_xad(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xad; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineEquivalentCircuit_rfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineEquivalentCircuit_xfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_r1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r1d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_x1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x1d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_xf1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xf1d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_xaq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xaq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_r1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r1q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_x1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x1q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_r2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r2q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_x2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* SynchronousMachineEquivalentCircuit_factory() { - return new SynchronousMachineEquivalentCircuit; - } + + + + + + + + + +const char SynchronousMachineEquivalentCircuit::debugName[] = "SynchronousMachineEquivalentCircuit"; +const char* SynchronousMachineEquivalentCircuit::debugString() const +{ + return SynchronousMachineEquivalentCircuit::debugName; } -void SynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit"), &SynchronousMachineEquivalentCircuit_factory)); } -void SynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xad"), &assign_SynchronousMachineEquivalentCircuit_xad)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.rfd"), &assign_SynchronousMachineEquivalentCircuit_rfd)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xfd"), &assign_SynchronousMachineEquivalentCircuit_xfd)); +void SynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.r1d"), &assign_SynchronousMachineEquivalentCircuit_r1d)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1d"), &assign_SynchronousMachineEquivalentCircuit_x1d)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xf1d"), &assign_SynchronousMachineEquivalentCircuit_xf1d)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xaq"), &assign_SynchronousMachineEquivalentCircuit_xaq)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.r1q"), &assign_SynchronousMachineEquivalentCircuit_r1q)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1q"), &assign_SynchronousMachineEquivalentCircuit_x1q)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.r2q"), &assign_SynchronousMachineEquivalentCircuit_r2q)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.rfd"), &assign_SynchronousMachineEquivalentCircuit_rfd)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1d"), &assign_SynchronousMachineEquivalentCircuit_x1d)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1q"), &assign_SynchronousMachineEquivalentCircuit_x1q)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x2q"), &assign_SynchronousMachineEquivalentCircuit_x2q)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xad"), &assign_SynchronousMachineEquivalentCircuit_xad)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xaq"), &assign_SynchronousMachineEquivalentCircuit_xaq)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xf1d"), &assign_SynchronousMachineEquivalentCircuit_xf1d)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xfd"), &assign_SynchronousMachineEquivalentCircuit_xfd)); } -void SynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SynchronousMachineEquivalentCircuit::debugName[] = "SynchronousMachineEquivalentCircuit"; -const char* SynchronousMachineEquivalentCircuit::debugString() +void SynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineEquivalentCircuit::debugName; } const BaseClassDefiner SynchronousMachineEquivalentCircuit::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner SynchronousMachineEquivalentCircuit::declare() return BaseClassDefiner(SynchronousMachineEquivalentCircuit::addConstructToMap, SynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap, SynchronousMachineEquivalentCircuit::addClassAssignFnsToMap, SynchronousMachineEquivalentCircuit::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineEquivalentCircuit_factory() + { + return new SynchronousMachineEquivalentCircuit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.hpp index 202d73266..47630a0f5 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineEquivalentCircuit.hpp @@ -1,48 +1,49 @@ #ifndef SynchronousMachineEquivalentCircuit_H #define SynchronousMachineEquivalentCircuit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDetailed.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "SynchronousMachineDetailed.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The electrical equations for all variations of the synchronous models are based on the SynchronousEquivalentCircuit diagram for the direct and quadrature axes. = + = + * / ( + ) = + * * / ( * + * + * ) = + = + * / (+ ) = + ** / ( * + * + * ) = ( + ) / ( * ) = ( * + * + * ) / ( * * ( + ) = ( + ) / ( * ) = ( * + * + * )/ ( * * ( + ) Same equations using CIM attributes from SynchronousMachineTimeConstantReactance class on left of = sign and SynchronousMachineEquivalentCircuit class on right (except as noted): xDirectSync = xad + RotatingMachineDynamics.statorLeakageReactance xDirectTrans = RotatingMachineDynamics.statorLeakageReactance + xad * xfd / (xad + xfd) xDirectSubtrans = RotatingMachineDynamics.statorLeakageReactance + xad * xfd * x1d / (xad * xfd + xad * x1d + xfd * x1d) xQuadSync = xaq + RotatingMachineDynamics.statorLeakageReactance xQuadTrans = RotatingMachineDynamics.statorLeakageReactance + xaq * x1q / (xaq+ x1q) xQuadSubtrans = RotatingMachineDynamics.statorLeakageReactance + xaq * x1q* x2q / (xaq * x1q + xaq * x2q + x1q * x2q) tpdo = (xad + xfd) / (2*pi*nominal frequency * rfd) tppdo = (xad * xfd + xad * x1d + xfd * x1d) / (2*pi*nominal frequency * r1d * (xad + xfd) tpqo = (xaq + x1q) / (2*pi*nominal frequency * r1q) tppqo = (xaq * x1q + xaq * x2q + x1q * x2q)/ (2*pi*nominal frequency * r2q * (xaq + x1q). Are only valid for a simplified model where "Canay" reactance is zero. */ - class SynchronousMachineEquivalentCircuit: public SynchronousMachineDetailed + class SynchronousMachineEquivalentCircuit : public SynchronousMachineDetailed { - public: - CIMPP::PU xad; /* D-axis mutual reactance. Default: nullptr */ - CIMPP::PU rfd; /* Field winding resistance. Default: nullptr */ - CIMPP::PU xfd; /* Field winding leakage reactance. Default: nullptr */ - CIMPP::PU r1d; /* D-axis damper 1 winding resistance. Default: nullptr */ - CIMPP::PU x1d; /* D-axis damper 1 winding leakage reactance. Default: nullptr */ - CIMPP::PU xf1d; /* Differential mutual (`Canay`) reactance. Default: nullptr */ - CIMPP::PU xaq; /* Q-axis mutual reactance. Default: nullptr */ - CIMPP::PU r1q; /* Q-axis damper 1 winding resistance. Default: nullptr */ - CIMPP::PU x1q; /* Q-axis damper 1 winding leakage reactance. Default: nullptr */ - CIMPP::PU r2q; /* Q-axis damper 2 winding resistance. Default: nullptr */ - CIMPP::PU x2q; /* Q-axis damper 2 winding leakage reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineEquivalentCircuit(); - virtual ~SynchronousMachineEquivalentCircuit(); - + ~SynchronousMachineEquivalentCircuit() override; + + CIMPP::PU r1d; /* D-axis damper 1 winding resistance. Default: nullptr */ + CIMPP::PU r1q; /* Q-axis damper 1 winding resistance. Default: nullptr */ + CIMPP::PU r2q; /* Q-axis damper 2 winding resistance. Default: nullptr */ + CIMPP::PU rfd; /* Field winding resistance. Default: nullptr */ + CIMPP::PU x1d; /* D-axis damper 1 winding leakage reactance. Default: nullptr */ + CIMPP::PU x1q; /* Q-axis damper 1 winding leakage reactance. Default: nullptr */ + CIMPP::PU x2q; /* Q-axis damper 2 winding leakage reactance. Default: nullptr */ + CIMPP::PU xad; /* D-axis mutual reactance. Default: nullptr */ + CIMPP::PU xaq; /* Q-axis mutual reactance. Default: nullptr */ + CIMPP::PU xf1d; /* Differential mutual (`Canay`) reactance. Default: nullptr */ + CIMPP::PU xfd; /* Field winding leakage reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineEquivalentCircuit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.cpp index cdd209bb7..55bd958b0 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineKind& rop) +SynchronousMachineKind& SynchronousMachineKind::operator=(SynchronousMachineKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SynchronousMachineKind::operator SynchronousMachineKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SynchronousMachineKind::debugName[] = "SynchronousMachineKind"; +const char* SynchronousMachineKind::debugString() const +{ + return SynchronousMachineKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SynchronousMachineKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -58,5 +89,47 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SynchronousMachineKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SynchronousMachineKind::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == SynchronousMachineKind::condenser) + { + EnumSymbol = "condenser"; + } + if (obj.value == SynchronousMachineKind::generatorOrCondenser) + { + EnumSymbol = "generatorOrCondenser"; + } + if (obj.value == SynchronousMachineKind::motor) + { + EnumSymbol = "motor"; + } + if (obj.value == SynchronousMachineKind::generatorOrMotor) + { + EnumSymbol = "generatorOrMotor"; + } + if (obj.value == SynchronousMachineKind::motorOrCondenser) + { + EnumSymbol = "motorOrCondenser"; + } + if (obj.value == SynchronousMachineKind::generatorOrCondenserOrMotor) + { + EnumSymbol = "generatorOrCondenserOrMotor"; + } + + if (!EnumSymbol.empty()) + { + os << "SynchronousMachineKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.hpp index 9bb36f126..9b3eaf71b 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineKind.hpp @@ -1,41 +1,45 @@ #ifndef SynchronousMachineKind_H #define SynchronousMachineKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Synchronous machine type. */ - enum class SynchronousMachineKind + class SynchronousMachineKind { - /** - * - */ - generator, - /** - * - */ - condenser, - /** - * - */ - generatorOrCondenser, - /** - * - */ - motor, - /** - * - */ - generatorOrMotor, - /** - * - */ - motorOrCondenser, - /** - * - */ - generatorOrCondenserOrMotor, + public: + enum SynchronousMachineKind_ENUM + { + generator, + condenser, + generatorOrCondenser, + motor, + generatorOrMotor, + motorOrCondenser, + generatorOrCondenserOrMotor, + }; + + SynchronousMachineKind() : value(), initialized(false) {} + SynchronousMachineKind(SynchronousMachineKind_ENUM value) : value(value), initialized(true) {} + + SynchronousMachineKind& operator=(SynchronousMachineKind_ENUM rop); + operator SynchronousMachineKind_ENUM() const; + + SynchronousMachineKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SynchronousMachineKind& rop); + friend std::ostream& operator<<(std::ostream& os, const SynchronousMachineKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.cpp index 69c97d45d..10460ede1 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineModelKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineModelKind& rop) +SynchronousMachineModelKind& SynchronousMachineModelKind::operator=(SynchronousMachineModelKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SynchronousMachineModelKind::operator SynchronousMachineModelKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SynchronousMachineModelKind::debugName[] = "SynchronousMachineModelKind"; +const char* SynchronousMachineModelKind::debugString() const +{ + return SynchronousMachineModelKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SynchronousMachineModelKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -48,5 +79,39 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SynchronousMachineModelKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SynchronousMachineModelKind::subtransient) + { + EnumSymbol = "subtransient"; + } + if (obj.value == SynchronousMachineModelKind::subtransientTypeF) + { + EnumSymbol = "subtransientTypeF"; + } + if (obj.value == SynchronousMachineModelKind::subtransientTypeJ) + { + EnumSymbol = "subtransientTypeJ"; + } + if (obj.value == SynchronousMachineModelKind::subtransientSimplified) + { + EnumSymbol = "subtransientSimplified"; + } + if (obj.value == SynchronousMachineModelKind::subtransientSimplifiedDirectAxis) + { + EnumSymbol = "subtransientSimplifiedDirectAxis"; + } + + if (!EnumSymbol.empty()) + { + os << "SynchronousMachineModelKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.hpp index 0d7526111..06da8b2b5 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineModelKind.hpp @@ -1,33 +1,58 @@ #ifndef SynchronousMachineModelKind_H #define SynchronousMachineModelKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of synchronous machine model used in Dynamic simulation applications. */ - enum class SynchronousMachineModelKind + class SynchronousMachineModelKind { - /** - * Subtransient synchronous machine model. - */ - subtransient, - /** - * WECC Type F variant of subtransient synchronous machine model. - */ - subtransientTypeF, - /** - * WECC Type J variant of subtransient synchronous machine model. - */ - subtransientTypeJ, - /** - * Simplified version of subtransient synchronous machine model where magnetic coupling between the direct and quadrature axes is ignored. - */ - subtransientSimplified, - /** - * Simplified version of a subtransient synchronous machine model with no damper circuit on d-axis. - */ - subtransientSimplifiedDirectAxis, + public: + enum SynchronousMachineModelKind_ENUM + { + /** + * Subtransient synchronous machine model. + */ + subtransient, + /** + * WECC Type F variant of subtransient synchronous machine model. + */ + subtransientTypeF, + /** + * WECC Type J variant of subtransient synchronous machine model. + */ + subtransientTypeJ, + /** + * Simplified version of subtransient synchronous machine model where magnetic coupling between the direct and quadrature axes is ignored. + */ + subtransientSimplified, + /** + * Simplified version of a subtransient synchronous machine model with no damper circuit on d-axis. + */ + subtransientSimplifiedDirectAxis, + }; + + SynchronousMachineModelKind() : value(), initialized(false) {} + SynchronousMachineModelKind(SynchronousMachineModelKind_ENUM value) : value(value), initialized(true) {} + + SynchronousMachineModelKind& operator=(SynchronousMachineModelKind_ENUM rop); + operator SynchronousMachineModelKind_ENUM() const; + + SynchronousMachineModelKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SynchronousMachineModelKind& rop); + friend std::ostream& operator<<(std::ostream& os, const SynchronousMachineModelKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineModelKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.cpp index 17134a897..92b1e2cc3 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineOperatingMode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineOperatingMode& rop) +SynchronousMachineOperatingMode& SynchronousMachineOperatingMode::operator=(SynchronousMachineOperatingMode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SynchronousMachineOperatingMode::operator SynchronousMachineOperatingMode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SynchronousMachineOperatingMode::debugName[] = "SynchronousMachineOperatingMode"; +const char* SynchronousMachineOperatingMode::debugString() const +{ + return SynchronousMachineOperatingMode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SynchronousMachineOperatingMode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SynchronousMachineOperatingMode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SynchronousMachineOperatingMode::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == SynchronousMachineOperatingMode::condenser) + { + EnumSymbol = "condenser"; + } + if (obj.value == SynchronousMachineOperatingMode::motor) + { + EnumSymbol = "motor"; + } + + if (!EnumSymbol.empty()) + { + os << "SynchronousMachineOperatingMode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.hpp index abbfd44cf..464590a5b 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineOperatingMode.hpp @@ -1,25 +1,41 @@ #ifndef SynchronousMachineOperatingMode_H #define SynchronousMachineOperatingMode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Synchronous machine operating mode. */ - enum class SynchronousMachineOperatingMode + class SynchronousMachineOperatingMode { - /** - * - */ - generator, - /** - * - */ - condenser, - /** - * - */ - motor, + public: + enum SynchronousMachineOperatingMode_ENUM + { + generator, + condenser, + motor, + }; + + SynchronousMachineOperatingMode() : value(), initialized(false) {} + SynchronousMachineOperatingMode(SynchronousMachineOperatingMode_ENUM value) : value(value), initialized(true) {} + + SynchronousMachineOperatingMode& operator=(SynchronousMachineOperatingMode_ENUM rop); + operator SynchronousMachineOperatingMode_ENUM() const; + + SynchronousMachineOperatingMode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SynchronousMachineOperatingMode& rop); + friend std::ostream& operator<<(std::ostream& os, const SynchronousMachineOperatingMode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineOperatingMode& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.cpp index 5def0becb..c871a8180 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.cpp @@ -1,36 +1,36 @@ -#include -#include "SynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineSimplified.hpp" +#include +#include + using namespace CIMPP; SynchronousMachineSimplified::SynchronousMachineSimplified() {}; - SynchronousMachineSimplified::~SynchronousMachineSimplified() {}; -namespace CIMPP { - BaseClass* SynchronousMachineSimplified_factory() { - return new SynchronousMachineSimplified; - } +const char SynchronousMachineSimplified::debugName[] = "SynchronousMachineSimplified"; +const char* SynchronousMachineSimplified::debugString() const +{ + return SynchronousMachineSimplified::debugName; } -void SynchronousMachineSimplified::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineSimplified::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineSimplified"), &SynchronousMachineSimplified_factory)); } -void SynchronousMachineSimplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void SynchronousMachineSimplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void SynchronousMachineSimplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SynchronousMachineSimplified::debugName[] = "SynchronousMachineSimplified"; -const char* SynchronousMachineSimplified::debugString() +void SynchronousMachineSimplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineSimplified::debugName; } const BaseClassDefiner SynchronousMachineSimplified::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner SynchronousMachineSimplified::declare() return BaseClassDefiner(SynchronousMachineSimplified::addConstructToMap, SynchronousMachineSimplified::addPrimitiveAssignFnsToMap, SynchronousMachineSimplified::addClassAssignFnsToMap, SynchronousMachineSimplified::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineSimplified_factory() + { + return new SynchronousMachineSimplified; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.hpp index 8f216ce1c..3cb0a9a5d 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineSimplified.hpp @@ -1,36 +1,37 @@ #ifndef SynchronousMachineSimplified_H #define SynchronousMachineSimplified_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* The simplified model represents a synchronous generator as a constant internal voltage behind an impedance ( + ) as shown in the Simplified diagram. Since internal voltage is held constant, there is no input and any excitation system model will be ignored. There is also no output. This model should not be used for representing a real generator except, perhaps, small generators whose response is insignificant. The parameters used for the Simplified model include: */ - class SynchronousMachineSimplified: public SynchronousMachineDynamics + class SynchronousMachineSimplified : public SynchronousMachineDynamics { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineSimplified(); - virtual ~SynchronousMachineSimplified(); - + ~SynchronousMachineSimplified() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineSimplified_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.cpp index 4ac4d088b..78d9a31b1 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.cpp @@ -1,246 +1,260 @@ -#include -#include "SynchronousMachineDetailed.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineTimeConstantReactance.hpp" -#include "RotorKind.hpp" -#include "SynchronousMachineModelKind.hpp" +#include +#include + #include "Simple_Float.hpp" +#include "SynchronousMachineModelKind.hpp" +#include "RotorKind.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; SynchronousMachineTimeConstantReactance::SynchronousMachineTimeConstantReactance() {}; - SynchronousMachineTimeConstantReactance::~SynchronousMachineTimeConstantReactance() {}; +bool assign_SynchronousMachineTimeConstantReactance_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_modelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->modelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_rotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rotorType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tpdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpdo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tppdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppdo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tppqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppqo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tpqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpqo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xDirectSubtrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xDirectSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xDirectSync; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xDirectTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xDirectTrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xQuadSubtrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xQuadSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xQuadSync; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xQuadTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xQuadTrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachineTimeConstantReactance_rotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rotorType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_modelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->modelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_xDirectSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xDirectSync; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_xDirectTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xDirectTrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xDirectSubtrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xQuadSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xQuadSync; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xQuadTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xQuadTrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xQuadSubtrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tpdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpdo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tppdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppdo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tpqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpqo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tppqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppqo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* SynchronousMachineTimeConstantReactance_factory() { - return new SynchronousMachineTimeConstantReactance; - } + + + + + + + + + + +const char SynchronousMachineTimeConstantReactance::debugName[] = "SynchronousMachineTimeConstantReactance"; +const char* SynchronousMachineTimeConstantReactance::debugString() const +{ + return SynchronousMachineTimeConstantReactance::debugName; } -void SynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance"), &SynchronousMachineTimeConstantReactance_factory)); } -void SynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.rotorType"), &assign_SynchronousMachineTimeConstantReactance_rotorType)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.modelType"), &assign_SynchronousMachineTimeConstantReactance_modelType)); +void SynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.ks"), &assign_SynchronousMachineTimeConstantReactance_ks)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.modelType"), &assign_SynchronousMachineTimeConstantReactance_modelType)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.rotorType"), &assign_SynchronousMachineTimeConstantReactance_rotorType)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tc"), &assign_SynchronousMachineTimeConstantReactance_tc)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpdo"), &assign_SynchronousMachineTimeConstantReactance_tpdo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppdo"), &assign_SynchronousMachineTimeConstantReactance_tppdo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppqo"), &assign_SynchronousMachineTimeConstantReactance_tppqo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpqo"), &assign_SynchronousMachineTimeConstantReactance_tpqo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectSync"), &assign_SynchronousMachineTimeConstantReactance_xDirectSync)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectTrans"), &assign_SynchronousMachineTimeConstantReactance_xDirectTrans)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadSync"), &assign_SynchronousMachineTimeConstantReactance_xQuadSync)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadTrans"), &assign_SynchronousMachineTimeConstantReactance_xQuadTrans)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpdo"), &assign_SynchronousMachineTimeConstantReactance_tpdo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppdo"), &assign_SynchronousMachineTimeConstantReactance_tppdo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpqo"), &assign_SynchronousMachineTimeConstantReactance_tpqo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppqo"), &assign_SynchronousMachineTimeConstantReactance_tppqo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tc"), &assign_SynchronousMachineTimeConstantReactance_tc)); } -void SynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SynchronousMachineTimeConstantReactance::debugName[] = "SynchronousMachineTimeConstantReactance"; -const char* SynchronousMachineTimeConstantReactance::debugString() +void SynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineTimeConstantReactance::debugName; } const BaseClassDefiner SynchronousMachineTimeConstantReactance::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner SynchronousMachineTimeConstantReactance::declare() return BaseClassDefiner(SynchronousMachineTimeConstantReactance::addConstructToMap, SynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap, SynchronousMachineTimeConstantReactance::addClassAssignFnsToMap, SynchronousMachineTimeConstantReactance::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineTimeConstantReactance_factory() + { + return new SynchronousMachineTimeConstantReactance; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.hpp index c783655c5..7742a80ed 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineTimeConstantReactance.hpp @@ -1,55 +1,56 @@ #ifndef SynchronousMachineTimeConstantReactance_H #define SynchronousMachineTimeConstantReactance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDetailed.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "RotorKind.hpp" -#include "SynchronousMachineModelKind.hpp" -#include "Simple_Float.hpp" +#include "SynchronousMachineDetailed.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "RotorKind.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "SynchronousMachineModelKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Synchronous machine detailed modelling types are defined by the combination of the attributes SynchronousMachineTimeConstantReactance.modelType and SynchronousMachineTimeConstantReactance.rotorType. The parameters used for models expressed in time constant reactance form include: */ - class SynchronousMachineTimeConstantReactance: public SynchronousMachineDetailed + class SynchronousMachineTimeConstantReactance : public SynchronousMachineDetailed { - public: - CIMPP::RotorKind rotorType; /* Type of rotor on physical machine. Default: 0 */ - CIMPP::SynchronousMachineModelKind modelType; /* Type of synchronous machine model used in Dynamic simulation applications. Default: 0 */ - CIMPP::Simple_Float ks; /* Saturation loading correction factor (Ks) (>= 0). Used only by Type J model. Typical Value = 0. Default: nullptr */ - CIMPP::PU xDirectSync; /* Direct-axis synchronous reactance (Xd) (>= X`d). The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. Typical Value = 1.8. Default: nullptr */ - CIMPP::PU xDirectTrans; /* Direct-axis transient reactance (unsaturated) (X`d) (> =X``d). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU xDirectSubtrans; /* Direct-axis subtransient reactance (unsaturated) (X``d) (> Xl). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU xQuadSync; /* Quadrature-axis synchronous reactance (Xq) (> =X`q). The ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency. Typical Value = 1.6. Default: nullptr */ - CIMPP::PU xQuadTrans; /* Quadrature-axis transient reactance (X`q) (> =X``q). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU xQuadSubtrans; /* Quadrature-axis subtransient reactance (X``q) (> Xl). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tpdo; /* Direct-axis transient rotor time constant (T`do) (> T``do). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tppdo; /* Direct-axis subtransient rotor time constant (T``do) (> 0). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tpqo; /* Quadrature-axis transient rotor time constant (T`qo) (> T``qo). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tppqo; /* Quadrature-axis subtransient rotor time constant (T``qo) (> 0). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tc; /* Damping time constant for `Canay` reactance. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineTimeConstantReactance(); - virtual ~SynchronousMachineTimeConstantReactance(); - + ~SynchronousMachineTimeConstantReactance() override; + + CIMPP::Simple_Float ks; /* Saturation loading correction factor (Ks) (>= 0). Used only by Type J model. Typical Value = 0. Default: nullptr */ + CIMPP::SynchronousMachineModelKind modelType; /* Type of synchronous machine model used in Dynamic simulation applications. Default: 0 */ + CIMPP::RotorKind rotorType; /* Type of rotor on physical machine. Default: 0 */ + CIMPP::Seconds tc; /* Damping time constant for `Canay` reactance. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tpdo; /* Direct-axis transient rotor time constant (T`do) (> T``do). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tppdo; /* Direct-axis subtransient rotor time constant (T``do) (> 0). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tppqo; /* Quadrature-axis subtransient rotor time constant (T``qo) (> 0). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tpqo; /* Quadrature-axis transient rotor time constant (T`qo) (> T``qo). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU xDirectSubtrans; /* Direct-axis subtransient reactance (unsaturated) (X``d) (> Xl). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU xDirectSync; /* Direct-axis synchronous reactance (Xd) (>= X`d). The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. Typical Value = 1.8. Default: nullptr */ + CIMPP::PU xDirectTrans; /* Direct-axis transient reactance (unsaturated) (X`d) (> =X``d). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU xQuadSubtrans; /* Quadrature-axis subtransient reactance (X``q) (> Xl). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU xQuadSync; /* Quadrature-axis synchronous reactance (Xq) (> =X`q). The ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency. Typical Value = 1.6. Default: nullptr */ + CIMPP::PU xQuadTrans; /* Quadrature-axis transient reactance (X`q) (> =X``q). Typical Value = 0.3. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineTimeConstantReactance_factory(); diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.cpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.cpp index 0fde574f7..80c109209 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "SynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; SynchronousMachineUserDefined::SynchronousMachineUserDefined() {}; - SynchronousMachineUserDefined::~SynchronousMachineUserDefined() {}; -bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_SynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_SynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass*, BaseClass*); +bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SynchronousMachineUserDefined_factory() { - return new SynchronousMachineUserDefined; - } +const char SynchronousMachineUserDefined::debugName[] = "SynchronousMachineUserDefined"; +const char* SynchronousMachineUserDefined::debugString() const +{ + return SynchronousMachineUserDefined::debugName; } -void SynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined"), &SynchronousMachineUserDefined_factory)); } -void SynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined.proprietary"), &assign_SynchronousMachineUserDefined_proprietary)); - } - -void SynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics)); } -const char SynchronousMachineUserDefined::debugName[] = "SynchronousMachineUserDefined"; -const char* SynchronousMachineUserDefined::debugString() +void SynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner SynchronousMachineUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SynchronousMachineUserDefined::declare() return BaseClassDefiner(SynchronousMachineUserDefined::addConstructToMap, SynchronousMachineUserDefined::addPrimitiveAssignFnsToMap, SynchronousMachineUserDefined::addClassAssignFnsToMap, SynchronousMachineUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineUserDefined_factory() + { + return new SynchronousMachineUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.hpp b/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.hpp index 9d3cf5a0d..801d49502 100644 --- a/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/SynchronousMachineUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef SynchronousMachineUserDefined_H #define SynchronousMachineUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "SynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Synchronous machine whose dynamic behaviour is described by a user-defined model. */ - class SynchronousMachineUserDefined: public SynchronousMachineDynamics + class SynchronousMachineUserDefined : public SynchronousMachineDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineUserDefined(); - virtual ~SynchronousMachineUserDefined(); - + ~SynchronousMachineUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TapChanger.cpp b/CGMES_2.4.15_16FEB2016/TapChanger.cpp index f96dcfabc..b353d76ce 100644 --- a/CGMES_2.4.15_16FEB2016/TapChanger.cpp +++ b/CGMES_2.4.15_16FEB2016/TapChanger.cpp @@ -1,194 +1,224 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapChanger.hpp" +#include +#include + +#include "SvTapStep.hpp" +#include "TapChangerControl.hpp" +#include "TapSchedule.hpp" +#include "Boolean.hpp" #include "Integer.hpp" #include "Integer.hpp" #include "Boolean.hpp" #include "Integer.hpp" #include "Voltage.hpp" #include "Integer.hpp" -#include "TapSchedule.hpp" -#include "TapChangerControl.hpp" -#include "SvTapStep.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" using namespace CIMPP; -TapChanger::TapChanger(): TapChangerControl(nullptr), SvTapStep(nullptr) {}; - +TapChanger::TapChanger() : SvTapStep(nullptr), TapChangerControl(nullptr) {}; TapChanger::~TapChanger() {}; +bool assign_TapChanger_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->controlEnabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_TapChanger_highStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->highStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_TapChanger_lowStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lowStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_TapChanger_ltcFlag(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ltcFlag; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_TapChanger_neutralStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->neutralStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChanger_neutralU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->neutralU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChanger_normalStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TapChanger_TapSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TapSchedules.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TapChanger_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->step; + if (buffer.fail()) + return false; + else return true; + } + return false; +} + + +bool assign_SvTapStep_TapChanger(BaseClass*, BaseClass*); +bool assign_TapChanger_SvTapStep(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChanger* element = dynamic_cast(BaseClass_ptr1); + SvTapStep* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvTapStep != element2) + { + element->SvTapStep = element2; + return assign_SvTapStep_TapChanger(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_TapChangerControl_TapChanger(BaseClass*, BaseClass*); -bool assign_TapChanger_TapChangerControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->TapChangerControl = dynamic_cast(BaseClass_ptr2); - if(element->TapChangerControl != nullptr) - return assign_TapChangerControl_TapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TapChanger_SvTapStep(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->SvTapStep = dynamic_cast(BaseClass_ptr2); - if(element->SvTapStep != nullptr) - return true; - } - return false; -} - - - - -bool assign_TapChanger_highStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->highStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_lowStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lowStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_ltcFlag(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ltcFlag; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_neutralStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->neutralStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_neutralU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->neutralU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_normalStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - - -bool assign_TapChanger_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->controlEnabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->step; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* TapChanger_factory() { - return new TapChanger; +bool assign_TapChanger_TapChangerControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChanger* element = dynamic_cast(BaseClass_ptr1); + TapChangerControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TapChangerControl != element2) + { + element->TapChangerControl = element2; + return assign_TapChangerControl_TapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TapSchedule_TapChanger(BaseClass*, BaseClass*); +bool assign_TapChanger_TapSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChanger* element = dynamic_cast(BaseClass_ptr1); + TapSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TapSchedules.begin(), element->TapSchedules.end(), element2) == element->TapSchedules.end()) + { + element->TapSchedules.push_back(element2); + return assign_TapSchedule_TapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + +const char TapChanger::debugName[] = "TapChanger"; +const char* TapChanger::debugString() const +{ + return TapChanger::debugName; } -void TapChanger::addConstructToMap(std::unordered_map& factory_map) { +void TapChanger::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TapChanger"), &TapChanger_factory)); } -void TapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TapChanger.controlEnabled"), &assign_TapChanger_controlEnabled)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.highStep"), &assign_TapChanger_highStep)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.lowStep"), &assign_TapChanger_lowStep)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.ltcFlag"), &assign_TapChanger_ltcFlag)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.neutralStep"), &assign_TapChanger_neutralStep)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.neutralU"), &assign_TapChanger_neutralU)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.normalStep"), &assign_TapChanger_normalStep)); - assign_map.insert(std::make_pair(std::string("cim:TapChanger.controlEnabled"), &assign_TapChanger_controlEnabled)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.step"), &assign_TapChanger_step)); } -void TapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapSchedules"), &assign_TapChanger_TapSchedules)); - assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapChangerControl"), &assign_TapChanger_TapChangerControl)); - assign_map.insert(std::make_pair(std::string("cim:TapChanger.SvTapStep"), &assign_TapChanger_SvTapStep)); - } - -const char TapChanger::debugName[] = "TapChanger"; -const char* TapChanger::debugString() +void TapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapChanger::debugName; + assign_map.insert(std::make_pair(std::string("cim:TapChanger.SvTapStep"), &assign_TapChanger_SvTapStep)); + assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapChangerControl"), &assign_TapChanger_TapChangerControl)); + assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapSchedules"), &assign_TapChanger_TapSchedules)); } const BaseClassDefiner TapChanger::declare() @@ -196,4 +226,10 @@ const BaseClassDefiner TapChanger::declare() return BaseClassDefiner(TapChanger::addConstructToMap, TapChanger::addPrimitiveAssignFnsToMap, TapChanger::addClassAssignFnsToMap, TapChanger::debugName); } - +namespace CIMPP +{ + BaseClass* TapChanger_factory() + { + return new TapChanger; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TapChanger.hpp b/CGMES_2.4.15_16FEB2016/TapChanger.hpp index aa957bc69..674003d92 100644 --- a/CGMES_2.4.15_16FEB2016/TapChanger.hpp +++ b/CGMES_2.4.15_16FEB2016/TapChanger.hpp @@ -1,54 +1,55 @@ #ifndef TapChanger_H #define TapChanger_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Voltage.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class SvTapStep; + class TapChangerControl; + class TapSchedule; -class TapSchedule; -class TapChangerControl; -class SvTapStep; /* Mechanism for changing transformer winding tap positions. */ - class TapChanger: public PowerSystemResource + class TapChanger : public PowerSystemResource { - public: - CIMPP::Integer highStep; /* Highest possible tap step position, advance from neutral. The attribute shall be greater than lowStep. Default: 0 */ - CIMPP::Integer lowStep; /* Lowest possible tap step position, retard from neutral Default: 0 */ - CIMPP::Boolean ltcFlag; /* Specifies whether or not a TapChanger has load tap changing capabilities. Default: false */ - CIMPP::Integer neutralStep; /* The neutral tap step position for this winding. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ - CIMPP::Voltage neutralU; /* Voltage at which the winding operates at the neutral tap setting. Default: nullptr */ - CIMPP::Integer normalStep; /* The tap step position used in `normal` network operation for this winding. For a `Fixed` tap changer indicates the current physical tap setting. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ - std::list TapSchedules; /* A TapSchedule is associated with a TapChanger. Default: 0 */ - CIMPP::TapChangerControl* TapChangerControl; /* The tap changers that participates in this regulating tap control scheme. Default: 0 */ - CIMPP::SvTapStep* SvTapStep; /* The tap step state associated with the tap changer. Default: 0 */ - CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ - CIMPP::Simple_Float step; /* Tap changer position. Starting step for a steady state solution. Non integer values are allowed to support continuous tap variables. The reasons for continuous value are to support study cases where no discrete tap changers has yet been designed, a solutions where a narrow voltage band force the tap step to oscillate or accommodate for a continuous solution as input. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapChanger(); - virtual ~TapChanger(); - + ~TapChanger() override; + + CIMPP::SvTapStep* SvTapStep; /* The tap step state associated with the tap changer. Default: 0 */ + CIMPP::TapChangerControl* TapChangerControl; /* The tap changers that participates in this regulating tap control scheme. Default: 0 */ + std::list TapSchedules; /* A TapSchedule is associated with a TapChanger. Default: 0 */ + CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ + CIMPP::Integer highStep; /* Highest possible tap step position, advance from neutral. The attribute shall be greater than lowStep. Default: 0 */ + CIMPP::Integer lowStep; /* Lowest possible tap step position, retard from neutral Default: 0 */ + CIMPP::Boolean ltcFlag; /* Specifies whether or not a TapChanger has load tap changing capabilities. Default: false */ + CIMPP::Integer neutralStep; /* The neutral tap step position for this winding. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ + CIMPP::Voltage neutralU; /* Voltage at which the winding operates at the neutral tap setting. Default: nullptr */ + CIMPP::Integer normalStep; /* The tap step position used in `normal` network operation for this winding. For a `Fixed` tap changer indicates the current physical tap setting. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ + CIMPP::Simple_Float step; /* Tap changer position. Starting step for a steady state solution. Non integer values are allowed to support continuous tap variables. The reasons for continuous value are to support study cases where no discrete tap changers has yet been designed, a solutions where a narrow voltage band force the tap step to oscillate or accommodate for a continuous solution as input. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapChanger_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TapChangerControl.cpp b/CGMES_2.4.15_16FEB2016/TapChangerControl.cpp index 3f5295e99..031f9704e 100644 --- a/CGMES_2.4.15_16FEB2016/TapChangerControl.cpp +++ b/CGMES_2.4.15_16FEB2016/TapChangerControl.cpp @@ -1,49 +1,56 @@ -#include -#include "RegulatingControl.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapChangerControl.hpp" +#include +#include + #include "TapChanger.hpp" using namespace CIMPP; TapChangerControl::TapChangerControl() {}; - TapChangerControl::~TapChangerControl() {}; -bool assign_TapChangerControl_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChangerControl* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TapChanger.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_TapChanger_TapChangerControl(BaseClass*, BaseClass*); +bool assign_TapChangerControl_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChangerControl* element = dynamic_cast(BaseClass_ptr1); + TapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TapChanger.begin(), element->TapChanger.end(), element2) == element->TapChanger.end()) + { + element->TapChanger.push_back(element2); + return assign_TapChanger_TapChangerControl(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* TapChangerControl_factory() { - return new TapChangerControl; - } +const char TapChangerControl::debugName[] = "TapChangerControl"; +const char* TapChangerControl::debugString() const +{ + return TapChangerControl::debugName; } -void TapChangerControl::addConstructToMap(std::unordered_map& factory_map) { +void TapChangerControl::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TapChangerControl"), &TapChangerControl_factory)); } -void TapChangerControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void TapChangerControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TapChangerControl.TapChanger"), &assign_TapChangerControl_TapChanger)); +void TapChangerControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TapChangerControl::debugName[] = "TapChangerControl"; -const char* TapChangerControl::debugString() +void TapChangerControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapChangerControl::debugName; + assign_map.insert(std::make_pair(std::string("cim:TapChangerControl.TapChanger"), &assign_TapChangerControl_TapChanger)); } const BaseClassDefiner TapChangerControl::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner TapChangerControl::declare() return BaseClassDefiner(TapChangerControl::addConstructToMap, TapChangerControl::addPrimitiveAssignFnsToMap, TapChangerControl::addClassAssignFnsToMap, TapChangerControl::debugName); } - +namespace CIMPP +{ + BaseClass* TapChangerControl_factory() + { + return new TapChangerControl; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TapChangerControl.hpp b/CGMES_2.4.15_16FEB2016/TapChangerControl.hpp index e9821b381..7e19b5b7a 100644 --- a/CGMES_2.4.15_16FEB2016/TapChangerControl.hpp +++ b/CGMES_2.4.15_16FEB2016/TapChangerControl.hpp @@ -1,38 +1,39 @@ #ifndef TapChangerControl_H #define TapChangerControl_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingControl.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RegulatingControl.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TapChanger; -class TapChanger; /* Describes behavior specific to tap changers, e.g. how the voltage at the end of a line varies with the load level and compensation of the voltage drop by tap adjustment. */ - class TapChangerControl: public RegulatingControl + class TapChangerControl : public RegulatingControl { - public: - std::list TapChanger; /* The regulating control scheme in which this tap changer participates. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapChangerControl(); - virtual ~TapChangerControl(); - + ~TapChangerControl() override; + + std::list TapChanger; /* The regulating control scheme in which this tap changer participates. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapChangerControl_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.cpp b/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.cpp index 07ea24148..764d42bac 100644 --- a/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.cpp +++ b/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapChangerTablePoint.hpp" +#include +#include + #include "PerCent.hpp" #include "PerCent.hpp" #include "PerCent.hpp" @@ -12,100 +16,107 @@ using namespace CIMPP; TapChangerTablePoint::TapChangerTablePoint() {}; - TapChangerTablePoint::~TapChangerTablePoint() {}; +bool assign_TapChangerTablePoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->step; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TapChangerTablePoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->step; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* TapChangerTablePoint_factory() { - return new TapChangerTablePoint; - } +const char TapChangerTablePoint::debugName[] = "TapChangerTablePoint"; +const char* TapChangerTablePoint::debugString() const +{ + return TapChangerTablePoint::debugName; } -void TapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) { +void TapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint"), &TapChangerTablePoint_factory)); } -void TapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint.b"), &assign_TapChangerTablePoint_b)); assign_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint.g"), &assign_TapChangerTablePoint_g)); assign_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint.r"), &assign_TapChangerTablePoint_r)); @@ -114,13 +125,8 @@ void TapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char TapChangerTablePoint::debugName[] = "TapChangerTablePoint"; -const char* TapChangerTablePoint::debugString() +void TapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapChangerTablePoint::debugName; } const BaseClassDefiner TapChangerTablePoint::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner TapChangerTablePoint::declare() return BaseClassDefiner(TapChangerTablePoint::addConstructToMap, TapChangerTablePoint::addPrimitiveAssignFnsToMap, TapChangerTablePoint::addClassAssignFnsToMap, TapChangerTablePoint::debugName); } - +namespace CIMPP +{ + BaseClass* TapChangerTablePoint_factory() + { + return new TapChangerTablePoint; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.hpp b/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.hpp index ad798ee16..72c16526f 100644 --- a/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.hpp +++ b/CGMES_2.4.15_16FEB2016/TapChangerTablePoint.hpp @@ -1,45 +1,43 @@ #ifndef TapChangerTablePoint_H #define TapChangerTablePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Integer.hpp" #include "PerCent.hpp" #include "Simple_Float.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ - /* - - */ - class TapChangerTablePoint: public BaseClass + class TapChangerTablePoint : public BaseClass { - public: - CIMPP::PerCent b; /* The magnetizing branch susceptance deviation in percent of nominal value. The actual susceptance is calculated as follows: calculated magnetizing susceptance = b(nominal) * (1 + b(from this class)/100). The b(nominal) is defined as the static magnetizing susceptance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - CIMPP::PerCent g; /* The magnetizing branch conductance deviation in percent of nominal value. The actual conductance is calculated as follows: calculated magnetizing conductance = g(nominal) * (1 + g(from this class)/100). The g(nominal) is defined as the static magnetizing conductance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - CIMPP::PerCent r; /* The resistance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated resistance = r(nominal) * (1 + r(from this class)/100). The r(nominal) is defined as the static resistance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - CIMPP::Simple_Float ratio; /* The voltage ratio in per unit. Hence this is a value close to one. Default: nullptr */ - CIMPP::Integer step; /* The tap step. Default: 0 */ - CIMPP::PerCent x; /* The series reactance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated reactance = x(nominal) * (1 + x(from this class)/100). The x(nominal) is defined as the static series reactance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapChangerTablePoint(); - virtual ~TapChangerTablePoint(); - + ~TapChangerTablePoint() override; + + CIMPP::PerCent b; /* The magnetizing branch susceptance deviation in percent of nominal value. The actual susceptance is calculated as follows: calculated magnetizing susceptance = b(nominal) * (1 + b(from this class)/100). The b(nominal) is defined as the static magnetizing susceptance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + CIMPP::PerCent g; /* The magnetizing branch conductance deviation in percent of nominal value. The actual conductance is calculated as follows: calculated magnetizing conductance = g(nominal) * (1 + g(from this class)/100). The g(nominal) is defined as the static magnetizing conductance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + CIMPP::PerCent r; /* The resistance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated resistance = r(nominal) * (1 + r(from this class)/100). The r(nominal) is defined as the static resistance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + CIMPP::Simple_Float ratio; /* The voltage ratio in per unit. Hence this is a value close to one. Default: nullptr */ + CIMPP::Integer step; /* The tap step. Default: 0 */ + CIMPP::PerCent x; /* The series reactance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated reactance = x(nominal) * (1 + x(from this class)/100). The x(nominal) is defined as the static series reactance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapChangerTablePoint_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TapSchedule.cpp b/CGMES_2.4.15_16FEB2016/TapSchedule.cpp index 231c62bb5..638119eee 100644 --- a/CGMES_2.4.15_16FEB2016/TapSchedule.cpp +++ b/CGMES_2.4.15_16FEB2016/TapSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapSchedule.hpp" +#include +#include + #include "TapChanger.hpp" using namespace CIMPP; -TapSchedule::TapSchedule(): TapChanger(nullptr) {}; - +TapSchedule::TapSchedule() : TapChanger(nullptr) {}; TapSchedule::~TapSchedule() {}; -bool assign_TapChanger_TapSchedules(BaseClass*, BaseClass*); -bool assign_TapSchedule_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->TapChanger = dynamic_cast(BaseClass_ptr2); - if(element->TapChanger != nullptr) - return assign_TapChanger_TapSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* TapSchedule_factory() { - return new TapSchedule; +bool assign_TapChanger_TapSchedules(BaseClass*, BaseClass*); +bool assign_TapSchedule_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapSchedule* element = dynamic_cast(BaseClass_ptr1); + TapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TapChanger != element2) + { + element->TapChanger = element2; + return assign_TapChanger_TapSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TapSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:TapSchedule"), &TapSchedule_factory)); +const char TapSchedule::debugName[] = "TapSchedule"; +const char* TapSchedule::debugString() const +{ + return TapSchedule::debugName; } -void TapSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void TapSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:TapSchedule"), &TapSchedule_factory)); +} -void TapSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TapSchedule.TapChanger"), &assign_TapSchedule_TapChanger)); +void TapSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TapSchedule::debugName[] = "TapSchedule"; -const char* TapSchedule::debugString() +void TapSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:TapSchedule.TapChanger"), &assign_TapSchedule_TapChanger)); } const BaseClassDefiner TapSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner TapSchedule::declare() return BaseClassDefiner(TapSchedule::addConstructToMap, TapSchedule::addPrimitiveAssignFnsToMap, TapSchedule::addClassAssignFnsToMap, TapSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* TapSchedule_factory() + { + return new TapSchedule; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TapSchedule.hpp b/CGMES_2.4.15_16FEB2016/TapSchedule.hpp index 2249aa7a5..540c7935e 100644 --- a/CGMES_2.4.15_16FEB2016/TapSchedule.hpp +++ b/CGMES_2.4.15_16FEB2016/TapSchedule.hpp @@ -1,38 +1,39 @@ #ifndef TapSchedule_H #define TapSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TapChanger; -class TapChanger; /* A pre-established pattern over time for a tap step. */ - class TapSchedule: public SeasonDayTypeSchedule + class TapSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::TapChanger* TapChanger; /* A TapChanger can have TapSchedules. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapSchedule(); - virtual ~TapSchedule(); - + ~TapSchedule() override; + + CIMPP::TapChanger* TapChanger; /* A TapChanger can have TapSchedules. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapSchedule_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Temperature.cpp b/CGMES_2.4.15_16FEB2016/Temperature.cpp index 7b29f89d5..3a788af85 100644 --- a/CGMES_2.4.15_16FEB2016/Temperature.cpp +++ b/CGMES_2.4.15_16FEB2016/Temperature.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Temperature.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Temperature::Temperature() {} -Temperature::~Temperature(){} +#include -Temperature::Temperature(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Temperature::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Temperature::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Temperature& Temperature::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Temperature::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Temperature::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Temperature::debugName[] = "Temperature"; -const char* Temperature::debugString() { +const char* Temperature::debugString() const +{ return Temperature::debugName; } - -const BaseClassDefiner Temperature::declare() { - return BaseClassDefiner(Temperature::addConstructToMap, Temperature::addPrimitiveAssignFnsToMap, Temperature::addClassAssignFnsToMap, Temperature::debugName); +Temperature& Temperature::operator+=(const Temperature& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Temperature& Temperature::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Temperature& Temperature::operator-=(const Temperature& rhs) { - value -= rhs.value; - return *this; - } - - Temperature& Temperature::operator*=(const Temperature& rhs) { - value *= rhs.value; - return *this; - } - - Temperature& Temperature::operator/=(const Temperature& rhs) { - value /= rhs.value; - return *this; - } +Temperature& Temperature::operator-=(const Temperature& rhs) +{ + value -= rhs.value; + return *this; +} - Temperature& Temperature::operator+=(const Temperature& rhs) { - value += rhs.value; - return *this; - } +Temperature& Temperature::operator*=(const Temperature& rhs) +{ + value *= rhs.value; + return *this; +} - Temperature::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Temperature& Temperature::operator/=(const Temperature& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Temperature& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Temperature& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Temperature& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Temperature.hpp b/CGMES_2.4.15_16FEB2016/Temperature.hpp index e15440197..33ba8ea2b 100644 --- a/CGMES_2.4.15_16FEB2016/Temperature.hpp +++ b/CGMES_2.4.15_16FEB2016/Temperature.hpp @@ -1,38 +1,39 @@ #ifndef Temperature_H #define Temperature_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Temperature : public BaseClass + /* + Value of temperature in degrees Celsius. + */ + class Temperature { - public: - Temperature(); - virtual ~Temperature(); - Temperature(long double value); - static const BaseClassDefiner declare(); - Temperature& operator=(long double &rop); + Temperature() : value(0.0), initialized(false) {} + Temperature(long double value) : value(value), initialized(true) {} + + Temperature& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Temperature& operator+=(const Temperature& rhs); Temperature& operator-=(const Temperature& rhs); Temperature& operator*=(const Temperature& rhs); Temperature& operator/=(const Temperature& rhs); + friend std::istream& operator>>(std::istream& lop, Temperature& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Temperature& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/Terminal.cpp b/CGMES_2.4.15_16FEB2016/Terminal.cpp index 8ee2c31c9..76c977550 100644 --- a/CGMES_2.4.15_16FEB2016/Terminal.cpp +++ b/CGMES_2.4.15_16FEB2016/Terminal.cpp @@ -1,191 +1,272 @@ -#include -#include "ACDCTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Terminal.hpp" +#include +#include + #include "ConductingEquipment.hpp" -#include "RemoteInputSignal.hpp" #include "ConnectivityNode.hpp" -#include "PhaseCode.hpp" #include "ACDCConverter.hpp" -#include "RegulatingControl.hpp" -#include "TieFlow.hpp" -#include "TransformerEnd.hpp" #include "MutualCoupling.hpp" #include "MutualCoupling.hpp" +#include "RegulatingControl.hpp" +#include "RemoteInputSignal.hpp" #include "SvPowerFlow.hpp" +#include "TieFlow.hpp" #include "TopologicalNode.hpp" +#include "TransformerEnd.hpp" +#include "PhaseCode.hpp" using namespace CIMPP; -Terminal::Terminal(): ConductingEquipment(nullptr), ConnectivityNode(nullptr), RegulatingControl(nullptr), TieFlow(nullptr), SvPowerFlow(nullptr), TopologicalNode(nullptr) {}; - +Terminal::Terminal() : ConductingEquipment(nullptr), ConnectivityNode(nullptr), RegulatingControl(nullptr), SvPowerFlow(nullptr), TopologicalNode(nullptr) {}; Terminal::~Terminal() {}; -bool assign_ConductingEquipment_Terminals(BaseClass*, BaseClass*); -bool assign_Terminal_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->ConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->ConductingEquipment != nullptr) - return assign_ConductingEquipment_Terminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_Terminal_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RemoteInputSignal.push_back(dynamic_cast(BaseClass_ptr2)); + + + + + + + + + + + +bool assign_Terminal_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Terminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->phases; + if (buffer.fail()) + return false; + else return true; + } + return false; +} + + +bool assign_ConductingEquipment_Terminals(BaseClass*, BaseClass*); +bool assign_Terminal_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + ConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConductingEquipment != element2) + { + element->ConductingEquipment = element2; + return assign_ConductingEquipment_Terminals(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_ConnectivityNode_Terminals(BaseClass*, BaseClass*); -bool assign_Terminal_ConnectivityNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->ConnectivityNode = dynamic_cast(BaseClass_ptr2); - if(element->ConnectivityNode != nullptr) - return assign_ConnectivityNode_Terminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Terminal_ConnectivityNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConnectivityNode != element2) + { + element->ConnectivityNode = element2; + return assign_ConnectivityNode_Terminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - -bool assign_Terminal_ConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConverterDCSides.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_ACDCConverter_PccTerminal(BaseClass*, BaseClass*); +bool assign_Terminal_ConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + ACDCConverter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConverterDCSides.begin(), element->ConverterDCSides.end(), element2) == element->ConverterDCSides.end()) + { + element->ConverterDCSides.push_back(element2); + return assign_ACDCConverter_PccTerminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Terminal_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->RegulatingControl = dynamic_cast(BaseClass_ptr2); - if(element->RegulatingControl != nullptr) - return true; - } - return false; +bool assign_MutualCoupling_First_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_HasFirstMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + MutualCoupling* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HasFirstMutualCoupling.begin(), element->HasFirstMutualCoupling.end(), element2) == element->HasFirstMutualCoupling.end()) + { + element->HasFirstMutualCoupling.push_back(element2); + return assign_MutualCoupling_First_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Terminal_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->TieFlow = dynamic_cast(BaseClass_ptr2); - if(element->TieFlow != nullptr) - return true; - } - return false; +bool assign_MutualCoupling_Second_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_HasSecondMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + MutualCoupling* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HasSecondMutualCoupling.begin(), element->HasSecondMutualCoupling.end(), element2) == element->HasSecondMutualCoupling.end()) + { + element->HasSecondMutualCoupling.push_back(element2); + return assign_MutualCoupling_Second_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Terminal_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TransformerEnd.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_RegulatingControl_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + RegulatingControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RegulatingControl != element2) + { + element->RegulatingControl = element2; + return assign_RegulatingControl_Terminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Terminal_HasFirstMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HasFirstMutualCoupling.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_RemoteInputSignal_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RemoteInputSignal.begin(), element->RemoteInputSignal.end(), element2) == element->RemoteInputSignal.end()) + { + element->RemoteInputSignal.push_back(element2); + return assign_RemoteInputSignal_Terminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Terminal_HasSecondMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HasSecondMutualCoupling.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_SvPowerFlow_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_SvPowerFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + SvPowerFlow* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvPowerFlow != element2) + { + element->SvPowerFlow = element2; + return assign_SvPowerFlow_Terminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Terminal_SvPowerFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->SvPowerFlow = dynamic_cast(BaseClass_ptr2); - if(element->SvPowerFlow != nullptr) - return true; - } - return false; +bool assign_TieFlow_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + TieFlow* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TieFlow.begin(), element->TieFlow.end(), element2) == element->TieFlow.end()) + { + element->TieFlow.push_back(element2); + return assign_TieFlow_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_TopologicalNode_Terminal(BaseClass*, BaseClass*); -bool assign_Terminal_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_Terminal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Terminal_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -bool assign_Terminal_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->phases; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TransformerEnd_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TransformerEnd.begin(), element->TransformerEnd.end(), element2) == element->TransformerEnd.end()) + { + element->TransformerEnd.push_back(element2); + return assign_TransformerEnd_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - - - - -namespace CIMPP { - BaseClass* Terminal_factory() { - return new Terminal; - } +const char Terminal::debugName[] = "Terminal"; +const char* Terminal::debugString() const +{ + return Terminal::debugName; } -void Terminal::addConstructToMap(std::unordered_map& factory_map) { +void Terminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Terminal"), &Terminal_factory)); } -void Terminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Terminal.phases"), &assign_Terminal_phases)); - } +void Terminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Terminal.phases"), &assign_Terminal_phases)); +} -void Terminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Terminal::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Terminal.ConductingEquipment"), &assign_Terminal_ConductingEquipment)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.RemoteInputSignal"), &assign_Terminal_RemoteInputSignal)); assign_map.insert(std::make_pair(std::string("cim:Terminal.ConnectivityNode"), &assign_Terminal_ConnectivityNode)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.ConverterDCSides"), &assign_Terminal_ConverterDCSides)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.RegulatingControl"), &assign_Terminal_RegulatingControl)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.TieFlow"), &assign_Terminal_TieFlow)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.TransformerEnd"), &assign_Terminal_TransformerEnd)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.ConverterDCSides"), &assign_Terminal_ConverterDCSides)); assign_map.insert(std::make_pair(std::string("cim:Terminal.HasFirstMutualCoupling"), &assign_Terminal_HasFirstMutualCoupling)); assign_map.insert(std::make_pair(std::string("cim:Terminal.HasSecondMutualCoupling"), &assign_Terminal_HasSecondMutualCoupling)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.RegulatingControl"), &assign_Terminal_RegulatingControl)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.RemoteInputSignal"), &assign_Terminal_RemoteInputSignal)); assign_map.insert(std::make_pair(std::string("cim:Terminal.SvPowerFlow"), &assign_Terminal_SvPowerFlow)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.TieFlow"), &assign_Terminal_TieFlow)); assign_map.insert(std::make_pair(std::string("cim:Terminal.TopologicalNode"), &assign_Terminal_TopologicalNode)); -} - -const char Terminal::debugName[] = "Terminal"; -const char* Terminal::debugString() -{ - return Terminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:Terminal.TransformerEnd"), &assign_Terminal_TransformerEnd)); } const BaseClassDefiner Terminal::declare() @@ -193,4 +274,10 @@ const BaseClassDefiner Terminal::declare() return BaseClassDefiner(Terminal::addConstructToMap, Terminal::addPrimitiveAssignFnsToMap, Terminal::addClassAssignFnsToMap, Terminal::debugName); } - +namespace CIMPP +{ + BaseClass* Terminal_factory() + { + return new Terminal; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Terminal.hpp b/CGMES_2.4.15_16FEB2016/Terminal.hpp index e55c6ae29..410b5d9b5 100644 --- a/CGMES_2.4.15_16FEB2016/Terminal.hpp +++ b/CGMES_2.4.15_16FEB2016/Terminal.hpp @@ -1,59 +1,60 @@ #ifndef Terminal_H #define Terminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ACDCTerminal.hpp" +#include "BaseClassDefiner.hpp" #include "PhaseCode.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ACDCConverter; + class ConductingEquipment; + class ConnectivityNode; + class MutualCoupling; + class RegulatingControl; + class RemoteInputSignal; + class SvPowerFlow; + class TieFlow; + class TopologicalNode; + class TransformerEnd; - -class ConductingEquipment; -class RemoteInputSignal; -class ConnectivityNode; -class ACDCConverter; -class RegulatingControl; -class TieFlow; -class TransformerEnd; -class MutualCoupling; -class SvPowerFlow; -class TopologicalNode; /* An AC electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called connectivity nodes. */ - class Terminal: public ACDCTerminal + class Terminal : public ACDCTerminal { - public: - CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment of the terminal. Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ - std::list RemoteInputSignal; /* Input signal coming from this terminal. Default: 0 */ - CIMPP::ConnectivityNode* ConnectivityNode; /* Terminals interconnected with zero impedance at a this connectivity node. Default: 0 */ - CIMPP::PhaseCode phases; /* Represents the normal network phasing condition. If the attribute is missing three phases (ABC or ABCN) shall be assumed. Default: 0 */ - std::list ConverterDCSides; /* Point of common coupling terminal for this converter DC side. It is typically the terminal on the power transformer (or switch) closest to the AC network. The power flow measurement must be the sum of all flows into the transformer. Default: 0 */ - CIMPP::RegulatingControl* RegulatingControl; /* The terminal associated with this regulating control. The terminal is associated instead of a node, since the terminal could connect into either a topological node (bus in bus-branch model) or a connectivity node (detailed switch model). Sometimes it is useful to model regulation at a terminal of a bus bar object since the bus bar can be present in both a bus-branch model or a model with switch detail. Default: 0 */ - CIMPP::TieFlow* TieFlow; /* The control area tie flows to which this terminal associates. Default: 0 */ - std::list TransformerEnd; /* All transformer ends connected at this terminal. Default: 0 */ - std::list HasFirstMutualCoupling; /* Mutual couplings associated with the branch as the first branch. Default: 0 */ - std::list HasSecondMutualCoupling; /* Mutual couplings with the branch associated as the first branch. Default: 0 */ - CIMPP::SvPowerFlow* SvPowerFlow; /* The power flow state variable associated with the terminal. Default: 0 */ - CIMPP::TopologicalNode* TopologicalNode; /* The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, thus making it unneccesary to model connectivity nodes in some cases. Note that if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Terminal(); - virtual ~Terminal(); - + ~Terminal() override; + + CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment of the terminal. Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ + CIMPP::ConnectivityNode* ConnectivityNode; /* Terminals interconnected with zero impedance at a this connectivity node. Default: 0 */ + std::list ConverterDCSides; /* Point of common coupling terminal for this converter DC side. It is typically the terminal on the power transformer (or switch) closest to the AC network. The power flow measurement must be the sum of all flows into the transformer. Default: 0 */ + std::list HasFirstMutualCoupling; /* Mutual couplings associated with the branch as the first branch. Default: 0 */ + std::list HasSecondMutualCoupling; /* Mutual couplings with the branch associated as the first branch. Default: 0 */ + CIMPP::RegulatingControl* RegulatingControl; /* The terminal associated with this regulating control. The terminal is associated instead of a node, since the terminal could connect into either a topological node (bus in bus-branch model) or a connectivity node (detailed switch model). Sometimes it is useful to model regulation at a terminal of a bus bar object since the bus bar can be present in both a bus-branch model or a model with switch detail. Default: 0 */ + std::list RemoteInputSignal; /* Input signal coming from this terminal. Default: 0 */ + CIMPP::SvPowerFlow* SvPowerFlow; /* The power flow state variable associated with the terminal. Default: 0 */ + std::list TieFlow; /* The control area tie flows to which this terminal associates. Default: 0 */ + CIMPP::TopologicalNode* TopologicalNode; /* The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, thus making it unneccesary to model connectivity nodes in some cases. Note that if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ + std::list TransformerEnd; /* All transformer ends connected at this terminal. Default: 0 */ + CIMPP::PhaseCode phases; /* Represents the normal network phasing condition. If the attribute is missing three phases (ABC or ABCN) shall be assumed. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Terminal_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TextDiagramObject.cpp b/CGMES_2.4.15_16FEB2016/TextDiagramObject.cpp index f8486b0ce..df7e44767 100644 --- a/CGMES_2.4.15_16FEB2016/TextDiagramObject.cpp +++ b/CGMES_2.4.15_16FEB2016/TextDiagramObject.cpp @@ -1,22 +1,25 @@ -#include -#include "DiagramObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TextDiagramObject.hpp" +#include +#include + #include "String.hpp" using namespace CIMPP; TextDiagramObject::TextDiagramObject() {}; - TextDiagramObject::~TextDiagramObject() {}; - - -bool assign_TextDiagramObject_text(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TextDiagramObject* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TextDiagramObject_text(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TextDiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { element->text = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -24,27 +27,26 @@ bool assign_TextDiagramObject_text(std::stringstream &buffer, BaseClass* BaseCla return false; } -namespace CIMPP { - BaseClass* TextDiagramObject_factory() { - return new TextDiagramObject; - } + + +const char TextDiagramObject::debugName[] = "TextDiagramObject"; +const char* TextDiagramObject::debugString() const +{ + return TextDiagramObject::debugName; } -void TextDiagramObject::addConstructToMap(std::unordered_map& factory_map) { +void TextDiagramObject::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TextDiagramObject"), &TextDiagramObject_factory)); } -void TextDiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TextDiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TextDiagramObject.text"), &assign_TextDiagramObject_text)); } -void TextDiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char TextDiagramObject::debugName[] = "TextDiagramObject"; -const char* TextDiagramObject::debugString() +void TextDiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TextDiagramObject::debugName; } const BaseClassDefiner TextDiagramObject::declare() @@ -52,4 +54,10 @@ const BaseClassDefiner TextDiagramObject::declare() return BaseClassDefiner(TextDiagramObject::addConstructToMap, TextDiagramObject::addPrimitiveAssignFnsToMap, TextDiagramObject::addClassAssignFnsToMap, TextDiagramObject::debugName); } - +namespace CIMPP +{ + BaseClass* TextDiagramObject_factory() + { + return new TextDiagramObject; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TextDiagramObject.hpp b/CGMES_2.4.15_16FEB2016/TextDiagramObject.hpp index 2e7c4c272..a683f51d4 100644 --- a/CGMES_2.4.15_16FEB2016/TextDiagramObject.hpp +++ b/CGMES_2.4.15_16FEB2016/TextDiagramObject.hpp @@ -1,38 +1,39 @@ #ifndef TextDiagramObject_H #define TextDiagramObject_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiagramObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiagramObject.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A diagram object for placing free-text or text derived from an associated domain object. */ - class TextDiagramObject: public DiagramObject + class TextDiagramObject : public DiagramObject { - public: - CIMPP::String text; /* The text that is displayed by this text diagram object. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TextDiagramObject(); - virtual ~TextDiagramObject(); - + ~TextDiagramObject() override; + + CIMPP::String text; /* The text that is displayed by this text diagram object. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TextDiagramObject_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.cpp index b99b3b9f5..976f64b7b 100644 --- a/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.cpp @@ -1,49 +1,56 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ThermalGeneratingUnit.hpp" +#include +#include + #include "FossilFuel.hpp" using namespace CIMPP; ThermalGeneratingUnit::ThermalGeneratingUnit() {}; - ThermalGeneratingUnit::~ThermalGeneratingUnit() {}; -bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ThermalGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->FossilFuels.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_FossilFuel_ThermalGeneratingUnit(BaseClass*, BaseClass*); +bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ThermalGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + FossilFuel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->FossilFuels.begin(), element->FossilFuels.end(), element2) == element->FossilFuels.end()) + { + element->FossilFuels.push_back(element2); + return assign_FossilFuel_ThermalGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* ThermalGeneratingUnit_factory() { - return new ThermalGeneratingUnit; - } +const char ThermalGeneratingUnit::debugName[] = "ThermalGeneratingUnit"; +const char* ThermalGeneratingUnit::debugString() const +{ + return ThermalGeneratingUnit::debugName; } -void ThermalGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void ThermalGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ThermalGeneratingUnit"), &ThermalGeneratingUnit_factory)); } -void ThermalGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ThermalGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ThermalGeneratingUnit.FossilFuels"), &assign_ThermalGeneratingUnit_FossilFuels)); +void ThermalGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ThermalGeneratingUnit::debugName[] = "ThermalGeneratingUnit"; -const char* ThermalGeneratingUnit::debugString() +void ThermalGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ThermalGeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:ThermalGeneratingUnit.FossilFuels"), &assign_ThermalGeneratingUnit_FossilFuels)); } const BaseClassDefiner ThermalGeneratingUnit::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner ThermalGeneratingUnit::declare() return BaseClassDefiner(ThermalGeneratingUnit::addConstructToMap, ThermalGeneratingUnit::addPrimitiveAssignFnsToMap, ThermalGeneratingUnit::addClassAssignFnsToMap, ThermalGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* ThermalGeneratingUnit_factory() + { + return new ThermalGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.hpp index db6b51ce3..ea4d6ff7c 100644 --- a/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/ThermalGeneratingUnit.hpp @@ -1,38 +1,39 @@ #ifndef ThermalGeneratingUnit_H #define ThermalGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class FossilFuel; -class FossilFuel; /* A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine. */ - class ThermalGeneratingUnit: public GeneratingUnit + class ThermalGeneratingUnit : public GeneratingUnit { - public: - std::list FossilFuels; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ThermalGeneratingUnit(); - virtual ~ThermalGeneratingUnit(); - + ~ThermalGeneratingUnit() override; + + std::list FossilFuels; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ThermalGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TieFlow.cpp b/CGMES_2.4.15_16FEB2016/TieFlow.cpp index 8a3acedb0..f7f2139c5 100644 --- a/CGMES_2.4.15_16FEB2016/TieFlow.cpp +++ b/CGMES_2.4.15_16FEB2016/TieFlow.cpp @@ -1,77 +1,92 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TieFlow.hpp" -#include "Boolean.hpp" -#include "Terminal.hpp" +#include +#include + #include "ControlArea.hpp" +#include "Terminal.hpp" +#include "Boolean.hpp" using namespace CIMPP; -TieFlow::TieFlow(): Terminal(nullptr), ControlArea(nullptr) {}; - +TieFlow::TieFlow() : ControlArea(nullptr), Terminal(nullptr) {}; TieFlow::~TieFlow() {}; -bool assign_Terminal_TieFlow(BaseClass*, BaseClass*); -bool assign_TieFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TieFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_TieFlow(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_ControlArea_TieFlow(BaseClass*, BaseClass*); -bool assign_TieFlow_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TieFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->ControlArea = dynamic_cast(BaseClass_ptr2); - if(element->ControlArea != nullptr) - return assign_ControlArea_TieFlow(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TieFlow_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TieFlow* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveFlowIn; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_TieFlow_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TieFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveFlowIn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ControlArea_TieFlow(BaseClass*, BaseClass*); +bool assign_TieFlow_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TieFlow* element = dynamic_cast(BaseClass_ptr1); + ControlArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ControlArea != element2) + { + element->ControlArea = element2; + return assign_ControlArea_TieFlow(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_Terminal_TieFlow(BaseClass*, BaseClass*); +bool assign_TieFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TieFlow* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_TieFlow(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* TieFlow_factory() { - return new TieFlow; - } +const char TieFlow::debugName[] = "TieFlow"; +const char* TieFlow::debugString() const +{ + return TieFlow::debugName; } -void TieFlow::addConstructToMap(std::unordered_map& factory_map) { +void TieFlow::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TieFlow"), &TieFlow_factory)); } -void TieFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TieFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TieFlow.positiveFlowIn"), &assign_TieFlow_positiveFlowIn)); - } - -void TieFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TieFlow.Terminal"), &assign_TieFlow_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:TieFlow.ControlArea"), &assign_TieFlow_ControlArea)); } -const char TieFlow::debugName[] = "TieFlow"; -const char* TieFlow::debugString() +void TieFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TieFlow::debugName; + assign_map.insert(std::make_pair(std::string("cim:TieFlow.ControlArea"), &assign_TieFlow_ControlArea)); + assign_map.insert(std::make_pair(std::string("cim:TieFlow.Terminal"), &assign_TieFlow_Terminal)); } const BaseClassDefiner TieFlow::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner TieFlow::declare() return BaseClassDefiner(TieFlow::addConstructToMap, TieFlow::addPrimitiveAssignFnsToMap, TieFlow::addClassAssignFnsToMap, TieFlow::debugName); } - +namespace CIMPP +{ + BaseClass* TieFlow_factory() + { + return new TieFlow; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TieFlow.hpp b/CGMES_2.4.15_16FEB2016/TieFlow.hpp index d6cd96180..2e02b52d2 100644 --- a/CGMES_2.4.15_16FEB2016/TieFlow.hpp +++ b/CGMES_2.4.15_16FEB2016/TieFlow.hpp @@ -1,42 +1,43 @@ #ifndef TieFlow_H #define TieFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ControlArea; + class Terminal; -class Terminal; -class ControlArea; /* A flow specification in terms of location and direction for a control area. */ - class TieFlow: public BaseClass + class TieFlow : public BaseClass { - public: - CIMPP::Boolean positiveFlowIn; /* True if the flow into the terminal (load convention) is also flow into the control area. For example, this attribute should be true if using the tie line terminal further away from the control area. For example to represent a tie to a shunt component (like a load or generator) in another area, this is the near end of a branch and this attribute would be specified as false. Default: false */ - CIMPP::Terminal* Terminal; /* The terminal to which this tie flow belongs. Default: 0 */ - CIMPP::ControlArea* ControlArea; /* The control area of the tie flows. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TieFlow(); - virtual ~TieFlow(); - + ~TieFlow() override; + + CIMPP::ControlArea* ControlArea; /* The control area of the tie flows. Default: 0 */ + CIMPP::Terminal* Terminal; /* The terminal to which this tie flow belongs. Default: 0 */ + CIMPP::Boolean positiveFlowIn; /* True if the flow into the terminal (load convention) is also flow into the control area. For example, this attribute should be true if using the tie line terminal further away from the control area. For example to represent a tie to a shunt component (like a load or generator) in another area, this is the near end of a branch and this attribute would be specified as false. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TieFlow_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TopologicalIsland.cpp b/CGMES_2.4.15_16FEB2016/TopologicalIsland.cpp index baf70c708..8ee4fba25 100644 --- a/CGMES_2.4.15_16FEB2016/TopologicalIsland.cpp +++ b/CGMES_2.4.15_16FEB2016/TopologicalIsland.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologicalIsland.hpp" +#include +#include + #include "TopologicalNode.hpp" #include "TopologicalNode.hpp" using namespace CIMPP; -TopologicalIsland::TopologicalIsland(): AngleRefTopologicalNode(nullptr) {}; - +TopologicalIsland::TopologicalIsland() : AngleRefTopologicalNode(nullptr) {}; TopologicalIsland::~TopologicalIsland() {}; + + + bool assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass*, BaseClass*); -bool assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalIsland* element = dynamic_cast(BaseClass_ptr1)) { - element->AngleRefTopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->AngleRefTopologicalNode != nullptr) - return assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalIsland* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AngleRefTopologicalNode != element2) + { + element->AngleRefTopologicalNode = element2; + return assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TopologicalIsland_TopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalIsland* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_TopologicalIsland(BaseClass*, BaseClass*); +bool assign_TopologicalIsland_TopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalIsland* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNodes.begin(), element->TopologicalNodes.end(), element2) == element->TopologicalNodes.end()) + { + element->TopologicalNodes.push_back(element2); + return assign_TopologicalNode_TopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* TopologicalIsland_factory() { - return new TopologicalIsland; - } +const char TopologicalIsland::debugName[] = "TopologicalIsland"; +const char* TopologicalIsland::debugString() const +{ + return TopologicalIsland::debugName; } -void TopologicalIsland::addConstructToMap(std::unordered_map& factory_map) { +void TopologicalIsland::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologicalIsland"), &TopologicalIsland_factory)); } -void TopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void TopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.AngleRefTopologicalNode"), &assign_TopologicalIsland_AngleRefTopologicalNode)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.TopologicalNodes"), &assign_TopologicalIsland_TopologicalNodes)); +void TopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TopologicalIsland::debugName[] = "TopologicalIsland"; -const char* TopologicalIsland::debugString() +void TopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TopologicalIsland::debugName; + assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.AngleRefTopologicalNode"), &assign_TopologicalIsland_AngleRefTopologicalNode)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.TopologicalNodes"), &assign_TopologicalIsland_TopologicalNodes)); } const BaseClassDefiner TopologicalIsland::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner TopologicalIsland::declare() return BaseClassDefiner(TopologicalIsland::addConstructToMap, TopologicalIsland::addPrimitiveAssignFnsToMap, TopologicalIsland::addClassAssignFnsToMap, TopologicalIsland::debugName); } - +namespace CIMPP +{ + BaseClass* TopologicalIsland_factory() + { + return new TopologicalIsland; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TopologicalIsland.hpp b/CGMES_2.4.15_16FEB2016/TopologicalIsland.hpp index 74cbc0821..8ddaccfbc 100644 --- a/CGMES_2.4.15_16FEB2016/TopologicalIsland.hpp +++ b/CGMES_2.4.15_16FEB2016/TopologicalIsland.hpp @@ -1,39 +1,40 @@ #ifndef TopologicalIsland_H #define TopologicalIsland_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TopologicalNode; -class TopologicalNode; /* An electrically connected subset of the network. Topological islands can change as the current network state changes: e.g. due to - disconnect switches or breakers change state in a SCADA/EMS - manual creation, change or deletion of topological nodes in a planning tool. */ - class TopologicalIsland: public IdentifiedObject + class TopologicalIsland : public IdentifiedObject { - public: - CIMPP::TopologicalNode* AngleRefTopologicalNode; /* The angle reference for the island. Normally there is one TopologicalNode that is selected as the angle reference for each island. Other reference schemes exist, so the association is typically optional. Default: 0 */ - std::list TopologicalNodes; /* A topological node belongs to a topological island. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologicalIsland(); - virtual ~TopologicalIsland(); - + ~TopologicalIsland() override; + + CIMPP::TopologicalNode* AngleRefTopologicalNode; /* The angle reference for the island. Normally there is one TopologicalNode that is selected as the angle reference for each island. Other reference schemes exist, so the association is typically optional. Default: 0 */ + std::list TopologicalNodes; /* A topological node belongs to a topological island. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologicalIsland_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TopologicalNode.cpp b/CGMES_2.4.15_16FEB2016/TopologicalNode.cpp index 1ee674f68..6d4835b56 100644 --- a/CGMES_2.4.15_16FEB2016/TopologicalNode.cpp +++ b/CGMES_2.4.15_16FEB2016/TopologicalNode.cpp @@ -1,10 +1,20 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologicalNode.hpp" +#include +#include + +#include "TopologicalIsland.hpp" #include "BaseVoltage.hpp" -#include "ConnectivityNode.hpp" #include "ConnectivityNodeContainer.hpp" +#include "ConnectivityNode.hpp" +#include "ReportingGroup.hpp" +#include "SvInjection.hpp" +#include "SvVoltage.hpp" +#include "Terminal.hpp" +#include "TopologicalIsland.hpp" #include "Boolean.hpp" #include "String.hpp" #include "String.hpp" @@ -12,49 +22,14 @@ #include "String.hpp" #include "String.hpp" #include "String.hpp" -#include "SvInjection.hpp" -#include "SvVoltage.hpp" -#include "TopologicalIsland.hpp" -#include "TopologicalIsland.hpp" -#include "ReportingGroup.hpp" -#include "Terminal.hpp" using namespace CIMPP; -TopologicalNode::TopologicalNode(): BaseVoltage(nullptr), ConnectivityNodeContainer(nullptr), SvInjection(nullptr), SvVoltage(nullptr), AngleRefTopologicalIsland(nullptr), TopologicalIsland(nullptr), ReportingGroup(nullptr) {}; - +TopologicalNode::TopologicalNode() : AngleRefTopologicalIsland(nullptr), BaseVoltage(nullptr), ConnectivityNodeContainer(nullptr), ReportingGroup(nullptr), SvInjection(nullptr), SvVoltage(nullptr), TopologicalIsland(nullptr) {}; TopologicalNode::~TopologicalNode() {}; -bool assign_BaseVoltage_TopologicalNode(BaseClass*, BaseClass*); -bool assign_TopologicalNode_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TopologicalNode_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConnectivityNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; - } - } - return false; -} -bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass*, BaseClass*); -bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->ConnectivityNodeContainer = dynamic_cast(BaseClass_ptr2); - if(element->ConnectivityNodeContainer != nullptr) - return assign_ConnectivityNodeContainer_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} @@ -63,82 +38,25 @@ bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, -bool assign_TopologicalNode_SvInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->SvInjection = dynamic_cast(BaseClass_ptr2); - if(element->SvInjection != nullptr) - return true; - } - return false; -} - -bool assign_TopologicalNode_SvVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->SvVoltage = dynamic_cast(BaseClass_ptr2); - if(element->SvVoltage != nullptr) - return true; - } - return false; -} - -bool assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->AngleRefTopologicalIsland = dynamic_cast(BaseClass_ptr2); - if(element->AngleRefTopologicalIsland != nullptr) - return true; - } - return false; -} - -bool assign_TopologicalNode_TopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalIsland = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalIsland != nullptr) - return true; - } - return false; -} - -bool assign_ReportingGroup_TopologicalNode(BaseClass*, BaseClass*); -bool assign_TopologicalNode_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->ReportingGroup = dynamic_cast(BaseClass_ptr2); - if(element->ReportingGroup != nullptr) - return assign_ReportingGroup_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TopologicalNode_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminal.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TopologicalNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->boundaryPoint; + if (buffer.fail()) + return false; + else return true; - } } return false; } - - - - -bool assign_TopologicalNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->boundaryPoint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TopologicalNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -146,10 +64,12 @@ bool assign_TopologicalNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* return false; } -bool assign_TopologicalNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -157,10 +77,12 @@ bool assign_TopologicalNode_fromEndName(std::stringstream &buffer, BaseClass* Ba return false; } -bool assign_TopologicalNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -168,10 +90,12 @@ bool assign_TopologicalNode_fromEndNameTso(std::stringstream &buffer, BaseClass* return false; } -bool assign_TopologicalNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -179,10 +103,12 @@ bool assign_TopologicalNode_toEndIsoCode(std::stringstream &buffer, BaseClass* B return false; } -bool assign_TopologicalNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -190,10 +116,12 @@ bool assign_TopologicalNode_toEndName(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_TopologicalNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -202,47 +130,199 @@ bool assign_TopologicalNode_toEndNameTso(std::stringstream &buffer, BaseClass* B } +bool assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + TopologicalIsland* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AngleRefTopologicalIsland != element2) + { + element->AngleRefTopologicalIsland = element2; + return assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_BaseVoltage_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNodeContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConnectivityNodeContainer != element2) + { + element->ConnectivityNodeContainer = element2; + return assign_ConnectivityNodeContainer_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_ConnectivityNode_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConnectivityNodes.begin(), element->ConnectivityNodes.end(), element2) == element->ConnectivityNodes.end()) + { + element->ConnectivityNodes.push_back(element2); + return assign_ConnectivityNode_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_ReportingGroup_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + ReportingGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ReportingGroup != element2) + { + element->ReportingGroup = element2; + return assign_ReportingGroup_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* TopologicalNode_factory() { - return new TopologicalNode; +bool assign_SvInjection_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_SvInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + SvInjection* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvInjection != element2) + { + element->SvInjection = element2; + return assign_SvInjection_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_SvVoltage_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_SvVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + SvVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvVoltage != element2) + { + element->SvVoltage = element2; + return assign_SvVoltage_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TopologicalNode::addConstructToMap(std::unordered_map& factory_map) { +bool assign_Terminal_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminal.begin(), element->Terminal.end(), element2) == element->Terminal.end()) + { + element->Terminal.push_back(element2); + return assign_Terminal_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TopologicalIsland_TopologicalNodes(BaseClass*, BaseClass*); +bool assign_TopologicalNode_TopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + TopologicalIsland* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalIsland != element2) + { + element->TopologicalIsland = element2; + return assign_TopologicalIsland_TopologicalNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + + + +const char TopologicalNode::debugName[] = "TopologicalNode"; +const char* TopologicalNode::debugString() const +{ + return TopologicalNode::debugName; +} + +void TopologicalNode::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologicalNode"), &TopologicalNode_factory)); } -void TopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.boundaryPoint"), &assign_TopologicalNode_boundaryPoint)); +void TopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.boundaryPoint"), &assign_TopologicalNode_boundaryPoint)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.fromEndIsoCode"), &assign_TopologicalNode_fromEndIsoCode)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.fromEndName"), &assign_TopologicalNode_fromEndName)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.fromEndNameTso"), &assign_TopologicalNode_fromEndNameTso)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.toEndIsoCode"), &assign_TopologicalNode_toEndIsoCode)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.toEndName"), &assign_TopologicalNode_toEndName)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.toEndNameTso"), &assign_TopologicalNode_toEndNameTso)); - } +} -void TopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void TopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.AngleRefTopologicalIsland"), &assign_TopologicalNode_AngleRefTopologicalIsland)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.BaseVoltage"), &assign_TopologicalNode_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ConnectivityNodes"), &assign_TopologicalNode_ConnectivityNodes)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ConnectivityNodeContainer"), &assign_TopologicalNode_ConnectivityNodeContainer)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvInjection"), &assign_TopologicalNode_SvInjection)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvVoltage"), &assign_TopologicalNode_SvVoltage)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.AngleRefTopologicalIsland"), &assign_TopologicalNode_AngleRefTopologicalIsland)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.TopologicalIsland"), &assign_TopologicalNode_TopologicalIsland)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ConnectivityNodes"), &assign_TopologicalNode_ConnectivityNodes)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ReportingGroup"), &assign_TopologicalNode_ReportingGroup)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvInjection"), &assign_TopologicalNode_SvInjection)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvVoltage"), &assign_TopologicalNode_SvVoltage)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.Terminal"), &assign_TopologicalNode_Terminal)); -} - -const char TopologicalNode::debugName[] = "TopologicalNode"; -const char* TopologicalNode::debugString() -{ - return TopologicalNode::debugName; + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.TopologicalIsland"), &assign_TopologicalNode_TopologicalIsland)); } const BaseClassDefiner TopologicalNode::declare() @@ -250,4 +330,10 @@ const BaseClassDefiner TopologicalNode::declare() return BaseClassDefiner(TopologicalNode::addConstructToMap, TopologicalNode::addPrimitiveAssignFnsToMap, TopologicalNode::addClassAssignFnsToMap, TopologicalNode::debugName); } - +namespace CIMPP +{ + BaseClass* TopologicalNode_factory() + { + return new TopologicalNode; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TopologicalNode.hpp b/CGMES_2.4.15_16FEB2016/TopologicalNode.hpp index baed98831..035d4035d 100644 --- a/CGMES_2.4.15_16FEB2016/TopologicalNode.hpp +++ b/CGMES_2.4.15_16FEB2016/TopologicalNode.hpp @@ -1,62 +1,63 @@ #ifndef TopologicalNode_H #define TopologicalNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "String.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class BaseVoltage; + class ConnectivityNode; + class ConnectivityNodeContainer; + class ReportingGroup; + class SvInjection; + class SvVoltage; + class Terminal; + class TopologicalIsland; -class BaseVoltage; -class ConnectivityNode; -class ConnectivityNodeContainer; -class SvInjection; -class SvVoltage; -class TopologicalIsland; -class ReportingGroup; -class Terminal; /* For a detailed substation model a topological node is a set of connectivity nodes that, in the current network state, are connected together through any type of closed switches, including jumpers. Topological nodes change as the current network state changes (i.e., switches, breakers, etc. change state). For a planning model, switch statuses are not used to form topological nodes. Instead they are manually created or deleted in a model builder tool. Topological nodes maintained this way are also called "busses". */ - class TopologicalNode: public IdentifiedObject + class TopologicalNode : public IdentifiedObject { - public: - CIMPP::BaseVoltage* BaseVoltage; /* The base voltage of the topologocial node. Default: 0 */ - std::list ConnectivityNodes; /* The connectivity nodes combine together to form this topological node. May depend on the current state of switches in the network. Default: 0 */ - CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* The connectivity node container to which the toplogical node belongs. Default: 0 */ - CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ - CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::SvInjection* SvInjection; /* The topological node associated with the flow injection state variable. Default: 0 */ - CIMPP::SvVoltage* SvVoltage; /* The topological node associated with the voltage state. Default: 0 */ - CIMPP::TopologicalIsland* AngleRefTopologicalIsland; /* The island for which the node is an angle reference. Normally there is one angle reference node for each island. Default: 0 */ - CIMPP::TopologicalIsland* TopologicalIsland; /* A topological node belongs to a topological island. Default: 0 */ - CIMPP::ReportingGroup* ReportingGroup; /* The topological nodes that belong to the reporting group. Default: 0 */ - std::list Terminal; /* The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connectivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologicalNode(); - virtual ~TopologicalNode(); - + ~TopologicalNode() override; + + CIMPP::TopologicalIsland* AngleRefTopologicalIsland; /* The island for which the node is an angle reference. Normally there is one angle reference node for each island. Default: 0 */ + CIMPP::BaseVoltage* BaseVoltage; /* The base voltage of the topologocial node. Default: 0 */ + CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* The connectivity node container to which the toplogical node belongs. Default: 0 */ + std::list ConnectivityNodes; /* The connectivity nodes combine together to form this topological node. May depend on the current state of switches in the network. Default: 0 */ + CIMPP::ReportingGroup* ReportingGroup; /* The topological nodes that belong to the reporting group. Default: 0 */ + CIMPP::SvInjection* SvInjection; /* The topological node associated with the flow injection state variable. Default: 0 */ + CIMPP::SvVoltage* SvVoltage; /* The topological node associated with the voltage state. Default: 0 */ + std::list Terminal; /* The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connectivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ + CIMPP::TopologicalIsland* TopologicalIsland; /* A topological node belongs to a topological island. Default: 0 */ + CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ + CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologicalNode_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.cpp b/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.cpp index 5ceb28277..d0cfdd217 100644 --- a/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologyBoundaryVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -TopologyBoundaryVersion::TopologyBoundaryVersion(): date(nullptr) {}; - +TopologyBoundaryVersion::TopologyBoundaryVersion() {}; TopologyBoundaryVersion::~TopologyBoundaryVersion() {}; - - -bool assign_TopologyBoundaryVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_TopologyBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_TopologyBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass return false; } -bool assign_TopologyBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_TopologyBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass return false; } +bool assign_TopologyBoundaryVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologyBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_TopologyBoundaryVersion_differenceModelURI(std::stringstream &buffer return false; } -bool assign_TopologyBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_TopologyBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseCla return false; } -bool assign_TopologyBoundaryVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_TopologyBoundaryVersion_entsoeURI(std::stringstream &buffer, BaseCla return false; } -bool assign_TopologyBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_TopologyBoundaryVersion_modelDescriptionURI(std::stringstream &buffe return false; } -bool assign_TopologyBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_TopologyBoundaryVersion_namespaceRDF(std::stringstream &buffer, Base return false; } -bool assign_TopologyBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_TopologyBoundaryVersion_namespaceUML(std::stringstream &buffer, Base return false; } -bool assign_TopologyBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_TopologyBoundaryVersion_shortName(std::stringstream &buffer, BaseCla return false; } -namespace CIMPP { - BaseClass* TopologyBoundaryVersion_factory() { - return new TopologyBoundaryVersion; - } + + + + + + + + + + + +const char TopologyBoundaryVersion::debugName[] = "TopologyBoundaryVersion"; +const char* TopologyBoundaryVersion::debugString() const +{ + return TopologyBoundaryVersion::debugName; } -void TopologyBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) { +void TopologyBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion"), &TopologyBoundaryVersion_factory)); } -void TopologyBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TopologyBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.baseUML"), &assign_TopologyBoundaryVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.baseURI"), &assign_TopologyBoundaryVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.differenceModelURI"), &assign_TopologyBoundaryVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.date"), &assign_TopologyBoundaryVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.differenceModelURI"), &assign_TopologyBoundaryVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.entsoeUML"), &assign_TopologyBoundaryVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.entsoeURI"), &assign_TopologyBoundaryVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.modelDescriptionURI"), &assign_TopologyBoundaryVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void TopologyBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.date"), &assign_TopologyBoundaryVersion_date)); - } - -const char TopologyBoundaryVersion::debugName[] = "TopologyBoundaryVersion"; -const char* TopologyBoundaryVersion::debugString() +void TopologyBoundaryVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TopologyBoundaryVersion::debugName; } const BaseClassDefiner TopologyBoundaryVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner TopologyBoundaryVersion::declare() return BaseClassDefiner(TopologyBoundaryVersion::addConstructToMap, TopologyBoundaryVersion::addPrimitiveAssignFnsToMap, TopologyBoundaryVersion::addClassAssignFnsToMap, TopologyBoundaryVersion::debugName); } - +namespace CIMPP +{ + BaseClass* TopologyBoundaryVersion_factory() + { + return new TopologyBoundaryVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.hpp b/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.hpp index 2dee1c50c..be3ffc37c 100644 --- a/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/TopologyBoundaryVersion.hpp @@ -1,48 +1,49 @@ #ifndef TopologyBoundaryVersion_H #define TopologyBoundaryVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class TopologyBoundaryVersion: public BaseClass + class TopologyBoundaryVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/TopologyBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologyBoundaryVersion(); - virtual ~TopologyBoundaryVersion(); - + ~TopologyBoundaryVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/TopologyBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologyBoundaryVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TopologyVersion.cpp b/CGMES_2.4.15_16FEB2016/TopologyVersion.cpp index cc87973a1..3e90c1136 100644 --- a/CGMES_2.4.15_16FEB2016/TopologyVersion.cpp +++ b/CGMES_2.4.15_16FEB2016/TopologyVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologyVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -TopologyVersion::TopologyVersion(): date(nullptr) {}; - +TopologyVersion::TopologyVersion() {}; TopologyVersion::~TopologyVersion() {}; - - -bool assign_TopologyVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_TopologyVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_TopologyVersion_baseUML(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_TopologyVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_TopologyVersion_baseURI(std::stringstream &buffer, BaseClass* BaseCl return false; } +bool assign_TopologyVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologyVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_TopologyVersion_differenceModelURI(std::stringstream &buffer, BaseCl return false; } -bool assign_TopologyVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_TopologyVersion_entsoeUML(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_TopologyVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_TopologyVersion_entsoeURI(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_TopologyVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_TopologyVersion_modelDescriptionURI(std::stringstream &buffer, BaseC return false; } -bool assign_TopologyVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_TopologyVersion_namespaceRDF(std::stringstream &buffer, BaseClass* B return false; } -bool assign_TopologyVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_TopologyVersion_namespaceUML(std::stringstream &buffer, BaseClass* B return false; } -bool assign_TopologyVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_TopologyVersion_shortName(std::stringstream &buffer, BaseClass* Base return false; } -namespace CIMPP { - BaseClass* TopologyVersion_factory() { - return new TopologyVersion; - } + + + + + + + + + + + +const char TopologyVersion::debugName[] = "TopologyVersion"; +const char* TopologyVersion::debugString() const +{ + return TopologyVersion::debugName; } -void TopologyVersion::addConstructToMap(std::unordered_map& factory_map) { +void TopologyVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologyVersion"), &TopologyVersion_factory)); } -void TopologyVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TopologyVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.baseUML"), &assign_TopologyVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.baseURI"), &assign_TopologyVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.differenceModelURI"), &assign_TopologyVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.date"), &assign_TopologyVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.differenceModelURI"), &assign_TopologyVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.entsoeUML"), &assign_TopologyVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.entsoeURI"), &assign_TopologyVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.modelDescriptionURI"), &assign_TopologyVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void TopologyVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.date"), &assign_TopologyVersion_date)); - } - -const char TopologyVersion::debugName[] = "TopologyVersion"; -const char* TopologyVersion::debugString() +void TopologyVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TopologyVersion::debugName; } const BaseClassDefiner TopologyVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner TopologyVersion::declare() return BaseClassDefiner(TopologyVersion::addConstructToMap, TopologyVersion::addPrimitiveAssignFnsToMap, TopologyVersion::addClassAssignFnsToMap, TopologyVersion::debugName); } - +namespace CIMPP +{ + BaseClass* TopologyVersion_factory() + { + return new TopologyVersion; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TopologyVersion.hpp b/CGMES_2.4.15_16FEB2016/TopologyVersion.hpp index 179768214..4727fb972 100644 --- a/CGMES_2.4.15_16FEB2016/TopologyVersion.hpp +++ b/CGMES_2.4.15_16FEB2016/TopologyVersion.hpp @@ -1,48 +1,49 @@ #ifndef TopologyVersion_H #define TopologyVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class TopologyVersion: public BaseClass + class TopologyVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Topology/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologyVersion(); - virtual ~TopologyVersion(); - + ~TopologyVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Topology/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologyVersion_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TransformerControlMode.cpp b/CGMES_2.4.15_16FEB2016/TransformerControlMode.cpp index 8b62218ec..3f49e0952 100644 --- a/CGMES_2.4.15_16FEB2016/TransformerControlMode.cpp +++ b/CGMES_2.4.15_16FEB2016/TransformerControlMode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TransformerControlMode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::TransformerControlMode& rop) +TransformerControlMode& TransformerControlMode::operator=(TransformerControlMode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +TransformerControlMode::operator TransformerControlMode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char TransformerControlMode::debugName[] = "TransformerControlMode"; +const char* TransformerControlMode::debugString() const +{ + return TransformerControlMode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, TransformerControlMode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const TransformerControlMode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == TransformerControlMode::volt) + { + EnumSymbol = "volt"; + } + if (obj.value == TransformerControlMode::reactive) + { + EnumSymbol = "reactive"; + } + + if (!EnumSymbol.empty()) + { + os << "TransformerControlMode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TransformerControlMode.hpp b/CGMES_2.4.15_16FEB2016/TransformerControlMode.hpp index 934a803c8..563b222e5 100644 --- a/CGMES_2.4.15_16FEB2016/TransformerControlMode.hpp +++ b/CGMES_2.4.15_16FEB2016/TransformerControlMode.hpp @@ -1,21 +1,46 @@ #ifndef TransformerControlMode_H #define TransformerControlMode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Control modes for a transformer. */ - enum class TransformerControlMode + class TransformerControlMode { - /** - * Voltage control - */ - volt, - /** - * Reactive power flow control - */ - reactive, + public: + enum TransformerControlMode_ENUM + { + /** + * Voltage control + */ + volt, + /** + * Reactive power flow control + */ + reactive, + }; + + TransformerControlMode() : value(), initialized(false) {} + TransformerControlMode(TransformerControlMode_ENUM value) : value(value), initialized(true) {} + + TransformerControlMode& operator=(TransformerControlMode_ENUM rop); + operator TransformerControlMode_ENUM() const; + + TransformerControlMode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, TransformerControlMode& rop); + friend std::ostream& operator<<(std::ostream& os, const TransformerControlMode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::TransformerControlMode& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/TransformerEnd.cpp b/CGMES_2.4.15_16FEB2016/TransformerEnd.cpp index a4f98d3b1..241deae09 100644 --- a/CGMES_2.4.15_16FEB2016/TransformerEnd.cpp +++ b/CGMES_2.4.15_16FEB2016/TransformerEnd.cpp @@ -1,146 +1,180 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TransformerEnd.hpp" -#include "Integer.hpp" +#include +#include + #include "BaseVoltage.hpp" -#include "Terminal.hpp" #include "PhaseTapChanger.hpp" #include "RatioTapChanger.hpp" -#include "Resistance.hpp" +#include "Terminal.hpp" +#include "Integer.hpp" #include "Boolean.hpp" +#include "Resistance.hpp" #include "Reactance.hpp" using namespace CIMPP; -TransformerEnd::TransformerEnd(): BaseVoltage(nullptr), Terminal(nullptr), PhaseTapChanger(nullptr), RatioTapChanger(nullptr) {}; - +TransformerEnd::TransformerEnd() : BaseVoltage(nullptr), PhaseTapChanger(nullptr), RatioTapChanger(nullptr), Terminal(nullptr) {}; TransformerEnd::~TransformerEnd() {}; -bool assign_BaseVoltage_TransformerEnds(BaseClass*, BaseClass*); -bool assign_TransformerEnd_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_TransformerEnds(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_Terminal_TransformerEnd(BaseClass*, BaseClass*); -bool assign_TransformerEnd_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_TransformerEnd_PhaseTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->PhaseTapChanger = dynamic_cast(BaseClass_ptr2); - if(element->PhaseTapChanger != nullptr) - return true; - } - return false; -} -bool assign_TransformerEnd_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->RatioTapChanger = dynamic_cast(BaseClass_ptr2); - if(element->RatioTapChanger != nullptr) - return true; - } - return false; +bool assign_TransformerEnd_endNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->endNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_TransformerEnd_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->grounded; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TransformerEnd_rground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rground; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TransformerEnd_xground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xground; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TransformerEnd_endNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->endNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_BaseVoltage_TransformerEnds(BaseClass*, BaseClass*); +bool assign_TransformerEnd_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_TransformerEnds(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_PhaseTapChanger_TransformerEnd(BaseClass*, BaseClass*); +bool assign_TransformerEnd_PhaseTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PhaseTapChanger != element2) + { + element->PhaseTapChanger = element2; + return assign_PhaseTapChanger_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_RatioTapChanger_TransformerEnd(BaseClass*, BaseClass*); +bool assign_TransformerEnd_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + RatioTapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RatioTapChanger != element2) + { + element->RatioTapChanger = element2; + return assign_RatioTapChanger_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_Terminal_TransformerEnd(BaseClass*, BaseClass*); +bool assign_TransformerEnd_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_TransformerEnd_rground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rground; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TransformerEnd_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->grounded; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TransformerEnd_xground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xground; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* TransformerEnd_factory() { - return new TransformerEnd; - } +const char TransformerEnd::debugName[] = "TransformerEnd"; +const char* TransformerEnd::debugString() const +{ + return TransformerEnd::debugName; } -void TransformerEnd::addConstructToMap(std::unordered_map& factory_map) { +void TransformerEnd::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TransformerEnd"), &TransformerEnd_factory)); } -void TransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.endNumber"), &assign_TransformerEnd_endNumber)); - assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.rground"), &assign_TransformerEnd_rground)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.grounded"), &assign_TransformerEnd_grounded)); + assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.rground"), &assign_TransformerEnd_rground)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.xground"), &assign_TransformerEnd_xground)); } -void TransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.BaseVoltage"), &assign_TransformerEnd_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.Terminal"), &assign_TransformerEnd_Terminal)); +void TransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.BaseVoltage"), &assign_TransformerEnd_BaseVoltage)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.PhaseTapChanger"), &assign_TransformerEnd_PhaseTapChanger)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.RatioTapChanger"), &assign_TransformerEnd_RatioTapChanger)); - } - -const char TransformerEnd::debugName[] = "TransformerEnd"; -const char* TransformerEnd::debugString() -{ - return TransformerEnd::debugName; + assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.Terminal"), &assign_TransformerEnd_Terminal)); } const BaseClassDefiner TransformerEnd::declare() @@ -148,4 +182,10 @@ const BaseClassDefiner TransformerEnd::declare() return BaseClassDefiner(TransformerEnd::addConstructToMap, TransformerEnd::addPrimitiveAssignFnsToMap, TransformerEnd::addClassAssignFnsToMap, TransformerEnd::debugName); } - +namespace CIMPP +{ + BaseClass* TransformerEnd_factory() + { + return new TransformerEnd; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TransformerEnd.hpp b/CGMES_2.4.15_16FEB2016/TransformerEnd.hpp index 8d679ffb5..93516d326 100644 --- a/CGMES_2.4.15_16FEB2016/TransformerEnd.hpp +++ b/CGMES_2.4.15_16FEB2016/TransformerEnd.hpp @@ -1,52 +1,53 @@ #ifndef TransformerEnd_H #define TransformerEnd_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" -#include "Resistance.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "Integer.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class BaseVoltage; + class PhaseTapChanger; + class RatioTapChanger; + class Terminal; -class BaseVoltage; -class Terminal; -class PhaseTapChanger; -class RatioTapChanger; /* A conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose, but this class is more flexible because it associates to terminal but is not a specialization of ConductingEquipment. */ - class TransformerEnd: public IdentifiedObject + class TransformerEnd : public IdentifiedObject { - public: - CIMPP::Integer endNumber; /* Number for this transformer end, corresponding to the end`s order in the power transformer vector group or phase angle clock number. Highest voltage winding should be 1. Each end within a power transformer should have a unique subsequent end number. Note the transformer end number need not match the terminal sequence number. Default: 0 */ - CIMPP::BaseVoltage* BaseVoltage; /* Base voltage of the transformer end. This is essential for PU calculation. Default: 0 */ - CIMPP::Terminal* Terminal; /* Terminal of the power transformer to which this transformer end belongs. Default: 0 */ - CIMPP::PhaseTapChanger* PhaseTapChanger; /* Transformer end to which this phase tap changer belongs. Default: 0 */ - CIMPP::RatioTapChanger* RatioTapChanger; /* Transformer end to which this ratio tap changer belongs. Default: 0 */ - CIMPP::Resistance rground; /* (for Yn and Zn connections) Resistance part of neutral impedance where `grounded` is true. Default: nullptr */ - CIMPP::Boolean grounded; /* (for Yn and Zn connections) True if the neutral is solidly grounded. Default: false */ - CIMPP::Reactance xground; /* (for Yn and Zn connections) Reactive part of neutral impedance where `grounded` is true. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TransformerEnd(); - virtual ~TransformerEnd(); - + ~TransformerEnd() override; + + CIMPP::BaseVoltage* BaseVoltage; /* Base voltage of the transformer end. This is essential for PU calculation. Default: 0 */ + CIMPP::PhaseTapChanger* PhaseTapChanger; /* Transformer end to which this phase tap changer belongs. Default: 0 */ + CIMPP::RatioTapChanger* RatioTapChanger; /* Transformer end to which this ratio tap changer belongs. Default: 0 */ + CIMPP::Terminal* Terminal; /* Terminal of the power transformer to which this transformer end belongs. Default: 0 */ + CIMPP::Integer endNumber; /* Number for this transformer end, corresponding to the end`s order in the power transformer vector group or phase angle clock number. Highest voltage winding should be 1. Each end within a power transformer should have a unique subsequent end number. Note the transformer end number need not match the terminal sequence number. Default: 0 */ + CIMPP::Boolean grounded; /* (for Yn and Zn connections) True if the neutral is solidly grounded. Default: false */ + CIMPP::Resistance rground; /* (for Yn and Zn connections) Resistance part of neutral impedance where `grounded` is true. Default: nullptr */ + CIMPP::Reactance xground; /* (for Yn and Zn connections) Reactive part of neutral impedance where `grounded` is true. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TransformerEnd_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TurbLCFB1.cpp b/CGMES_2.4.15_16FEB2016/TurbLCFB1.cpp index ea541863b..b5c4049d7 100644 --- a/CGMES_2.4.15_16FEB2016/TurbLCFB1.cpp +++ b/CGMES_2.4.15_16FEB2016/TurbLCFB1.cpp @@ -1,216 +1,228 @@ -#include -#include "TurbineLoadControllerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbLCFB1.hpp" -#include "ActivePower.hpp" -#include "Boolean.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "ActivePower.hpp" #include "Boolean.hpp" +#include "ActivePower.hpp" #include "Boolean.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "ActivePower.hpp" using namespace CIMPP; TurbLCFB1::TurbLCFB1() {}; - TurbLCFB1::~TurbLCFB1() {}; +bool assign_TurbLCFB1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_fb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_irmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->irmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_pbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_pmwset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmwset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_speedReferenceGovernor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->speedReferenceGovernor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpelec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TurbLCFB1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TurbLCFB1_speedReferenceGovernor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->speedReferenceGovernor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TurbLCFB1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TurbLCFB1_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_fb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_pbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpelec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_irmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->irmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_pmwset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmwset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* TurbLCFB1_factory() { - return new TurbLCFB1; - } + + + + + + + + + +const char TurbLCFB1::debugName[] = "TurbLCFB1"; +const char* TurbLCFB1::debugString() const +{ + return TurbLCFB1::debugName; } -void TurbLCFB1::addConstructToMap(std::unordered_map& factory_map) { +void TurbLCFB1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbLCFB1"), &TurbLCFB1_factory)); } -void TurbLCFB1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.mwbase"), &assign_TurbLCFB1_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.speedReferenceGovernor"), &assign_TurbLCFB1_speedReferenceGovernor)); +void TurbLCFB1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.db"), &assign_TurbLCFB1_db)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.emax"), &assign_TurbLCFB1_emax)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.fb"), &assign_TurbLCFB1_fb)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.kp"), &assign_TurbLCFB1_kp)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.ki"), &assign_TurbLCFB1_ki)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.fbf"), &assign_TurbLCFB1_fbf)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.pbf"), &assign_TurbLCFB1_pbf)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.tpelec"), &assign_TurbLCFB1_tpelec)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.irmax"), &assign_TurbLCFB1_irmax)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.ki"), &assign_TurbLCFB1_ki)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.kp"), &assign_TurbLCFB1_kp)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.mwbase"), &assign_TurbLCFB1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.pbf"), &assign_TurbLCFB1_pbf)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.pmwset"), &assign_TurbLCFB1_pmwset)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.speedReferenceGovernor"), &assign_TurbLCFB1_speedReferenceGovernor)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.tpelec"), &assign_TurbLCFB1_tpelec)); } -void TurbLCFB1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char TurbLCFB1::debugName[] = "TurbLCFB1"; -const char* TurbLCFB1::debugString() +void TurbLCFB1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbLCFB1::debugName; } const BaseClassDefiner TurbLCFB1::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner TurbLCFB1::declare() return BaseClassDefiner(TurbLCFB1::addConstructToMap, TurbLCFB1::addPrimitiveAssignFnsToMap, TurbLCFB1::addClassAssignFnsToMap, TurbLCFB1::debugName); } - +namespace CIMPP +{ + BaseClass* TurbLCFB1_factory() + { + return new TurbLCFB1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TurbLCFB1.hpp b/CGMES_2.4.15_16FEB2016/TurbLCFB1.hpp index ab3d7a698..b1f382324 100644 --- a/CGMES_2.4.15_16FEB2016/TurbLCFB1.hpp +++ b/CGMES_2.4.15_16FEB2016/TurbLCFB1.hpp @@ -1,52 +1,53 @@ #ifndef TurbLCFB1_H #define TurbLCFB1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineLoadControllerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineLoadControllerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Turbine Load Controller model developed in the WECC. This model represents a supervisory turbine load controller that acts to maintain turbine power at a set value by continuous adjustment of the turbine governor speed-load reference. This model is intended to represent slow reset 'outer loop' controllers managing the action of the turbine governor. */ - class TurbLCFB1: public TurbineLoadControllerDynamics + class TurbLCFB1 : public TurbineLoadControllerDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Boolean speedReferenceGovernor; /* Type of turbine governor reference (Type). true = speed reference governor false = load reference governor. Typical Value = true. Default: false */ - CIMPP::PU db; /* Controller dead band (db). Typical Value = 0. Default: nullptr */ - CIMPP::PU emax; /* Maximum control error (Emax) (note 4). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU fb; /* Frequency bias gain (Fb). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean fbf; /* Frequency bias flag (Fbf). true = enable frequency bias false = disable frequency bias. Typical Value = false. Default: false */ - CIMPP::Boolean pbf; /* Power controller flag (Pbf). true = enable load controller false = disable load controller. Typical Value = false. Default: false */ - CIMPP::Seconds tpelec; /* Power transducer time constant (Tpelec). Typical Value = 0. Default: nullptr */ - CIMPP::PU irmax; /* Maximum turbine speed/load reference bias (Irmax) (note 3). Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower pmwset; /* Power controller setpoint (Pmwset) (note 1). Unit = MW. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbLCFB1(); - virtual ~TurbLCFB1(); - + ~TurbLCFB1() override; + + CIMPP::PU db; /* Controller dead band (db). Typical Value = 0. Default: nullptr */ + CIMPP::PU emax; /* Maximum control error (Emax) (note 4). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU fb; /* Frequency bias gain (Fb). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean fbf; /* Frequency bias flag (Fbf). true = enable frequency bias false = disable frequency bias. Typical Value = false. Default: false */ + CIMPP::PU irmax; /* Maximum turbine speed/load reference bias (Irmax) (note 3). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::Boolean pbf; /* Power controller flag (Pbf). true = enable load controller false = disable load controller. Typical Value = false. Default: false */ + CIMPP::ActivePower pmwset; /* Power controller setpoint (Pmwset) (note 1). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Boolean speedReferenceGovernor; /* Type of turbine governor reference (Type). true = speed reference governor false = load reference governor. Typical Value = true. Default: false */ + CIMPP::Seconds tpelec; /* Power transducer time constant (Tpelec). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbLCFB1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.cpp b/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.cpp index b40191d87..a2bf98e5c 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.cpp @@ -1,74 +1,96 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineGovernorDynamics.hpp" -#include "SynchronousMachineDynamics.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" +#include "SynchronousMachineDynamics.hpp" #include "TurbineLoadControllerDynamics.hpp" using namespace CIMPP; -TurbineGovernorDynamics::TurbineGovernorDynamics(): AsynchronousMachineDynamics(nullptr), TurbineLoadControllerDynamics(nullptr) {}; - +TurbineGovernorDynamics::TurbineGovernorDynamics() : AsynchronousMachineDynamics(nullptr), TurbineLoadControllerDynamics(nullptr) {}; TurbineGovernorDynamics::~TurbineGovernorDynamics() {}; -bool assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SynchronousMachineDynamics.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); +bool assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); -bool assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); +bool assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SynchronousMachineDynamics.begin(), element->SynchronousMachineDynamics.end(), element2) == element->SynchronousMachineDynamics.end()) + { + element->SynchronousMachineDynamics.push_back(element2); + return assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineLoadControllerDynamics = dynamic_cast(BaseClass_ptr2); - if(element->TurbineLoadControllerDynamics != nullptr) - return true; - } - return false; +bool assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); +bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineLoadControllerDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineLoadControllerDynamics != element2) + { + element->TurbineLoadControllerDynamics = element2; + return assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* TurbineGovernorDynamics_factory() { - return new TurbineGovernorDynamics; - } +const char TurbineGovernorDynamics::debugName[] = "TurbineGovernorDynamics"; +const char* TurbineGovernorDynamics::debugString() const +{ + return TurbineGovernorDynamics::debugName; } -void TurbineGovernorDynamics::addConstructToMap(std::unordered_map& factory_map) { +void TurbineGovernorDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics"), &TurbineGovernorDynamics_factory)); } -void TurbineGovernorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void TurbineGovernorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.SynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.AsynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_AsynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.TurbineLoadControllerDynamics"), &assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics)); +void TurbineGovernorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TurbineGovernorDynamics::debugName[] = "TurbineGovernorDynamics"; -const char* TurbineGovernorDynamics::debugString() +void TurbineGovernorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineGovernorDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.AsynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_AsynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.SynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_SynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.TurbineLoadControllerDynamics"), &assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics)); } const BaseClassDefiner TurbineGovernorDynamics::declare() @@ -76,4 +98,10 @@ const BaseClassDefiner TurbineGovernorDynamics::declare() return BaseClassDefiner(TurbineGovernorDynamics::addConstructToMap, TurbineGovernorDynamics::addPrimitiveAssignFnsToMap, TurbineGovernorDynamics::addClassAssignFnsToMap, TurbineGovernorDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineGovernorDynamics_factory() + { + return new TurbineGovernorDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.hpp b/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.hpp index 900acdd9c..159723b38 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/TurbineGovernorDynamics.hpp @@ -1,42 +1,43 @@ #ifndef TurbineGovernorDynamics_H #define TurbineGovernorDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachineDynamics; + class SynchronousMachineDynamics; + class TurbineLoadControllerDynamics; -class SynchronousMachineDynamics; -class AsynchronousMachineDynamics; -class TurbineLoadControllerDynamics; /* Turbine-governor function block whose behavior is described by reference to a standard model */ - class TurbineGovernorDynamics: public DynamicsFunctionBlock + class TurbineGovernorDynamics : public DynamicsFunctionBlock { - public: - std::list SynchronousMachineDynamics; /* Turbine-governor model associated with this synchronous machine model. Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this turbine-governor model is associated. Default: 0 */ - CIMPP::TurbineLoadControllerDynamics* TurbineLoadControllerDynamics; /* Turbine load controller providing input to this turbine-governor. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineGovernorDynamics(); - virtual ~TurbineGovernorDynamics(); - + ~TurbineGovernorDynamics() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this turbine-governor model is associated. Default: 0 */ + std::list SynchronousMachineDynamics; /* Turbine-governor model associated with this synchronous machine model. Default: 0 */ + CIMPP::TurbineLoadControllerDynamics* TurbineLoadControllerDynamics; /* Turbine load controller providing input to this turbine-governor. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineGovernorDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.cpp b/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.cpp index dd1ca842b..8ebaeff3f 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineGovernorUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; TurbineGovernorUserDefined::TurbineGovernorUserDefined() {}; - TurbineGovernorUserDefined::~TurbineGovernorUserDefined() {}; -bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TurbineGovernorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_TurbineGovernorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass*, BaseClass*); +bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* TurbineGovernorUserDefined_factory() { - return new TurbineGovernorUserDefined; - } +const char TurbineGovernorUserDefined::debugName[] = "TurbineGovernorUserDefined"; +const char* TurbineGovernorUserDefined::debugString() const +{ + return TurbineGovernorUserDefined::debugName; } -void TurbineGovernorUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void TurbineGovernorUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined"), &TurbineGovernorUserDefined_factory)); } -void TurbineGovernorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TurbineGovernorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined.proprietary"), &assign_TurbineGovernorUserDefined_proprietary)); - } - -void TurbineGovernorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined.ProprietaryParameterDynamics"), &assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics)); } -const char TurbineGovernorUserDefined::debugName[] = "TurbineGovernorUserDefined"; -const char* TurbineGovernorUserDefined::debugString() +void TurbineGovernorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineGovernorUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined.ProprietaryParameterDynamics"), &assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner TurbineGovernorUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner TurbineGovernorUserDefined::declare() return BaseClassDefiner(TurbineGovernorUserDefined::addConstructToMap, TurbineGovernorUserDefined::addPrimitiveAssignFnsToMap, TurbineGovernorUserDefined::addClassAssignFnsToMap, TurbineGovernorUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineGovernorUserDefined_factory() + { + return new TurbineGovernorUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.hpp b/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.hpp index cf430d55a..522072b50 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/TurbineGovernorUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef TurbineGovernorUserDefined_H #define TurbineGovernorUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Turbine-governor function block whose dynamic behaviour is described by */ - class TurbineGovernorUserDefined: public TurbineGovernorDynamics + class TurbineGovernorUserDefined : public TurbineGovernorDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineGovernorUserDefined(); - virtual ~TurbineGovernorUserDefined(); - + ~TurbineGovernorUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineGovernorUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.cpp b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.cpp index c87fef90e..eac14ab44 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineLoadControllerDynamics.hpp" +#include +#include + #include "TurbineGovernorDynamics.hpp" using namespace CIMPP; -TurbineLoadControllerDynamics::TurbineLoadControllerDynamics(): TurbineGovernorDynamics(nullptr) {}; - +TurbineLoadControllerDynamics::TurbineLoadControllerDynamics() : TurbineGovernorDynamics(nullptr) {}; TurbineLoadControllerDynamics::~TurbineLoadControllerDynamics() {}; -bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass*, BaseClass*); -bool assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineLoadControllerDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineGovernorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->TurbineGovernorDynamics != nullptr) - return assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* TurbineLoadControllerDynamics_factory() { - return new TurbineLoadControllerDynamics; +bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass*, BaseClass*); +bool assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineLoadControllerDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineGovernorDynamics != element2) + { + element->TurbineGovernorDynamics = element2; + return assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TurbineLoadControllerDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics"), &TurbineLoadControllerDynamics_factory)); +const char TurbineLoadControllerDynamics::debugName[] = "TurbineLoadControllerDynamics"; +const char* TurbineLoadControllerDynamics::debugString() const +{ + return TurbineLoadControllerDynamics::debugName; } -void TurbineLoadControllerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void TurbineLoadControllerDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics"), &TurbineLoadControllerDynamics_factory)); +} -void TurbineLoadControllerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics.TurbineGovernorDynamics"), &assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics)); +void TurbineLoadControllerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TurbineLoadControllerDynamics::debugName[] = "TurbineLoadControllerDynamics"; -const char* TurbineLoadControllerDynamics::debugString() +void TurbineLoadControllerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineLoadControllerDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics.TurbineGovernorDynamics"), &assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics)); } const BaseClassDefiner TurbineLoadControllerDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner TurbineLoadControllerDynamics::declare() return BaseClassDefiner(TurbineLoadControllerDynamics::addConstructToMap, TurbineLoadControllerDynamics::addPrimitiveAssignFnsToMap, TurbineLoadControllerDynamics::addClassAssignFnsToMap, TurbineLoadControllerDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineLoadControllerDynamics_factory() + { + return new TurbineLoadControllerDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.hpp b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.hpp index f7ce321c2..22756c038 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerDynamics.hpp @@ -1,38 +1,39 @@ #ifndef TurbineLoadControllerDynamics_H #define TurbineLoadControllerDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TurbineGovernorDynamics; -class TurbineGovernorDynamics; /* Turbine load controller function block whose behavior is described by reference to a standard model */ - class TurbineLoadControllerDynamics: public DynamicsFunctionBlock + class TurbineLoadControllerDynamics : public DynamicsFunctionBlock { - public: - CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor controlled by this turbine load controller. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineLoadControllerDynamics(); - virtual ~TurbineLoadControllerDynamics(); - + ~TurbineLoadControllerDynamics() override; + + CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor controlled by this turbine load controller. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineLoadControllerDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.cpp b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.cpp index b2e2a832e..70752dcc4 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "TurbineLoadControllerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineLoadControllerUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; TurbineLoadControllerUserDefined::TurbineLoadControllerUserDefined() {}; - TurbineLoadControllerUserDefined::~TurbineLoadControllerUserDefined() {}; -bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TurbineLoadControllerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_TurbineLoadControllerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass*, BaseClass*); +bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* TurbineLoadControllerUserDefined_factory() { - return new TurbineLoadControllerUserDefined; - } +const char TurbineLoadControllerUserDefined::debugName[] = "TurbineLoadControllerUserDefined"; +const char* TurbineLoadControllerUserDefined::debugString() const +{ + return TurbineLoadControllerUserDefined::debugName; } -void TurbineLoadControllerUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void TurbineLoadControllerUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined"), &TurbineLoadControllerUserDefined_factory)); } -void TurbineLoadControllerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TurbineLoadControllerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined.proprietary"), &assign_TurbineLoadControllerUserDefined_proprietary)); - } - -void TurbineLoadControllerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined.ProprietaryParameterDynamics"), &assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics)); } -const char TurbineLoadControllerUserDefined::debugName[] = "TurbineLoadControllerUserDefined"; -const char* TurbineLoadControllerUserDefined::debugString() +void TurbineLoadControllerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineLoadControllerUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined.ProprietaryParameterDynamics"), &assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner TurbineLoadControllerUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner TurbineLoadControllerUserDefined::declare() return BaseClassDefiner(TurbineLoadControllerUserDefined::addConstructToMap, TurbineLoadControllerUserDefined::addPrimitiveAssignFnsToMap, TurbineLoadControllerUserDefined::addClassAssignFnsToMap, TurbineLoadControllerUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineLoadControllerUserDefined_factory() + { + return new TurbineLoadControllerUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.hpp b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.hpp index 45616aba3..d37fd76e1 100644 --- a/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/TurbineLoadControllerUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef TurbineLoadControllerUserDefined_H #define TurbineLoadControllerUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineLoadControllerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineLoadControllerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Turbine load controller function block whose dynamic behaviour is described by */ - class TurbineLoadControllerUserDefined: public TurbineLoadControllerDynamics + class TurbineLoadControllerUserDefined : public TurbineLoadControllerDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineLoadControllerUserDefined(); - virtual ~TurbineLoadControllerUserDefined(); - + ~TurbineLoadControllerUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineLoadControllerUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.cpp b/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.cpp index 659682375..c9798125d 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.cpp @@ -1,7 +1,11 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLim2Simplified.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -13,129 +17,132 @@ using namespace CIMPP; UnderexcLim2Simplified::UnderexcLim2Simplified() {}; - UnderexcLim2Simplified::~UnderexcLim2Simplified() {}; +bool assign_UnderexcLim2Simplified_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kui; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLim2Simplified_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kui; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLim2Simplified_factory() { - return new UnderexcLim2Simplified; - } +const char UnderexcLim2Simplified::debugName[] = "UnderexcLim2Simplified"; +const char* UnderexcLim2Simplified::debugString() const +{ + return UnderexcLim2Simplified::debugName; } -void UnderexcLim2Simplified::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLim2Simplified::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified"), &UnderexcLim2Simplified_factory)); } -void UnderexcLim2Simplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q0"), &assign_UnderexcLim2Simplified_q0)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q1"), &assign_UnderexcLim2Simplified_q1)); +void UnderexcLim2Simplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.kui"), &assign_UnderexcLim2Simplified_kui)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.p0"), &assign_UnderexcLim2Simplified_p0)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.p1"), &assign_UnderexcLim2Simplified_p1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.kui"), &assign_UnderexcLim2Simplified_kui)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.vuimin"), &assign_UnderexcLim2Simplified_vuimin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q0"), &assign_UnderexcLim2Simplified_q0)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q1"), &assign_UnderexcLim2Simplified_q1)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.vuimax"), &assign_UnderexcLim2Simplified_vuimax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.vuimin"), &assign_UnderexcLim2Simplified_vuimin)); } -void UnderexcLim2Simplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLim2Simplified::debugName[] = "UnderexcLim2Simplified"; -const char* UnderexcLim2Simplified::debugString() +void UnderexcLim2Simplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLim2Simplified::debugName; } const BaseClassDefiner UnderexcLim2Simplified::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner UnderexcLim2Simplified::declare() return BaseClassDefiner(UnderexcLim2Simplified::addConstructToMap, UnderexcLim2Simplified::addPrimitiveAssignFnsToMap, UnderexcLim2Simplified::addClassAssignFnsToMap, UnderexcLim2Simplified::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLim2Simplified_factory() + { + return new UnderexcLim2Simplified; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.hpp b/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.hpp index cd0a3f9ca..8d1117474 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLim2Simplified.hpp @@ -1,44 +1,45 @@ #ifndef UnderexcLim2Simplified_H #define UnderexcLim2Simplified_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* This model can be derived from UnderexcLimIEEE2. The limit characteristic (look -up table) is a single straight-line, the same as UnderexcLimIEEE2 (see Figure 10.4 (p 32), IEEE 421.5-2005 Section 10.2). */ - class UnderexcLim2Simplified: public UnderexcitationLimiterDynamics + class UnderexcLim2Simplified : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU q0; /* Segment Q initial point (Q0). Typical Value = -0.31. Default: nullptr */ - CIMPP::PU q1; /* Segment Q end point (Q1). Typical Value = -0.1. Default: nullptr */ - CIMPP::PU p0; /* Segment P initial point (P0). Typical Value = 0. Default: nullptr */ - CIMPP::PU p1; /* Segment P end point (P1). Typical Value = 1. Default: nullptr */ - CIMPP::PU kui; /* Gain Under excitation limiter (Kui). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vuimin; /* Minimum error signal (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU vuimax; /* Maximum error signal (V). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLim2Simplified(); - virtual ~UnderexcLim2Simplified(); - + ~UnderexcLim2Simplified() override; + + CIMPP::PU kui; /* Gain Under excitation limiter (Kui). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU p0; /* Segment P initial point (P0). Typical Value = 0. Default: nullptr */ + CIMPP::PU p1; /* Segment P end point (P1). Typical Value = 1. Default: nullptr */ + CIMPP::PU q0; /* Segment Q initial point (Q0). Typical Value = -0.31. Default: nullptr */ + CIMPP::PU q1; /* Segment Q end point (Q1). Typical Value = -0.1. Default: nullptr */ + CIMPP::PU vuimax; /* Maximum error signal (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vuimin; /* Minimum error signal (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLim2Simplified_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.cpp b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.cpp index 713167cb8..e09b8a4fd 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.cpp @@ -1,11 +1,11 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimIEEE1.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,245 +17,260 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; UnderexcLimIEEE1::UnderexcLimIEEE1() {}; - UnderexcLimIEEE1::~UnderexcLimIEEE1() {}; +bool assign_UnderexcLimIEEE1_kuc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kuc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kuf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kui; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kur(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kur; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vucmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vucmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vurmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vurmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimIEEE1_kur(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kur; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kuc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kuc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kuf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vurmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vurmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vucmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vucmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kui; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLimIEEE1_factory() { - return new UnderexcLimIEEE1; - } +const char UnderexcLimIEEE1::debugName[] = "UnderexcLimIEEE1"; +const char* UnderexcLimIEEE1::debugString() const +{ + return UnderexcLimIEEE1::debugName; } -void UnderexcLimIEEE1::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimIEEE1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1"), &UnderexcLimIEEE1_factory)); } -void UnderexcLimIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kur"), &assign_UnderexcLimIEEE1_kur)); +void UnderexcLimIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kuc"), &assign_UnderexcLimIEEE1_kuc)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kuf"), &assign_UnderexcLimIEEE1_kuf)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vurmax"), &assign_UnderexcLimIEEE1_vurmax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vucmax"), &assign_UnderexcLimIEEE1_vucmax)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kui"), &assign_UnderexcLimIEEE1_kui)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kul"), &assign_UnderexcLimIEEE1_kul)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimax"), &assign_UnderexcLimIEEE1_vuimax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimin"), &assign_UnderexcLimIEEE1_vuimin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kur"), &assign_UnderexcLimIEEE1_kur)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu1"), &assign_UnderexcLimIEEE1_tu1)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu2"), &assign_UnderexcLimIEEE1_tu2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu3"), &assign_UnderexcLimIEEE1_tu3)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu4"), &assign_UnderexcLimIEEE1_tu4)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vucmax"), &assign_UnderexcLimIEEE1_vucmax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimax"), &assign_UnderexcLimIEEE1_vuimax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimin"), &assign_UnderexcLimIEEE1_vuimin)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vulmax"), &assign_UnderexcLimIEEE1_vulmax)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vulmin"), &assign_UnderexcLimIEEE1_vulmin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vurmax"), &assign_UnderexcLimIEEE1_vurmax)); } -void UnderexcLimIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimIEEE1::debugName[] = "UnderexcLimIEEE1"; -const char* UnderexcLimIEEE1::debugString() +void UnderexcLimIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimIEEE1::debugName; } const BaseClassDefiner UnderexcLimIEEE1::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner UnderexcLimIEEE1::declare() return BaseClassDefiner(UnderexcLimIEEE1::addConstructToMap, UnderexcLimIEEE1::addPrimitiveAssignFnsToMap, UnderexcLimIEEE1::addClassAssignFnsToMap, UnderexcLimIEEE1::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimIEEE1_factory() + { + return new UnderexcLimIEEE1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.hpp b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.hpp index f8bf85ce3..8d114d67e 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE1.hpp @@ -1,53 +1,54 @@ #ifndef UnderexcLimIEEE1_H #define UnderexcLimIEEE1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents the Type UEL1 model which has a circular limit boundary when plotted in terms of machine reactive power vs. real power output. Reference: IEEE UEL1 421.5-2005 Section 10.1. */ - class UnderexcLimIEEE1: public UnderexcitationLimiterDynamics + class UnderexcLimIEEE1 : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU kur; /* UEL radius setting (K). Typical Value = 1.95. Default: nullptr */ - CIMPP::PU kuc; /* UEL center setting (K). Typical Value = 1.38. Default: nullptr */ - CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 3.3. Default: nullptr */ - CIMPP::PU vurmax; /* UEL maximum limit for radius phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ - CIMPP::PU vucmax; /* UEL maximum limit for operating point phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ - CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 100. Default: nullptr */ - CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Default: nullptr */ - CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Default: nullptr */ - CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 18. Default: nullptr */ - CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = -18. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimIEEE1(); - virtual ~UnderexcLimIEEE1(); - + ~UnderexcLimIEEE1() override; + + CIMPP::PU kuc; /* UEL center setting (K). Typical Value = 1.38. Default: nullptr */ + CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 3.3. Default: nullptr */ + CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 100. Default: nullptr */ + CIMPP::PU kur; /* UEL radius setting (K). Typical Value = 1.95. Default: nullptr */ + CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::PU vucmax; /* UEL maximum limit for operating point phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ + CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Default: nullptr */ + CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Default: nullptr */ + CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 18. Default: nullptr */ + CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = -18. Default: nullptr */ + CIMPP::PU vurmax; /* UEL maximum limit for radius phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimIEEE1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.cpp b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.cpp index 3a58421dd..1fdffe52d 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.cpp @@ -1,21 +1,19 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimIEEE2.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -36,601 +34,643 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; UnderexcLimIEEE2::UnderexcLimIEEE2() {}; - UnderexcLimIEEE2::~UnderexcLimIEEE2() {}; +bool assign_UnderexcLimIEEE2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kfb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kfb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kuf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kui; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tup; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tuq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_tuv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimIEEE2_tuv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_tup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tup; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_tuq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kui; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kuf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_kfb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kfb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* UnderexcLimIEEE2_factory() { - return new UnderexcLimIEEE2; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char UnderexcLimIEEE2::debugName[] = "UnderexcLimIEEE2"; +const char* UnderexcLimIEEE2::debugString() const +{ + return UnderexcLimIEEE2::debugName; } -void UnderexcLimIEEE2::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimIEEE2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2"), &UnderexcLimIEEE2_factory)); } -void UnderexcLimIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuv"), &assign_UnderexcLimIEEE2_tuv)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tup"), &assign_UnderexcLimIEEE2_tup)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuq"), &assign_UnderexcLimIEEE2_tuq)); +void UnderexcLimIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k1"), &assign_UnderexcLimIEEE2_k1)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k2"), &assign_UnderexcLimIEEE2_k2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kfb"), &assign_UnderexcLimIEEE2_kfb)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kuf"), &assign_UnderexcLimIEEE2_kuf)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kui"), &assign_UnderexcLimIEEE2_kui)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kul"), &assign_UnderexcLimIEEE2_kul)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimax"), &assign_UnderexcLimIEEE2_vuimax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimin"), &assign_UnderexcLimIEEE2_vuimin)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kuf"), &assign_UnderexcLimIEEE2_kuf)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kfb"), &assign_UnderexcLimIEEE2_kfb)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tul"), &assign_UnderexcLimIEEE2_tul)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu1"), &assign_UnderexcLimIEEE2_tu1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu2"), &assign_UnderexcLimIEEE2_tu2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu3"), &assign_UnderexcLimIEEE2_tu3)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu4"), &assign_UnderexcLimIEEE2_tu4)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmax"), &assign_UnderexcLimIEEE2_vulmax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmin"), &assign_UnderexcLimIEEE2_vulmin)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p0"), &assign_UnderexcLimIEEE2_p0)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q0"), &assign_UnderexcLimIEEE2_q0)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p1"), &assign_UnderexcLimIEEE2_p1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q1"), &assign_UnderexcLimIEEE2_q1)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p10"), &assign_UnderexcLimIEEE2_p10)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p2"), &assign_UnderexcLimIEEE2_p2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q2"), &assign_UnderexcLimIEEE2_q2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p3"), &assign_UnderexcLimIEEE2_p3)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q3"), &assign_UnderexcLimIEEE2_q3)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p4"), &assign_UnderexcLimIEEE2_p4)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q4"), &assign_UnderexcLimIEEE2_q4)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p5"), &assign_UnderexcLimIEEE2_p5)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q5"), &assign_UnderexcLimIEEE2_q5)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p6"), &assign_UnderexcLimIEEE2_p6)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q6"), &assign_UnderexcLimIEEE2_q6)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p7"), &assign_UnderexcLimIEEE2_p7)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q7"), &assign_UnderexcLimIEEE2_q7)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p8"), &assign_UnderexcLimIEEE2_p8)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q8"), &assign_UnderexcLimIEEE2_q8)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p9"), &assign_UnderexcLimIEEE2_p9)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q9"), &assign_UnderexcLimIEEE2_q9)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p10"), &assign_UnderexcLimIEEE2_p10)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q0"), &assign_UnderexcLimIEEE2_q0)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q1"), &assign_UnderexcLimIEEE2_q1)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q10"), &assign_UnderexcLimIEEE2_q10)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k1"), &assign_UnderexcLimIEEE2_k1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k2"), &assign_UnderexcLimIEEE2_k2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q2"), &assign_UnderexcLimIEEE2_q2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q3"), &assign_UnderexcLimIEEE2_q3)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q4"), &assign_UnderexcLimIEEE2_q4)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q5"), &assign_UnderexcLimIEEE2_q5)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q6"), &assign_UnderexcLimIEEE2_q6)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q7"), &assign_UnderexcLimIEEE2_q7)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q8"), &assign_UnderexcLimIEEE2_q8)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q9"), &assign_UnderexcLimIEEE2_q9)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu1"), &assign_UnderexcLimIEEE2_tu1)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu2"), &assign_UnderexcLimIEEE2_tu2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu3"), &assign_UnderexcLimIEEE2_tu3)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu4"), &assign_UnderexcLimIEEE2_tu4)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tul"), &assign_UnderexcLimIEEE2_tul)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tup"), &assign_UnderexcLimIEEE2_tup)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuq"), &assign_UnderexcLimIEEE2_tuq)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuv"), &assign_UnderexcLimIEEE2_tuv)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimax"), &assign_UnderexcLimIEEE2_vuimax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimin"), &assign_UnderexcLimIEEE2_vuimin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmax"), &assign_UnderexcLimIEEE2_vulmax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmin"), &assign_UnderexcLimIEEE2_vulmin)); } -void UnderexcLimIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimIEEE2::debugName[] = "UnderexcLimIEEE2"; -const char* UnderexcLimIEEE2::debugString() +void UnderexcLimIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimIEEE2::debugName; } const BaseClassDefiner UnderexcLimIEEE2::declare() @@ -638,4 +678,10 @@ const BaseClassDefiner UnderexcLimIEEE2::declare() return BaseClassDefiner(UnderexcLimIEEE2::addConstructToMap, UnderexcLimIEEE2::addPrimitiveAssignFnsToMap, UnderexcLimIEEE2::addClassAssignFnsToMap, UnderexcLimIEEE2::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimIEEE2_factory() + { + return new UnderexcLimIEEE2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.hpp b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.hpp index 94c021f10..c7a840649 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimIEEE2.hpp @@ -1,79 +1,80 @@ #ifndef UnderexcLimIEEE2_H #define UnderexcLimIEEE2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents the Type UEL2 which has either a straight-line or multi-segment characteristic when plotted in terms of machine reactive power output vs. real power output. Reference: IEEE UEL2 421.5-2005 Section 10.2. (Limit characteristic lookup table shown in Figure 10.4 (p 32) of the standard). */ - class UnderexcLimIEEE2: public UnderexcitationLimiterDynamics + class UnderexcLimIEEE2 : public UnderexcitationLimiterDynamics { - public: - CIMPP::Seconds tuv; /* Voltage filter time constant (T). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tup; /* Real power filter time constant (T). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tuq; /* Reactive power filter time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kfb; /* Gain associated with optional integrator feedback input signal to UEL (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tul; /* Time constant associated with optional integrator feedback input signal to UEL (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU p0; /* Real power values for endpoints (P). Typical Value = 0. Default: nullptr */ - CIMPP::PU q0; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ - CIMPP::PU p1; /* Real power values for endpoints (P). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU q1; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ - CIMPP::PU p2; /* Real power values for endpoints (P). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU q2; /* Reactive power values for endpoints (Q). Typical Value = -0.28. Default: nullptr */ - CIMPP::PU p3; /* Real power values for endpoints (P). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU q3; /* Reactive power values for endpoints (Q). Typical Value = -0.21. Default: nullptr */ - CIMPP::PU p4; /* Real power values for endpoints (P). Typical Value = 1.02. Default: nullptr */ - CIMPP::PU q4; /* Reactive power values for endpoints (Q). Typical Value = 0. Default: nullptr */ - CIMPP::PU p5; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q5; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p6; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q6; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p7; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q7; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p8; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q8; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p9; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q9; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p10; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q10; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::Simple_Float k1; /* UEL terminal voltage exponent applied to real power input to UEL limit look-up table (k1). Typical Value = 2. Default: nullptr */ - CIMPP::Simple_Float k2; /* UEL terminal voltage exponent applied to reactive power output from UEL limit look-up table (k2). Typical Value = 2. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimIEEE2(); - virtual ~UnderexcLimIEEE2(); - + ~UnderexcLimIEEE2() override; + + CIMPP::Simple_Float k1; /* UEL terminal voltage exponent applied to real power input to UEL limit look-up table (k1). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float k2; /* UEL terminal voltage exponent applied to reactive power output from UEL limit look-up table (k2). Typical Value = 2. Default: nullptr */ + CIMPP::PU kfb; /* Gain associated with optional integrator feedback input signal to UEL (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 0.8. Default: nullptr */ + CIMPP::PU p0; /* Real power values for endpoints (P). Typical Value = 0. Default: nullptr */ + CIMPP::PU p1; /* Real power values for endpoints (P). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU p10; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p2; /* Real power values for endpoints (P). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU p3; /* Real power values for endpoints (P). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU p4; /* Real power values for endpoints (P). Typical Value = 1.02. Default: nullptr */ + CIMPP::PU p5; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p6; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p7; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p8; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p9; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU q0; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ + CIMPP::PU q1; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ + CIMPP::PU q10; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q2; /* Reactive power values for endpoints (Q). Typical Value = -0.28. Default: nullptr */ + CIMPP::PU q3; /* Reactive power values for endpoints (Q). Typical Value = -0.21. Default: nullptr */ + CIMPP::PU q4; /* Reactive power values for endpoints (Q). Typical Value = 0. Default: nullptr */ + CIMPP::PU q5; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q6; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q7; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q8; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q9; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tul; /* Time constant associated with optional integrator feedback input signal to UEL (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tup; /* Real power filter time constant (T). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tuq; /* Reactive power filter time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tuv; /* Voltage filter time constant (T). Typical Value = 5. Default: nullptr */ + CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Typical Value = 0.25. Default: nullptr */ + CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 0.25. Default: nullptr */ + CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimIEEE2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimX1.cpp b/CGMES_2.4.15_16FEB2016/UnderexcLimX1.cpp index 63d2f2f3b..3d9a9b6e1 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimX1.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimX1.cpp @@ -1,126 +1,132 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimX1.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; UnderexcLimX1::UnderexcLimX1() {}; - UnderexcLimX1::~UnderexcLimX1() {}; +bool assign_UnderexcLimX1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->melmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimX1_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->melmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLimX1_factory() { - return new UnderexcLimX1; - } +const char UnderexcLimX1::debugName[] = "UnderexcLimX1"; +const char* UnderexcLimX1::debugString() const +{ + return UnderexcLimX1::debugName; } -void UnderexcLimX1::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimX1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimX1"), &UnderexcLimX1_factory)); } -void UnderexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void UnderexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.k"), &assign_UnderexcLimX1_k)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.kf2"), &assign_UnderexcLimX1_kf2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tf2"), &assign_UnderexcLimX1_tf2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.km"), &assign_UnderexcLimX1_km)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tm"), &assign_UnderexcLimX1_tm)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.melmax"), &assign_UnderexcLimX1_melmax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.k"), &assign_UnderexcLimX1_k)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tf2"), &assign_UnderexcLimX1_tf2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tm"), &assign_UnderexcLimX1_tm)); } -void UnderexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimX1::debugName[] = "UnderexcLimX1"; -const char* UnderexcLimX1::debugString() +void UnderexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimX1::debugName; } const BaseClassDefiner UnderexcLimX1::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner UnderexcLimX1::declare() return BaseClassDefiner(UnderexcLimX1::addConstructToMap, UnderexcLimX1::addPrimitiveAssignFnsToMap, UnderexcLimX1::addClassAssignFnsToMap, UnderexcLimX1::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimX1_factory() + { + return new UnderexcLimX1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimX1.hpp b/CGMES_2.4.15_16FEB2016/UnderexcLimX1.hpp index 0a28ebd83..f79ff24dd 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimX1.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimX1.hpp @@ -1,44 +1,42 @@ #ifndef UnderexcLimX1_H #define UnderexcLimX1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ - - /* - - */ - class UnderexcLimX1: public UnderexcitationLimiterDynamics + class UnderexcLimX1 : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ - CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ - CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ - CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ - CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ - CIMPP::PU k; /* Minimum excitation limit slope (K) (>0). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimX1(); - virtual ~UnderexcLimX1(); - + ~UnderexcLimX1() override; + + CIMPP::PU k; /* Minimum excitation limit slope (K) (>0). Default: nullptr */ + CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ + CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ + CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ + CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ + CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimX1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimX2.cpp b/CGMES_2.4.15_16FEB2016/UnderexcLimX2.cpp index 0a05e2ee8..9b6bc21c8 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimX2.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimX2.cpp @@ -1,141 +1,148 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimX2.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; UnderexcLimX2::UnderexcLimX2() {}; - UnderexcLimX2::~UnderexcLimX2() {}; +bool assign_UnderexcLimX2_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->melmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_qo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimX2_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->melmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_qo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLimX2_factory() { - return new UnderexcLimX2; - } +const char UnderexcLimX2::debugName[] = "UnderexcLimX2"; +const char* UnderexcLimX2::debugString() const +{ + return UnderexcLimX2::debugName; } -void UnderexcLimX2::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimX2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimX2"), &UnderexcLimX2_factory)); } -void UnderexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void UnderexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.kf2"), &assign_UnderexcLimX2_kf2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tf2"), &assign_UnderexcLimX2_tf2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.km"), &assign_UnderexcLimX2_km)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tm"), &assign_UnderexcLimX2_tm)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.melmax"), &assign_UnderexcLimX2_melmax)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.qo"), &assign_UnderexcLimX2_qo)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.r"), &assign_UnderexcLimX2_r)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tf2"), &assign_UnderexcLimX2_tf2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tm"), &assign_UnderexcLimX2_tm)); } -void UnderexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimX2::debugName[] = "UnderexcLimX2"; -const char* UnderexcLimX2::debugString() +void UnderexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimX2::debugName; } const BaseClassDefiner UnderexcLimX2::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner UnderexcLimX2::declare() return BaseClassDefiner(UnderexcLimX2::addConstructToMap, UnderexcLimX2::addPrimitiveAssignFnsToMap, UnderexcLimX2::addClassAssignFnsToMap, UnderexcLimX2::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimX2_factory() + { + return new UnderexcLimX2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcLimX2.hpp b/CGMES_2.4.15_16FEB2016/UnderexcLimX2.hpp index 9dde80c38..23ce6a21b 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcLimX2.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcLimX2.hpp @@ -1,45 +1,43 @@ #ifndef UnderexcLimX2_H #define UnderexcLimX2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ - - /* - - */ - class UnderexcLimX2: public UnderexcitationLimiterDynamics + class UnderexcLimX2 : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ - CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ - CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ - CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ - CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ - CIMPP::PU qo; /* Excitation center setting (Qo). Default: nullptr */ - CIMPP::PU r; /* Excitation radius (R). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimX2(); - virtual ~UnderexcLimX2(); - + ~UnderexcLimX2() override; + + CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ + CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ + CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ + CIMPP::PU qo; /* Excitation center setting (Qo). Default: nullptr */ + CIMPP::PU r; /* Excitation radius (R). Default: nullptr */ + CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ + CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimX2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.cpp b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.cpp index b12fed72e..131bea982 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.cpp @@ -1,61 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcitationLimiterDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -UnderexcitationLimiterDynamics::UnderexcitationLimiterDynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr) {}; - +UnderexcitationLimiterDynamics::UnderexcitationLimiterDynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr) {}; UnderexcitationLimiterDynamics::~UnderexcitationLimiterDynamics() {}; -bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass*, BaseClass*); -bool assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass*, BaseClass*); +bool assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* UnderexcitationLimiterDynamics_factory() { - return new UnderexcitationLimiterDynamics; +bool assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass*, BaseClass*); +bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void UnderexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics"), &UnderexcitationLimiterDynamics_factory)); +const char UnderexcitationLimiterDynamics::debugName[] = "UnderexcitationLimiterDynamics"; +const char* UnderexcitationLimiterDynamics::debugString() const +{ + return UnderexcitationLimiterDynamics::debugName; } -void UnderexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void UnderexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics"), &UnderexcitationLimiterDynamics_factory)); +} -void UnderexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.RemoteInputSignal"), &assign_UnderexcitationLimiterDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics)); +void UnderexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char UnderexcitationLimiterDynamics::debugName[] = "UnderexcitationLimiterDynamics"; -const char* UnderexcitationLimiterDynamics::debugString() +void UnderexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcitationLimiterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.RemoteInputSignal"), &assign_UnderexcitationLimiterDynamics_RemoteInputSignal)); } const BaseClassDefiner UnderexcitationLimiterDynamics::declare() @@ -63,4 +78,10 @@ const BaseClassDefiner UnderexcitationLimiterDynamics::declare() return BaseClassDefiner(UnderexcitationLimiterDynamics::addConstructToMap, UnderexcitationLimiterDynamics::addPrimitiveAssignFnsToMap, UnderexcitationLimiterDynamics::addClassAssignFnsToMap, UnderexcitationLimiterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcitationLimiterDynamics_factory() + { + return new UnderexcitationLimiterDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.hpp b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.hpp index 1f6b6b2b6..1ad15fc65 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterDynamics.hpp @@ -1,40 +1,41 @@ #ifndef UnderexcitationLimiterDynamics_H #define UnderexcitationLimiterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Underexcitation limiter function block whose behaviour is described by reference to a standard model */ - class UnderexcitationLimiterDynamics: public DynamicsFunctionBlock + class UnderexcitationLimiterDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this underexcitation limiter model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this underexcitation limiter model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcitationLimiterDynamics(); - virtual ~UnderexcitationLimiterDynamics(); - + ~UnderexcitationLimiterDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this underexcitation limiter model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this underexcitation limiter model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcitationLimiterDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.cpp b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.cpp index 83d2787f9..6415389ab 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcitationLimiterUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; UnderexcitationLimiterUserDefined::UnderexcitationLimiterUserDefined() {}; - UnderexcitationLimiterUserDefined::~UnderexcitationLimiterUserDefined() {}; -bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_UnderexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_UnderexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass*, BaseClass*); +bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* UnderexcitationLimiterUserDefined_factory() { - return new UnderexcitationLimiterUserDefined; - } +const char UnderexcitationLimiterUserDefined::debugName[] = "UnderexcitationLimiterUserDefined"; +const char* UnderexcitationLimiterUserDefined::debugString() const +{ + return UnderexcitationLimiterUserDefined::debugName; } -void UnderexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined"), &UnderexcitationLimiterUserDefined_factory)); } -void UnderexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void UnderexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined.proprietary"), &assign_UnderexcitationLimiterUserDefined_proprietary)); - } - -void UnderexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } -const char UnderexcitationLimiterUserDefined::debugName[] = "UnderexcitationLimiterUserDefined"; -const char* UnderexcitationLimiterUserDefined::debugString() +void UnderexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcitationLimiterUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner UnderexcitationLimiterUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner UnderexcitationLimiterUserDefined::declare() return BaseClassDefiner(UnderexcitationLimiterUserDefined::addConstructToMap, UnderexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap, UnderexcitationLimiterUserDefined::addClassAssignFnsToMap, UnderexcitationLimiterUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcitationLimiterUserDefined_factory() + { + return new UnderexcitationLimiterUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.hpp b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.hpp index fda986fbc..46f6cfdcb 100644 --- a/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/UnderexcitationLimiterUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef UnderexcitationLimiterUserDefined_H #define UnderexcitationLimiterUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Underexcitation limiter function block whose dynamic behaviour is described by */ - class UnderexcitationLimiterUserDefined: public UnderexcitationLimiterDynamics + class UnderexcitationLimiterUserDefined : public UnderexcitationLimiterDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcitationLimiterUserDefined(); - virtual ~UnderexcitationLimiterUserDefined(); - + ~UnderexcitationLimiterUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcitationLimiterUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/UnitMultiplier.cpp b/CGMES_2.4.15_16FEB2016/UnitMultiplier.cpp index 1c4e564c8..51e68a621 100644 --- a/CGMES_2.4.15_16FEB2016/UnitMultiplier.cpp +++ b/CGMES_2.4.15_16FEB2016/UnitMultiplier.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnitMultiplier.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::UnitMultiplier& rop) +UnitMultiplier& UnitMultiplier::operator=(UnitMultiplier_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +UnitMultiplier::operator UnitMultiplier_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char UnitMultiplier::debugName[] = "UnitMultiplier"; +const char* UnitMultiplier::debugString() const +{ + return UnitMultiplier::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, UnitMultiplier& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -78,5 +109,63 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const UnitMultiplier& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == UnitMultiplier::p) + { + EnumSymbol = "p"; + } + if (obj.value == UnitMultiplier::n) + { + EnumSymbol = "n"; + } + if (obj.value == UnitMultiplier::micro) + { + EnumSymbol = "micro"; + } + if (obj.value == UnitMultiplier::m) + { + EnumSymbol = "m"; + } + if (obj.value == UnitMultiplier::c) + { + EnumSymbol = "c"; + } + if (obj.value == UnitMultiplier::d) + { + EnumSymbol = "d"; + } + if (obj.value == UnitMultiplier::k) + { + EnumSymbol = "k"; + } + if (obj.value == UnitMultiplier::M) + { + EnumSymbol = "M"; + } + if (obj.value == UnitMultiplier::G) + { + EnumSymbol = "G"; + } + if (obj.value == UnitMultiplier::T) + { + EnumSymbol = "T"; + } + if (obj.value == UnitMultiplier::none) + { + EnumSymbol = "none"; + } + + if (!EnumSymbol.empty()) + { + os << "UnitMultiplier." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnitMultiplier.hpp b/CGMES_2.4.15_16FEB2016/UnitMultiplier.hpp index 8f4273089..710c6f153 100644 --- a/CGMES_2.4.15_16FEB2016/UnitMultiplier.hpp +++ b/CGMES_2.4.15_16FEB2016/UnitMultiplier.hpp @@ -1,57 +1,82 @@ #ifndef UnitMultiplier_H #define UnitMultiplier_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The unit multipliers defined for the CIM. */ - enum class UnitMultiplier + class UnitMultiplier { - /** - * Pico 10**-12. - */ - p, - /** - * Nano 10**-9. - */ - n, - /** - * Micro 10**-6. - */ - micro, - /** - * Milli 10**-3. - */ - m, - /** - * Centi 10**-2. - */ - c, - /** - * Deci 10**-1. - */ - d, - /** - * Kilo 10**3. - */ - k, - /** - * Mega 10**6. - */ - M, - /** - * Giga 10**9. - */ - G, - /** - * Tera 10**12. - */ - T, - /** - * No multiplier or equivalently multiply by 1. - */ - none, + public: + enum UnitMultiplier_ENUM + { + /** + * Pico 10**-12. + */ + p, + /** + * Nano 10**-9. + */ + n, + /** + * Micro 10**-6. + */ + micro, + /** + * Milli 10**-3. + */ + m, + /** + * Centi 10**-2. + */ + c, + /** + * Deci 10**-1. + */ + d, + /** + * Kilo 10**3. + */ + k, + /** + * Mega 10**6. + */ + M, + /** + * Giga 10**9. + */ + G, + /** + * Tera 10**12. + */ + T, + /** + * No multiplier or equivalently multiply by 1. + */ + none, + }; + + UnitMultiplier() : value(), initialized(false) {} + UnitMultiplier(UnitMultiplier_ENUM value) : value(value), initialized(true) {} + + UnitMultiplier& operator=(UnitMultiplier_ENUM rop); + operator UnitMultiplier_ENUM() const; + + UnitMultiplier_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, UnitMultiplier& rop); + friend std::ostream& operator<<(std::ostream& os, const UnitMultiplier& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::UnitMultiplier& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/UnitSymbol.cpp b/CGMES_2.4.15_16FEB2016/UnitSymbol.cpp index 2eafd7cdc..8812cdffb 100644 --- a/CGMES_2.4.15_16FEB2016/UnitSymbol.cpp +++ b/CGMES_2.4.15_16FEB2016/UnitSymbol.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnitSymbol.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::UnitSymbol& rop) +UnitSymbol& UnitSymbol::operator=(UnitSymbol_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +UnitSymbol::operator UnitSymbol_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char UnitSymbol::debugName[] = "UnitSymbol"; +const char* UnitSymbol::debugString() const +{ + return UnitSymbol::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, UnitSymbol& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -158,5 +189,127 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const UnitSymbol& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == UnitSymbol::VA) + { + EnumSymbol = "VA"; + } + if (obj.value == UnitSymbol::W) + { + EnumSymbol = "W"; + } + if (obj.value == UnitSymbol::VAr) + { + EnumSymbol = "VAr"; + } + if (obj.value == UnitSymbol::VAh) + { + EnumSymbol = "VAh"; + } + if (obj.value == UnitSymbol::Wh) + { + EnumSymbol = "Wh"; + } + if (obj.value == UnitSymbol::VArh) + { + EnumSymbol = "VArh"; + } + if (obj.value == UnitSymbol::V) + { + EnumSymbol = "V"; + } + if (obj.value == UnitSymbol::ohm) + { + EnumSymbol = "ohm"; + } + if (obj.value == UnitSymbol::A) + { + EnumSymbol = "A"; + } + if (obj.value == UnitSymbol::F) + { + EnumSymbol = "F"; + } + if (obj.value == UnitSymbol::H) + { + EnumSymbol = "H"; + } + if (obj.value == UnitSymbol::degC) + { + EnumSymbol = "degC"; + } + if (obj.value == UnitSymbol::s) + { + EnumSymbol = "s"; + } + if (obj.value == UnitSymbol::min) + { + EnumSymbol = "min"; + } + if (obj.value == UnitSymbol::h) + { + EnumSymbol = "h"; + } + if (obj.value == UnitSymbol::deg) + { + EnumSymbol = "deg"; + } + if (obj.value == UnitSymbol::rad) + { + EnumSymbol = "rad"; + } + if (obj.value == UnitSymbol::J) + { + EnumSymbol = "J"; + } + if (obj.value == UnitSymbol::N) + { + EnumSymbol = "N"; + } + if (obj.value == UnitSymbol::S) + { + EnumSymbol = "S"; + } + if (obj.value == UnitSymbol::none) + { + EnumSymbol = "none"; + } + if (obj.value == UnitSymbol::Hz) + { + EnumSymbol = "Hz"; + } + if (obj.value == UnitSymbol::g) + { + EnumSymbol = "g"; + } + if (obj.value == UnitSymbol::Pa) + { + EnumSymbol = "Pa"; + } + if (obj.value == UnitSymbol::m) + { + EnumSymbol = "m"; + } + if (obj.value == UnitSymbol::m2) + { + EnumSymbol = "m2"; + } + if (obj.value == UnitSymbol::m3) + { + EnumSymbol = "m3"; + } + + if (!EnumSymbol.empty()) + { + os << "UnitSymbol." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/UnitSymbol.hpp b/CGMES_2.4.15_16FEB2016/UnitSymbol.hpp index 536d56505..b63a20465 100644 --- a/CGMES_2.4.15_16FEB2016/UnitSymbol.hpp +++ b/CGMES_2.4.15_16FEB2016/UnitSymbol.hpp @@ -1,121 +1,146 @@ #ifndef UnitSymbol_H #define UnitSymbol_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The units defined for usage in the CIM. */ - enum class UnitSymbol + class UnitSymbol { - /** - * Apparent power in volt ampere. - */ - VA, - /** - * Active power in watt. - */ - W, - /** - * Reactive power in volt ampere reactive. - */ - VAr, - /** - * Apparent energy in volt ampere hours. - */ - VAh, - /** - * Real energy in what hours. - */ - Wh, - /** - * Reactive energy in volt ampere reactive hours. - */ - VArh, - /** - * Voltage in volt. - */ - V, - /** - * Resistance in ohm. - */ - ohm, - /** - * Current in ampere. - */ - A, - /** - * Capacitance in farad. - */ - F, - /** - * Inductance in henry. - */ - H, - /** - * Relative temperature in degrees Celsius. In the SI unit system the symbol is [SYMBOL REMOVED]C. Electric charge is measured in coulomb that has the unit symbol C. To distinguish degree Celsius form coulomb the symbol used in the UML is degC. Reason for not using [SYMBOL REMOVED]C is the special character [SYMBOL REMOVED] is difficult to manage in software. - */ - degC, - /** - * Time in seconds. - */ - s, - /** - * Time in minutes. - */ - min, - /** - * Time in hours. - */ - h, - /** - * Plane angle in degrees. - */ - deg, - /** - * Plane angle in radians. - */ - rad, - /** - * Energy in joule. - */ - J, - /** - * Force in newton. - */ - N, - /** - * Conductance in siemens. - */ - S, - /** - * Dimension less quantity, e.g. count, per unit, etc. - */ - none, - /** - * Frequency in hertz. - */ - Hz, - /** - * Mass in gram. - */ - g, - /** - * Pressure in pascal (n/m2). - */ - Pa, - /** - * Length in meter. - */ - m, - /** - * Area in square meters. - */ - m2, - /** - * Volume in cubic meters. - */ - m3, + public: + enum UnitSymbol_ENUM + { + /** + * Apparent power in volt ampere. + */ + VA, + /** + * Active power in watt. + */ + W, + /** + * Reactive power in volt ampere reactive. + */ + VAr, + /** + * Apparent energy in volt ampere hours. + */ + VAh, + /** + * Real energy in what hours. + */ + Wh, + /** + * Reactive energy in volt ampere reactive hours. + */ + VArh, + /** + * Voltage in volt. + */ + V, + /** + * Resistance in ohm. + */ + ohm, + /** + * Current in ampere. + */ + A, + /** + * Capacitance in farad. + */ + F, + /** + * Inductance in henry. + */ + H, + /** + * Relative temperature in degrees Celsius. In the SI unit system the symbol is [SYMBOL REMOVED]C. Electric charge is measured in coulomb that has the unit symbol C. To distinguish degree Celsius form coulomb the symbol used in the UML is degC. Reason for not using [SYMBOL REMOVED]C is the special character [SYMBOL REMOVED] is difficult to manage in software. + */ + degC, + /** + * Time in seconds. + */ + s, + /** + * Time in minutes. + */ + min, + /** + * Time in hours. + */ + h, + /** + * Plane angle in degrees. + */ + deg, + /** + * Plane angle in radians. + */ + rad, + /** + * Energy in joule. + */ + J, + /** + * Force in newton. + */ + N, + /** + * Conductance in siemens. + */ + S, + /** + * Dimension less quantity, e.g. count, per unit, etc. + */ + none, + /** + * Frequency in hertz. + */ + Hz, + /** + * Mass in gram. + */ + g, + /** + * Pressure in pascal (n/m2). + */ + Pa, + /** + * Length in meter. + */ + m, + /** + * Area in square meters. + */ + m2, + /** + * Volume in cubic meters. + */ + m3, + }; + + UnitSymbol() : value(), initialized(false) {} + UnitSymbol(UnitSymbol_ENUM value) : value(value), initialized(true) {} + + UnitSymbol& operator=(UnitSymbol_ENUM rop); + operator UnitSymbol_ENUM() const; + + UnitSymbol_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, UnitSymbol& rop); + friend std::ostream& operator<<(std::ostream& os, const UnitSymbol& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::UnitSymbol& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/VAdjIEEE.cpp b/CGMES_2.4.15_16FEB2016/VAdjIEEE.cpp index 11850a91c..40cbde3f2 100644 --- a/CGMES_2.4.15_16FEB2016/VAdjIEEE.cpp +++ b/CGMES_2.4.15_16FEB2016/VAdjIEEE.cpp @@ -1,126 +1,132 @@ -#include -#include "VoltageAdjusterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VAdjIEEE.hpp" +#include +#include + #include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; VAdjIEEE::VAdjIEEE() {}; - VAdjIEEE::~VAdjIEEE() {}; +bool assign_VAdjIEEE_adjslew(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->adjslew; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_taoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->taoff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_taon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->taon; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_vadjf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadjf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_vadjmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadjmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_vadjmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadjmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VAdjIEEE_vadjf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadjf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_adjslew(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->adjslew; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_vadjmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadjmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_vadjmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadjmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_taon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->taon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_taoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->taoff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* VAdjIEEE_factory() { - return new VAdjIEEE; - } +const char VAdjIEEE::debugName[] = "VAdjIEEE"; +const char* VAdjIEEE::debugString() const +{ + return VAdjIEEE::debugName; } -void VAdjIEEE::addConstructToMap(std::unordered_map& factory_map) { +void VAdjIEEE::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VAdjIEEE"), &VAdjIEEE_factory)); } -void VAdjIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjf"), &assign_VAdjIEEE_vadjf)); +void VAdjIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.adjslew"), &assign_VAdjIEEE_adjslew)); + assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taoff"), &assign_VAdjIEEE_taoff)); + assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taon"), &assign_VAdjIEEE_taon)); + assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjf"), &assign_VAdjIEEE_vadjf)); assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjmax"), &assign_VAdjIEEE_vadjmax)); assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjmin"), &assign_VAdjIEEE_vadjmin)); - assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taon"), &assign_VAdjIEEE_taon)); - assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taoff"), &assign_VAdjIEEE_taoff)); } -void VAdjIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char VAdjIEEE::debugName[] = "VAdjIEEE"; -const char* VAdjIEEE::debugString() +void VAdjIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VAdjIEEE::debugName; } const BaseClassDefiner VAdjIEEE::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner VAdjIEEE::declare() return BaseClassDefiner(VAdjIEEE::addConstructToMap, VAdjIEEE::addPrimitiveAssignFnsToMap, VAdjIEEE::addClassAssignFnsToMap, VAdjIEEE::debugName); } - +namespace CIMPP +{ + BaseClass* VAdjIEEE_factory() + { + return new VAdjIEEE; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VAdjIEEE.hpp b/CGMES_2.4.15_16FEB2016/VAdjIEEE.hpp index 29e19347e..dfbc75b3f 100644 --- a/CGMES_2.4.15_16FEB2016/VAdjIEEE.hpp +++ b/CGMES_2.4.15_16FEB2016/VAdjIEEE.hpp @@ -1,45 +1,46 @@ #ifndef VAdjIEEE_H #define VAdjIEEE_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageAdjusterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "VoltageAdjusterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Voltage Adjuster which is used to represent the voltage adjuster in either a power factor or var control system. Reference: IEEE Standard 421.5-2005 Section 11.1. */ - class VAdjIEEE: public VoltageAdjusterDynamics + class VAdjIEEE : public VoltageAdjusterDynamics { - public: - CIMPP::Simple_Float vadjf; /* Set high to provide a continuous raise or lower (). Default: nullptr */ - CIMPP::Simple_Float adjslew; /* Rate at which output of adjuster changes (). Unit = sec./PU. Typical Value = 300. Default: nullptr */ - CIMPP::PU vadjmax; /* Maximum output of the adjuster (). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vadjmin; /* Minimum output of the adjuster (). Typical Value = 0.9. Default: nullptr */ - CIMPP::Seconds taon; /* Time that adjuster pulses are on (). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds taoff; /* Time that adjuster pulses are off (). Typical Value = 0.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VAdjIEEE(); - virtual ~VAdjIEEE(); - + ~VAdjIEEE() override; + + CIMPP::Simple_Float adjslew; /* Rate at which output of adjuster changes (). Unit = sec./PU. Typical Value = 300. Default: nullptr */ + CIMPP::Seconds taoff; /* Time that adjuster pulses are off (). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds taon; /* Time that adjuster pulses are on (). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float vadjf; /* Set high to provide a continuous raise or lower (). Default: nullptr */ + CIMPP::PU vadjmax; /* Maximum output of the adjuster (). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vadjmin; /* Minimum output of the adjuster (). Typical Value = 0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VAdjIEEE_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VCompIEEEType1.cpp b/CGMES_2.4.15_16FEB2016/VCompIEEEType1.cpp index ca9a4e20d..81a902412 100644 --- a/CGMES_2.4.15_16FEB2016/VCompIEEEType1.cpp +++ b/CGMES_2.4.15_16FEB2016/VCompIEEEType1.cpp @@ -1,81 +1,84 @@ -#include -#include "VoltageCompensatorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VCompIEEEType1.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; VCompIEEEType1::VCompIEEEType1() {}; - VCompIEEEType1::~VCompIEEEType1() {}; +bool assign_VCompIEEEType1_rc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VCompIEEEType1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VCompIEEEType1_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VCompIEEEType1_rc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VCompIEEEType1_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VCompIEEEType1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* VCompIEEEType1_factory() { - return new VCompIEEEType1; - } +const char VCompIEEEType1::debugName[] = "VCompIEEEType1"; +const char* VCompIEEEType1::debugString() const +{ + return VCompIEEEType1::debugName; } -void VCompIEEEType1::addConstructToMap(std::unordered_map& factory_map) { +void VCompIEEEType1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VCompIEEEType1"), &VCompIEEEType1_factory)); } -void VCompIEEEType1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VCompIEEEType1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.rc"), &assign_VCompIEEEType1_rc)); - assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.xc"), &assign_VCompIEEEType1_xc)); assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.tr"), &assign_VCompIEEEType1_tr)); + assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.xc"), &assign_VCompIEEEType1_xc)); } -void VCompIEEEType1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char VCompIEEEType1::debugName[] = "VCompIEEEType1"; -const char* VCompIEEEType1::debugString() +void VCompIEEEType1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VCompIEEEType1::debugName; } const BaseClassDefiner VCompIEEEType1::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner VCompIEEEType1::declare() return BaseClassDefiner(VCompIEEEType1::addConstructToMap, VCompIEEEType1::addPrimitiveAssignFnsToMap, VCompIEEEType1::addClassAssignFnsToMap, VCompIEEEType1::debugName); } - +namespace CIMPP +{ + BaseClass* VCompIEEEType1_factory() + { + return new VCompIEEEType1; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VCompIEEEType1.hpp b/CGMES_2.4.15_16FEB2016/VCompIEEEType1.hpp index dba5bc5ba..3c20535b0 100644 --- a/CGMES_2.4.15_16FEB2016/VCompIEEEType1.hpp +++ b/CGMES_2.4.15_16FEB2016/VCompIEEEType1.hpp @@ -1,41 +1,42 @@ #ifndef VCompIEEEType1_H #define VCompIEEEType1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageCompensatorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageCompensatorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Reference: IEEE Standard 421.5-2005 Section 4. */ - class VCompIEEEType1: public VoltageCompensatorDynamics + class VCompIEEEType1 : public VoltageCompensatorDynamics { - public: - CIMPP::PU rc; /* Default: nullptr */ - CIMPP::PU xc; /* Default: nullptr */ - CIMPP::Seconds tr; /* Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VCompIEEEType1(); - virtual ~VCompIEEEType1(); - + ~VCompIEEEType1() override; + + CIMPP::PU rc; /* Default: nullptr */ + CIMPP::Seconds tr; /* Default: nullptr */ + CIMPP::PU xc; /* Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VCompIEEEType1_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VCompIEEEType2.cpp b/CGMES_2.4.15_16FEB2016/VCompIEEEType2.cpp index 14daa99b2..828250e60 100644 --- a/CGMES_2.4.15_16FEB2016/VCompIEEEType2.cpp +++ b/CGMES_2.4.15_16FEB2016/VCompIEEEType2.cpp @@ -1,63 +1,72 @@ -#include -#include "VoltageCompensatorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VCompIEEEType2.hpp" -#include "Seconds.hpp" +#include +#include + #include "GenICompensationForGenJ.hpp" +#include "Seconds.hpp" using namespace CIMPP; -VCompIEEEType2::VCompIEEEType2(): GenICompensationForGenJ(nullptr) {}; - +VCompIEEEType2::VCompIEEEType2() {}; VCompIEEEType2::~VCompIEEEType2() {}; -bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1)) { - element->GenICompensationForGenJ = dynamic_cast(BaseClass_ptr2); - if(element->GenICompensationForGenJ != nullptr) - return true; - } - return false; +bool assign_VCompIEEEType2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_VCompIEEEType2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass*, BaseClass*); +bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1); + GenICompensationForGenJ* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->GenICompensationForGenJ.begin(), element->GenICompensationForGenJ.end(), element2) == element->GenICompensationForGenJ.end()) + { + element->GenICompensationForGenJ.push_back(element2); + return assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VCompIEEEType2_factory() { - return new VCompIEEEType2; - } +const char VCompIEEEType2::debugName[] = "VCompIEEEType2"; +const char* VCompIEEEType2::debugString() const +{ + return VCompIEEEType2::debugName; } -void VCompIEEEType2::addConstructToMap(std::unordered_map& factory_map) { +void VCompIEEEType2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VCompIEEEType2"), &VCompIEEEType2_factory)); } -void VCompIEEEType2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VCompIEEEType2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType2.tr"), &assign_VCompIEEEType2_tr)); - } - -void VCompIEEEType2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType2.GenICompensationForGenJ"), &assign_VCompIEEEType2_GenICompensationForGenJ)); } -const char VCompIEEEType2::debugName[] = "VCompIEEEType2"; -const char* VCompIEEEType2::debugString() +void VCompIEEEType2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VCompIEEEType2::debugName; + assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType2.GenICompensationForGenJ"), &assign_VCompIEEEType2_GenICompensationForGenJ)); } const BaseClassDefiner VCompIEEEType2::declare() @@ -65,4 +74,10 @@ const BaseClassDefiner VCompIEEEType2::declare() return BaseClassDefiner(VCompIEEEType2::addConstructToMap, VCompIEEEType2::addPrimitiveAssignFnsToMap, VCompIEEEType2::addClassAssignFnsToMap, VCompIEEEType2::debugName); } - +namespace CIMPP +{ + BaseClass* VCompIEEEType2_factory() + { + return new VCompIEEEType2; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VCompIEEEType2.hpp b/CGMES_2.4.15_16FEB2016/VCompIEEEType2.hpp index 14dd6d973..2eb1c729a 100644 --- a/CGMES_2.4.15_16FEB2016/VCompIEEEType2.hpp +++ b/CGMES_2.4.15_16FEB2016/VCompIEEEType2.hpp @@ -1,40 +1,38 @@ #ifndef VCompIEEEType2_H #define VCompIEEEType2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageCompensatorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageCompensatorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class GenICompensationForGenJ; - -class GenICompensationForGenJ; - /* - - */ - class VCompIEEEType2: public VoltageCompensatorDynamics + class VCompIEEEType2 : public VoltageCompensatorDynamics { - public: - CIMPP::Seconds tr; /* Default: nullptr */ - CIMPP::GenICompensationForGenJ* GenICompensationForGenJ; /* Compensation of this voltage compensator`s generator for current flow out of another generator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VCompIEEEType2(); - virtual ~VCompIEEEType2(); - + ~VCompIEEEType2() override; + + std::list GenICompensationForGenJ; /* Compensation of this voltage compensator`s generator for current flow out of another generator. Default: 0 */ + CIMPP::Seconds tr; /* Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VCompIEEEType2_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Validity.cpp b/CGMES_2.4.15_16FEB2016/Validity.cpp index be115cd76..9796a2efa 100644 --- a/CGMES_2.4.15_16FEB2016/Validity.cpp +++ b/CGMES_2.4.15_16FEB2016/Validity.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Validity.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::Validity& rop) +Validity& Validity::operator=(Validity_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +Validity::operator Validity_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Validity::debugName[] = "Validity"; +const char* Validity::debugString() const +{ + return Validity::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Validity& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const Validity& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == Validity::GOOD) + { + EnumSymbol = "GOOD"; + } + if (obj.value == Validity::QUESTIONABLE) + { + EnumSymbol = "QUESTIONABLE"; + } + if (obj.value == Validity::INVALID) + { + EnumSymbol = "INVALID"; + } + + if (!EnumSymbol.empty()) + { + os << "Validity." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/Validity.hpp b/CGMES_2.4.15_16FEB2016/Validity.hpp index 5c66bbbc6..fb4d8ce56 100644 --- a/CGMES_2.4.15_16FEB2016/Validity.hpp +++ b/CGMES_2.4.15_16FEB2016/Validity.hpp @@ -1,25 +1,50 @@ #ifndef Validity_H #define Validity_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Validity for MeasurementValue. */ - enum class Validity + class Validity { - /** - * The value is marked good if no abnormal condition of the acquisition function or the information source is detected. - */ - GOOD, - /** - * The value is marked questionable if a supervision function detects an abnormal behaviour, however the value could still be valid. The client is responsible for determining whether or not values marked "questionable" should be used. - */ - QUESTIONABLE, - /** - * The value is marked invalid when a supervision function recognises abnormal conditions of the acquisition function or the information source (missing or non-operating updating devices). The value is not defined under this condition. The mark invalid is used to indicate to the client that the value may be incorrect and shall not be used. - */ - INVALID, + public: + enum Validity_ENUM + { + /** + * The value is marked good if no abnormal condition of the acquisition function or the information source is detected. + */ + GOOD, + /** + * The value is marked questionable if a supervision function detects an abnormal behaviour, however the value could still be valid. The client is responsible for determining whether or not values marked "questionable" should be used. + */ + QUESTIONABLE, + /** + * The value is marked invalid when a supervision function recognises abnormal conditions of the acquisition function or the information source (missing or non-operating updating devices). The value is not defined under this condition. The mark invalid is used to indicate to the client that the value may be incorrect and shall not be used. + */ + INVALID, + }; + + Validity() : value(), initialized(false) {} + Validity(Validity_ENUM value) : value(value), initialized(true) {} + + Validity& operator=(Validity_ENUM rop); + operator Validity_ENUM() const; + + Validity_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Validity& rop); + friend std::ostream& operator<<(std::ostream& os, const Validity& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::Validity& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/ValueAliasSet.cpp b/CGMES_2.4.15_16FEB2016/ValueAliasSet.cpp index 0829d94cf..09cad7fd2 100644 --- a/CGMES_2.4.15_16FEB2016/ValueAliasSet.cpp +++ b/CGMES_2.4.15_16FEB2016/ValueAliasSet.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ValueAliasSet.hpp" +#include +#include + #include "Command.hpp" #include "Discrete.hpp" #include "RaiseLowerCommand.hpp" @@ -10,84 +14,114 @@ using namespace CIMPP; ValueAliasSet::ValueAliasSet() {}; - ValueAliasSet::~ValueAliasSet() {}; -bool assign_ValueAliasSet_Commands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Commands.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + + +bool assign_Command_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_Commands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + Command* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Commands.begin(), element->Commands.end(), element2) == element->Commands.end()) + { + element->Commands.push_back(element2); + return assign_Command_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ValueAliasSet_Discretes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Discretes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Discrete_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_Discretes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + Discrete* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Discretes.begin(), element->Discretes.end(), element2) == element->Discretes.end()) + { + element->Discretes.push_back(element2); + return assign_Discrete_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RaiseLowerCommands.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_RaiseLowerCommand_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + RaiseLowerCommand* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RaiseLowerCommands.begin(), element->RaiseLowerCommands.end(), element2) == element->RaiseLowerCommands.end()) + { + element->RaiseLowerCommands.push_back(element2); + return assign_RaiseLowerCommand_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ValueAliasSet_Values(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Values.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_ValueToAlias_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_Values(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + ValueToAlias* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Values.begin(), element->Values.end(), element2) == element->Values.end()) + { + element->Values.push_back(element2); + return assign_ValueToAlias_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - -namespace CIMPP { - BaseClass* ValueAliasSet_factory() { - return new ValueAliasSet; - } +const char ValueAliasSet::debugName[] = "ValueAliasSet"; +const char* ValueAliasSet::debugString() const +{ + return ValueAliasSet::debugName; } -void ValueAliasSet::addConstructToMap(std::unordered_map& factory_map) { +void ValueAliasSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ValueAliasSet"), &ValueAliasSet_factory)); } -void ValueAliasSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ValueAliasSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void ValueAliasSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void ValueAliasSet::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.Commands"), &assign_ValueAliasSet_Commands)); assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.Discretes"), &assign_ValueAliasSet_Discretes)); assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.RaiseLowerCommands"), &assign_ValueAliasSet_RaiseLowerCommands)); assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.Values"), &assign_ValueAliasSet_Values)); } -const char ValueAliasSet::debugName[] = "ValueAliasSet"; -const char* ValueAliasSet::debugString() -{ - return ValueAliasSet::debugName; -} - const BaseClassDefiner ValueAliasSet::declare() { return BaseClassDefiner(ValueAliasSet::addConstructToMap, ValueAliasSet::addPrimitiveAssignFnsToMap, ValueAliasSet::addClassAssignFnsToMap, ValueAliasSet::debugName); } - +namespace CIMPP +{ + BaseClass* ValueAliasSet_factory() + { + return new ValueAliasSet; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ValueAliasSet.hpp b/CGMES_2.4.15_16FEB2016/ValueAliasSet.hpp index f0cafcbee..5cf4ee926 100644 --- a/CGMES_2.4.15_16FEB2016/ValueAliasSet.hpp +++ b/CGMES_2.4.15_16FEB2016/ValueAliasSet.hpp @@ -1,44 +1,45 @@ #ifndef ValueAliasSet_H #define ValueAliasSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Command; + class Discrete; + class RaiseLowerCommand; + class ValueToAlias; -class Command; -class Discrete; -class RaiseLowerCommand; -class ValueToAlias; /* Describes the translation of a set of values into a name and is intendend to facilitate cusom translations. Each ValueAliasSet has a name, description etc. A specific Measurement may represent a discrete state like Open, Closed, Intermediate etc. This requires a translation from the MeasurementValue.value number to a string, e.g. 0->"Invalid", 1->"Open", 2->"Closed", 3->"Intermediate". Each ValueToAlias member in ValueAliasSet.Value describe a mapping for one particular value to a name. */ - class ValueAliasSet: public IdentifiedObject + class ValueAliasSet : public IdentifiedObject { - public: - std::list Commands; /* The Commands using the set for translation. Default: 0 */ - std::list Discretes; /* The Measurements using the set for translation. Default: 0 */ - std::list RaiseLowerCommands; /* The Commands using the set for translation. Default: 0 */ - std::list Values; /* The ValueAliasSet having the ValueToAlias mappings. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ValueAliasSet(); - virtual ~ValueAliasSet(); - + ~ValueAliasSet() override; + + std::list Commands; /* The Commands using the set for translation. Default: 0 */ + std::list Discretes; /* The Measurements using the set for translation. Default: 0 */ + std::list RaiseLowerCommands; /* The Commands using the set for translation. Default: 0 */ + std::list Values; /* The ValueAliasSet having the ValueToAlias mappings. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ValueAliasSet_factory(); diff --git a/CGMES_2.4.15_16FEB2016/ValueToAlias.cpp b/CGMES_2.4.15_16FEB2016/ValueToAlias.cpp index a5e24988e..6472d61b0 100644 --- a/CGMES_2.4.15_16FEB2016/ValueToAlias.cpp +++ b/CGMES_2.4.15_16FEB2016/ValueToAlias.cpp @@ -1,64 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ValueToAlias.hpp" +#include +#include + #include "ValueAliasSet.hpp" #include "Integer.hpp" using namespace CIMPP; -ValueToAlias::ValueToAlias(): ValueAliasSet(nullptr) {}; - +ValueToAlias::ValueToAlias() : ValueAliasSet(nullptr) {}; ValueToAlias::~ValueToAlias() {}; -bool assign_ValueAliasSet_Values(BaseClass*, BaseClass*); -bool assign_ValueToAlias_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueToAlias* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_Values(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_ValueToAlias_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ValueToAlias* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ValueToAlias_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ValueToAlias* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ValueAliasSet_Values(BaseClass*, BaseClass*); +bool assign_ValueToAlias_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueToAlias* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_Values(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ValueToAlias_factory() { - return new ValueToAlias; - } + +const char ValueToAlias::debugName[] = "ValueToAlias"; +const char* ValueToAlias::debugString() const +{ + return ValueToAlias::debugName; } -void ValueToAlias::addConstructToMap(std::unordered_map& factory_map) { +void ValueToAlias::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ValueToAlias"), &ValueToAlias_factory)); } -void ValueToAlias::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.value"), &assign_ValueToAlias_value)); +void ValueToAlias::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.value"), &assign_ValueToAlias_value)); } -void ValueToAlias::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.ValueAliasSet"), &assign_ValueToAlias_ValueAliasSet)); - } - -const char ValueToAlias::debugName[] = "ValueToAlias"; -const char* ValueToAlias::debugString() +void ValueToAlias::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ValueToAlias::debugName; + assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.ValueAliasSet"), &assign_ValueToAlias_ValueAliasSet)); } const BaseClassDefiner ValueToAlias::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner ValueToAlias::declare() return BaseClassDefiner(ValueToAlias::addConstructToMap, ValueToAlias::addPrimitiveAssignFnsToMap, ValueToAlias::addClassAssignFnsToMap, ValueToAlias::debugName); } - +namespace CIMPP +{ + BaseClass* ValueToAlias_factory() + { + return new ValueToAlias; + } +} diff --git a/CGMES_2.4.15_16FEB2016/ValueToAlias.hpp b/CGMES_2.4.15_16FEB2016/ValueToAlias.hpp index fcdd8316a..6cb282164 100644 --- a/CGMES_2.4.15_16FEB2016/ValueToAlias.hpp +++ b/CGMES_2.4.15_16FEB2016/ValueToAlias.hpp @@ -1,40 +1,41 @@ #ifndef ValueToAlias_H #define ValueToAlias_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ValueAliasSet; - -class ValueAliasSet; /* Describes the translation of one particular value into a name, e.g. 1 as "Open". */ - class ValueToAlias: public IdentifiedObject + class ValueToAlias : public IdentifiedObject { - public: - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueToAlias mappings included in the set. Default: 0 */ - CIMPP::Integer value; /* The value that is mapped. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ValueToAlias(); - virtual ~ValueToAlias(); - + ~ValueToAlias() override; + + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueToAlias mappings included in the set. Default: 0 */ + CIMPP::Integer value; /* The value that is mapped. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ValueToAlias_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VisibilityLayer.cpp b/CGMES_2.4.15_16FEB2016/VisibilityLayer.cpp index cc031b8ae..f08a78d66 100644 --- a/CGMES_2.4.15_16FEB2016/VisibilityLayer.cpp +++ b/CGMES_2.4.15_16FEB2016/VisibilityLayer.cpp @@ -1,64 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VisibilityLayer.hpp" +#include +#include + #include "DiagramObject.hpp" #include "Integer.hpp" using namespace CIMPP; VisibilityLayer::VisibilityLayer() {}; - VisibilityLayer::~VisibilityLayer() {}; -bool assign_VisibilityLayer_VisibleObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VisibilityLayer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VisibleObjects.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_VisibilityLayer_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VisibilityLayer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->drawingOrder; + if (buffer.fail()) + return false; + else return true; - } } return false; } - - -bool assign_VisibilityLayer_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VisibilityLayer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->drawingOrder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObject_VisibilityLayers(BaseClass*, BaseClass*); +bool assign_VisibilityLayer_VisibleObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VisibilityLayer* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VisibleObjects.begin(), element->VisibleObjects.end(), element2) == element->VisibleObjects.end()) + { + element->VisibleObjects.push_back(element2); + return assign_DiagramObject_VisibilityLayers(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VisibilityLayer_factory() { - return new VisibilityLayer; - } + +const char VisibilityLayer::debugName[] = "VisibilityLayer"; +const char* VisibilityLayer::debugString() const +{ + return VisibilityLayer::debugName; } -void VisibilityLayer::addConstructToMap(std::unordered_map& factory_map) { +void VisibilityLayer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VisibilityLayer"), &VisibilityLayer_factory)); } -void VisibilityLayer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.drawingOrder"), &assign_VisibilityLayer_drawingOrder)); +void VisibilityLayer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.drawingOrder"), &assign_VisibilityLayer_drawingOrder)); } -void VisibilityLayer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.VisibleObjects"), &assign_VisibilityLayer_VisibleObjects)); - } - -const char VisibilityLayer::debugName[] = "VisibilityLayer"; -const char* VisibilityLayer::debugString() +void VisibilityLayer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VisibilityLayer::debugName; + assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.VisibleObjects"), &assign_VisibilityLayer_VisibleObjects)); } const BaseClassDefiner VisibilityLayer::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner VisibilityLayer::declare() return BaseClassDefiner(VisibilityLayer::addConstructToMap, VisibilityLayer::addPrimitiveAssignFnsToMap, VisibilityLayer::addClassAssignFnsToMap, VisibilityLayer::debugName); } - +namespace CIMPP +{ + BaseClass* VisibilityLayer_factory() + { + return new VisibilityLayer; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VisibilityLayer.hpp b/CGMES_2.4.15_16FEB2016/VisibilityLayer.hpp index 97805d650..3df88871d 100644 --- a/CGMES_2.4.15_16FEB2016/VisibilityLayer.hpp +++ b/CGMES_2.4.15_16FEB2016/VisibilityLayer.hpp @@ -1,40 +1,41 @@ #ifndef VisibilityLayer_H #define VisibilityLayer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; - -class DiagramObject; /* Layers are typically used for grouping diagram objects according to themes and scales. Themes are used to display or hide certain information (e.g., lakes, borders), while scales are used for hiding or displaying information depending on the current zoom level (hide text when it is too small to be read, or when it exceeds the screen size). This is also called de-cluttering. CIM based graphics exchange will support an m:n relationship between diagram objects and layers. It will be the task of the importing system to convert an m:n case into an appropriate 1:n representation if the importing system does not support m:n. */ - class VisibilityLayer: public IdentifiedObject + class VisibilityLayer : public IdentifiedObject { - public: - std::list VisibleObjects; /* A visibility layer can contain one or more diagram objects. Default: 0 */ - CIMPP::Integer drawingOrder; /* The drawing order for this layer. The higher the number, the later the layer and the objects within it are rendered. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VisibilityLayer(); - virtual ~VisibilityLayer(); - + ~VisibilityLayer() override; + + std::list VisibleObjects; /* A visibility layer can contain one or more diagram objects. Default: 0 */ + CIMPP::Integer drawingOrder; /* The drawing order for this layer. The higher the number, the later the layer and the objects within it are rendered. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VisibilityLayer_factory(); diff --git a/CGMES_2.4.15_16FEB2016/Voltage.cpp b/CGMES_2.4.15_16FEB2016/Voltage.cpp index 7675f6208..3f7992f4e 100644 --- a/CGMES_2.4.15_16FEB2016/Voltage.cpp +++ b/CGMES_2.4.15_16FEB2016/Voltage.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Voltage.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Voltage::Voltage() {} -Voltage::~Voltage(){} +#include -Voltage::Voltage(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Voltage::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Voltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Voltage& Voltage::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Voltage::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Voltage::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Voltage::debugName[] = "Voltage"; -const char* Voltage::debugString() { +const char* Voltage::debugString() const +{ return Voltage::debugName; } - -const BaseClassDefiner Voltage::declare() { - return BaseClassDefiner(Voltage::addConstructToMap, Voltage::addPrimitiveAssignFnsToMap, Voltage::addClassAssignFnsToMap, Voltage::debugName); +Voltage& Voltage::operator+=(const Voltage& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Voltage& Voltage::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Voltage& Voltage::operator-=(const Voltage& rhs) { - value -= rhs.value; - return *this; - } - - Voltage& Voltage::operator*=(const Voltage& rhs) { - value *= rhs.value; - return *this; - } - - Voltage& Voltage::operator/=(const Voltage& rhs) { - value /= rhs.value; - return *this; - } +Voltage& Voltage::operator-=(const Voltage& rhs) +{ + value -= rhs.value; + return *this; +} - Voltage& Voltage::operator+=(const Voltage& rhs) { - value += rhs.value; - return *this; - } +Voltage& Voltage::operator*=(const Voltage& rhs) +{ + value *= rhs.value; + return *this; +} - Voltage::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Voltage& Voltage::operator/=(const Voltage& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Voltage& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Voltage& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Voltage& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_16FEB2016/Voltage.hpp b/CGMES_2.4.15_16FEB2016/Voltage.hpp index ffef540d3..12eb87179 100644 --- a/CGMES_2.4.15_16FEB2016/Voltage.hpp +++ b/CGMES_2.4.15_16FEB2016/Voltage.hpp @@ -1,38 +1,39 @@ #ifndef Voltage_H #define Voltage_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Voltage : public BaseClass + /* + Electrical voltage, can be both AC and DC. + */ + class Voltage { - public: - Voltage(); - virtual ~Voltage(); - Voltage(long double value); - static const BaseClassDefiner declare(); - Voltage& operator=(long double &rop); + Voltage() : value(0.0), initialized(false) {} + Voltage(long double value) : value(value), initialized(true) {} + + Voltage& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Voltage& operator+=(const Voltage& rhs); Voltage& operator-=(const Voltage& rhs); Voltage& operator*=(const Voltage& rhs); Voltage& operator/=(const Voltage& rhs); + friend std::istream& operator>>(std::istream& lop, Voltage& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Voltage& obj); }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.cpp b/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.cpp index 5e9077a68..fbd1e515e 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageAdjusterDynamics.hpp" +#include +#include + #include "PFVArControllerType1Dynamics.hpp" using namespace CIMPP; -VoltageAdjusterDynamics::VoltageAdjusterDynamics(): PFVArControllerType1Dynamics(nullptr) {}; - +VoltageAdjusterDynamics::VoltageAdjusterDynamics() : PFVArControllerType1Dynamics(nullptr) {}; VoltageAdjusterDynamics::~VoltageAdjusterDynamics() {}; -bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass*, BaseClass*); -bool assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageAdjusterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1Dynamics != nullptr) - return assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* VoltageAdjusterDynamics_factory() { - return new VoltageAdjusterDynamics; +bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass*, BaseClass*); +bool assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageAdjusterDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1Dynamics != element2) + { + element->PFVArControllerType1Dynamics = element2; + return assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void VoltageAdjusterDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics"), &VoltageAdjusterDynamics_factory)); +const char VoltageAdjusterDynamics::debugName[] = "VoltageAdjusterDynamics"; +const char* VoltageAdjusterDynamics::debugString() const +{ + return VoltageAdjusterDynamics::debugName; } -void VoltageAdjusterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void VoltageAdjusterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics"), &VoltageAdjusterDynamics_factory)); +} -void VoltageAdjusterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics.PFVArControllerType1Dynamics"), &assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics)); +void VoltageAdjusterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char VoltageAdjusterDynamics::debugName[] = "VoltageAdjusterDynamics"; -const char* VoltageAdjusterDynamics::debugString() +void VoltageAdjusterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageAdjusterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics.PFVArControllerType1Dynamics"), &assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics)); } const BaseClassDefiner VoltageAdjusterDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner VoltageAdjusterDynamics::declare() return BaseClassDefiner(VoltageAdjusterDynamics::addConstructToMap, VoltageAdjusterDynamics::addPrimitiveAssignFnsToMap, VoltageAdjusterDynamics::addClassAssignFnsToMap, VoltageAdjusterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageAdjusterDynamics_factory() + { + return new VoltageAdjusterDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.hpp b/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.hpp index 9786dd22c..9f64ce933 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltageAdjusterDynamics.hpp @@ -1,38 +1,39 @@ #ifndef VoltageAdjusterDynamics_H #define VoltageAdjusterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class PFVArControllerType1Dynamics; -class PFVArControllerType1Dynamics; /* Voltage adjuster function block whose behaviour is described by reference to a standard model */ - class VoltageAdjusterDynamics: public DynamicsFunctionBlock + class VoltageAdjusterDynamics : public DynamicsFunctionBlock { - public: - CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model with which this voltage adjuster is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageAdjusterDynamics(); - virtual ~VoltageAdjusterDynamics(); - + ~VoltageAdjusterDynamics() override; + + CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model with which this voltage adjuster is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageAdjusterDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.cpp b/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.cpp index 74edd01de..b41599c4a 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "VoltageAdjusterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageAdjusterUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; VoltageAdjusterUserDefined::VoltageAdjusterUserDefined() {}; - VoltageAdjusterUserDefined::~VoltageAdjusterUserDefined() {}; -bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_VoltageAdjusterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_VoltageAdjusterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass*, BaseClass*); +bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VoltageAdjusterUserDefined_factory() { - return new VoltageAdjusterUserDefined; - } +const char VoltageAdjusterUserDefined::debugName[] = "VoltageAdjusterUserDefined"; +const char* VoltageAdjusterUserDefined::debugString() const +{ + return VoltageAdjusterUserDefined::debugName; } -void VoltageAdjusterUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void VoltageAdjusterUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined"), &VoltageAdjusterUserDefined_factory)); } -void VoltageAdjusterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VoltageAdjusterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined.proprietary"), &assign_VoltageAdjusterUserDefined_proprietary)); - } - -void VoltageAdjusterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined.ProprietaryParameterDynamics"), &assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics)); } -const char VoltageAdjusterUserDefined::debugName[] = "VoltageAdjusterUserDefined"; -const char* VoltageAdjusterUserDefined::debugString() +void VoltageAdjusterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageAdjusterUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined.ProprietaryParameterDynamics"), &assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner VoltageAdjusterUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner VoltageAdjusterUserDefined::declare() return BaseClassDefiner(VoltageAdjusterUserDefined::addConstructToMap, VoltageAdjusterUserDefined::addPrimitiveAssignFnsToMap, VoltageAdjusterUserDefined::addClassAssignFnsToMap, VoltageAdjusterUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageAdjusterUserDefined_factory() + { + return new VoltageAdjusterUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.hpp b/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.hpp index 34cc6a4dd..85173e315 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltageAdjusterUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef VoltageAdjusterUserDefined_H #define VoltageAdjusterUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageAdjusterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageAdjusterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* function block whose dynamic behaviour is described by */ - class VoltageAdjusterUserDefined: public VoltageAdjusterDynamics + class VoltageAdjusterUserDefined : public VoltageAdjusterDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageAdjusterUserDefined(); - virtual ~VoltageAdjusterUserDefined(); - + ~VoltageAdjusterUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageAdjusterUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.cpp b/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.cpp index f17bd2e98..283d81921 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.cpp @@ -1,61 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageCompensatorDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -VoltageCompensatorDynamics::VoltageCompensatorDynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr) {}; - +VoltageCompensatorDynamics::VoltageCompensatorDynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr) {}; VoltageCompensatorDynamics::~VoltageCompensatorDynamics() {}; -bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass*, BaseClass*); -bool assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass*, BaseClass*); +bool assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* VoltageCompensatorDynamics_factory() { - return new VoltageCompensatorDynamics; +bool assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass*, BaseClass*); +bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void VoltageCompensatorDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics"), &VoltageCompensatorDynamics_factory)); +const char VoltageCompensatorDynamics::debugName[] = "VoltageCompensatorDynamics"; +const char* VoltageCompensatorDynamics::debugString() const +{ + return VoltageCompensatorDynamics::debugName; } -void VoltageCompensatorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void VoltageCompensatorDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics"), &VoltageCompensatorDynamics_factory)); +} -void VoltageCompensatorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.RemoteInputSignal"), &assign_VoltageCompensatorDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.ExcitationSystemDynamics"), &assign_VoltageCompensatorDynamics_ExcitationSystemDynamics)); +void VoltageCompensatorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char VoltageCompensatorDynamics::debugName[] = "VoltageCompensatorDynamics"; -const char* VoltageCompensatorDynamics::debugString() +void VoltageCompensatorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageCompensatorDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.ExcitationSystemDynamics"), &assign_VoltageCompensatorDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.RemoteInputSignal"), &assign_VoltageCompensatorDynamics_RemoteInputSignal)); } const BaseClassDefiner VoltageCompensatorDynamics::declare() @@ -63,4 +78,10 @@ const BaseClassDefiner VoltageCompensatorDynamics::declare() return BaseClassDefiner(VoltageCompensatorDynamics::addConstructToMap, VoltageCompensatorDynamics::addPrimitiveAssignFnsToMap, VoltageCompensatorDynamics::addClassAssignFnsToMap, VoltageCompensatorDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageCompensatorDynamics_factory() + { + return new VoltageCompensatorDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.hpp b/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.hpp index 2d280101e..d49ec9fa9 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltageCompensatorDynamics.hpp @@ -1,40 +1,41 @@ #ifndef VoltageCompensatorDynamics_H #define VoltageCompensatorDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Voltage compensator function block whose behaviour is described by reference to a standard model */ - class VoltageCompensatorDynamics: public DynamicsFunctionBlock + class VoltageCompensatorDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this voltage compensator model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this voltage compensator is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageCompensatorDynamics(); - virtual ~VoltageCompensatorDynamics(); - + ~VoltageCompensatorDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this voltage compensator is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this voltage compensator model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageCompensatorDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.cpp b/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.cpp index c7b3db0b1..7c74de428 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "VoltageCompensatorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageCompensatorUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; VoltageCompensatorUserDefined::VoltageCompensatorUserDefined() {}; - VoltageCompensatorUserDefined::~VoltageCompensatorUserDefined() {}; -bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_VoltageCompensatorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_VoltageCompensatorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass*, BaseClass*); +bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VoltageCompensatorUserDefined_factory() { - return new VoltageCompensatorUserDefined; - } +const char VoltageCompensatorUserDefined::debugName[] = "VoltageCompensatorUserDefined"; +const char* VoltageCompensatorUserDefined::debugString() const +{ + return VoltageCompensatorUserDefined::debugName; } -void VoltageCompensatorUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void VoltageCompensatorUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined"), &VoltageCompensatorUserDefined_factory)); } -void VoltageCompensatorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VoltageCompensatorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined.proprietary"), &assign_VoltageCompensatorUserDefined_proprietary)); - } - -void VoltageCompensatorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined.ProprietaryParameterDynamics"), &assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics)); } -const char VoltageCompensatorUserDefined::debugName[] = "VoltageCompensatorUserDefined"; -const char* VoltageCompensatorUserDefined::debugString() +void VoltageCompensatorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageCompensatorUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined.ProprietaryParameterDynamics"), &assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner VoltageCompensatorUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner VoltageCompensatorUserDefined::declare() return BaseClassDefiner(VoltageCompensatorUserDefined::addConstructToMap, VoltageCompensatorUserDefined::addPrimitiveAssignFnsToMap, VoltageCompensatorUserDefined::addClassAssignFnsToMap, VoltageCompensatorUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageCompensatorUserDefined_factory() + { + return new VoltageCompensatorUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.hpp b/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.hpp index 99718ea81..5ffa1b065 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltageCompensatorUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef VoltageCompensatorUserDefined_H #define VoltageCompensatorUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageCompensatorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageCompensatorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Voltage compensator function block whose dynamic behaviour is described by */ - class VoltageCompensatorUserDefined: public VoltageCompensatorDynamics + class VoltageCompensatorUserDefined : public VoltageCompensatorDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageCompensatorUserDefined(); - virtual ~VoltageCompensatorUserDefined(); - + ~VoltageCompensatorUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageCompensatorUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VoltageLevel.cpp b/CGMES_2.4.15_16FEB2016/VoltageLevel.cpp index 82d279697..4fa8006ee 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageLevel.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltageLevel.cpp @@ -1,105 +1,128 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageLevel.hpp" +#include +#include + +#include "BaseVoltage.hpp" #include "Bay.hpp" +#include "Substation.hpp" #include "Voltage.hpp" #include "Voltage.hpp" -#include "BaseVoltage.hpp" -#include "Substation.hpp" using namespace CIMPP; -VoltageLevel::VoltageLevel(): BaseVoltage(nullptr), Substation(nullptr) {}; - +VoltageLevel::VoltageLevel() : BaseVoltage(nullptr), Substation(nullptr) {}; VoltageLevel::~VoltageLevel() {}; -bool assign_VoltageLevel_Bays(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Bays.push_back(dynamic_cast(BaseClass_ptr2)); + + + +bool assign_VoltageLevel_highVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->highVoltageLimit; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_VoltageLevel_lowVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lowVoltageLimit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} bool assign_BaseVoltage_VoltageLevel(BaseClass*, BaseClass*); -bool assign_VoltageLevel_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_VoltageLevel(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_Substation_VoltageLevels(BaseClass*, BaseClass*); -bool assign_VoltageLevel_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - element->Substation = dynamic_cast(BaseClass_ptr2); - if(element->Substation != nullptr) - return assign_Substation_VoltageLevels(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_VoltageLevel_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageLevel* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_VoltageLevel(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - -bool assign_VoltageLevel_highVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->highVoltageLimit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Bay_VoltageLevel(BaseClass*, BaseClass*); +bool assign_VoltageLevel_Bays(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageLevel* element = dynamic_cast(BaseClass_ptr1); + Bay* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Bays.begin(), element->Bays.end(), element2) == element->Bays.end()) + { + element->Bays.push_back(element2); + return assign_Bay_VoltageLevel(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_VoltageLevel_lowVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lowVoltageLimit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Substation_VoltageLevels(BaseClass*, BaseClass*); +bool assign_VoltageLevel_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageLevel* element = dynamic_cast(BaseClass_ptr1); + Substation* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Substation != element2) + { + element->Substation = element2; + return assign_Substation_VoltageLevels(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VoltageLevel_factory() { - return new VoltageLevel; - } +const char VoltageLevel::debugName[] = "VoltageLevel"; +const char* VoltageLevel::debugString() const +{ + return VoltageLevel::debugName; } -void VoltageLevel::addConstructToMap(std::unordered_map& factory_map) { +void VoltageLevel::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageLevel"), &VoltageLevel_factory)); } -void VoltageLevel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.highVoltageLimit"), &assign_VoltageLevel_highVoltageLimit)); +void VoltageLevel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.highVoltageLimit"), &assign_VoltageLevel_highVoltageLimit)); assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.lowVoltageLimit"), &assign_VoltageLevel_lowVoltageLimit)); - } - -void VoltageLevel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Bays"), &assign_VoltageLevel_Bays)); - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.BaseVoltage"), &assign_VoltageLevel_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Substation"), &assign_VoltageLevel_Substation)); } -const char VoltageLevel::debugName[] = "VoltageLevel"; -const char* VoltageLevel::debugString() +void VoltageLevel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageLevel::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.BaseVoltage"), &assign_VoltageLevel_BaseVoltage)); + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Bays"), &assign_VoltageLevel_Bays)); + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Substation"), &assign_VoltageLevel_Substation)); } const BaseClassDefiner VoltageLevel::declare() @@ -107,4 +130,10 @@ const BaseClassDefiner VoltageLevel::declare() return BaseClassDefiner(VoltageLevel::addConstructToMap, VoltageLevel::addPrimitiveAssignFnsToMap, VoltageLevel::addClassAssignFnsToMap, VoltageLevel::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageLevel_factory() + { + return new VoltageLevel; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltageLevel.hpp b/CGMES_2.4.15_16FEB2016/VoltageLevel.hpp index 9adca20f1..7d22565db 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageLevel.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltageLevel.hpp @@ -1,45 +1,46 @@ #ifndef VoltageLevel_H #define VoltageLevel_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class BaseVoltage; + class Bay; + class Substation; - -class Bay; -class BaseVoltage; -class Substation; /* A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these. */ - class VoltageLevel: public EquipmentContainer + class VoltageLevel : public EquipmentContainer { - public: - std::list Bays; /* The bays within this voltage level. Default: 0 */ - CIMPP::Voltage highVoltageLimit; /* The bus bar`s high voltage limit Default: nullptr */ - CIMPP::Voltage lowVoltageLimit; /* The bus bar`s low voltage limit Default: nullptr */ - CIMPP::BaseVoltage* BaseVoltage; /* The base voltage used for all equipment within the voltage level. Default: 0 */ - CIMPP::Substation* Substation; /* The substation of the voltage level. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageLevel(); - virtual ~VoltageLevel(); - + ~VoltageLevel() override; + + CIMPP::BaseVoltage* BaseVoltage; /* The base voltage used for all equipment within the voltage level. Default: 0 */ + std::list Bays; /* The bays within this voltage level. Default: 0 */ + CIMPP::Substation* Substation; /* The substation of the voltage level. Default: 0 */ + CIMPP::Voltage highVoltageLimit; /* The bus bar`s high voltage limit Default: nullptr */ + CIMPP::Voltage lowVoltageLimit; /* The bus bar`s low voltage limit Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageLevel_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VoltageLimit.cpp b/CGMES_2.4.15_16FEB2016/VoltageLimit.cpp index fdc3a7ba8..f03b3f928 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageLimit.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltageLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageLimit.hpp" +#include +#include + #include "Voltage.hpp" using namespace CIMPP; VoltageLimit::VoltageLimit() {}; - VoltageLimit::~VoltageLimit() {}; +bool assign_VoltageLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VoltageLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* VoltageLimit_factory() { - return new VoltageLimit; - } +const char VoltageLimit::debugName[] = "VoltageLimit"; +const char* VoltageLimit::debugString() const +{ + return VoltageLimit::debugName; } -void VoltageLimit::addConstructToMap(std::unordered_map& factory_map) { +void VoltageLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageLimit"), &VoltageLimit_factory)); } -void VoltageLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VoltageLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VoltageLimit.value"), &assign_VoltageLimit_value)); } -void VoltageLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char VoltageLimit::debugName[] = "VoltageLimit"; -const char* VoltageLimit::debugString() +void VoltageLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageLimit::debugName; } const BaseClassDefiner VoltageLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner VoltageLimit::declare() return BaseClassDefiner(VoltageLimit::addConstructToMap, VoltageLimit::addPrimitiveAssignFnsToMap, VoltageLimit::addClassAssignFnsToMap, VoltageLimit::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageLimit_factory() + { + return new VoltageLimit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltageLimit.hpp b/CGMES_2.4.15_16FEB2016/VoltageLimit.hpp index 7814a40b1..4dd2c2588 100644 --- a/CGMES_2.4.15_16FEB2016/VoltageLimit.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltageLimit.hpp @@ -1,38 +1,39 @@ #ifndef VoltageLimit_H #define VoltageLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Operational limit applied to voltage. */ - class VoltageLimit: public OperationalLimit + class VoltageLimit : public OperationalLimit { - public: - CIMPP::Voltage value; /* Limit on voltage. High or low limit nature of the limit depends upon the properties of the operational limit type. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageLimit(); - virtual ~VoltageLimit(); - + ~VoltageLimit() override; + + CIMPP::Voltage value; /* Limit on voltage. High or low limit nature of the limit depends upon the properties of the operational limit type. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageLimit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.cpp b/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.cpp index 119b3c228..70718a915 100644 --- a/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.cpp +++ b/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltagePerReactivePower.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" +#include -using namespace CIMPP; - -VoltagePerReactivePower::VoltagePerReactivePower(): value(nullptr) {}; - -VoltagePerReactivePower::~VoltagePerReactivePower() {}; - - -bool assign_VoltagePerReactivePower_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_VoltagePerReactivePower_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VoltagePerReactivePower_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_VoltagePerReactivePower_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_VoltagePerReactivePower_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +VoltagePerReactivePower& VoltagePerReactivePower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* VoltagePerReactivePower_factory() { - return new VoltagePerReactivePower; +VoltagePerReactivePower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void VoltagePerReactivePower::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower"), &VoltagePerReactivePower_factory)); +const char VoltagePerReactivePower::debugName[] = "VoltagePerReactivePower"; +const char* VoltagePerReactivePower::debugString() const +{ + return VoltagePerReactivePower::debugName; } -void VoltagePerReactivePower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.unit"), &assign_VoltagePerReactivePower_unit)); - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.denominatorMultiplier"), &assign_VoltagePerReactivePower_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.multiplier"), &assign_VoltagePerReactivePower_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.denominatorUnit"), &assign_VoltagePerReactivePower_denominatorUnit)); +VoltagePerReactivePower& VoltagePerReactivePower::operator+=(const VoltagePerReactivePower& rhs) +{ + value += rhs.value; + return *this; } -void VoltagePerReactivePower::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.value"), &assign_VoltagePerReactivePower_value)); - } +VoltagePerReactivePower& VoltagePerReactivePower::operator-=(const VoltagePerReactivePower& rhs) +{ + value -= rhs.value; + return *this; +} -const char VoltagePerReactivePower::debugName[] = "VoltagePerReactivePower"; -const char* VoltagePerReactivePower::debugString() +VoltagePerReactivePower& VoltagePerReactivePower::operator*=(const VoltagePerReactivePower& rhs) { - return VoltagePerReactivePower::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner VoltagePerReactivePower::declare() +VoltagePerReactivePower& VoltagePerReactivePower::operator/=(const VoltagePerReactivePower& rhs) { - return BaseClassDefiner(VoltagePerReactivePower::addConstructToMap, VoltagePerReactivePower::addPrimitiveAssignFnsToMap, VoltagePerReactivePower::addClassAssignFnsToMap, VoltagePerReactivePower::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VoltagePerReactivePower& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const VoltagePerReactivePower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.hpp b/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.hpp index bb831cfc9..51ef9b955 100644 --- a/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.hpp +++ b/CGMES_2.4.15_16FEB2016/VoltagePerReactivePower.hpp @@ -1,46 +1,39 @@ #ifndef VoltagePerReactivePower_H #define VoltagePerReactivePower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Voltage variation with reactive power. */ - class VoltagePerReactivePower: public BaseClass + class VoltagePerReactivePower { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - + VoltagePerReactivePower() : value(0.0), initialized(false) {} + VoltagePerReactivePower(long double value) : value(value), initialized(true) {} + + VoltagePerReactivePower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - VoltagePerReactivePower(); - virtual ~VoltagePerReactivePower(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + VoltagePerReactivePower& operator+=(const VoltagePerReactivePower& rhs); + VoltagePerReactivePower& operator-=(const VoltagePerReactivePower& rhs); + VoltagePerReactivePower& operator*=(const VoltagePerReactivePower& rhs); + VoltagePerReactivePower& operator/=(const VoltagePerReactivePower& rhs); - BaseClass* VoltagePerReactivePower_factory(); + friend std::istream& operator>>(std::istream& lop, VoltagePerReactivePower& rop); + friend std::ostream& operator<<(std::ostream& os, const VoltagePerReactivePower& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/VolumeFlowRate.cpp b/CGMES_2.4.15_16FEB2016/VolumeFlowRate.cpp index e46015960..4ccbb5db3 100644 --- a/CGMES_2.4.15_16FEB2016/VolumeFlowRate.cpp +++ b/CGMES_2.4.15_16FEB2016/VolumeFlowRate.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VolumeFlowRate.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "Float.hpp" - -using namespace CIMPP; - -VolumeFlowRate::VolumeFlowRate(): value(nullptr) {}; - -VolumeFlowRate::~VolumeFlowRate() {}; - +#include +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; - - -bool assign_VolumeFlowRate_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - -bool assign_VolumeFlowRate_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VolumeFlowRate_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VolumeFlowRate_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VolumeFlowRate_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +VolumeFlowRate& VolumeFlowRate::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } - -namespace CIMPP { - BaseClass* VolumeFlowRate_factory() { - return new VolumeFlowRate; +VolumeFlowRate::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void VolumeFlowRate::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VolumeFlowRate"), &VolumeFlowRate_factory)); +const char VolumeFlowRate::debugName[] = "VolumeFlowRate"; +const char* VolumeFlowRate::debugString() const +{ + return VolumeFlowRate::debugName; } -void VolumeFlowRate::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.denominatorMultiplier"), &assign_VolumeFlowRate_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.denominatorUnit"), &assign_VolumeFlowRate_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.multiplier"), &assign_VolumeFlowRate_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.unit"), &assign_VolumeFlowRate_unit)); - } +VolumeFlowRate& VolumeFlowRate::operator+=(const VolumeFlowRate& rhs) +{ + value += rhs.value; + return *this; +} -void VolumeFlowRate::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.value"), &assign_VolumeFlowRate_value)); +VolumeFlowRate& VolumeFlowRate::operator-=(const VolumeFlowRate& rhs) +{ + value -= rhs.value; + return *this; } -const char VolumeFlowRate::debugName[] = "VolumeFlowRate"; -const char* VolumeFlowRate::debugString() +VolumeFlowRate& VolumeFlowRate::operator*=(const VolumeFlowRate& rhs) { - return VolumeFlowRate::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner VolumeFlowRate::declare() +VolumeFlowRate& VolumeFlowRate::operator/=(const VolumeFlowRate& rhs) { - return BaseClassDefiner(VolumeFlowRate::addConstructToMap, VolumeFlowRate::addPrimitiveAssignFnsToMap, VolumeFlowRate::addClassAssignFnsToMap, VolumeFlowRate::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VolumeFlowRate& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const VolumeFlowRate& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VolumeFlowRate.hpp b/CGMES_2.4.15_16FEB2016/VolumeFlowRate.hpp index db8b06c43..256cf7e18 100644 --- a/CGMES_2.4.15_16FEB2016/VolumeFlowRate.hpp +++ b/CGMES_2.4.15_16FEB2016/VolumeFlowRate.hpp @@ -1,46 +1,39 @@ #ifndef VolumeFlowRate_H #define VolumeFlowRate_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Volume per time. */ - class VolumeFlowRate: public BaseClass + class VolumeFlowRate { - public: - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::Float* value; /* Default: nullptr */ - + VolumeFlowRate() : value(0.0), initialized(false) {} + VolumeFlowRate(long double value) : value(value), initialized(true) {} + + VolumeFlowRate& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - VolumeFlowRate(); - virtual ~VolumeFlowRate(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + VolumeFlowRate& operator+=(const VolumeFlowRate& rhs); + VolumeFlowRate& operator-=(const VolumeFlowRate& rhs); + VolumeFlowRate& operator*=(const VolumeFlowRate& rhs); + VolumeFlowRate& operator/=(const VolumeFlowRate& rhs); - BaseClass* VolumeFlowRate_factory(); + friend std::istream& operator>>(std::istream& lop, VolumeFlowRate& rop); + friend std::ostream& operator<<(std::ostream& os, const VolumeFlowRate& obj); + }; } #endif diff --git a/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.cpp b/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.cpp index e6ccbe7d3..ada4fd1b3 100644 --- a/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.cpp +++ b/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.cpp @@ -1,49 +1,56 @@ -#include -#include "Curve.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsCapabilityCurve.hpp" +#include +#include + #include "VsConverter.hpp" using namespace CIMPP; VsCapabilityCurve::VsCapabilityCurve() {}; - VsCapabilityCurve::~VsCapabilityCurve() {}; -bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VsCapabilityCurve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VsConverterDCSides.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_VsConverter_CapabilityCurve(BaseClass*, BaseClass*); +bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VsCapabilityCurve* element = dynamic_cast(BaseClass_ptr1); + VsConverter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VsConverterDCSides.begin(), element->VsConverterDCSides.end(), element2) == element->VsConverterDCSides.end()) + { + element->VsConverterDCSides.push_back(element2); + return assign_VsConverter_CapabilityCurve(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* VsCapabilityCurve_factory() { - return new VsCapabilityCurve; - } +const char VsCapabilityCurve::debugName[] = "VsCapabilityCurve"; +const char* VsCapabilityCurve::debugString() const +{ + return VsCapabilityCurve::debugName; } -void VsCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) { +void VsCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VsCapabilityCurve"), &VsCapabilityCurve_factory)); } -void VsCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void VsCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VsCapabilityCurve.VsConverterDCSides"), &assign_VsCapabilityCurve_VsConverterDCSides)); +void VsCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char VsCapabilityCurve::debugName[] = "VsCapabilityCurve"; -const char* VsCapabilityCurve::debugString() +void VsCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VsCapabilityCurve::debugName; + assign_map.insert(std::make_pair(std::string("cim:VsCapabilityCurve.VsConverterDCSides"), &assign_VsCapabilityCurve_VsConverterDCSides)); } const BaseClassDefiner VsCapabilityCurve::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner VsCapabilityCurve::declare() return BaseClassDefiner(VsCapabilityCurve::addConstructToMap, VsCapabilityCurve::addPrimitiveAssignFnsToMap, VsCapabilityCurve::addClassAssignFnsToMap, VsCapabilityCurve::debugName); } - +namespace CIMPP +{ + BaseClass* VsCapabilityCurve_factory() + { + return new VsCapabilityCurve; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.hpp b/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.hpp index c05a8641c..d1720fd0e 100644 --- a/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.hpp +++ b/CGMES_2.4.15_16FEB2016/VsCapabilityCurve.hpp @@ -1,38 +1,39 @@ #ifndef VsCapabilityCurve_H #define VsCapabilityCurve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Curve.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Curve.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class VsConverter; -class VsConverter; /* The P-Q capability curve for a voltage source converter, with P on x-axis and Qmin and Qmax on y1-axis and y2-axis. */ - class VsCapabilityCurve: public Curve + class VsCapabilityCurve : public Curve { - public: - std::list VsConverterDCSides; /* Capability curve of this converter. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VsCapabilityCurve(); - virtual ~VsCapabilityCurve(); - + ~VsCapabilityCurve() override; + + std::list VsConverterDCSides; /* Capability curve of this converter. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VsCapabilityCurve_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VsConverter.cpp b/CGMES_2.4.15_16FEB2016/VsConverter.cpp index eeecba959..e61483f2f 100644 --- a/CGMES_2.4.15_16FEB2016/VsConverter.cpp +++ b/CGMES_2.4.15_16FEB2016/VsConverter.cpp @@ -1,214 +1,232 @@ -#include -#include "ACDCConverter.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsConverter.hpp" -#include "Simple_Float.hpp" -#include "CurrentFlow.hpp" +#include +#include + #include "VsCapabilityCurve.hpp" #include "AngleDegrees.hpp" -#include "Voltage.hpp" #include "PU.hpp" #include "Resistance.hpp" +#include "Simple_Float.hpp" +#include "CurrentFlow.hpp" #include "VsPpccControlKind.hpp" #include "VsQpccControlKind.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" #include "Voltage.hpp" +#include "Voltage.hpp" using namespace CIMPP; -VsConverter::VsConverter(): CapabilityCurve(nullptr) {}; - +VsConverter::VsConverter() : CapabilityCurve(nullptr) {}; VsConverter::~VsConverter() {}; +bool assign_VsConverter_delta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->delta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass*, BaseClass*); -bool assign_VsConverter_CapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - element->CapabilityCurve = dynamic_cast(BaseClass_ptr2); - if(element->CapabilityCurve != nullptr) - return assign_VsCapabilityCurve_VsConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_VsConverter_droop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->droop; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_VsConverter_droopCompensation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->droopCompensation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_maxModulationIndex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxModulationIndex; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_maxValveCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxValveCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pPccControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_qPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qPccControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_qShare(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qShare; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_targetQpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetQpcc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - - -bool assign_VsConverter_maxModulationIndex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxModulationIndex; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_maxValveCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxValveCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_VsConverter_delta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->delta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_uf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_droop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->droop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_droopCompensation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->droopCompensation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pPccControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_qPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qPccControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_qShare(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qShare; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_targetQpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetQpcc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_targetUpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetUpcc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* VsConverter_factory() { - return new VsConverter; +bool assign_VsConverter_targetUpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetUpcc; + if (buffer.fail()) + return false; + else + return true; } + return false; } -void VsConverter::addConstructToMap(std::unordered_map& factory_map) { +bool assign_VsConverter_uf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + + +bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass*, BaseClass*); +bool assign_VsConverter_CapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VsConverter* element = dynamic_cast(BaseClass_ptr1); + VsCapabilityCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->CapabilityCurve != element2) + { + element->CapabilityCurve = element2; + return assign_VsCapabilityCurve_VsConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + + + + + + + +const char VsConverter::debugName[] = "VsConverter"; +const char* VsConverter::debugString() const +{ + return VsConverter::debugName; +} + +void VsConverter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VsConverter"), &VsConverter_factory)); } -void VsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxModulationIndex"), &assign_VsConverter_maxModulationIndex)); - assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxValveCurrent"), &assign_VsConverter_maxValveCurrent)); - assign_map.insert(std::make_pair(std::string("cim:VsConverter.delta"), &assign_VsConverter_delta)); - assign_map.insert(std::make_pair(std::string("cim:VsConverter.uf"), &assign_VsConverter_uf)); +void VsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:VsConverter.delta"), &assign_VsConverter_delta)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.droop"), &assign_VsConverter_droop)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.droopCompensation"), &assign_VsConverter_droopCompensation)); + assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxModulationIndex"), &assign_VsConverter_maxModulationIndex)); + assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxValveCurrent"), &assign_VsConverter_maxValveCurrent)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.pPccControl"), &assign_VsConverter_pPccControl)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.qPccControl"), &assign_VsConverter_qPccControl)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.qShare"), &assign_VsConverter_qShare)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.targetQpcc"), &assign_VsConverter_targetQpcc)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.targetUpcc"), &assign_VsConverter_targetUpcc)); + assign_map.insert(std::make_pair(std::string("cim:VsConverter.uf"), &assign_VsConverter_uf)); } -void VsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VsConverter.CapabilityCurve"), &assign_VsConverter_CapabilityCurve)); - } - -const char VsConverter::debugName[] = "VsConverter"; -const char* VsConverter::debugString() +void VsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VsConverter::debugName; + assign_map.insert(std::make_pair(std::string("cim:VsConverter.CapabilityCurve"), &assign_VsConverter_CapabilityCurve)); } const BaseClassDefiner VsConverter::declare() @@ -216,4 +234,10 @@ const BaseClassDefiner VsConverter::declare() return BaseClassDefiner(VsConverter::addConstructToMap, VsConverter::addPrimitiveAssignFnsToMap, VsConverter::addClassAssignFnsToMap, VsConverter::debugName); } - +namespace CIMPP +{ + BaseClass* VsConverter_factory() + { + return new VsConverter; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VsConverter.hpp b/CGMES_2.4.15_16FEB2016/VsConverter.hpp index 366f9dc6b..f3a2be60e 100644 --- a/CGMES_2.4.15_16FEB2016/VsConverter.hpp +++ b/CGMES_2.4.15_16FEB2016/VsConverter.hpp @@ -1,59 +1,60 @@ #ifndef VsConverter_H #define VsConverter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCConverter.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "CurrentFlow.hpp" +#include "ACDCConverter.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -#include "Voltage.hpp" +#include "CurrentFlow.hpp" #include "PU.hpp" +#include "PerCent.hpp" +#include "ReactivePower.hpp" #include "Resistance.hpp" +#include "Simple_Float.hpp" +#include "Voltage.hpp" #include "VsPpccControlKind.hpp" #include "VsQpccControlKind.hpp" -#include "PerCent.hpp" -#include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class VsCapabilityCurve; - -class VsCapabilityCurve; /* DC side of the voltage source converter (VSC). */ - class VsConverter: public ACDCConverter + class VsConverter : public ACDCConverter { - public: - CIMPP::Simple_Float maxModulationIndex; /* The max quotient between the AC converter voltage (Uc) and DC voltage (Ud). A factor typically less than 1. VSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow maxValveCurrent; /* The maximum current through a valve. This current limit is the basis for calculating the capability diagram. VSC configuration data. Default: nullptr */ - CIMPP::VsCapabilityCurve* CapabilityCurve; /* All converters with this capability curve. Default: 0 */ - CIMPP::AngleDegrees delta; /* Angle between uf and uc. Converter state variable used in power flow. Default: nullptr */ - CIMPP::Voltage uf; /* Filter bus voltage. Converter state variable, result from power flow. Default: nullptr */ - CIMPP::PU droop; /* Droop constant; pu value is obtained as D [kV^2 / MW] x Sb / Ubdc^2. Default: nullptr */ - CIMPP::Resistance droopCompensation; /* Compensation (resistance) constant. Used to compensate for voltage drop when controlling voltage at a distant bus. Default: nullptr */ - CIMPP::VsPpccControlKind pPccControl; /* Kind of control of real power and/or DC voltage. Default: 0 */ - CIMPP::VsQpccControlKind qPccControl; /* Default: 0 */ - CIMPP::PerCent qShare; /* Reactive power sharing factor among parallel converters on Uac control. Default: nullptr */ - CIMPP::ReactivePower targetQpcc; /* Reactive power injection target in AC grid, at point of common coupling. Default: nullptr */ - CIMPP::Voltage targetUpcc; /* Voltage target in AC grid, at point of common coupling. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VsConverter(); - virtual ~VsConverter(); - + ~VsConverter() override; + + CIMPP::VsCapabilityCurve* CapabilityCurve; /* All converters with this capability curve. Default: 0 */ + CIMPP::AngleDegrees delta; /* Angle between uf and uc. Converter state variable used in power flow. Default: nullptr */ + CIMPP::PU droop; /* Droop constant; pu value is obtained as D [kV^2 / MW] x Sb / Ubdc^2. Default: nullptr */ + CIMPP::Resistance droopCompensation; /* Compensation (resistance) constant. Used to compensate for voltage drop when controlling voltage at a distant bus. Default: nullptr */ + CIMPP::Simple_Float maxModulationIndex; /* The max quotient between the AC converter voltage (Uc) and DC voltage (Ud). A factor typically less than 1. VSC configuration data used in power flow. Default: nullptr */ + CIMPP::CurrentFlow maxValveCurrent; /* The maximum current through a valve. This current limit is the basis for calculating the capability diagram. VSC configuration data. Default: nullptr */ + CIMPP::VsPpccControlKind pPccControl; /* Kind of control of real power and/or DC voltage. Default: 0 */ + CIMPP::VsQpccControlKind qPccControl; /* Default: 0 */ + CIMPP::PerCent qShare; /* Reactive power sharing factor among parallel converters on Uac control. Default: nullptr */ + CIMPP::ReactivePower targetQpcc; /* Reactive power injection target in AC grid, at point of common coupling. Default: nullptr */ + CIMPP::Voltage targetUpcc; /* Voltage target in AC grid, at point of common coupling. Default: nullptr */ + CIMPP::Voltage uf; /* Filter bus voltage. Converter state variable, result from power flow. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VsConverter_factory(); diff --git a/CGMES_2.4.15_16FEB2016/VsPpccControlKind.cpp b/CGMES_2.4.15_16FEB2016/VsPpccControlKind.cpp index 981bf6ba8..bc8b2d84a 100644 --- a/CGMES_2.4.15_16FEB2016/VsPpccControlKind.cpp +++ b/CGMES_2.4.15_16FEB2016/VsPpccControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsPpccControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::VsPpccControlKind& rop) +VsPpccControlKind& VsPpccControlKind::operator=(VsPpccControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +VsPpccControlKind::operator VsPpccControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char VsPpccControlKind::debugName[] = "VsPpccControlKind"; +const char* VsPpccControlKind::debugString() const +{ + return VsPpccControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VsPpccControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -48,5 +79,39 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const VsPpccControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == VsPpccControlKind::pPcc) + { + EnumSymbol = "pPcc"; + } + if (obj.value == VsPpccControlKind::udc) + { + EnumSymbol = "udc"; + } + if (obj.value == VsPpccControlKind::pPccAndUdcDroop) + { + EnumSymbol = "pPccAndUdcDroop"; + } + if (obj.value == VsPpccControlKind::pPccAndUdcDroopWithCompensation) + { + EnumSymbol = "pPccAndUdcDroopWithCompensation"; + } + if (obj.value == VsPpccControlKind::pPccAndUdcDroopPilot) + { + EnumSymbol = "pPccAndUdcDroopPilot"; + } + + if (!EnumSymbol.empty()) + { + os << "VsPpccControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VsPpccControlKind.hpp b/CGMES_2.4.15_16FEB2016/VsPpccControlKind.hpp index 2ee70f715..3aec56bb0 100644 --- a/CGMES_2.4.15_16FEB2016/VsPpccControlKind.hpp +++ b/CGMES_2.4.15_16FEB2016/VsPpccControlKind.hpp @@ -1,33 +1,58 @@ #ifndef VsPpccControlKind_H #define VsPpccControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Types applicable to the control of real power and/or DC voltage by voltage source converter. */ - enum class VsPpccControlKind + class VsPpccControlKind { - /** - * Control variable (target) is real power at PCC bus. - */ - pPcc, - /** - * Control variable (target) is DC voltage and real power at PCC bus is derived. - */ - udc, - /** - * Control variables (targets) are both active power at point of common coupling and local DC voltage, with the droop. - */ - pPccAndUdcDroop, - /** - * Control variables (targets) are both active power at point of common coupling and compensated DC voltage, with the droop; compensation factor is the resistance, as an approximation of the DC voltage of a common (real or virtual) node in the DC network. - */ - pPccAndUdcDroopWithCompensation, - /** - * Control variables (targets) are both active power at point of common coupling and the pilot DC voltage, with the droop. - */ - pPccAndUdcDroopPilot, + public: + enum VsPpccControlKind_ENUM + { + /** + * Control variable (target) is real power at PCC bus. + */ + pPcc, + /** + * Control variable (target) is DC voltage and real power at PCC bus is derived. + */ + udc, + /** + * Control variables (targets) are both active power at point of common coupling and local DC voltage, with the droop. + */ + pPccAndUdcDroop, + /** + * Control variables (targets) are both active power at point of common coupling and compensated DC voltage, with the droop; compensation factor is the resistance, as an approximation of the DC voltage of a common (real or virtual) node in the DC network. + */ + pPccAndUdcDroopWithCompensation, + /** + * Control variables (targets) are both active power at point of common coupling and the pilot DC voltage, with the droop. + */ + pPccAndUdcDroopPilot, + }; + + VsPpccControlKind() : value(), initialized(false) {} + VsPpccControlKind(VsPpccControlKind_ENUM value) : value(value), initialized(true) {} + + VsPpccControlKind& operator=(VsPpccControlKind_ENUM rop); + operator VsPpccControlKind_ENUM() const; + + VsPpccControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, VsPpccControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const VsPpccControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::VsPpccControlKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/VsQpccControlKind.cpp b/CGMES_2.4.15_16FEB2016/VsQpccControlKind.cpp index d279d97e2..7f438e41c 100644 --- a/CGMES_2.4.15_16FEB2016/VsQpccControlKind.cpp +++ b/CGMES_2.4.15_16FEB2016/VsQpccControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsQpccControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::VsQpccControlKind& rop) +VsQpccControlKind& VsQpccControlKind::operator=(VsQpccControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +VsQpccControlKind::operator VsQpccControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char VsQpccControlKind::debugName[] = "VsQpccControlKind"; +const char* VsQpccControlKind::debugString() const +{ + return VsQpccControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VsQpccControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const VsQpccControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == VsQpccControlKind::reactivePcc) + { + EnumSymbol = "reactivePcc"; + } + if (obj.value == VsQpccControlKind::voltagePcc) + { + EnumSymbol = "voltagePcc"; + } + if (obj.value == VsQpccControlKind::powerFactorPcc) + { + EnumSymbol = "powerFactorPcc"; + } + + if (!EnumSymbol.empty()) + { + os << "VsQpccControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/VsQpccControlKind.hpp b/CGMES_2.4.15_16FEB2016/VsQpccControlKind.hpp index d3f545d91..cc10bbf78 100644 --- a/CGMES_2.4.15_16FEB2016/VsQpccControlKind.hpp +++ b/CGMES_2.4.15_16FEB2016/VsQpccControlKind.hpp @@ -1,25 +1,38 @@ #ifndef VsQpccControlKind_H #define VsQpccControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { - /* - - */ - enum class VsQpccControlKind +#include +#include + +namespace CIMPP +{ + class VsQpccControlKind { - /** - * - */ - reactivePcc, - /** - * - */ - voltagePcc, - /** - * - */ - powerFactorPcc, + public: + enum VsQpccControlKind_ENUM + { + reactivePcc, + voltagePcc, + powerFactorPcc, + }; + + VsQpccControlKind() : value(), initialized(false) {} + VsQpccControlKind(VsQpccControlKind_ENUM value) : value(value), initialized(true) {} + + VsQpccControlKind& operator=(VsQpccControlKind_ENUM rop); + operator VsQpccControlKind_ENUM() const; + + VsQpccControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, VsQpccControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const VsQpccControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::VsQpccControlKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.cpp b/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.cpp index 15045d5a6..af5ebf4d2 100644 --- a/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.cpp @@ -1,48 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindAeroConstIEC.hpp" +#include +#include + #include "WindGenTurbineType1IEC.hpp" using namespace CIMPP; -WindAeroConstIEC::WindAeroConstIEC(): WindGenTurbineType1IEC(nullptr) {}; - +WindAeroConstIEC::WindAeroConstIEC() : WindGenTurbineType1IEC(nullptr) {}; WindAeroConstIEC::~WindAeroConstIEC() {}; -bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindAeroConstIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType1IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType1IEC != nullptr) - return true; - } - return false; -} - -namespace CIMPP { - BaseClass* WindAeroConstIEC_factory() { - return new WindAeroConstIEC; +bool assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass*, BaseClass*); +bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindAeroConstIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType1IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType1IEC != element2) + { + element->WindGenTurbineType1IEC = element2; + return assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindAeroConstIEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC"), &WindAeroConstIEC_factory)); +const char WindAeroConstIEC::debugName[] = "WindAeroConstIEC"; +const char* WindAeroConstIEC::debugString() const +{ + return WindAeroConstIEC::debugName; } -void WindAeroConstIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindAeroConstIEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC"), &WindAeroConstIEC_factory)); +} -void WindAeroConstIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC.WindGenTurbineType1IEC"), &assign_WindAeroConstIEC_WindGenTurbineType1IEC)); +void WindAeroConstIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindAeroConstIEC::debugName[] = "WindAeroConstIEC"; -const char* WindAeroConstIEC::debugString() +void WindAeroConstIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindAeroConstIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC.WindGenTurbineType1IEC"), &assign_WindAeroConstIEC_WindGenTurbineType1IEC)); } const BaseClassDefiner WindAeroConstIEC::declare() @@ -50,4 +58,10 @@ const BaseClassDefiner WindAeroConstIEC::declare() return BaseClassDefiner(WindAeroConstIEC::addConstructToMap, WindAeroConstIEC::addPrimitiveAssignFnsToMap, WindAeroConstIEC::addClassAssignFnsToMap, WindAeroConstIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindAeroConstIEC_factory() + { + return new WindAeroConstIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.hpp b/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.hpp index 9538d248c..ad46f30a6 100644 --- a/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindAeroConstIEC.hpp @@ -1,38 +1,39 @@ #ifndef WindAeroConstIEC_H #define WindAeroConstIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindGenTurbineType1IEC; -class WindGenTurbineType1IEC; /* The constant aerodynamic torque model assumes that the aerodynamic torque is constant. Reference: IEC Standard 61400-27-1 Section 6.6.1.1. */ - class WindAeroConstIEC: public IdentifiedObject + class WindAeroConstIEC : public IdentifiedObject { - public: - CIMPP::WindGenTurbineType1IEC* WindGenTurbineType1IEC; /* Wind turbine type 1 model with which this wind aerodynamic model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindAeroConstIEC(); - virtual ~WindAeroConstIEC(); - + ~WindAeroConstIEC() override; + + CIMPP::WindGenTurbineType1IEC* WindGenTurbineType1IEC; /* Wind turbine type 1 model with which this wind aerodynamic model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindAeroConstIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.cpp b/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.cpp index a54aa0e59..4f2b018a5 100644 --- a/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.cpp @@ -1,123 +1,136 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindAeroLinearIEC.hpp" +#include +#include + +#include "WindGenTurbineType3IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "AngleDegrees.hpp" -#include "WindGenTurbineType3IEC.hpp" using namespace CIMPP; -WindAeroLinearIEC::WindAeroLinearIEC(): WindGenTurbineType3IEC(nullptr) {}; - +WindAeroLinearIEC::WindAeroLinearIEC() : WindGenTurbineType3IEC(nullptr) {}; WindAeroLinearIEC::~WindAeroLinearIEC() {}; +bool assign_WindAeroLinearIEC_dpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpomega; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_dptheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dptheta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_omegazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omegazero; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_pavail(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pavail; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; +bool assign_WindAeroLinearIEC_thetazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetazero; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindAeroLinearIEC_dpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpomega; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass*, BaseClass*); +bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindAeroLinearIEC_dptheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dptheta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindAeroLinearIEC_omegazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omegazero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindAeroLinearIEC_pavail(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pavail; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindAeroLinearIEC_thetazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetazero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindAeroLinearIEC_factory() { - return new WindAeroLinearIEC; - } +const char WindAeroLinearIEC::debugName[] = "WindAeroLinearIEC"; +const char* WindAeroLinearIEC::debugString() const +{ + return WindAeroLinearIEC::debugName; } -void WindAeroLinearIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindAeroLinearIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC"), &WindAeroLinearIEC_factory)); } -void WindAeroLinearIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindAeroLinearIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.dpomega"), &assign_WindAeroLinearIEC_dpomega)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.dptheta"), &assign_WindAeroLinearIEC_dptheta)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.omegazero"), &assign_WindAeroLinearIEC_omegazero)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.pavail"), &assign_WindAeroLinearIEC_pavail)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.thetazero"), &assign_WindAeroLinearIEC_thetazero)); - } - -void WindAeroLinearIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.WindGenTurbineType3IEC"), &assign_WindAeroLinearIEC_WindGenTurbineType3IEC)); } -const char WindAeroLinearIEC::debugName[] = "WindAeroLinearIEC"; -const char* WindAeroLinearIEC::debugString() +void WindAeroLinearIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindAeroLinearIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.WindGenTurbineType3IEC"), &assign_WindAeroLinearIEC_WindGenTurbineType3IEC)); } const BaseClassDefiner WindAeroLinearIEC::declare() @@ -125,4 +138,10 @@ const BaseClassDefiner WindAeroLinearIEC::declare() return BaseClassDefiner(WindAeroLinearIEC::addConstructToMap, WindAeroLinearIEC::addPrimitiveAssignFnsToMap, WindAeroLinearIEC::addClassAssignFnsToMap, WindAeroLinearIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindAeroLinearIEC_factory() + { + return new WindAeroLinearIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.hpp b/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.hpp index 6b15e7e05..5556cf924 100644 --- a/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindAeroLinearIEC.hpp @@ -1,45 +1,46 @@ #ifndef WindAeroLinearIEC_H #define WindAeroLinearIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" +#include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindGenTurbineType3IEC; -class WindGenTurbineType3IEC; /* The linearised aerodynamic model. Reference: IEC Standard 614000-27-1 Section 6.6.1.2. */ - class WindAeroLinearIEC: public IdentifiedObject + class WindAeroLinearIEC : public IdentifiedObject { - public: - CIMPP::PU dpomega; /* Partial derivative of aerodynamic power with respect to changes in WTR speed (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU dptheta; /* Partial derivative of aerodynamic power with respect to changes in pitch angle (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU omegazero; /* Rotor speed if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pavail; /* Available aerodynamic power (). It is case dependent parameter. Default: nullptr */ - CIMPP::AngleDegrees thetazero; /* Pitch angle if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind generator type 3 model with which this wind aerodynamic model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindAeroLinearIEC(); - virtual ~WindAeroLinearIEC(); - + ~WindAeroLinearIEC() override; + + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind generator type 3 model with which this wind aerodynamic model is associated. Default: 0 */ + CIMPP::PU dpomega; /* Partial derivative of aerodynamic power with respect to changes in WTR speed (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU dptheta; /* Partial derivative of aerodynamic power with respect to changes in pitch angle (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU omegazero; /* Rotor speed if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pavail; /* Available aerodynamic power (). It is case dependent parameter. Default: nullptr */ + CIMPP::AngleDegrees thetazero; /* Pitch angle if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindAeroLinearIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.cpp b/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.cpp index 7498409c3..b1b64d199 100644 --- a/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.cpp @@ -1,136 +1,156 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContCurrLimIEC.hpp" +#include +#include + +#include "WindDynamicsLookupTable.hpp" +#include "WindTurbineType3or4IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "Boolean.hpp" #include "Boolean.hpp" #include "Seconds.hpp" -#include "WindTurbineType3or4IEC.hpp" -#include "WindDynamicsLookupTable.hpp" using namespace CIMPP; -WindContCurrLimIEC::WindContCurrLimIEC(): WindTurbineType3or4IEC(nullptr) {}; - +WindContCurrLimIEC::WindContCurrLimIEC() : WindTurbineType3or4IEC(nullptr) {}; WindContCurrLimIEC::~WindContCurrLimIEC() {}; +bool assign_WindContCurrLimIEC_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContCurrLimIEC_imaxdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imaxdip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContCurrLimIEC_mdfslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mdfslim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4IEC != nullptr) - return true; - } - return false; +bool assign_WindContCurrLimIEC_mqpri(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mqpri; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindDynamicsLookupTable.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindContCurrLimIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindContCurrLimIEC_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass*, BaseClass*); +bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContCurrLimIEC_imaxdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imaxdip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass*, BaseClass*); +bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4IEC != element2) + { + element->WindTurbineType3or4IEC = element2; + return assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContCurrLimIEC_mdfslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mdfslim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContCurrLimIEC_mqpri(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mqpri; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContCurrLimIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContCurrLimIEC_factory() { - return new WindContCurrLimIEC; - } +const char WindContCurrLimIEC::debugName[] = "WindContCurrLimIEC"; +const char* WindContCurrLimIEC::debugString() const +{ + return WindContCurrLimIEC::debugName; } -void WindContCurrLimIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContCurrLimIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC"), &WindContCurrLimIEC_factory)); } -void WindContCurrLimIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContCurrLimIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.imax"), &assign_WindContCurrLimIEC_imax)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.imaxdip"), &assign_WindContCurrLimIEC_imaxdip)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.mdfslim"), &assign_WindContCurrLimIEC_mdfslim)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.mqpri"), &assign_WindContCurrLimIEC_mqpri)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.tufilt"), &assign_WindContCurrLimIEC_tufilt)); - } - -void WindContCurrLimIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindTurbineType3or4IEC"), &assign_WindContCurrLimIEC_WindTurbineType3or4IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindDynamicsLookupTable"), &assign_WindContCurrLimIEC_WindDynamicsLookupTable)); } -const char WindContCurrLimIEC::debugName[] = "WindContCurrLimIEC"; -const char* WindContCurrLimIEC::debugString() +void WindContCurrLimIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContCurrLimIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindDynamicsLookupTable"), &assign_WindContCurrLimIEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindTurbineType3or4IEC"), &assign_WindContCurrLimIEC_WindTurbineType3or4IEC)); } const BaseClassDefiner WindContCurrLimIEC::declare() @@ -138,4 +158,10 @@ const BaseClassDefiner WindContCurrLimIEC::declare() return BaseClassDefiner(WindContCurrLimIEC::addConstructToMap, WindContCurrLimIEC::addPrimitiveAssignFnsToMap, WindContCurrLimIEC::addClassAssignFnsToMap, WindContCurrLimIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContCurrLimIEC_factory() + { + return new WindContCurrLimIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.hpp b/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.hpp index 6d75b61e8..071ff806d 100644 --- a/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContCurrLimIEC.hpp @@ -1,48 +1,49 @@ #ifndef WindContCurrLimIEC_H #define WindContCurrLimIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindTurbineType3or4IEC; -class WindTurbineType3or4IEC; -class WindDynamicsLookupTable; /* Current limitation model. The current limitation model combines the physical limits. Reference: IEC Standard 61400-27-1 Section 6.6.5.7. */ - class WindContCurrLimIEC: public IdentifiedObject + class WindContCurrLimIEC : public IdentifiedObject { - public: - CIMPP::PU imax; /* Maximum continuous current at the wind turbine terminals (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU imaxdip; /* Maximum current during voltage dip at the wind turbine terminals (). It is project dependent parameter. Default: nullptr */ - CIMPP::Boolean mdfslim; /* Limitation of type 3 stator current (): - false=0: total current limitation, - true=1: stator current limitation). It is type dependent parameter. Default: false */ - CIMPP::Boolean mqpri; /* Prioritisation of q control during LVRT (): - true = 1: reactive power priority, - false = 0: active power priority. It is project dependent parameter. Default: false */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this wind control current limitation model is associated. Default: 0 */ - std::list WindDynamicsLookupTable; /* The current control limitation model with which this wind dynamics lookup table is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContCurrLimIEC(); - virtual ~WindContCurrLimIEC(); - + ~WindContCurrLimIEC() override; + + std::list WindDynamicsLookupTable; /* The current control limitation model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this wind control current limitation model is associated. Default: 0 */ + CIMPP::PU imax; /* Maximum continuous current at the wind turbine terminals (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU imaxdip; /* Maximum current during voltage dip at the wind turbine terminals (). It is project dependent parameter. Default: nullptr */ + CIMPP::Boolean mdfslim; /* Limitation of type 3 stator current (): - false=0: total current limitation, - true=1: stator current limitation). It is type dependent parameter. Default: false */ + CIMPP::Boolean mqpri; /* Prioritisation of q control during LVRT (): - true = 1: reactive power priority, - false = 0: active power priority. It is project dependent parameter. Default: false */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContCurrLimIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContPType3IEC.cpp b/CGMES_2.4.15_16FEB2016/WindContPType3IEC.cpp index 97dc2c67c..841bebeea 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPType3IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContPType3IEC.cpp @@ -1,7 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPType3IEC.hpp" +#include +#include + +#include "WindDynamicsLookupTable.hpp" +#include "WindGenTurbineType3IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -23,321 +29,357 @@ #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "WindGenTurbineType3IEC.hpp" -#include "WindDynamicsLookupTable.hpp" using namespace CIMPP; -WindContPType3IEC::WindContPType3IEC(): WindGenTurbineType3IEC(nullptr), WindDynamicsLookupTable(nullptr) {}; - +WindContPType3IEC::WindContPType3IEC() : WindGenTurbineType3IEC(nullptr) {}; WindContPType3IEC::~WindContPType3IEC() {}; +bool assign_WindContPType3IEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_dtrisemaxlvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtrisemaxlvrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_kdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdtd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_mplvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mplvrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_omegaoffset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omegaoffset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_pdtdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pdtdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_rramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rramp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tdvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_temin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->temin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tomegafilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tuscale(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuscale; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_twref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_udvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_updip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->updip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; +bool assign_WindContPType3IEC_wdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wdtd; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindDynamicsLookupTable = dynamic_cast(BaseClass_ptr2); - if(element->WindDynamicsLookupTable != nullptr) - return true; - } - return false; +bool assign_WindContPType3IEC_zeta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeta; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType3IEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass*, BaseClass*); +bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType3IEC_dtrisemaxlvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtrisemaxlvrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass*, BaseClass*); +bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType3IEC_kdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdtd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_mplvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mplvrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_omegaoffset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omegaoffset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_pdtdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pdtdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_rramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rramp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tdvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_temin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->temin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tomegafilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tuscale(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuscale; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_twref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_udvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_updip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->updip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_wdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wdtd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_zeta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContPType3IEC_factory() { - return new WindContPType3IEC; - } +const char WindContPType3IEC::debugName[] = "WindContPType3IEC"; +const char* WindContPType3IEC::debugString() const +{ + return WindContPType3IEC::debugName; } -void WindContPType3IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPType3IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPType3IEC"), &WindContPType3IEC_factory)); } -void WindContPType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.dpmax"), &assign_WindContPType3IEC_dpmax)); assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.dtrisemaxlvrt"), &assign_WindContPType3IEC_dtrisemaxlvrt)); assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.kdtd"), &assign_WindContPType3IEC_kdtd)); @@ -359,17 +401,12 @@ void WindContPType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindGenTurbineType3IEC"), &assign_WindContPType3IEC_WindGenTurbineType3IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindDynamicsLookupTable"), &assign_WindContPType3IEC_WindDynamicsLookupTable)); } -const char WindContPType3IEC::debugName[] = "WindContPType3IEC"; -const char* WindContPType3IEC::debugString() +void WindContPType3IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPType3IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindDynamicsLookupTable"), &assign_WindContPType3IEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindGenTurbineType3IEC"), &assign_WindContPType3IEC_WindGenTurbineType3IEC)); } const BaseClassDefiner WindContPType3IEC::declare() @@ -377,4 +414,10 @@ const BaseClassDefiner WindContPType3IEC::declare() return BaseClassDefiner(WindContPType3IEC::addConstructToMap, WindContPType3IEC::addPrimitiveAssignFnsToMap, WindContPType3IEC::addClassAssignFnsToMap, WindContPType3IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPType3IEC_factory() + { + return new WindContPType3IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContPType3IEC.hpp b/CGMES_2.4.15_16FEB2016/WindContPType3IEC.hpp index 938abe5d2..5dc2f994e 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPType3IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContPType3IEC.hpp @@ -1,65 +1,66 @@ #ifndef WindContPType3IEC_H #define WindContPType3IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindGenTurbineType3IEC; -class WindGenTurbineType3IEC; -class WindDynamicsLookupTable; /* P control model Type 3. Reference: IEC Standard 61400-27-1 Section 6.6.5.3. */ - class WindContPType3IEC: public IdentifiedObject + class WindContPType3IEC : public IdentifiedObject { - public: - CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU dtrisemaxlvrt; /* Limitation of torque rise rate during LVRT for S (d). It is project dependent parameter. Default: nullptr */ - CIMPP::PU kdtd; /* Gain for active drive train damping (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kip; /* PI controller integration parameter (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpp; /* PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::Boolean mplvrt; /* Enable LVRT power control mode (M true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ - CIMPP::PU omegaoffset; /* Offset to reference value that limits controller action during rotor speed changes (omega). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pdtdmax; /* Maximum active drive train damping power (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rramp; /* Ramp limitation of torque, required in some grid codes (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tdvs; /* Timedelay after deep voltage sags (T). It is project dependent parameter. Default: nullptr */ - CIMPP::PU temin; /* Minimum electrical generator torque (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU tuscale; /* Voltage scaling factor of reset-torque (T). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds twref; /* Time constant in speed reference filter (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU udvs; /* Voltage limit for hold LVRT status after deep voltage sags (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU updip; /* Voltage dip threshold for P-control (). Part of turbine control, often different (e.g 0.8) from converter thresholds. It is project dependent parameter. Default: nullptr */ - CIMPP::PU wdtd; /* Active drive train damping frequency (omega). It can be calculated from two mass model parameters. It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float zeta; /* Coefficient for active drive train damping (zeta). It is type dependent parameter. Default: nullptr */ - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this Wind control P type 3 model is associated. Default: 0 */ - CIMPP::WindDynamicsLookupTable* WindDynamicsLookupTable; /* The P control type 3 model with which this wind dynamics lookup table is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPType3IEC(); - virtual ~WindContPType3IEC(); - + ~WindContPType3IEC() override; + + std::list WindDynamicsLookupTable; /* The P control type 3 model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this Wind control P type 3 model is associated. Default: 0 */ + CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU dtrisemaxlvrt; /* Limitation of torque rise rate during LVRT for S (d). It is project dependent parameter. Default: nullptr */ + CIMPP::PU kdtd; /* Gain for active drive train damping (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kip; /* PI controller integration parameter (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpp; /* PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::Boolean mplvrt; /* Enable LVRT power control mode (M true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ + CIMPP::PU omegaoffset; /* Offset to reference value that limits controller action during rotor speed changes (omega). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pdtdmax; /* Maximum active drive train damping power (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rramp; /* Ramp limitation of torque, required in some grid codes (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tdvs; /* Timedelay after deep voltage sags (T). It is project dependent parameter. Default: nullptr */ + CIMPP::PU temin; /* Minimum electrical generator torque (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU tuscale; /* Voltage scaling factor of reset-torque (T). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds twref; /* Time constant in speed reference filter (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU udvs; /* Voltage limit for hold LVRT status after deep voltage sags (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU updip; /* Voltage dip threshold for P-control (). Part of turbine control, often different (e.g 0.8) from converter thresholds. It is project dependent parameter. Default: nullptr */ + CIMPP::PU wdtd; /* Active drive train damping frequency (omega). It can be calculated from two mass model parameters. It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float zeta; /* Coefficient for active drive train damping (zeta). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPType3IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.cpp b/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.cpp index 451eeb6f5..abd8f9dab 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.cpp @@ -1,93 +1,104 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPType4aIEC.hpp" +#include +#include + +#include "WindTurbineType4aIEC.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindTurbineType4aIEC.hpp" using namespace CIMPP; -WindContPType4aIEC::WindContPType4aIEC(): WindTurbineType4aIEC(nullptr) {}; - +WindContPType4aIEC::WindContPType4aIEC() : WindTurbineType4aIEC(nullptr) {}; WindContPType4aIEC::~WindContPType4aIEC() {}; +bool assign_WindContPType4aIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType4aIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType4aIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType4aIEC != nullptr) - return true; - } - return false; +bool assign_WindContPType4aIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType4aIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass*, BaseClass*); +bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType4aIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType4aIEC != element2) + { + element->WindTurbineType4aIEC = element2; + return assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType4aIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType4aIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContPType4aIEC_factory() { - return new WindContPType4aIEC; - } +const char WindContPType4aIEC::debugName[] = "WindContPType4aIEC"; +const char* WindContPType4aIEC::debugString() const +{ + return WindContPType4aIEC::debugName; } -void WindContPType4aIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPType4aIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC"), &WindContPType4aIEC_factory)); } -void WindContPType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.dpmax"), &assign_WindContPType4aIEC_dpmax)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.tpord"), &assign_WindContPType4aIEC_tpord)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.tufilt"), &assign_WindContPType4aIEC_tufilt)); - } - -void WindContPType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.WindTurbineType4aIEC"), &assign_WindContPType4aIEC_WindTurbineType4aIEC)); } -const char WindContPType4aIEC::debugName[] = "WindContPType4aIEC"; -const char* WindContPType4aIEC::debugString() +void WindContPType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPType4aIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.WindTurbineType4aIEC"), &assign_WindContPType4aIEC_WindTurbineType4aIEC)); } const BaseClassDefiner WindContPType4aIEC::declare() @@ -95,4 +106,10 @@ const BaseClassDefiner WindContPType4aIEC::declare() return BaseClassDefiner(WindContPType4aIEC::addConstructToMap, WindContPType4aIEC::addPrimitiveAssignFnsToMap, WindContPType4aIEC::addClassAssignFnsToMap, WindContPType4aIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPType4aIEC_factory() + { + return new WindContPType4aIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.hpp b/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.hpp index 6bea47516..c95a2af05 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContPType4aIEC.hpp @@ -1,43 +1,44 @@ #ifndef WindContPType4aIEC_H #define WindContPType4aIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType4aIEC; - -class WindTurbineType4aIEC; /* P control model Type 4A. Reference: IEC Standard 61400-27-1 Section 6.6.5.4. */ - class WindContPType4aIEC: public IdentifiedObject + class WindContPType4aIEC : public IdentifiedObject { - public: - CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType4aIEC* WindTurbineType4aIEC; /* Wind turbine type 4A model with which this wind control P type 4A model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPType4aIEC(); - virtual ~WindContPType4aIEC(); - + ~WindContPType4aIEC() override; + + CIMPP::WindTurbineType4aIEC* WindTurbineType4aIEC; /* Wind turbine type 4A model with which this wind control P type 4A model is associated. Default: 0 */ + CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPType4aIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.cpp b/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.cpp index 099407b5b..25670919f 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.cpp @@ -1,108 +1,120 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPType4bIEC.hpp" +#include +#include + +#include "WindTurbineType4bIEC.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindTurbineType4bIEC.hpp" using namespace CIMPP; -WindContPType4bIEC::WindContPType4bIEC(): WindTurbineType4bIEC(nullptr) {}; - +WindContPType4bIEC::WindContPType4bIEC() : WindTurbineType4bIEC(nullptr) {}; WindContPType4bIEC::~WindContPType4bIEC() {}; +bool assign_WindContPType4bIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType4bIEC_tpaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpaero; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType4bIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType4bIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType4bIEC != nullptr) - return true; - } - return false; +bool assign_WindContPType4bIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType4bIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass*, BaseClass*); +bool assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType4bIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType4bIEC != element2) + { + element->WindTurbineType4bIEC = element2; + return assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType4bIEC_tpaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpaero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType4bIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType4bIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContPType4bIEC_factory() { - return new WindContPType4bIEC; - } +const char WindContPType4bIEC::debugName[] = "WindContPType4bIEC"; +const char* WindContPType4bIEC::debugString() const +{ + return WindContPType4bIEC::debugName; } -void WindContPType4bIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPType4bIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC"), &WindContPType4bIEC_factory)); } -void WindContPType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.dpmax"), &assign_WindContPType4bIEC_dpmax)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.tpaero"), &assign_WindContPType4bIEC_tpaero)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.tpord"), &assign_WindContPType4bIEC_tpord)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.tufilt"), &assign_WindContPType4bIEC_tufilt)); - } - -void WindContPType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.WindTurbineType4bIEC"), &assign_WindContPType4bIEC_WindTurbineType4bIEC)); } -const char WindContPType4bIEC::debugName[] = "WindContPType4bIEC"; -const char* WindContPType4bIEC::debugString() +void WindContPType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPType4bIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.WindTurbineType4bIEC"), &assign_WindContPType4bIEC_WindTurbineType4bIEC)); } const BaseClassDefiner WindContPType4bIEC::declare() @@ -110,4 +122,10 @@ const BaseClassDefiner WindContPType4bIEC::declare() return BaseClassDefiner(WindContPType4bIEC::addConstructToMap, WindContPType4bIEC::addPrimitiveAssignFnsToMap, WindContPType4bIEC::addClassAssignFnsToMap, WindContPType4bIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPType4bIEC_factory() + { + return new WindContPType4bIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.hpp b/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.hpp index 586daf965..c2f174f9b 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContPType4bIEC.hpp @@ -1,44 +1,45 @@ #ifndef WindContPType4bIEC_H #define WindContPType4bIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType4bIEC; - -class WindTurbineType4bIEC; /* P control model Type 4B. Reference: IEC Standard 61400-27-1 Section 6.6.5.5. */ - class WindContPType4bIEC: public IdentifiedObject + class WindContPType4bIEC : public IdentifiedObject { - public: - CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tpaero; /* Time constant in aerodynamic power response (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind control P type 4B model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPType4bIEC(); - virtual ~WindContPType4bIEC(); - + ~WindContPType4bIEC() override; + + CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind control P type 4B model is associated. Default: 0 */ + CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tpaero; /* Time constant in aerodynamic power response (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPType4bIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.cpp b/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.cpp index 0e74abd50..1abd36c2c 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.cpp @@ -1,7 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPitchAngleIEC.hpp" +#include +#include + +#include "WindGenTurbineType3IEC.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "PU.hpp" @@ -12,167 +17,185 @@ #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" #include "Seconds.hpp" -#include "WindGenTurbineType3IEC.hpp" using namespace CIMPP; -WindContPitchAngleIEC::WindContPitchAngleIEC(): WindGenTurbineType3IEC(nullptr) {}; - +WindContPitchAngleIEC::WindContPitchAngleIEC() : WindGenTurbineType3IEC(nullptr) {}; WindContPitchAngleIEC::~WindContPitchAngleIEC() {}; +bool assign_WindContPitchAngleIEC_dthetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dthetamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_dthetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dthetamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kiomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiomega; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpomega; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_thetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_thetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; +bool assign_WindContPitchAngleIEC_ttheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ttheta; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPitchAngleIEC_dthetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dthetamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass*, BaseClass*); +bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPitchAngleIEC_dthetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dthetamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kiomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiomega; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpomega; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContPitchAngleIEC_thetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContPitchAngleIEC_thetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContPitchAngleIEC_ttheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ttheta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* WindContPitchAngleIEC_factory() { - return new WindContPitchAngleIEC; - } + + + + + +const char WindContPitchAngleIEC::debugName[] = "WindContPitchAngleIEC"; +const char* WindContPitchAngleIEC::debugString() const +{ + return WindContPitchAngleIEC::debugName; } -void WindContPitchAngleIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPitchAngleIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC"), &WindContPitchAngleIEC_factory)); } -void WindContPitchAngleIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPitchAngleIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.dthetamax"), &assign_WindContPitchAngleIEC_dthetamax)); assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.dthetamin"), &assign_WindContPitchAngleIEC_dthetamin)); assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.kic"), &assign_WindContPitchAngleIEC_kic)); @@ -183,16 +206,11 @@ void WindContPitchAngleIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.WindGenTurbineType3IEC"), &assign_WindContPitchAngleIEC_WindGenTurbineType3IEC)); } -const char WindContPitchAngleIEC::debugName[] = "WindContPitchAngleIEC"; -const char* WindContPitchAngleIEC::debugString() +void WindContPitchAngleIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPitchAngleIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.WindGenTurbineType3IEC"), &assign_WindContPitchAngleIEC_WindGenTurbineType3IEC)); } const BaseClassDefiner WindContPitchAngleIEC::declare() @@ -200,4 +218,10 @@ const BaseClassDefiner WindContPitchAngleIEC::declare() return BaseClassDefiner(WindContPitchAngleIEC::addConstructToMap, WindContPitchAngleIEC::addPrimitiveAssignFnsToMap, WindContPitchAngleIEC::addClassAssignFnsToMap, WindContPitchAngleIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPitchAngleIEC_factory() + { + return new WindContPitchAngleIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.hpp b/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.hpp index dbd8fb229..c1f015f98 100644 --- a/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContPitchAngleIEC.hpp @@ -1,52 +1,53 @@ #ifndef WindContPitchAngleIEC_H #define WindContPitchAngleIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" +#include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindGenTurbineType3IEC; -class WindGenTurbineType3IEC; /* Pitch angle control model. Reference: IEC Standard 61400-27-1 Section 6.6.5.8. */ - class WindContPitchAngleIEC: public IdentifiedObject + class WindContPitchAngleIEC : public IdentifiedObject { - public: - CIMPP::Simple_Float dthetamax; /* Maximum pitch positive ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ - CIMPP::Simple_Float dthetamin; /* Maximum pitch negative ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ - CIMPP::PU kic; /* Power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kiomega; /* Speed PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpc; /* Power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpomega; /* Speed PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpx; /* Pitch cross coupling gain (K). It is type dependent parameter. Default: nullptr */ - CIMPP::AngleDegrees thetamax; /* Maximum pitch angle (). It is type dependent parameter. Default: nullptr */ - CIMPP::AngleDegrees thetamin; /* Minimum pitch angle (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds ttheta; /* Pitch time constant (t). It is type dependent parameter. Default: nullptr */ - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this pitch control model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPitchAngleIEC(); - virtual ~WindContPitchAngleIEC(); - + ~WindContPitchAngleIEC() override; + + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this pitch control model is associated. Default: 0 */ + CIMPP::Simple_Float dthetamax; /* Maximum pitch positive ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ + CIMPP::Simple_Float dthetamin; /* Maximum pitch negative ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ + CIMPP::PU kic; /* Power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kiomega; /* Speed PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpc; /* Power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpomega; /* Speed PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpx; /* Pitch cross coupling gain (K). It is type dependent parameter. Default: nullptr */ + CIMPP::AngleDegrees thetamax; /* Maximum pitch angle (). It is type dependent parameter. Default: nullptr */ + CIMPP::AngleDegrees thetamin; /* Minimum pitch angle (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds ttheta; /* Pitch time constant (t). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPitchAngleIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContQIEC.cpp b/CGMES_2.4.15_16FEB2016/WindContQIEC.cpp index 8c85dc09e..60df4e0e3 100644 --- a/CGMES_2.4.15_16FEB2016/WindContQIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContQIEC.cpp @@ -1,7 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContQIEC.hpp" +#include +#include + +#include "WindTurbineType3or4IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -28,375 +33,409 @@ #include "WindLVRTQcontrolModesKind.hpp" #include "WindQcontrolModesKind.hpp" #include "PU.hpp" -#include "WindTurbineType3or4IEC.hpp" using namespace CIMPP; -WindContQIEC::WindContQIEC(): WindTurbineType3or4IEC(nullptr) {}; - +WindContQIEC::WindContQIEC() : WindTurbineType3or4IEC(nullptr) {}; WindContQIEC::~WindContQIEC() {}; +bool assign_WindContQIEC_iqh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_iqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_iqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_iqpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqpost; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kiu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kpq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kqv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_qmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_qmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_rdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tiq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpost; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tqord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tqord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_udb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_udb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_umax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->umax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_umin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->umin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_uqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uqdip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_uref0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uref0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_windLVRTQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windLVRTQcontrolModesType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_windQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windQcontrolModesType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4IEC != nullptr) - return true; - } - return false; +bool assign_WindContQIEC_xdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContQIEC_iqh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass*, BaseClass*); +bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContQIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4IEC != element2) + { + element->WindTurbineType3or4IEC = element2; + return assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContQIEC_iqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_iqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_iqpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqpost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_kiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_kiu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_kpq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_kpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_kqv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_qmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_qmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_rdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tiq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tqord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tqord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_udb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_udb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_umax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->umax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_umin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->umin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_uqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uqdip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_uref0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uref0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_windLVRTQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windLVRTQcontrolModesType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_windQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windQcontrolModesType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_xdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* WindContQIEC_factory() { - return new WindContQIEC; - } + + + + + + + + + + + + + + + + + + + + + +const char WindContQIEC::debugName[] = "WindContQIEC"; +const char* WindContQIEC::debugString() const +{ + return WindContQIEC::debugName; } -void WindContQIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContQIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContQIEC"), &WindContQIEC_factory)); } -void WindContQIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContQIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.iqh1"), &assign_WindContQIEC_iqh1)); assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.iqmax"), &assign_WindContQIEC_iqmax)); assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.iqmin"), &assign_WindContQIEC_iqmin)); @@ -423,16 +462,11 @@ void WindContQIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.WindTurbineType3or4IEC"), &assign_WindContQIEC_WindTurbineType3or4IEC)); } -const char WindContQIEC::debugName[] = "WindContQIEC"; -const char* WindContQIEC::debugString() +void WindContQIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContQIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.WindTurbineType3or4IEC"), &assign_WindContQIEC_WindTurbineType3or4IEC)); } const BaseClassDefiner WindContQIEC::declare() @@ -440,4 +474,10 @@ const BaseClassDefiner WindContQIEC::declare() return BaseClassDefiner(WindContQIEC::addConstructToMap, WindContQIEC::addPrimitiveAssignFnsToMap, WindContQIEC::addClassAssignFnsToMap, WindContQIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContQIEC_factory() + { + return new WindContQIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContQIEC.hpp b/CGMES_2.4.15_16FEB2016/WindContQIEC.hpp index 36c3bc452..eb9e06da8 100644 --- a/CGMES_2.4.15_16FEB2016/WindContQIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContQIEC.hpp @@ -1,68 +1,69 @@ #ifndef WindContQIEC_H #define WindContQIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "WindLVRTQcontrolModesKind.hpp" #include "WindQcontrolModesKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType3or4IEC; - -class WindTurbineType3or4IEC; /* Q control model. Reference: IEC Standard 61400-27-1 Section 6.6.5.6. */ - class WindContQIEC: public IdentifiedObject + class WindContQIEC : public IdentifiedObject { - public: - CIMPP::PU iqh1; /* Maximum reactive current injection during dip (i). It is type dependent parameter. Default: nullptr */ - CIMPP::PU iqmax; /* Maximum reactive current injection (i). It is type dependent parameter. Default: nullptr */ - CIMPP::PU iqmin; /* Minimum reactive current injection (i). It is type dependent parameter. Default: nullptr */ - CIMPP::PU iqpost; /* Post fault reactive current injection (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU kiq; /* Reactive power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kiu; /* Voltage PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpq; /* Reactive power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpu; /* Voltage PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kqv; /* Voltage scaling factor for LVRT current (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU qmax; /* Maximum reactive power (q). It is type dependent parameter. Default: nullptr */ - CIMPP::PU qmin; /* Minimum reactive power (q). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rdroop; /* Resistive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tiq; /* Time constant in reactive current lag (T). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfilt; /* Power measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpost; /* Length of time period where post fault reactive power is injected (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tqord; /* Time constant in reactive power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU udb1; /* Voltage dead band lower limit (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU udb2; /* Voltage dead band upper limit (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU umax; /* Maximum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ - CIMPP::PU umin; /* Minimum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ - CIMPP::PU uqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU uref0; /* User defined bias in voltage reference (), used when =. It is case dependent parameter. Default: nullptr */ - CIMPP::WindLVRTQcontrolModesKind windLVRTQcontrolModesType; /* Types of LVRT Q control modes (). It is project dependent parameter. Default: 0 */ - CIMPP::WindQcontrolModesKind windQcontrolModesType; /* Types of general wind turbine Q control modes (). It is project dependent parameter. Default: 0 */ - CIMPP::PU xdroop; /* Inductive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this reactive control mode is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContQIEC(); - virtual ~WindContQIEC(); - + ~WindContQIEC() override; + + CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this reactive control mode is associated. Default: 0 */ + CIMPP::PU iqh1; /* Maximum reactive current injection during dip (i). It is type dependent parameter. Default: nullptr */ + CIMPP::PU iqmax; /* Maximum reactive current injection (i). It is type dependent parameter. Default: nullptr */ + CIMPP::PU iqmin; /* Minimum reactive current injection (i). It is type dependent parameter. Default: nullptr */ + CIMPP::PU iqpost; /* Post fault reactive current injection (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU kiq; /* Reactive power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kiu; /* Voltage PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpq; /* Reactive power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpu; /* Voltage PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kqv; /* Voltage scaling factor for LVRT current (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU qmax; /* Maximum reactive power (q). It is type dependent parameter. Default: nullptr */ + CIMPP::PU qmin; /* Minimum reactive power (q). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rdroop; /* Resistive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tiq; /* Time constant in reactive current lag (T). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfilt; /* Power measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpost; /* Length of time period where post fault reactive power is injected (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tqord; /* Time constant in reactive power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU udb1; /* Voltage dead band lower limit (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU udb2; /* Voltage dead band upper limit (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU umax; /* Maximum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ + CIMPP::PU umin; /* Minimum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ + CIMPP::PU uqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU uref0; /* User defined bias in voltage reference (), used when =. It is case dependent parameter. Default: nullptr */ + CIMPP::WindLVRTQcontrolModesKind windLVRTQcontrolModesType; /* Types of LVRT Q control modes (). It is project dependent parameter. Default: 0 */ + CIMPP::WindQcontrolModesKind windQcontrolModesType; /* Types of general wind turbine Q control modes (). It is project dependent parameter. Default: 0 */ + CIMPP::PU xdroop; /* Inductive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContQIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.cpp b/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.cpp index 0bd845bc4..59dfd4868 100644 --- a/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.cpp @@ -1,7 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContRotorRIEC.hpp" +#include +#include + +#include "WindDynamicsLookupTable.hpp" +#include "WindGenTurbineType2IEC.hpp" #include "PU.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -10,153 +16,175 @@ #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindDynamicsLookupTable.hpp" -#include "WindGenTurbineType2IEC.hpp" using namespace CIMPP; -WindContRotorRIEC::WindContRotorRIEC(): WindGenTurbineType2IEC(nullptr) {}; - +WindContRotorRIEC::WindContRotorRIEC() : WindGenTurbineType2IEC(nullptr) {}; WindContRotorRIEC::~WindContRotorRIEC() {}; +bool assign_WindContRotorRIEC_kirr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kirr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_komegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->komegafilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_kpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_kprr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kprr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_rmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindDynamicsLookupTable.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindContRotorRIEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tomegafilt; + if (buffer.fail()) + return false; + else return true; + } + return false; +} + +bool assign_WindContRotorRIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + + +bool assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass*, BaseClass*); +bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType2IEC != nullptr) - return true; - } - return false; -} - - -bool assign_WindContRotorRIEC_kirr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kirr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_komegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->komegafilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_kpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_kprr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kprr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_rmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tomegafilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - -namespace CIMPP { - BaseClass* WindContRotorRIEC_factory() { - return new WindContRotorRIEC; +bool assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass*, BaseClass*); +bool assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType2IEC != element2) + { + element->WindGenTurbineType2IEC = element2; + return assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + +const char WindContRotorRIEC::debugName[] = "WindContRotorRIEC"; +const char* WindContRotorRIEC::debugString() const +{ + return WindContRotorRIEC::debugName; } -void WindContRotorRIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContRotorRIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC"), &WindContRotorRIEC_factory)); } -void WindContRotorRIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContRotorRIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.kirr"), &assign_WindContRotorRIEC_kirr)); assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.komegafilt"), &assign_WindContRotorRIEC_komegafilt)); assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.kpfilt"), &assign_WindContRotorRIEC_kpfilt)); @@ -165,17 +193,12 @@ void WindContRotorRIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindDynamicsLookupTable"), &assign_WindContRotorRIEC_WindDynamicsLookupTable)); - assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindGenTurbineType2IEC"), &assign_WindContRotorRIEC_WindGenTurbineType2IEC)); } -const char WindContRotorRIEC::debugName[] = "WindContRotorRIEC"; -const char* WindContRotorRIEC::debugString() +void WindContRotorRIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContRotorRIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindDynamicsLookupTable"), &assign_WindContRotorRIEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindGenTurbineType2IEC"), &assign_WindContRotorRIEC_WindGenTurbineType2IEC)); } const BaseClassDefiner WindContRotorRIEC::declare() @@ -183,4 +206,10 @@ const BaseClassDefiner WindContRotorRIEC::declare() return BaseClassDefiner(WindContRotorRIEC::addConstructToMap, WindContRotorRIEC::addPrimitiveAssignFnsToMap, WindContRotorRIEC::addClassAssignFnsToMap, WindContRotorRIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContRotorRIEC_factory() + { + return new WindContRotorRIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.hpp b/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.hpp index 33d92613b..cfecbb5d1 100644 --- a/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindContRotorRIEC.hpp @@ -1,51 +1,52 @@ #ifndef WindContRotorRIEC_H #define WindContRotorRIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindGenTurbineType2IEC; -class WindDynamicsLookupTable; -class WindGenTurbineType2IEC; /* Rotor resistance control model. Reference: IEC Standard 61400-27-1 Section 6.6.5.2. */ - class WindContRotorRIEC: public IdentifiedObject + class WindContRotorRIEC : public IdentifiedObject { - public: - CIMPP::PU kirr; /* Integral gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float komegafilt; /* Filter gain for generator speed measurement (K). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kpfilt; /* Filter gain for power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kprr; /* Proportional gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rmax; /* Maximum rotor resistance (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rmin; /* Minimum rotor resistance (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ - std::list WindDynamicsLookupTable; /* The wind dynamics lookup table associated with this rotor resistance control model. Default: 0 */ - CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with whitch this wind control rotor resistance model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContRotorRIEC(); - virtual ~WindContRotorRIEC(); - + ~WindContRotorRIEC() override; + + std::list WindDynamicsLookupTable; /* The wind dynamics lookup table associated with this rotor resistance control model. Default: 0 */ + CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with whitch this wind control rotor resistance model is associated. Default: 0 */ + CIMPP::PU kirr; /* Integral gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float komegafilt; /* Filter gain for generator speed measurement (K). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kpfilt; /* Filter gain for power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kprr; /* Proportional gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rmax; /* Maximum rotor resistance (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rmin; /* Minimum rotor resistance (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContRotorRIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.cpp b/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.cpp index 26c365097..16f28bf01 100644 --- a/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.cpp +++ b/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.cpp @@ -1,148 +1,180 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindDynamicsLookupTable.hpp" +#include +#include + #include "WindContCurrLimIEC.hpp" #include "WindContPType3IEC.hpp" #include "WindContRotorRIEC.hpp" +#include "WindPlantFreqPcontrolIEC.hpp" #include "Simple_Float.hpp" #include "WindLookupTableFunctionKind.hpp" #include "Simple_Float.hpp" #include "Integer.hpp" -#include "WindPlantFreqPcontrolIEC.hpp" using namespace CIMPP; -WindDynamicsLookupTable::WindDynamicsLookupTable(): WindContCurrLimIEC(nullptr), WindContPType3IEC(nullptr), WindContRotorRIEC(nullptr), WindPlantFreqPcontrolIEC(nullptr) {}; - +WindDynamicsLookupTable::WindDynamicsLookupTable() : WindContCurrLimIEC(nullptr), WindContPType3IEC(nullptr), WindContRotorRIEC(nullptr), WindPlantFreqPcontrolIEC(nullptr) {}; WindDynamicsLookupTable::~WindDynamicsLookupTable() {}; -bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContCurrLimIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContCurrLimIEC != nullptr) - return assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType3IEC != nullptr) - return assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContRotorRIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContRotorRIEC != nullptr) - return assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantFreqPcontrolIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantFreqPcontrolIEC != nullptr) - return assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindDynamicsLookupTable_input(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->input; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindDynamicsLookupTable_lookupTableFunctionType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lookupTableFunctionType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindDynamicsLookupTable_output(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->output; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindDynamicsLookupTable_sequence(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequence; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindDynamicsLookupTable_input(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->input; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindContCurrLimIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContCurrLimIEC != element2) + { + element->WindContCurrLimIEC = element2; + return assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindDynamicsLookupTable_lookupTableFunctionType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lookupTableFunctionType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindContPType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType3IEC != element2) + { + element->WindContPType3IEC = element2; + return assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindDynamicsLookupTable_output(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->output; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindContRotorRIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContRotorRIEC != element2) + { + element->WindContRotorRIEC = element2; + return assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindDynamicsLookupTable_sequence(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequence; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindPlantFreqPcontrolIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantFreqPcontrolIEC != element2) + { + element->WindPlantFreqPcontrolIEC = element2; + return assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindDynamicsLookupTable_factory() { - return new WindDynamicsLookupTable; - } + + + +const char WindDynamicsLookupTable::debugName[] = "WindDynamicsLookupTable"; +const char* WindDynamicsLookupTable::debugString() const +{ + return WindDynamicsLookupTable::debugName; } -void WindDynamicsLookupTable::addConstructToMap(std::unordered_map& factory_map) { +void WindDynamicsLookupTable::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable"), &WindDynamicsLookupTable_factory)); } -void WindDynamicsLookupTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.input"), &assign_WindDynamicsLookupTable_input)); +void WindDynamicsLookupTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.input"), &assign_WindDynamicsLookupTable_input)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.lookupTableFunctionType"), &assign_WindDynamicsLookupTable_lookupTableFunctionType)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.output"), &assign_WindDynamicsLookupTable_output)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.sequence"), &assign_WindDynamicsLookupTable_sequence)); - } +} -void WindDynamicsLookupTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void WindDynamicsLookupTable::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindContCurrLimIEC"), &assign_WindDynamicsLookupTable_WindContCurrLimIEC)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindContPType3IEC"), &assign_WindDynamicsLookupTable_WindContPType3IEC)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindContRotorRIEC"), &assign_WindDynamicsLookupTable_WindContRotorRIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindPlantFreqPcontrolIEC"), &assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC)); -} - -const char WindDynamicsLookupTable::debugName[] = "WindDynamicsLookupTable"; -const char* WindDynamicsLookupTable::debugString() -{ - return WindDynamicsLookupTable::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindPlantFreqPcontrolIEC"), &assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC)); } const BaseClassDefiner WindDynamicsLookupTable::declare() @@ -150,4 +182,10 @@ const BaseClassDefiner WindDynamicsLookupTable::declare() return BaseClassDefiner(WindDynamicsLookupTable::addConstructToMap, WindDynamicsLookupTable::addPrimitiveAssignFnsToMap, WindDynamicsLookupTable::addClassAssignFnsToMap, WindDynamicsLookupTable::debugName); } - +namespace CIMPP +{ + BaseClass* WindDynamicsLookupTable_factory() + { + return new WindDynamicsLookupTable; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.hpp b/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.hpp index a2de32ef2..2ed62aca5 100644 --- a/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.hpp +++ b/CGMES_2.4.15_16FEB2016/WindDynamicsLookupTable.hpp @@ -1,51 +1,52 @@ #ifndef WindDynamicsLookupTable_H #define WindDynamicsLookupTable_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" #include "WindLookupTableFunctionKind.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class WindContCurrLimIEC; + class WindContPType3IEC; + class WindContRotorRIEC; + class WindPlantFreqPcontrolIEC; -class WindContCurrLimIEC; -class WindContPType3IEC; -class WindContRotorRIEC; -class WindPlantFreqPcontrolIEC; /* The class models a look up table for the purpose of wind standard models. */ - class WindDynamicsLookupTable: public IdentifiedObject + class WindDynamicsLookupTable : public IdentifiedObject { - public: - CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* The wind dynamics lookup table associated with this current control limitation model. Default: 0 */ - CIMPP::WindContPType3IEC* WindContPType3IEC; /* The wind dynamics lookup table associated with this P control type 3 model. Default: 0 */ - CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* The rotor resistance control model with which this wind dynamics lookup table is associated. Default: 0 */ - CIMPP::Simple_Float input; /* Input value (x) for the lookup table function. Default: nullptr */ - CIMPP::WindLookupTableFunctionKind lookupTableFunctionType; /* Type of the lookup table function. Default: 0 */ - CIMPP::Simple_Float output; /* Output value (y) for the lookup table function. Default: nullptr */ - CIMPP::Integer sequence; /* Sequence numbers of the pairs of the input (x) and the output (y) of the lookup table function. Default: 0 */ - CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* The wind dynamics lookup table associated with this frequency and active power wind plant model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindDynamicsLookupTable(); - virtual ~WindDynamicsLookupTable(); - + ~WindDynamicsLookupTable() override; + + CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* The wind dynamics lookup table associated with this current control limitation model. Default: 0 */ + CIMPP::WindContPType3IEC* WindContPType3IEC; /* The wind dynamics lookup table associated with this P control type 3 model. Default: 0 */ + CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* The rotor resistance control model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* The wind dynamics lookup table associated with this frequency and active power wind plant model. Default: 0 */ + CIMPP::Simple_Float input; /* Input value (x) for the lookup table function. Default: nullptr */ + CIMPP::WindLookupTableFunctionKind lookupTableFunctionType; /* Type of the lookup table function. Default: 0 */ + CIMPP::Simple_Float output; /* Output value (y) for the lookup table function. Default: nullptr */ + CIMPP::Integer sequence; /* Sequence numbers of the pairs of the input (x) and the output (y) of the lookup table function. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindDynamicsLookupTable_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.cpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.cpp index 90be7036b..42758de0c 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.cpp @@ -1,49 +1,56 @@ -#include -#include "WindTurbineType1or2IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType1IEC.hpp" +#include +#include + #include "WindAeroConstIEC.hpp" using namespace CIMPP; -WindGenTurbineType1IEC::WindGenTurbineType1IEC(): WindAeroConstIEC(nullptr) {}; - +WindGenTurbineType1IEC::WindGenTurbineType1IEC() : WindAeroConstIEC(nullptr) {}; WindGenTurbineType1IEC::~WindGenTurbineType1IEC() {}; -bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType1IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindAeroConstIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindAeroConstIEC != nullptr) - return assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* WindGenTurbineType1IEC_factory() { - return new WindGenTurbineType1IEC; +bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType1IEC* element = dynamic_cast(BaseClass_ptr1); + WindAeroConstIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindAeroConstIEC != element2) + { + element->WindAeroConstIEC = element2; + return assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindGenTurbineType1IEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC"), &WindGenTurbineType1IEC_factory)); +const char WindGenTurbineType1IEC::debugName[] = "WindGenTurbineType1IEC"; +const char* WindGenTurbineType1IEC::debugString() const +{ + return WindGenTurbineType1IEC::debugName; } -void WindGenTurbineType1IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindGenTurbineType1IEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC"), &WindGenTurbineType1IEC_factory)); +} -void WindGenTurbineType1IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC.WindAeroConstIEC"), &assign_WindGenTurbineType1IEC_WindAeroConstIEC)); +void WindGenTurbineType1IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindGenTurbineType1IEC::debugName[] = "WindGenTurbineType1IEC"; -const char* WindGenTurbineType1IEC::debugString() +void WindGenTurbineType1IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType1IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC.WindAeroConstIEC"), &assign_WindGenTurbineType1IEC_WindAeroConstIEC)); } const BaseClassDefiner WindGenTurbineType1IEC::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner WindGenTurbineType1IEC::declare() return BaseClassDefiner(WindGenTurbineType1IEC::addConstructToMap, WindGenTurbineType1IEC::addPrimitiveAssignFnsToMap, WindGenTurbineType1IEC::addClassAssignFnsToMap, WindGenTurbineType1IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType1IEC_factory() + { + return new WindGenTurbineType1IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.hpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.hpp index b1460e321..e25b25c4e 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType1IEC.hpp @@ -1,38 +1,39 @@ #ifndef WindGenTurbineType1IEC_H #define WindGenTurbineType1IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType1or2IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindAeroConstIEC; -class WindAeroConstIEC; /* Wind turbine IEC Type 1. Reference: IEC Standard 61400-27-1, section 6.5.2. */ - class WindGenTurbineType1IEC: public WindTurbineType1or2IEC + class WindGenTurbineType1IEC : public WindTurbineType1or2IEC { - public: - CIMPP::WindAeroConstIEC* WindAeroConstIEC; /* Wind aerodynamic model associated with this wind turbine type 1 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType1IEC(); - virtual ~WindGenTurbineType1IEC(); - + ~WindGenTurbineType1IEC() override; + + CIMPP::WindAeroConstIEC* WindAeroConstIEC; /* Wind aerodynamic model associated with this wind turbine type 1 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType1IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.cpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.cpp index 4bdcadf22..a0472c038 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindTurbineType1or2IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType2IEC.hpp" +#include +#include + #include "WindContRotorRIEC.hpp" #include "WindPitchContEmulIEC.hpp" using namespace CIMPP; -WindGenTurbineType2IEC::WindGenTurbineType2IEC(): WindContRotorRIEC(nullptr), WindPitchContEmulIEC(nullptr) {}; - +WindGenTurbineType2IEC::WindGenTurbineType2IEC() : WindContRotorRIEC(nullptr), WindPitchContEmulIEC(nullptr) {}; WindGenTurbineType2IEC::~WindGenTurbineType2IEC() {}; + + + bool assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContRotorRIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContRotorRIEC != nullptr) - return assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1); + WindContRotorRIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContRotorRIEC != element2) + { + element->WindContRotorRIEC = element2; + return assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPitchContEmulIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPitchContEmulIEC != nullptr) - return assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1); + WindPitchContEmulIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPitchContEmulIEC != element2) + { + element->WindPitchContEmulIEC = element2; + return assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindGenTurbineType2IEC_factory() { - return new WindGenTurbineType2IEC; - } +const char WindGenTurbineType2IEC::debugName[] = "WindGenTurbineType2IEC"; +const char* WindGenTurbineType2IEC::debugString() const +{ + return WindGenTurbineType2IEC::debugName; } -void WindGenTurbineType2IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType2IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC"), &WindGenTurbineType2IEC_factory)); } -void WindGenTurbineType2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindGenTurbineType2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindContRotorRIEC"), &assign_WindGenTurbineType2IEC_WindContRotorRIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindPitchContEmulIEC"), &assign_WindGenTurbineType2IEC_WindPitchContEmulIEC)); +void WindGenTurbineType2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindGenTurbineType2IEC::debugName[] = "WindGenTurbineType2IEC"; -const char* WindGenTurbineType2IEC::debugString() +void WindGenTurbineType2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType2IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindContRotorRIEC"), &assign_WindGenTurbineType2IEC_WindContRotorRIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindPitchContEmulIEC"), &assign_WindGenTurbineType2IEC_WindPitchContEmulIEC)); } const BaseClassDefiner WindGenTurbineType2IEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindGenTurbineType2IEC::declare() return BaseClassDefiner(WindGenTurbineType2IEC::addConstructToMap, WindGenTurbineType2IEC::addPrimitiveAssignFnsToMap, WindGenTurbineType2IEC::addClassAssignFnsToMap, WindGenTurbineType2IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType2IEC_factory() + { + return new WindGenTurbineType2IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.hpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.hpp index 89485480a..92b0a595b 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType2IEC.hpp @@ -1,40 +1,41 @@ #ifndef WindGenTurbineType2IEC_H #define WindGenTurbineType2IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType1or2IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContRotorRIEC; + class WindPitchContEmulIEC; -class WindContRotorRIEC; -class WindPitchContEmulIEC; /* Wind turbine IEC Type 2. Reference: IEC Standard 61400-27-1, section 6.5.3. */ - class WindGenTurbineType2IEC: public WindTurbineType1or2IEC + class WindGenTurbineType2IEC : public WindTurbineType1or2IEC { - public: - CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* Wind control rotor resistance model associated with wind turbine type 2 model. Default: 0 */ - CIMPP::WindPitchContEmulIEC* WindPitchContEmulIEC; /* Pitch control emulator model associated with this wind turbine type 2 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType2IEC(); - virtual ~WindGenTurbineType2IEC(); - + ~WindGenTurbineType2IEC() override; + + CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* Wind control rotor resistance model associated with wind turbine type 2 model. Default: 0 */ + CIMPP::WindPitchContEmulIEC* WindPitchContEmulIEC; /* Pitch control emulator model associated with this wind turbine type 2 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType2IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.cpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.cpp index bf8cee136..7395215bf 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.cpp @@ -1,118 +1,148 @@ -#include -#include "WindTurbineType3or4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType3IEC.hpp" +#include +#include + #include "WindAeroLinearIEC.hpp" -#include "WindContPitchAngleIEC.hpp" #include "WindContPType3IEC.hpp" +#include "WindContPitchAngleIEC.hpp" +#include "WindMechIEC.hpp" #include "PU.hpp" #include "PU.hpp" -#include "WindMechIEC.hpp" using namespace CIMPP; -WindGenTurbineType3IEC::WindGenTurbineType3IEC(): WindAeroLinearIEC(nullptr), WindContPitchAngleIEC(nullptr), WindContPType3IEC(nullptr), WindMechIEC(nullptr) {}; - +WindGenTurbineType3IEC::WindGenTurbineType3IEC() : WindAeroLinearIEC(nullptr), WindContPType3IEC(nullptr), WindContPitchAngleIEC(nullptr), WindMechIEC(nullptr) {}; WindGenTurbineType3IEC::~WindGenTurbineType3IEC() {}; -bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindAeroLinearIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindAeroLinearIEC != nullptr) - return assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPitchAngleIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPitchAngleIEC != nullptr) - return assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType3IEC != nullptr) - return assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindMechIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindMechIEC != nullptr) - return assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindGenTurbineType3IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dipmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindGenTurbineType3IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->diqmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindAeroLinearIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindAeroLinearIEC != element2) + { + element->WindAeroLinearIEC = element2; + return assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindContPType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType3IEC != element2) + { + element->WindContPType3IEC = element2; + return assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_WindGenTurbineType3IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dipmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindContPitchAngleIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPitchAngleIEC != element2) + { + element->WindContPitchAngleIEC = element2; + return assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindGenTurbineType3IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->diqmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindMechIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindMechIEC != element2) + { + element->WindMechIEC = element2; + return assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindGenTurbineType3IEC_factory() { - return new WindGenTurbineType3IEC; - } + +const char WindGenTurbineType3IEC::debugName[] = "WindGenTurbineType3IEC"; +const char* WindGenTurbineType3IEC::debugString() const +{ + return WindGenTurbineType3IEC::debugName; } -void WindGenTurbineType3IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType3IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC"), &WindGenTurbineType3IEC_factory)); } -void WindGenTurbineType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.dipmax"), &assign_WindGenTurbineType3IEC_dipmax)); +void WindGenTurbineType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.dipmax"), &assign_WindGenTurbineType3IEC_dipmax)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.diqmax"), &assign_WindGenTurbineType3IEC_diqmax)); - } - -void WindGenTurbineType3IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindAeroLinearIEC"), &assign_WindGenTurbineType3IEC_WindAeroLinearIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPitchAngleIEC"), &assign_WindGenTurbineType3IEC_WindContPitchAngleIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPType3IEC"), &assign_WindGenTurbineType3IEC_WindContPType3IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindMechIEC"), &assign_WindGenTurbineType3IEC_WindMechIEC)); } -const char WindGenTurbineType3IEC::debugName[] = "WindGenTurbineType3IEC"; -const char* WindGenTurbineType3IEC::debugString() +void WindGenTurbineType3IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType3IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindAeroLinearIEC"), &assign_WindGenTurbineType3IEC_WindAeroLinearIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPType3IEC"), &assign_WindGenTurbineType3IEC_WindContPType3IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPitchAngleIEC"), &assign_WindGenTurbineType3IEC_WindContPitchAngleIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindMechIEC"), &assign_WindGenTurbineType3IEC_WindMechIEC)); } const BaseClassDefiner WindGenTurbineType3IEC::declare() @@ -120,4 +150,10 @@ const BaseClassDefiner WindGenTurbineType3IEC::declare() return BaseClassDefiner(WindGenTurbineType3IEC::addConstructToMap, WindGenTurbineType3IEC::addPrimitiveAssignFnsToMap, WindGenTurbineType3IEC::addClassAssignFnsToMap, WindGenTurbineType3IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType3IEC_factory() + { + return new WindGenTurbineType3IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.hpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.hpp index 222fca906..4060364f3 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3IEC.hpp @@ -1,47 +1,48 @@ #ifndef WindGenTurbineType3IEC_H #define WindGenTurbineType3IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType3or4IEC.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindAeroLinearIEC; + class WindContPType3IEC; + class WindContPitchAngleIEC; + class WindMechIEC; - -class WindAeroLinearIEC; -class WindContPitchAngleIEC; -class WindContPType3IEC; -class WindMechIEC; /* Generator model for wind turbines of IEC type 3A and 3B. */ - class WindGenTurbineType3IEC: public WindTurbineType3or4IEC + class WindGenTurbineType3IEC : public WindTurbineType3or4IEC { - public: - CIMPP::WindAeroLinearIEC* WindAeroLinearIEC; /* Wind aerodynamic model associated with this wind generator type 3 model. Default: 0 */ - CIMPP::WindContPitchAngleIEC* WindContPitchAngleIEC; /* Wind control pitch angle model associated with this wind turbine type 3. Default: 0 */ - CIMPP::WindContPType3IEC* WindContPType3IEC; /* Wind control P type 3 model associated with this wind turbine type 3 model. Default: 0 */ - CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 3 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType3IEC(); - virtual ~WindGenTurbineType3IEC(); - + ~WindGenTurbineType3IEC() override; + + CIMPP::WindAeroLinearIEC* WindAeroLinearIEC; /* Wind aerodynamic model associated with this wind generator type 3 model. Default: 0 */ + CIMPP::WindContPType3IEC* WindContPType3IEC; /* Wind control P type 3 model associated with this wind turbine type 3 model. Default: 0 */ + CIMPP::WindContPitchAngleIEC* WindContPitchAngleIEC; /* Wind control pitch angle model associated with this wind turbine type 3. Default: 0 */ + CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 3 model. Default: 0 */ + CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ + CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType3IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.cpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.cpp index 08ea8a858..a665f7def 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.cpp @@ -1,81 +1,84 @@ -#include -#include "WindGenTurbineType3IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType3aIEC.hpp" +#include +#include + #include "Simple_Float.hpp" -#include "PU.hpp" #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; WindGenTurbineType3aIEC::WindGenTurbineType3aIEC() {}; - WindGenTurbineType3aIEC::~WindGenTurbineType3aIEC() {}; +bool assign_WindGenTurbineType3aIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3aIEC_tic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3aIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGenTurbineType3aIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3aIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3aIEC_tic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGenTurbineType3aIEC_factory() { - return new WindGenTurbineType3aIEC; - } +const char WindGenTurbineType3aIEC::debugName[] = "WindGenTurbineType3aIEC"; +const char* WindGenTurbineType3aIEC::debugString() const +{ + return WindGenTurbineType3aIEC::debugName; } -void WindGenTurbineType3aIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType3aIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC"), &WindGenTurbineType3aIEC_factory)); } -void WindGenTurbineType3aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGenTurbineType3aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.kpc"), &assign_WindGenTurbineType3aIEC_kpc)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.xs"), &assign_WindGenTurbineType3aIEC_xs)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.tic"), &assign_WindGenTurbineType3aIEC_tic)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.xs"), &assign_WindGenTurbineType3aIEC_xs)); } -void WindGenTurbineType3aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGenTurbineType3aIEC::debugName[] = "WindGenTurbineType3aIEC"; -const char* WindGenTurbineType3aIEC::debugString() +void WindGenTurbineType3aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType3aIEC::debugName; } const BaseClassDefiner WindGenTurbineType3aIEC::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner WindGenTurbineType3aIEC::declare() return BaseClassDefiner(WindGenTurbineType3aIEC::addConstructToMap, WindGenTurbineType3aIEC::addPrimitiveAssignFnsToMap, WindGenTurbineType3aIEC::addClassAssignFnsToMap, WindGenTurbineType3aIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType3aIEC_factory() + { + return new WindGenTurbineType3aIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.hpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.hpp index d48b002c6..d803c1dd5 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3aIEC.hpp @@ -1,42 +1,43 @@ #ifndef WindGenTurbineType3aIEC_H #define WindGenTurbineType3aIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenTurbineType3IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "WindGenTurbineType3IEC.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEC Type 3A generator set model. Reference: IEC Standard 61400-27-1 Section 6.6.3.2. */ - class WindGenTurbineType3aIEC: public WindGenTurbineType3IEC + class WindGenTurbineType3aIEC : public WindGenTurbineType3IEC { - public: - CIMPP::Simple_Float kpc; /* Current PI controller proportional gain (K). It is type dependent parameter. Default: nullptr */ - CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tic; /* Current PI controller integration time constant (T). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType3aIEC(); - virtual ~WindGenTurbineType3aIEC(); - + ~WindGenTurbineType3aIEC() override; + + CIMPP::Simple_Float kpc; /* Current PI controller proportional gain (K). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tic; /* Current PI controller integration time constant (T). It is type dependent parameter. Default: nullptr */ + CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType3aIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.cpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.cpp index 9421974c8..6bc10880c 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.cpp @@ -1,111 +1,116 @@ -#include -#include "WindGenTurbineType3IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType3bIEC.hpp" +#include +#include + #include "Simple_Float.hpp" +#include "Boolean.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "PU.hpp" using namespace CIMPP; WindGenTurbineType3bIEC::WindGenTurbineType3bIEC() {}; - WindGenTurbineType3bIEC::~WindGenTurbineType3bIEC() {}; +bool assign_WindGenTurbineType3bIEC_fducw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fducw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_mwtcwp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwtcwp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_two(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->two; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGenTurbineType3bIEC_fducw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fducw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_two(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->two; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_mwtcwp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwtcwp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGenTurbineType3bIEC_factory() { - return new WindGenTurbineType3bIEC; - } +const char WindGenTurbineType3bIEC::debugName[] = "WindGenTurbineType3bIEC"; +const char* WindGenTurbineType3bIEC::debugString() const +{ + return WindGenTurbineType3bIEC::debugName; } -void WindGenTurbineType3bIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType3bIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC"), &WindGenTurbineType3bIEC_factory)); } -void WindGenTurbineType3bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGenTurbineType3bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.fducw"), &assign_WindGenTurbineType3bIEC_fducw)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.mwtcwp"), &assign_WindGenTurbineType3bIEC_mwtcwp)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.tg"), &assign_WindGenTurbineType3bIEC_tg)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.two"), &assign_WindGenTurbineType3bIEC_two)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.mwtcwp"), &assign_WindGenTurbineType3bIEC_mwtcwp)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.xs"), &assign_WindGenTurbineType3bIEC_xs)); } -void WindGenTurbineType3bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGenTurbineType3bIEC::debugName[] = "WindGenTurbineType3bIEC"; -const char* WindGenTurbineType3bIEC::debugString() +void WindGenTurbineType3bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType3bIEC::debugName; } const BaseClassDefiner WindGenTurbineType3bIEC::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner WindGenTurbineType3bIEC::declare() return BaseClassDefiner(WindGenTurbineType3bIEC::addConstructToMap, WindGenTurbineType3bIEC::addPrimitiveAssignFnsToMap, WindGenTurbineType3bIEC::addClassAssignFnsToMap, WindGenTurbineType3bIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType3bIEC_factory() + { + return new WindGenTurbineType3bIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.hpp b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.hpp index cf278976c..49e1153e3 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenTurbineType3bIEC.hpp @@ -1,45 +1,46 @@ #ifndef WindGenTurbineType3bIEC_H #define WindGenTurbineType3bIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenTurbineType3IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "WindGenTurbineType3IEC.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEC Type 3B generator set model. Reference: IEC Standard 61400-27-1 Section 6.6.3.3. */ - class WindGenTurbineType3bIEC: public WindGenTurbineType3IEC + class WindGenTurbineType3bIEC : public WindGenTurbineType3IEC { - public: - CIMPP::Simple_Float fducw; /* Crowbar duration versus voltage variation look-up table (f()). It is case dependent parameter. Default: nullptr */ - CIMPP::Seconds tg; /* Current generation Time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds two; /* Time constant for crowbar washout filter (). It is case dependent parameter. Default: nullptr */ - CIMPP::Boolean mwtcwp; /* Crowbar control mode (). The parameter is case dependent parameter. Default: false */ - CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType3bIEC(); - virtual ~WindGenTurbineType3bIEC(); - + ~WindGenTurbineType3bIEC() override; + + CIMPP::Simple_Float fducw; /* Crowbar duration versus voltage variation look-up table (f()). It is case dependent parameter. Default: nullptr */ + CIMPP::Boolean mwtcwp; /* Crowbar control mode (). The parameter is case dependent parameter. Default: false */ + CIMPP::Seconds tg; /* Current generation Time constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds two; /* Time constant for crowbar washout filter (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType3bIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenType4IEC.cpp b/CGMES_2.4.15_16FEB2016/WindGenType4IEC.cpp index caa28226c..1553cc490 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenType4IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenType4IEC.cpp @@ -1,7 +1,11 @@ -#include -#include "WindTurbineType3or4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenType4IEC.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -10,87 +14,87 @@ using namespace CIMPP; WindGenType4IEC::WindGenType4IEC() {}; - WindGenType4IEC::~WindGenType4IEC() {}; +bool assign_WindGenType4IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dipmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenType4IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->diqmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenType4IEC_diqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->diqmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenType4IEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGenType4IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dipmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenType4IEC_diqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->diqmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenType4IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->diqmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenType4IEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGenType4IEC_factory() { - return new WindGenType4IEC; - } +const char WindGenType4IEC::debugName[] = "WindGenType4IEC"; +const char* WindGenType4IEC::debugString() const +{ + return WindGenType4IEC::debugName; } -void WindGenType4IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenType4IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenType4IEC"), &WindGenType4IEC_factory)); } -void WindGenType4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGenType4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.dipmax"), &assign_WindGenType4IEC_dipmax)); - assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.diqmin"), &assign_WindGenType4IEC_diqmin)); assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.diqmax"), &assign_WindGenType4IEC_diqmax)); + assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.diqmin"), &assign_WindGenType4IEC_diqmin)); assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.tg"), &assign_WindGenType4IEC_tg)); } -void WindGenType4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGenType4IEC::debugName[] = "WindGenType4IEC"; -const char* WindGenType4IEC::debugString() +void WindGenType4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenType4IEC::debugName; } const BaseClassDefiner WindGenType4IEC::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner WindGenType4IEC::declare() return BaseClassDefiner(WindGenType4IEC::addConstructToMap, WindGenType4IEC::addPrimitiveAssignFnsToMap, WindGenType4IEC::addClassAssignFnsToMap, WindGenType4IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenType4IEC_factory() + { + return new WindGenType4IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenType4IEC.hpp b/CGMES_2.4.15_16FEB2016/WindGenType4IEC.hpp index 8c926e691..b969138e3 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenType4IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenType4IEC.hpp @@ -1,42 +1,43 @@ #ifndef WindGenType4IEC_H #define WindGenType4IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType3or4IEC.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEC Type 4 generator set model. Reference: IEC Standard 61400-27-1 Section 6.6.3.4. */ - class WindGenType4IEC: public WindTurbineType3or4IEC + class WindGenType4IEC : public WindTurbineType3or4IEC { - public: - CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::PU diqmin; /* Minimum reactive current ramp rate (d). It is case dependent parameter. Default: nullptr */ - CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tg; /* Time constant (T). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenType4IEC(); - virtual ~WindGenType4IEC(); - + ~WindGenType4IEC() override; + + CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ + CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ + CIMPP::PU diqmin; /* Minimum reactive current ramp rate (d). It is case dependent parameter. Default: nullptr */ + CIMPP::Seconds tg; /* Time constant (T). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenType4IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindGenUnitKind.cpp b/CGMES_2.4.15_16FEB2016/WindGenUnitKind.cpp index 097470d2e..f92814598 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenUnitKind.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGenUnitKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenUnitKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindGenUnitKind& rop) +WindGenUnitKind& WindGenUnitKind::operator=(WindGenUnitKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindGenUnitKind::operator WindGenUnitKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindGenUnitKind::debugName[] = "WindGenUnitKind"; +const char* WindGenUnitKind::debugString() const +{ + return WindGenUnitKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindGenUnitKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindGenUnitKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindGenUnitKind::offshore) + { + EnumSymbol = "offshore"; + } + if (obj.value == WindGenUnitKind::onshore) + { + EnumSymbol = "onshore"; + } + + if (!EnumSymbol.empty()) + { + os << "WindGenUnitKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGenUnitKind.hpp b/CGMES_2.4.15_16FEB2016/WindGenUnitKind.hpp index a05e1b754..4aa57c46c 100644 --- a/CGMES_2.4.15_16FEB2016/WindGenUnitKind.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGenUnitKind.hpp @@ -1,21 +1,46 @@ #ifndef WindGenUnitKind_H #define WindGenUnitKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Kind of wind generating unit. */ - enum class WindGenUnitKind + class WindGenUnitKind { - /** - * The wind generating unit is located offshore. - */ - offshore, - /** - * The wind generating unit is located onshore. - */ - onshore, + public: + enum WindGenUnitKind_ENUM + { + /** + * The wind generating unit is located offshore. + */ + offshore, + /** + * The wind generating unit is located onshore. + */ + onshore, + }; + + WindGenUnitKind() : value(), initialized(false) {} + WindGenUnitKind(WindGenUnitKind_ENUM value) : value(value), initialized(true) {} + + WindGenUnitKind& operator=(WindGenUnitKind_ENUM rop); + operator WindGenUnitKind_ENUM() const; + + WindGenUnitKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindGenUnitKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindGenUnitKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindGenUnitKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.cpp b/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.cpp index c3728f0bf..b07a7b82d 100644 --- a/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.cpp +++ b/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.cpp @@ -1,51 +1,52 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGeneratingUnit.hpp" +#include +#include + #include "WindGenUnitKind.hpp" using namespace CIMPP; WindGeneratingUnit::WindGeneratingUnit() {}; - WindGeneratingUnit::~WindGeneratingUnit() {}; +bool assign_WindGeneratingUnit_windGenUnitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windGenUnitType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGeneratingUnit_windGenUnitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windGenUnitType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGeneratingUnit_factory() { - return new WindGeneratingUnit; - } +const char WindGeneratingUnit::debugName[] = "WindGeneratingUnit"; +const char* WindGeneratingUnit::debugString() const +{ + return WindGeneratingUnit::debugName; } -void WindGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void WindGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGeneratingUnit"), &WindGeneratingUnit_factory)); } -void WindGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGeneratingUnit.windGenUnitType"), &assign_WindGeneratingUnit_windGenUnitType)); } -void WindGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGeneratingUnit::debugName[] = "WindGeneratingUnit"; -const char* WindGeneratingUnit::debugString() +void WindGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGeneratingUnit::debugName; } const BaseClassDefiner WindGeneratingUnit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner WindGeneratingUnit::declare() return BaseClassDefiner(WindGeneratingUnit::addConstructToMap, WindGeneratingUnit::addPrimitiveAssignFnsToMap, WindGeneratingUnit::addClassAssignFnsToMap, WindGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* WindGeneratingUnit_factory() + { + return new WindGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.hpp b/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.hpp index caa29762f..9ab3810cd 100644 --- a/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.hpp +++ b/CGMES_2.4.15_16FEB2016/WindGeneratingUnit.hpp @@ -1,38 +1,39 @@ #ifndef WindGeneratingUnit_H #define WindGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" #include "WindGenUnitKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A wind driven generating unit. May be used to represent a single turbine or an aggregation. */ - class WindGeneratingUnit: public GeneratingUnit + class WindGeneratingUnit : public GeneratingUnit { - public: - CIMPP::WindGenUnitKind windGenUnitType; /* The kind of wind generating unit Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGeneratingUnit(); - virtual ~WindGeneratingUnit(); - + ~WindGeneratingUnit() override; + + CIMPP::WindGenUnitKind windGenUnitType; /* The kind of wind generating unit Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.cpp b/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.cpp index eb9d181ef..1cd506474 100644 --- a/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.cpp +++ b/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindLVRTQcontrolModesKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindLVRTQcontrolModesKind& rop) +WindLVRTQcontrolModesKind& WindLVRTQcontrolModesKind::operator=(WindLVRTQcontrolModesKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindLVRTQcontrolModesKind::operator WindLVRTQcontrolModesKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindLVRTQcontrolModesKind::debugName[] = "WindLVRTQcontrolModesKind"; +const char* WindLVRTQcontrolModesKind::debugString() const +{ + return WindLVRTQcontrolModesKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindLVRTQcontrolModesKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindLVRTQcontrolModesKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindLVRTQcontrolModesKind::mode1) + { + EnumSymbol = "mode1"; + } + if (obj.value == WindLVRTQcontrolModesKind::mode2) + { + EnumSymbol = "mode2"; + } + if (obj.value == WindLVRTQcontrolModesKind::mode3) + { + EnumSymbol = "mode3"; + } + + if (!EnumSymbol.empty()) + { + os << "WindLVRTQcontrolModesKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.hpp b/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.hpp index 59fb40515..7b731082a 100644 --- a/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.hpp +++ b/CGMES_2.4.15_16FEB2016/WindLVRTQcontrolModesKind.hpp @@ -1,25 +1,50 @@ #ifndef WindLVRTQcontrolModesKind_H #define WindLVRTQcontrolModesKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* LVRT Q control modes . */ - enum class WindLVRTQcontrolModesKind + class WindLVRTQcontrolModesKind { - /** - * Voltage dependent reactive current injection (). - */ - mode1, - /** - * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection (). - */ - mode2, - /** - * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection during fault, and as the pre-fault value plus an additional constant reactive current injection post fault (). - */ - mode3, + public: + enum WindLVRTQcontrolModesKind_ENUM + { + /** + * Voltage dependent reactive current injection (). + */ + mode1, + /** + * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection (). + */ + mode2, + /** + * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection during fault, and as the pre-fault value plus an additional constant reactive current injection post fault (). + */ + mode3, + }; + + WindLVRTQcontrolModesKind() : value(), initialized(false) {} + WindLVRTQcontrolModesKind(WindLVRTQcontrolModesKind_ENUM value) : value(value), initialized(true) {} + + WindLVRTQcontrolModesKind& operator=(WindLVRTQcontrolModesKind_ENUM rop); + operator WindLVRTQcontrolModesKind_ENUM() const; + + WindLVRTQcontrolModesKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindLVRTQcontrolModesKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindLVRTQcontrolModesKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindLVRTQcontrolModesKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.cpp b/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.cpp index 3ccd6b9ee..e6d94391f 100644 --- a/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.cpp +++ b/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindLookupTableFunctionKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindLookupTableFunctionKind& rop) +WindLookupTableFunctionKind& WindLookupTableFunctionKind::operator=(WindLookupTableFunctionKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindLookupTableFunctionKind::operator WindLookupTableFunctionKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindLookupTableFunctionKind::debugName[] = "WindLookupTableFunctionKind"; +const char* WindLookupTableFunctionKind::debugString() const +{ + return WindLookupTableFunctionKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindLookupTableFunctionKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -48,5 +79,39 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindLookupTableFunctionKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindLookupTableFunctionKind::fpslip) + { + EnumSymbol = "fpslip"; + } + if (obj.value == WindLookupTableFunctionKind::fpomega) + { + EnumSymbol = "fpomega"; + } + if (obj.value == WindLookupTableFunctionKind::ipvdl) + { + EnumSymbol = "ipvdl"; + } + if (obj.value == WindLookupTableFunctionKind::iqvdl) + { + EnumSymbol = "iqvdl"; + } + if (obj.value == WindLookupTableFunctionKind::fdpf) + { + EnumSymbol = "fdpf"; + } + + if (!EnumSymbol.empty()) + { + os << "WindLookupTableFunctionKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.hpp b/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.hpp index 415886431..98f42e4fa 100644 --- a/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.hpp +++ b/CGMES_2.4.15_16FEB2016/WindLookupTableFunctionKind.hpp @@ -1,33 +1,58 @@ #ifndef WindLookupTableFunctionKind_H #define WindLookupTableFunctionKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Function of the lookup table. */ - enum class WindLookupTableFunctionKind + class WindLookupTableFunctionKind { - /** - * Power versus slip lookup table (f()). It is used for rotor resistance control model, IEC 61400-27-1, section 6.6.5.2. - */ - fpslip, - /** - * Power vs. speed lookup table (f()). It is used for P control model type 3, IEC 61400-27-1, section 6.6.5.3. - */ - fpomega, - /** - * Lookup table for voltage dependency of active current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. - */ - ipvdl, - /** - * Lookup table for voltage dependency of reactive current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. - */ - iqvdl, - /** - * Power vs. frequency lookup table (()). It is used for wind power plant frequency and active power control model, IEC 61400-27-1, Annex E. - */ - fdpf, + public: + enum WindLookupTableFunctionKind_ENUM + { + /** + * Power versus slip lookup table (f()). It is used for rotor resistance control model, IEC 61400-27-1, section 6.6.5.2. + */ + fpslip, + /** + * Power vs. speed lookup table (f()). It is used for P control model type 3, IEC 61400-27-1, section 6.6.5.3. + */ + fpomega, + /** + * Lookup table for voltage dependency of active current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. + */ + ipvdl, + /** + * Lookup table for voltage dependency of reactive current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. + */ + iqvdl, + /** + * Power vs. frequency lookup table (()). It is used for wind power plant frequency and active power control model, IEC 61400-27-1, Annex E. + */ + fdpf, + }; + + WindLookupTableFunctionKind() : value(), initialized(false) {} + WindLookupTableFunctionKind(WindLookupTableFunctionKind_ENUM value) : value(value), initialized(true) {} + + WindLookupTableFunctionKind& operator=(WindLookupTableFunctionKind_ENUM rop); + operator WindLookupTableFunctionKind_ENUM() const; + + WindLookupTableFunctionKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindLookupTableFunctionKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindLookupTableFunctionKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindLookupTableFunctionKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/WindMechIEC.cpp b/CGMES_2.4.15_16FEB2016/WindMechIEC.cpp index 8340c48f5..baaf7aa19 100644 --- a/CGMES_2.4.15_16FEB2016/WindMechIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindMechIEC.cpp @@ -1,132 +1,160 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindMechIEC.hpp" +#include +#include + #include "WindGenTurbineType3IEC.hpp" +#include "WindTurbineType1or2IEC.hpp" +#include "WindTurbineType4bIEC.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "WindTurbineType4bIEC.hpp" -#include "WindTurbineType1or2IEC.hpp" using namespace CIMPP; -WindMechIEC::WindMechIEC(): WindGenTurbineType3IEC(nullptr), WindTurbineType4bIEC(nullptr), WindTurbineType1or2IEC(nullptr) {}; - +WindMechIEC::WindMechIEC() : WindGenTurbineType3IEC(nullptr), WindTurbineType1or2IEC(nullptr), WindTurbineType4bIEC(nullptr) {}; WindMechIEC::~WindMechIEC() {}; -bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; -} - +bool assign_WindMechIEC_cdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cdrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindMechIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType4bIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType4bIEC != nullptr) - return true; - } - return false; +bool assign_WindMechIEC_hgen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hgen; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2IEC != nullptr) - return true; - } - return false; +bool assign_WindMechIEC_hwtr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hwtr; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindMechIEC_kdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindMechIEC_cdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cdrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass*, BaseClass*); +bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindMechIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindMechIEC_hgen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hgen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass*, BaseClass*); +bool assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindMechIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2IEC != element2) + { + element->WindTurbineType1or2IEC = element2; + return assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindMechIEC_hwtr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hwtr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType4bIEC_WindMechIEC(BaseClass*, BaseClass*); +bool assign_WindMechIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindMechIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType4bIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType4bIEC != element2) + { + element->WindTurbineType4bIEC = element2; + return assign_WindTurbineType4bIEC_WindMechIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindMechIEC_kdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindMechIEC_factory() { - return new WindMechIEC; - } + +const char WindMechIEC::debugName[] = "WindMechIEC"; +const char* WindMechIEC::debugString() const +{ + return WindMechIEC::debugName; } -void WindMechIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindMechIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindMechIEC"), &WindMechIEC_factory)); } -void WindMechIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.cdrt"), &assign_WindMechIEC_cdrt)); +void WindMechIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.cdrt"), &assign_WindMechIEC_cdrt)); assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.hgen"), &assign_WindMechIEC_hgen)); assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.hwtr"), &assign_WindMechIEC_hwtr)); assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.kdrt"), &assign_WindMechIEC_kdrt)); - } - -void WindMechIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindGenTurbineType3IEC"), &assign_WindMechIEC_WindGenTurbineType3IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType4bIEC"), &assign_WindMechIEC_WindTurbineType4bIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType1or2IEC"), &assign_WindMechIEC_WindTurbineType1or2IEC)); } -const char WindMechIEC::debugName[] = "WindMechIEC"; -const char* WindMechIEC::debugString() +void WindMechIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindMechIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindGenTurbineType3IEC"), &assign_WindMechIEC_WindGenTurbineType3IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType1or2IEC"), &assign_WindMechIEC_WindTurbineType1or2IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType4bIEC"), &assign_WindMechIEC_WindTurbineType4bIEC)); } const BaseClassDefiner WindMechIEC::declare() @@ -134,4 +162,10 @@ const BaseClassDefiner WindMechIEC::declare() return BaseClassDefiner(WindMechIEC::addConstructToMap, WindMechIEC::addPrimitiveAssignFnsToMap, WindMechIEC::addClassAssignFnsToMap, WindMechIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindMechIEC_factory() + { + return new WindMechIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindMechIEC.hpp b/CGMES_2.4.15_16FEB2016/WindMechIEC.hpp index d64412485..ae94d37e0 100644 --- a/CGMES_2.4.15_16FEB2016/WindMechIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindMechIEC.hpp @@ -1,48 +1,49 @@ #ifndef WindMechIEC_H #define WindMechIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindGenTurbineType3IEC; + class WindTurbineType1or2IEC; + class WindTurbineType4bIEC; - -class WindGenTurbineType3IEC; -class WindTurbineType4bIEC; -class WindTurbineType1or2IEC; /* Two mass model. Reference: IEC Standard 61400-27-1 Section 6.6.2.1. */ - class WindMechIEC: public IdentifiedObject + class WindMechIEC : public IdentifiedObject { - public: - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine Type 3 model with which this wind mechanical model is associated. Default: 0 */ - CIMPP::PU cdrt; /* Drive train damping (. It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds hgen; /* Inertia constant of generator (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds hwtr; /* Inertia constant of wind turbine rotor (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kdrt; /* Drive train stiffness (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind mechanical model is associated. Default: 0 */ - CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind mechanical model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindMechIEC(); - virtual ~WindMechIEC(); - + ~WindMechIEC() override; + + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine Type 3 model with which this wind mechanical model is associated. Default: 0 */ + CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind mechanical model is associated. Default: 0 */ + CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind mechanical model is associated. Default: 0 */ + CIMPP::PU cdrt; /* Drive train damping (. It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds hgen; /* Inertia constant of generator (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds hwtr; /* Inertia constant of wind turbine rotor (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kdrt; /* Drive train stiffness (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindMechIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.cpp b/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.cpp index 333eb56b9..560b23032 100644 --- a/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPitchContEmulIEC.hpp" +#include +#include + #include "WindGenTurbineType2IEC.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -16,164 +20,183 @@ using namespace CIMPP; -WindPitchContEmulIEC::WindPitchContEmulIEC(): WindGenTurbineType2IEC(nullptr) {}; - +WindPitchContEmulIEC::WindPitchContEmulIEC() : WindGenTurbineType2IEC(nullptr) {}; WindPitchContEmulIEC::~WindPitchContEmulIEC() {}; -bool assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType2IEC != nullptr) - return true; - } - return false; + +bool assign_WindPitchContEmulIEC_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindPitchContEmulIEC_kipce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kipce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_komegaaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->komegaaero; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_kppce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kppce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_omegaref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omegaref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_pimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_pimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPitchContEmulIEC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPitchContEmulIEC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass*, BaseClass*); +bool assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType2IEC != element2) + { + element->WindGenTurbineType2IEC = element2; + return assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_WindPitchContEmulIEC_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_kipce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kipce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_komegaaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->komegaaero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_kppce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kppce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_omegaref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omegaref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_pimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_pimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPitchContEmulIEC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPitchContEmulIEC_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* WindPitchContEmulIEC_factory() { - return new WindPitchContEmulIEC; - } +const char WindPitchContEmulIEC::debugName[] = "WindPitchContEmulIEC"; +const char* WindPitchContEmulIEC::debugString() const +{ + return WindPitchContEmulIEC::debugName; } -void WindPitchContEmulIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPitchContEmulIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC"), &WindPitchContEmulIEC_factory)); } -void WindPitchContEmulIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kdroop"), &assign_WindPitchContEmulIEC_kdroop)); +void WindPitchContEmulIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kdroop"), &assign_WindPitchContEmulIEC_kdroop)); assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kipce"), &assign_WindPitchContEmulIEC_kipce)); assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.komegaaero"), &assign_WindPitchContEmulIEC_komegaaero)); assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kppce"), &assign_WindPitchContEmulIEC_kppce)); @@ -185,14 +208,9 @@ void WindPitchContEmulIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.WindGenTurbineType2IEC"), &assign_WindPitchContEmulIEC_WindGenTurbineType2IEC)); - } - -const char WindPitchContEmulIEC::debugName[] = "WindPitchContEmulIEC"; -const char* WindPitchContEmulIEC::debugString() +void WindPitchContEmulIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPitchContEmulIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.WindGenTurbineType2IEC"), &assign_WindPitchContEmulIEC_WindGenTurbineType2IEC)); } const BaseClassDefiner WindPitchContEmulIEC::declare() @@ -200,4 +218,10 @@ const BaseClassDefiner WindPitchContEmulIEC::declare() return BaseClassDefiner(WindPitchContEmulIEC::addConstructToMap, WindPitchContEmulIEC::addPrimitiveAssignFnsToMap, WindPitchContEmulIEC::addClassAssignFnsToMap, WindPitchContEmulIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPitchContEmulIEC_factory() + { + return new WindPitchContEmulIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.hpp b/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.hpp index aa4b94b58..d8a52e704 100644 --- a/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindPitchContEmulIEC.hpp @@ -1,51 +1,52 @@ #ifndef WindPitchContEmulIEC_H #define WindPitchContEmulIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindGenTurbineType2IEC; -class WindGenTurbineType2IEC; /* Pitch control emulator model. Reference: IEC Standard 61400-27-1 Section 6.6.5.1. */ - class WindPitchContEmulIEC: public IdentifiedObject + class WindPitchContEmulIEC : public IdentifiedObject { - public: - CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with which this Pitch control emulator model is associated. Default: 0 */ - CIMPP::Simple_Float kdroop; /* Power error gain (). It is case dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kipce; /* Pitch control emulator integral constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU komegaaero; /* Aerodynamic power change vs. omegachange (). It is case dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kppce; /* Pitch control emulator proportional constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU omegaref; /* Rotor speed in initial steady state (omega). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pimax; /* Maximum steady state power (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pimin; /* Minimum steady state power (). It is case dependent parameter. Default: nullptr */ - CIMPP::Seconds t1; /* First time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds t2; /* Second time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpe; /* Time constant in generator air gap power lag (). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPitchContEmulIEC(); - virtual ~WindPitchContEmulIEC(); - + ~WindPitchContEmulIEC() override; + + CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with which this Pitch control emulator model is associated. Default: 0 */ + CIMPP::Simple_Float kdroop; /* Power error gain (). It is case dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kipce; /* Pitch control emulator integral constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU komegaaero; /* Aerodynamic power change vs. omegachange (). It is case dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kppce; /* Pitch control emulator proportional constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU omegaref; /* Rotor speed in initial steady state (omega). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pimax; /* Maximum steady state power (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pimin; /* Minimum steady state power (). It is case dependent parameter. Default: nullptr */ + CIMPP::Seconds t1; /* First time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds t2; /* Second time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpe; /* Time constant in generator air gap power lag (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPitchContEmulIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindPlantDynamics.cpp b/CGMES_2.4.15_16FEB2016/WindPlantDynamics.cpp index dc3d72c03..8234ab546 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantDynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantDynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantDynamics.hpp" +#include +#include + #include "RemoteInputSignal.hpp" #include "WindTurbineType3or4Dynamics.hpp" using namespace CIMPP; -WindPlantDynamics::WindPlantDynamics(): RemoteInputSignal(nullptr) {}; - +WindPlantDynamics::WindPlantDynamics() : RemoteInputSignal(nullptr) {}; WindPlantDynamics::~WindPlantDynamics() {}; + + + bool assign_RemoteInputSignal_WindPlantDynamics(BaseClass*, BaseClass*); -bool assign_WindPlantDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return assign_RemoteInputSignal_WindPlantDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindPlantDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_WindPlantDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindTurbineType3or4Dynamics.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass*, BaseClass*); +bool assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindTurbineType3or4Dynamics.begin(), element->WindTurbineType3or4Dynamics.end(), element2) == element->WindTurbineType3or4Dynamics.end()) + { + element->WindTurbineType3or4Dynamics.push_back(element2); + return assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* WindPlantDynamics_factory() { - return new WindPlantDynamics; - } +const char WindPlantDynamics::debugName[] = "WindPlantDynamics"; +const char* WindPlantDynamics::debugString() const +{ + return WindPlantDynamics::debugName; } -void WindPlantDynamics::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantDynamics"), &WindPlantDynamics_factory)); } -void WindPlantDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindPlantDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.RemoteInputSignal"), &assign_WindPlantDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.WindTurbineType3or4Dynamics"), &assign_WindPlantDynamics_WindTurbineType3or4Dynamics)); +void WindPlantDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindPlantDynamics::debugName[] = "WindPlantDynamics"; -const char* WindPlantDynamics::debugString() +void WindPlantDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.RemoteInputSignal"), &assign_WindPlantDynamics_RemoteInputSignal)); + assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.WindTurbineType3or4Dynamics"), &assign_WindPlantDynamics_WindTurbineType3or4Dynamics)); } const BaseClassDefiner WindPlantDynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindPlantDynamics::declare() return BaseClassDefiner(WindPlantDynamics::addConstructToMap, WindPlantDynamics::addPrimitiveAssignFnsToMap, WindPlantDynamics::addClassAssignFnsToMap, WindPlantDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantDynamics_factory() + { + return new WindPlantDynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindPlantDynamics.hpp b/CGMES_2.4.15_16FEB2016/WindPlantDynamics.hpp index c8106fb45..a0931f253 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantDynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantDynamics.hpp @@ -1,40 +1,41 @@ #ifndef WindPlantDynamics_H #define WindPlantDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RemoteInputSignal; + class WindTurbineType3or4Dynamics; -class RemoteInputSignal; -class WindTurbineType3or4Dynamics; /* Parent class supporting relationships to wind turbines Type 3 and 4 and wind plant IEC and user defined wind plants including their control models. */ - class WindPlantDynamics: public DynamicsFunctionBlock + class WindPlantDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* The wind plant using the remote signal. Default: 0 */ - std::list WindTurbineType3or4Dynamics; /* The wind turbine type 3 or 4 associated with this wind plant. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantDynamics(); - virtual ~WindPlantDynamics(); - + ~WindPlantDynamics() override; + + CIMPP::RemoteInputSignal* RemoteInputSignal; /* The wind plant using the remote signal. Default: 0 */ + std::list WindTurbineType3or4Dynamics; /* The wind turbine type 3 or 4 associated with this wind plant. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantDynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.cpp b/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.cpp index acc30e152..8340a1e1b 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.cpp @@ -1,8 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantFreqPcontrolIEC.hpp" +#include +#include + #include "WindDynamicsLookupTable.hpp" +#include "WindPlantIEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" @@ -13,179 +18,204 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindPlantIEC.hpp" using namespace CIMPP; -WindPlantFreqPcontrolIEC::WindPlantFreqPcontrolIEC(): WindPlantIEC(nullptr) {}; - +WindPlantFreqPcontrolIEC::WindPlantFreqPcontrolIEC() : WindPlantIEC(nullptr) {}; WindPlantFreqPcontrolIEC::~WindPlantFreqPcontrolIEC() {}; -bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindDynamicsLookupTable.push_back(dynamic_cast(BaseClass_ptr2)); + + +bool assign_WindPlantFreqPcontrolIEC_dprefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dprefmax; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_WindPlantFreqPcontrolIEC_dprefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dprefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_kiwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiwpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_kpwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpwpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_prefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prefmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_prefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_tpft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpft; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_tpfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_twpffilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twpffilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twppfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantIEC != nullptr) - return true; - } - return false; +bool assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass*, BaseClass*); +bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass*, BaseClass*); +bool assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantIEC != element2) + { + element->WindPlantIEC = element2; + return assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_WindPlantFreqPcontrolIEC_dprefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dprefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_dprefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dprefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_kiwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiwpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_kpwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpwpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_prefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_prefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_tpft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpft; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_tpfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_twpffilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twpffilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twppfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* WindPlantFreqPcontrolIEC_factory() { - return new WindPlantFreqPcontrolIEC; - } + + + +const char WindPlantFreqPcontrolIEC::debugName[] = "WindPlantFreqPcontrolIEC"; +const char* WindPlantFreqPcontrolIEC::debugString() const +{ + return WindPlantFreqPcontrolIEC::debugName; } -void WindPlantFreqPcontrolIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantFreqPcontrolIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC"), &WindPlantFreqPcontrolIEC_factory)); } -void WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.dprefmax"), &assign_WindPlantFreqPcontrolIEC_dprefmax)); +void WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.dprefmax"), &assign_WindPlantFreqPcontrolIEC_dprefmax)); assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.dprefmin"), &assign_WindPlantFreqPcontrolIEC_dprefmin)); assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.kiwpp"), &assign_WindPlantFreqPcontrolIEC_kiwpp)); assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.kpwpp"), &assign_WindPlantFreqPcontrolIEC_kpwpp)); @@ -195,17 +225,12 @@ void WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindDynamicsLookupTable"), &assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable)); - assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindPlantIEC"), &assign_WindPlantFreqPcontrolIEC_WindPlantIEC)); } -const char WindPlantFreqPcontrolIEC::debugName[] = "WindPlantFreqPcontrolIEC"; -const char* WindPlantFreqPcontrolIEC::debugString() +void WindPlantFreqPcontrolIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantFreqPcontrolIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindDynamicsLookupTable"), &assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindPlantIEC"), &assign_WindPlantFreqPcontrolIEC_WindPlantIEC)); } const BaseClassDefiner WindPlantFreqPcontrolIEC::declare() @@ -213,4 +238,10 @@ const BaseClassDefiner WindPlantFreqPcontrolIEC::declare() return BaseClassDefiner(WindPlantFreqPcontrolIEC::addConstructToMap, WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap, WindPlantFreqPcontrolIEC::addClassAssignFnsToMap, WindPlantFreqPcontrolIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantFreqPcontrolIEC_factory() + { + return new WindPlantFreqPcontrolIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.hpp b/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.hpp index a9dece8c9..5e3c327c9 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantFreqPcontrolIEC.hpp @@ -1,53 +1,54 @@ #ifndef WindPlantFreqPcontrolIEC_H #define WindPlantFreqPcontrolIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindPlantIEC; -class WindDynamicsLookupTable; -class WindPlantIEC; /* Frequency and active power controller model. Reference: IEC Standard 61400-27-1 Annex E. */ - class WindPlantFreqPcontrolIEC: public IdentifiedObject + class WindPlantFreqPcontrolIEC : public IdentifiedObject { - public: - std::list WindDynamicsLookupTable; /* The frequency and active power wind plant control model with which this wind dynamics lookup table is associated. Default: 0 */ - CIMPP::PU dprefmax; /* Maximum ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU dprefmin; /* Minimum (negative) ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kiwpp; /* Plant P controller integral gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kpwpp; /* Plant P controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU prefmax; /* Maximum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU prefmin; /* Minimum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twpffilt; /* Filter time constant for frequency measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind plant frequency and active power control is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantFreqPcontrolIEC(); - virtual ~WindPlantFreqPcontrolIEC(); - + ~WindPlantFreqPcontrolIEC() override; + + std::list WindDynamicsLookupTable; /* The frequency and active power wind plant control model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind plant frequency and active power control is associated. Default: 0 */ + CIMPP::PU dprefmax; /* Maximum ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU dprefmin; /* Minimum (negative) ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kiwpp; /* Plant P controller integral gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kpwpp; /* Plant P controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU prefmax; /* Maximum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU prefmin; /* Minimum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twpffilt; /* Filter time constant for frequency measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantFreqPcontrolIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindPlantIEC.cpp b/CGMES_2.4.15_16FEB2016/WindPlantIEC.cpp index 15cb96b46..d05195c27 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantIEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindPlantDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantIEC.hpp" +#include +#include + #include "WindPlantFreqPcontrolIEC.hpp" #include "WindPlantReactiveControlIEC.hpp" using namespace CIMPP; -WindPlantIEC::WindPlantIEC(): WindPlantFreqPcontrolIEC(nullptr), WindPlantReactiveControlIEC(nullptr) {}; - +WindPlantIEC::WindPlantIEC() : WindPlantFreqPcontrolIEC(nullptr), WindPlantReactiveControlIEC(nullptr) {}; WindPlantIEC::~WindPlantIEC() {}; + + + bool assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass*, BaseClass*); -bool assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantFreqPcontrolIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantFreqPcontrolIEC != nullptr) - return assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantFreqPcontrolIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantFreqPcontrolIEC != element2) + { + element->WindPlantFreqPcontrolIEC = element2; + return assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass*, BaseClass*); -bool assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantReactiveControlIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantReactiveControlIEC != nullptr) - return assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantReactiveControlIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantReactiveControlIEC != element2) + { + element->WindPlantReactiveControlIEC = element2; + return assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindPlantIEC_factory() { - return new WindPlantIEC; - } +const char WindPlantIEC::debugName[] = "WindPlantIEC"; +const char* WindPlantIEC::debugString() const +{ + return WindPlantIEC::debugName; } -void WindPlantIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantIEC"), &WindPlantIEC_factory)); } -void WindPlantIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindPlantIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantFreqPcontrolIEC"), &assign_WindPlantIEC_WindPlantFreqPcontrolIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantReactiveControlIEC"), &assign_WindPlantIEC_WindPlantReactiveControlIEC)); +void WindPlantIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindPlantIEC::debugName[] = "WindPlantIEC"; -const char* WindPlantIEC::debugString() +void WindPlantIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantFreqPcontrolIEC"), &assign_WindPlantIEC_WindPlantFreqPcontrolIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantReactiveControlIEC"), &assign_WindPlantIEC_WindPlantReactiveControlIEC)); } const BaseClassDefiner WindPlantIEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindPlantIEC::declare() return BaseClassDefiner(WindPlantIEC::addConstructToMap, WindPlantIEC::addPrimitiveAssignFnsToMap, WindPlantIEC::addClassAssignFnsToMap, WindPlantIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantIEC_factory() + { + return new WindPlantIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindPlantIEC.hpp b/CGMES_2.4.15_16FEB2016/WindPlantIEC.hpp index b72e8a539..28e9bf1d6 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantIEC.hpp @@ -1,40 +1,41 @@ #ifndef WindPlantIEC_H #define WindPlantIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindPlantDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindPlantDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindPlantFreqPcontrolIEC; + class WindPlantReactiveControlIEC; -class WindPlantFreqPcontrolIEC; -class WindPlantReactiveControlIEC; /* Simplified IEC type plant level model. Reference: IEC 61400-27-1, AnnexE. */ - class WindPlantIEC: public WindPlantDynamics + class WindPlantIEC : public WindPlantDynamics { - public: - CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* Wind plant frequency and active power control model associated with this wind plant. Default: 0 */ - CIMPP::WindPlantReactiveControlIEC* WindPlantReactiveControlIEC; /* Wind plant reactive control model associated with this wind plant. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantIEC(); - virtual ~WindPlantIEC(); - + ~WindPlantIEC() override; + + CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* Wind plant frequency and active power control model associated with this wind plant. Default: 0 */ + CIMPP::WindPlantReactiveControlIEC* WindPlantReactiveControlIEC; /* Wind plant reactive control model associated with this wind plant. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.cpp b/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.cpp index 2ac16c68e..8c885fe24 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantReactiveControlIEC.hpp" +#include +#include + #include "WindPlantIEC.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -19,26 +23,197 @@ using namespace CIMPP; -WindPlantReactiveControlIEC::WindPlantReactiveControlIEC(): WindPlantIEC(nullptr) {}; - +WindPlantReactiveControlIEC::WindPlantReactiveControlIEC() : WindPlantIEC(nullptr) {}; WindPlantReactiveControlIEC::~WindPlantReactiveControlIEC() {}; -bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantIEC != nullptr) - return true; - } - return false; + +bool assign_WindPlantReactiveControlIEC_kiwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiwpx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_kpwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpwpx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_kwpqu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kwpqu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_mwppf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwppf; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindPlantReactiveControlIEC_mwpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twppfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_twpqfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twpqfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_twpufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twpufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_txft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->txft; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_txfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->txfv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_uwpqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uwpqdip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_xrefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xrefmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_xrefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xrefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass*, BaseClass*); +bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantIEC != element2) + { + element->WindPlantIEC = element2; + return assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} @@ -48,174 +223,25 @@ bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, -bool assign_WindPlantReactiveControlIEC_kiwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiwpx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_kpwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpwpx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_kwpqu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kwpqu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_mwppf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwppf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_mwpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twppfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_twpqfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twpqfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_twpufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twpufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_txft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->txft; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_txfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->txfv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_uwpqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uwpqdip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_xrefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xrefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_xrefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xrefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* WindPlantReactiveControlIEC_factory() { - return new WindPlantReactiveControlIEC; - } +const char WindPlantReactiveControlIEC::debugName[] = "WindPlantReactiveControlIEC"; +const char* WindPlantReactiveControlIEC::debugString() const +{ + return WindPlantReactiveControlIEC::debugName; } -void WindPlantReactiveControlIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantReactiveControlIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC"), &WindPlantReactiveControlIEC_factory)); } -void WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kiwpx"), &assign_WindPlantReactiveControlIEC_kiwpx)); +void WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kiwpx"), &assign_WindPlantReactiveControlIEC_kiwpx)); assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kpwpx"), &assign_WindPlantReactiveControlIEC_kpwpx)); assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kwpqu"), &assign_WindPlantReactiveControlIEC_kwpqu)); assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.mwppf"), &assign_WindPlantReactiveControlIEC_mwppf)); @@ -230,14 +256,9 @@ void WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap(std::unordered_map< assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.xrefmin"), &assign_WindPlantReactiveControlIEC_xrefmin)); } -void WindPlantReactiveControlIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.WindPlantIEC"), &assign_WindPlantReactiveControlIEC_WindPlantIEC)); - } - -const char WindPlantReactiveControlIEC::debugName[] = "WindPlantReactiveControlIEC"; -const char* WindPlantReactiveControlIEC::debugString() +void WindPlantReactiveControlIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantReactiveControlIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.WindPlantIEC"), &assign_WindPlantReactiveControlIEC_WindPlantIEC)); } const BaseClassDefiner WindPlantReactiveControlIEC::declare() @@ -245,4 +266,10 @@ const BaseClassDefiner WindPlantReactiveControlIEC::declare() return BaseClassDefiner(WindPlantReactiveControlIEC::addConstructToMap, WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap, WindPlantReactiveControlIEC::addClassAssignFnsToMap, WindPlantReactiveControlIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantReactiveControlIEC_factory() + { + return new WindPlantReactiveControlIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.hpp b/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.hpp index 5ed10385c..cb72971bb 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantReactiveControlIEC.hpp @@ -1,55 +1,56 @@ #ifndef WindPlantReactiveControlIEC_H #define WindPlantReactiveControlIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindPlantIEC; -class WindPlantIEC; /* Simplified plant voltage and reactive power control model for use with type 3 and type 4 wind turbine models. Reference: IEC Standard 61400-27-1 Annex E. */ - class WindPlantReactiveControlIEC: public IdentifiedObject + class WindPlantReactiveControlIEC : public IdentifiedObject { - public: - CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind reactive control is associated. Default: 0 */ - CIMPP::Simple_Float kiwpx; /* Plant Q controller integral gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kpwpx; /* Plant Q controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kwpqu; /* Plant voltage control droop (). It is project dependent parameter. Default: nullptr */ - CIMPP::Boolean mwppf; /* Power factor control modes selector (). Used only if mwpu is set to false. true = 1: power factor control false = 0: reactive power control. It is project dependent parameter. Default: false */ - CIMPP::Boolean mwpu; /* Reactive power control modes selector (). true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ - CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twpqfilt; /* Filter time constant for reactive power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twpufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds txft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds txfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU uwpqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU xrefmax; /* Maximum ( or delta ) request from the plant controller (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU xrefmin; /* Minimum ( or delta) request from the plant controller (). It is project dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantReactiveControlIEC(); - virtual ~WindPlantReactiveControlIEC(); - + ~WindPlantReactiveControlIEC() override; + + CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind reactive control is associated. Default: 0 */ + CIMPP::Simple_Float kiwpx; /* Plant Q controller integral gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kpwpx; /* Plant Q controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kwpqu; /* Plant voltage control droop (). It is project dependent parameter. Default: nullptr */ + CIMPP::Boolean mwppf; /* Power factor control modes selector (). Used only if mwpu is set to false. true = 1: power factor control false = 0: reactive power control. It is project dependent parameter. Default: false */ + CIMPP::Boolean mwpu; /* Reactive power control modes selector (). true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ + CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twpqfilt; /* Filter time constant for reactive power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twpufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds txft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds txfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU uwpqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU xrefmax; /* Maximum ( or delta ) request from the plant controller (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU xrefmin; /* Minimum ( or delta) request from the plant controller (). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantReactiveControlIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.cpp b/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.cpp index ad5a9c42f..443180339 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "WindPlantDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; WindPlantUserDefined::WindPlantUserDefined() {}; - WindPlantUserDefined::~WindPlantUserDefined() {}; -bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindPlantUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindPlantUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass*, BaseClass*); +bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindPlantUserDefined_factory() { - return new WindPlantUserDefined; - } +const char WindPlantUserDefined::debugName[] = "WindPlantUserDefined"; +const char* WindPlantUserDefined::debugString() const +{ + return WindPlantUserDefined::debugName; } -void WindPlantUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined"), &WindPlantUserDefined_factory)); } -void WindPlantUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindPlantUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined.proprietary"), &assign_WindPlantUserDefined_proprietary)); - } - -void WindPlantUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined.ProprietaryParameterDynamics"), &assign_WindPlantUserDefined_ProprietaryParameterDynamics)); } -const char WindPlantUserDefined::debugName[] = "WindPlantUserDefined"; -const char* WindPlantUserDefined::debugString() +void WindPlantUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined.ProprietaryParameterDynamics"), &assign_WindPlantUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner WindPlantUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner WindPlantUserDefined::declare() return BaseClassDefiner(WindPlantUserDefined::addConstructToMap, WindPlantUserDefined::addPrimitiveAssignFnsToMap, WindPlantUserDefined::addClassAssignFnsToMap, WindPlantUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantUserDefined_factory() + { + return new WindPlantUserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.hpp b/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.hpp index 679f975f9..c4afa108d 100644 --- a/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/WindPlantUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef WindPlantUserDefined_H #define WindPlantUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindPlantDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindPlantDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Wind plant function block whose dynamic behaviour is described by */ - class WindPlantUserDefined: public WindPlantDynamics + class WindPlantUserDefined : public WindPlantDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantUserDefined(); - virtual ~WindPlantUserDefined(); - + ~WindPlantUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantUserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindProtectionIEC.cpp b/CGMES_2.4.15_16FEB2016/WindProtectionIEC.cpp index 9a38edbfb..88873297f 100644 --- a/CGMES_2.4.15_16FEB2016/WindProtectionIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindProtectionIEC.cpp @@ -1,7 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindProtectionIEC.hpp" +#include +#include + +#include "WindTurbineType1or2IEC.hpp" +#include "WindTurbineType3or4IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" @@ -10,152 +16,175 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "WindTurbineType3or4IEC.hpp" -#include "WindTurbineType1or2IEC.hpp" using namespace CIMPP; -WindProtectionIEC::WindProtectionIEC(): WindTurbineType3or4IEC(nullptr), WindTurbineType1or2IEC(nullptr) {}; - +WindProtectionIEC::WindProtectionIEC() : WindTurbineType1or2IEC(nullptr), WindTurbineType3or4IEC(nullptr) {}; WindProtectionIEC::~WindProtectionIEC() {}; +bool assign_WindProtectionIEC_fover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fover; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_funder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->funder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tfover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfover; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tfunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfunder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tuover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuover; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tuunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuunder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4IEC != nullptr) - return true; - } - return false; +bool assign_WindProtectionIEC_uover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uover; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2IEC != nullptr) - return true; - } - return false; +bool assign_WindProtectionIEC_uunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uunder; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindProtectionIEC_fover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass*, BaseClass*); +bool assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2IEC != element2) + { + element->WindTurbineType1or2IEC = element2; + return assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindProtectionIEC_funder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->funder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass*, BaseClass*); +bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4IEC != element2) + { + element->WindTurbineType3or4IEC = element2; + return assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindProtectionIEC_tfover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_tfunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfunder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_tuover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_tuunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuunder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_uover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindProtectionIEC_uunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uunder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - -namespace CIMPP { - BaseClass* WindProtectionIEC_factory() { - return new WindProtectionIEC; - } + + + + +const char WindProtectionIEC::debugName[] = "WindProtectionIEC"; +const char* WindProtectionIEC::debugString() const +{ + return WindProtectionIEC::debugName; } -void WindProtectionIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindProtectionIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindProtectionIEC"), &WindProtectionIEC_factory)); } -void WindProtectionIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindProtectionIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.fover"), &assign_WindProtectionIEC_fover)); assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.funder"), &assign_WindProtectionIEC_funder)); assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.tfover"), &assign_WindProtectionIEC_tfover)); @@ -164,17 +193,12 @@ void WindProtectionIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType3or4IEC"), &assign_WindProtectionIEC_WindTurbineType3or4IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType1or2IEC"), &assign_WindProtectionIEC_WindTurbineType1or2IEC)); } -const char WindProtectionIEC::debugName[] = "WindProtectionIEC"; -const char* WindProtectionIEC::debugString() +void WindProtectionIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindProtectionIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType1or2IEC"), &assign_WindProtectionIEC_WindTurbineType1or2IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType3or4IEC"), &assign_WindProtectionIEC_WindTurbineType3or4IEC)); } const BaseClassDefiner WindProtectionIEC::declare() @@ -182,4 +206,10 @@ const BaseClassDefiner WindProtectionIEC::declare() return BaseClassDefiner(WindProtectionIEC::addConstructToMap, WindProtectionIEC::addPrimitiveAssignFnsToMap, WindProtectionIEC::addClassAssignFnsToMap, WindProtectionIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindProtectionIEC_factory() + { + return new WindProtectionIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindProtectionIEC.hpp b/CGMES_2.4.15_16FEB2016/WindProtectionIEC.hpp index a56220bee..aff760adf 100644 --- a/CGMES_2.4.15_16FEB2016/WindProtectionIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindProtectionIEC.hpp @@ -1,50 +1,51 @@ #ifndef WindProtectionIEC_H #define WindProtectionIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType1or2IEC; + class WindTurbineType3or4IEC; - -class WindTurbineType3or4IEC; -class WindTurbineType1or2IEC; /* The grid protection model includes protection against over and under voltage, and against over and under frequency. Reference: IEC Standard 614000-27-1 Section 6.6.6. */ - class WindProtectionIEC: public IdentifiedObject + class WindProtectionIEC : public IdentifiedObject { - public: - CIMPP::PU fover; /* Set of wind turbine over frequency protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU funder; /* Set of wind turbine under frequency protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tfover; /* Set of corresponding wind turbine over frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tfunder; /* Set of corresponding wind turbine under frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tuover; /* Set of corresponding wind turbine over voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tuunder; /* Set of corresponding wind turbine under voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU uover; /* Set of wind turbine over voltage protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU uunder; /* Set of wind turbine under voltage protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind generator type 3 or 4 model with which this wind turbine protection model is associated. Default: 0 */ - CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind turbine protection model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindProtectionIEC(); - virtual ~WindProtectionIEC(); - + ~WindProtectionIEC() override; + + CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind turbine protection model is associated. Default: 0 */ + CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind generator type 3 or 4 model with which this wind turbine protection model is associated. Default: 0 */ + CIMPP::PU fover; /* Set of wind turbine over frequency protection levels (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU funder; /* Set of wind turbine under frequency protection levels (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tfover; /* Set of corresponding wind turbine over frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tfunder; /* Set of corresponding wind turbine under frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tuover; /* Set of corresponding wind turbine over voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tuunder; /* Set of corresponding wind turbine under voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU uover; /* Set of wind turbine over voltage protection levels (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU uunder; /* Set of wind turbine under voltage protection levels (). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindProtectionIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.cpp b/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.cpp index b45e7cd66..b5c887e96 100644 --- a/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.cpp +++ b/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindQcontrolModesKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindQcontrolModesKind& rop) +WindQcontrolModesKind& WindQcontrolModesKind::operator=(WindQcontrolModesKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindQcontrolModesKind::operator WindQcontrolModesKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindQcontrolModesKind::debugName[] = "WindQcontrolModesKind"; +const char* WindQcontrolModesKind::debugString() const +{ + return WindQcontrolModesKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindQcontrolModesKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindQcontrolModesKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindQcontrolModesKind::voltage) + { + EnumSymbol = "voltage"; + } + if (obj.value == WindQcontrolModesKind::reactivePower) + { + EnumSymbol = "reactivePower"; + } + if (obj.value == WindQcontrolModesKind::openLoopReactivePower) + { + EnumSymbol = "openLoopReactivePower"; + } + if (obj.value == WindQcontrolModesKind::powerFactor) + { + EnumSymbol = "powerFactor"; + } + + if (!EnumSymbol.empty()) + { + os << "WindQcontrolModesKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.hpp b/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.hpp index c74042607..770a20720 100644 --- a/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.hpp +++ b/CGMES_2.4.15_16FEB2016/WindQcontrolModesKind.hpp @@ -1,29 +1,54 @@ #ifndef WindQcontrolModesKind_H #define WindQcontrolModesKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* General wind turbine Q control modes . */ - enum class WindQcontrolModesKind + class WindQcontrolModesKind { - /** - * Voltage control (). - */ - voltage, - /** - * Reactive power control (). - */ - reactivePower, - /** - * Open loop reactive power control (only used with closed loop at plant level) (). - */ - openLoopReactivePower, - /** - * Power factor control (). - */ - powerFactor, + public: + enum WindQcontrolModesKind_ENUM + { + /** + * Voltage control (). + */ + voltage, + /** + * Reactive power control (). + */ + reactivePower, + /** + * Open loop reactive power control (only used with closed loop at plant level) (). + */ + openLoopReactivePower, + /** + * Power factor control (). + */ + powerFactor, + }; + + WindQcontrolModesKind() : value(), initialized(false) {} + WindQcontrolModesKind(WindQcontrolModesKind_ENUM value) : value(value), initialized(true) {} + + WindQcontrolModesKind& operator=(WindQcontrolModesKind_ENUM rop); + operator WindQcontrolModesKind_ENUM() const; + + WindQcontrolModesKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindQcontrolModesKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindQcontrolModesKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindQcontrolModesKind& rop); } #endif diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.cpp b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.cpp index 21a534207..e406e4c7c 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType1or2Dynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -WindTurbineType1or2Dynamics::WindTurbineType1or2Dynamics(): RemoteInputSignal(nullptr), AsynchronousMachineDynamics(nullptr) {}; - +WindTurbineType1or2Dynamics::WindTurbineType1or2Dynamics() : AsynchronousMachineDynamics(nullptr), RemoteInputSignal(nullptr) {}; WindTurbineType1or2Dynamics::~WindTurbineType1or2Dynamics() {}; -bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); +bool assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* WindTurbineType1or2Dynamics_factory() { - return new WindTurbineType1or2Dynamics; +bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); +bool assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindTurbineType1or2Dynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics"), &WindTurbineType1or2Dynamics_factory)); +const char WindTurbineType1or2Dynamics::debugName[] = "WindTurbineType1or2Dynamics"; +const char* WindTurbineType1or2Dynamics::debugString() const +{ + return WindTurbineType1or2Dynamics::debugName; } -void WindTurbineType1or2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType1or2Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics"), &WindTurbineType1or2Dynamics_factory)); +} -void WindTurbineType1or2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.RemoteInputSignal"), &assign_WindTurbineType1or2Dynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.AsynchronousMachineDynamics"), &assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics)); +void WindTurbineType1or2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType1or2Dynamics::debugName[] = "WindTurbineType1or2Dynamics"; -const char* WindTurbineType1or2Dynamics::debugString() +void WindTurbineType1or2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType1or2Dynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.AsynchronousMachineDynamics"), &assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.RemoteInputSignal"), &assign_WindTurbineType1or2Dynamics_RemoteInputSignal)); } const BaseClassDefiner WindTurbineType1or2Dynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindTurbineType1or2Dynamics::declare() return BaseClassDefiner(WindTurbineType1or2Dynamics::addConstructToMap, WindTurbineType1or2Dynamics::addPrimitiveAssignFnsToMap, WindTurbineType1or2Dynamics::addClassAssignFnsToMap, WindTurbineType1or2Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType1or2Dynamics_factory() + { + return new WindTurbineType1or2Dynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.hpp b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.hpp index 2d7b85a52..7376d2de7 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2Dynamics.hpp @@ -1,40 +1,41 @@ #ifndef WindTurbineType1or2Dynamics_H #define WindTurbineType1or2Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachineDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class AsynchronousMachineDynamics; /* Parent class supporting relationships to wind turbines Type 1 and 2 and their control models. */ - class WindTurbineType1or2Dynamics: public DynamicsFunctionBlock + class WindTurbineType1or2Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this wind generator Type 1 or Type 2 model. Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this wind generator type 1 or 2 model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType1or2Dynamics(); - virtual ~WindTurbineType1or2Dynamics(); - + ~WindTurbineType1or2Dynamics() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this wind generator type 1 or 2 model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this wind generator Type 1 or Type 2 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType1or2Dynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.cpp b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.cpp index 69e37a1c6..5b28517df 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindTurbineType1or2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType1or2IEC.hpp" +#include +#include + #include "WindMechIEC.hpp" #include "WindProtectionIEC.hpp" using namespace CIMPP; -WindTurbineType1or2IEC::WindTurbineType1or2IEC(): WindMechIEC(nullptr), WindProtectionIEC(nullptr) {}; - +WindTurbineType1or2IEC::WindTurbineType1or2IEC() : WindMechIEC(nullptr), WindProtectionIEC(nullptr) {}; WindTurbineType1or2IEC::~WindTurbineType1or2IEC() {}; + + + bool assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindMechIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindMechIEC != nullptr) - return assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1); + WindMechIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindMechIEC != element2) + { + element->WindMechIEC = element2; + return assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindProtectionIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindProtectionIEC != nullptr) - return assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1); + WindProtectionIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindProtectionIEC != element2) + { + element->WindProtectionIEC = element2; + return assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindTurbineType1or2IEC_factory() { - return new WindTurbineType1or2IEC; - } +const char WindTurbineType1or2IEC::debugName[] = "WindTurbineType1or2IEC"; +const char* WindTurbineType1or2IEC::debugString() const +{ + return WindTurbineType1or2IEC::debugName; } -void WindTurbineType1or2IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindTurbineType1or2IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC"), &WindTurbineType1or2IEC_factory)); } -void WindTurbineType1or2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindTurbineType1or2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindMechIEC"), &assign_WindTurbineType1or2IEC_WindMechIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindProtectionIEC"), &assign_WindTurbineType1or2IEC_WindProtectionIEC)); +void WindTurbineType1or2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType1or2IEC::debugName[] = "WindTurbineType1or2IEC"; -const char* WindTurbineType1or2IEC::debugString() +void WindTurbineType1or2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType1or2IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindMechIEC"), &assign_WindTurbineType1or2IEC_WindMechIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindProtectionIEC"), &assign_WindTurbineType1or2IEC_WindProtectionIEC)); } const BaseClassDefiner WindTurbineType1or2IEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindTurbineType1or2IEC::declare() return BaseClassDefiner(WindTurbineType1or2IEC::addConstructToMap, WindTurbineType1or2IEC::addPrimitiveAssignFnsToMap, WindTurbineType1or2IEC::addClassAssignFnsToMap, WindTurbineType1or2IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType1or2IEC_factory() + { + return new WindTurbineType1or2IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.hpp b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.hpp index ec4ea8b84..fa28cd1a6 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType1or2IEC.hpp @@ -1,40 +1,41 @@ #ifndef WindTurbineType1or2IEC_H #define WindTurbineType1or2IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType1or2Dynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindMechIEC; + class WindProtectionIEC; -class WindMechIEC; -class WindProtectionIEC; /* Generator model for wind turbine of IEC Type 1 or Type 2 is a standard asynchronous generator model. Reference: IEC Standard 614000-27-1 Section 6.6.3.1. */ - class WindTurbineType1or2IEC: public WindTurbineType1or2Dynamics + class WindTurbineType1or2IEC : public WindTurbineType1or2Dynamics { - public: - CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind generator type 1 or 2 model. Default: 0 */ - CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 1 or 2 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType1or2IEC(); - virtual ~WindTurbineType1or2IEC(); - + ~WindTurbineType1or2IEC() override; + + CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind generator type 1 or 2 model. Default: 0 */ + CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 1 or 2 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType1or2IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.cpp b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.cpp index 408a19da5..c07dc9b09 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.cpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.cpp @@ -1,80 +1,107 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType3or4Dynamics.hpp" +#include +#include + #include "EnergySource.hpp" #include "RemoteInputSignal.hpp" #include "WindPlantDynamics.hpp" using namespace CIMPP; -WindTurbineType3or4Dynamics::WindTurbineType3or4Dynamics(): EnergySource(nullptr), RemoteInputSignal(nullptr), WindPlantDynamics(nullptr) {}; - +WindTurbineType3or4Dynamics::WindTurbineType3or4Dynamics() : EnergySource(nullptr), RemoteInputSignal(nullptr), WindPlantDynamics(nullptr) {}; WindTurbineType3or4Dynamics::~WindTurbineType3or4Dynamics() {}; + + + + bool assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->EnergySource = dynamic_cast(BaseClass_ptr2); - if(element->EnergySource != nullptr) - return assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1); + EnergySource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EnergySource != element2) + { + element->EnergySource = element2; + return assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantDynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantDynamics != nullptr) - return assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1); + WindPlantDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantDynamics != element2) + { + element->WindPlantDynamics = element2; + return assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* WindTurbineType3or4Dynamics_factory() { - return new WindTurbineType3or4Dynamics; - } +const char WindTurbineType3or4Dynamics::debugName[] = "WindTurbineType3or4Dynamics"; +const char* WindTurbineType3or4Dynamics::debugString() const +{ + return WindTurbineType3or4Dynamics::debugName; } -void WindTurbineType3or4Dynamics::addConstructToMap(std::unordered_map& factory_map) { +void WindTurbineType3or4Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics"), &WindTurbineType3or4Dynamics_factory)); } -void WindTurbineType3or4Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType3or4Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void WindTurbineType3or4Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void WindTurbineType3or4Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics.EnergySource"), &assign_WindTurbineType3or4Dynamics_EnergySource)); assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics.RemoteInputSignal"), &assign_WindTurbineType3or4Dynamics_RemoteInputSignal)); assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics.WindPlantDynamics"), &assign_WindTurbineType3or4Dynamics_WindPlantDynamics)); } -const char WindTurbineType3or4Dynamics::debugName[] = "WindTurbineType3or4Dynamics"; -const char* WindTurbineType3or4Dynamics::debugString() -{ - return WindTurbineType3or4Dynamics::debugName; -} - const BaseClassDefiner WindTurbineType3or4Dynamics::declare() { return BaseClassDefiner(WindTurbineType3or4Dynamics::addConstructToMap, WindTurbineType3or4Dynamics::addPrimitiveAssignFnsToMap, WindTurbineType3or4Dynamics::addClassAssignFnsToMap, WindTurbineType3or4Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType3or4Dynamics_factory() + { + return new WindTurbineType3or4Dynamics; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.hpp b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.hpp index e06840403..9f217f08c 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.hpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4Dynamics.hpp @@ -1,42 +1,43 @@ #ifndef WindTurbineType3or4Dynamics_H #define WindTurbineType3or4Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EnergySource; + class RemoteInputSignal; + class WindPlantDynamics; -class EnergySource; -class RemoteInputSignal; -class WindPlantDynamics; /* Parent class supporting relationships to wind turbines Type 3 and 4 and wind plant including their control models. */ - class WindTurbineType3or4Dynamics: public DynamicsFunctionBlock + class WindTurbineType3or4Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::EnergySource* EnergySource; /* Energy Source (current source) with which this wind Type 3 or 4 dynamics model is asoociated. Default: 0 */ - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Wind turbine Type 3 or 4 models using this remote input signal. Default: 0 */ - CIMPP::WindPlantDynamics* WindPlantDynamics; /* The wind plant with which the wind turbines type 3 or 4 are associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType3or4Dynamics(); - virtual ~WindTurbineType3or4Dynamics(); - + ~WindTurbineType3or4Dynamics() override; + + CIMPP::EnergySource* EnergySource; /* Energy Source (current source) with which this wind Type 3 or 4 dynamics model is asoociated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Wind turbine Type 3 or 4 models using this remote input signal. Default: 0 */ + CIMPP::WindPlantDynamics* WindPlantDynamics; /* The wind plant with which the wind turbines type 3 or 4 are associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType3or4Dynamics_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.cpp b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.cpp index 3bb18fb7b..0b04e8254 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.cpp @@ -1,75 +1,96 @@ -#include -#include "WindTurbineType3or4Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType3or4IEC.hpp" -#include "WindContCurrLimIEC.hpp" +#include +#include + #include "WindContQIEC.hpp" +#include "WindContCurrLimIEC.hpp" #include "WindProtectionIEC.hpp" using namespace CIMPP; -WindTurbineType3or4IEC::WindTurbineType3or4IEC(): WindContCurrLimIEC(nullptr), WIndContQIEC(nullptr), WindProtectionIEC(nullptr) {}; - +WindTurbineType3or4IEC::WindTurbineType3or4IEC() : WIndContQIEC(nullptr), WindContCurrLimIEC(nullptr), WindProtectionIEC(nullptr) {}; WindTurbineType3or4IEC::~WindTurbineType3or4IEC() {}; -bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContCurrLimIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContCurrLimIEC != nullptr) - return assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WIndContQIEC = dynamic_cast(BaseClass_ptr2); - if(element->WIndContQIEC != nullptr) - return assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindProtectionIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindProtectionIEC != nullptr) - return assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1); + WindContQIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WIndContQIEC != element2) + { + element->WIndContQIEC = element2; + return assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1); + WindContCurrLimIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContCurrLimIEC != element2) + { + element->WindContCurrLimIEC = element2; + return assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* WindTurbineType3or4IEC_factory() { - return new WindTurbineType3or4IEC; +bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1); + WindProtectionIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindProtectionIEC != element2) + { + element->WindProtectionIEC = element2; + return assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindTurbineType3or4IEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC"), &WindTurbineType3or4IEC_factory)); +const char WindTurbineType3or4IEC::debugName[] = "WindTurbineType3or4IEC"; +const char* WindTurbineType3or4IEC::debugString() const +{ + return WindTurbineType3or4IEC::debugName; } -void WindTurbineType3or4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType3or4IEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC"), &WindTurbineType3or4IEC_factory)); +} -void WindTurbineType3or4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindContCurrLimIEC"), &assign_WindTurbineType3or4IEC_WindContCurrLimIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WIndContQIEC"), &assign_WindTurbineType3or4IEC_WIndContQIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindProtectionIEC"), &assign_WindTurbineType3or4IEC_WindProtectionIEC)); +void WindTurbineType3or4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType3or4IEC::debugName[] = "WindTurbineType3or4IEC"; -const char* WindTurbineType3or4IEC::debugString() +void WindTurbineType3or4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType3or4IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WIndContQIEC"), &assign_WindTurbineType3or4IEC_WIndContQIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindContCurrLimIEC"), &assign_WindTurbineType3or4IEC_WindContCurrLimIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindProtectionIEC"), &assign_WindTurbineType3or4IEC_WindProtectionIEC)); } const BaseClassDefiner WindTurbineType3or4IEC::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner WindTurbineType3or4IEC::declare() return BaseClassDefiner(WindTurbineType3or4IEC::addConstructToMap, WindTurbineType3or4IEC::addPrimitiveAssignFnsToMap, WindTurbineType3or4IEC::addClassAssignFnsToMap, WindTurbineType3or4IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType3or4IEC_factory() + { + return new WindTurbineType3or4IEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.hpp b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.hpp index 5334a32ce..b85ecab14 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType3or4IEC.hpp @@ -1,42 +1,43 @@ #ifndef WindTurbineType3or4IEC_H #define WindTurbineType3or4IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType3or4Dynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContCurrLimIEC; + class WindContQIEC; + class WindProtectionIEC; -class WindContCurrLimIEC; -class WindContQIEC; -class WindProtectionIEC; /* Parent class supporting relationships to IEC wind turbines Type 3 and 4 and wind plant including their control models. */ - class WindTurbineType3or4IEC: public WindTurbineType3or4Dynamics + class WindTurbineType3or4IEC : public WindTurbineType3or4Dynamics { - public: - CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* Wind control current limitation model associated with this wind turbine type 3 or 4 model. Default: 0 */ - CIMPP::WindContQIEC* WIndContQIEC; /* Wind control Q model associated with this wind turbine type 3 or 4 model. Default: 0 */ - CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 3 or 4 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType3or4IEC(); - virtual ~WindTurbineType3or4IEC(); - + ~WindTurbineType3or4IEC() override; + + CIMPP::WindContQIEC* WIndContQIEC; /* Wind control Q model associated with this wind turbine type 3 or 4 model. Default: 0 */ + CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* Wind control current limitation model associated with this wind turbine type 3 or 4 model. Default: 0 */ + CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 3 or 4 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType3or4IEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.cpp b/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.cpp index 901bcea9a..ed87fb457 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.cpp @@ -1,49 +1,56 @@ -#include -#include "WindGenType4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType4aIEC.hpp" +#include +#include + #include "WindContPType4aIEC.hpp" using namespace CIMPP; -WindTurbineType4aIEC::WindTurbineType4aIEC(): WindContPType4aIEC(nullptr) {}; - +WindTurbineType4aIEC::WindTurbineType4aIEC() : WindContPType4aIEC(nullptr) {}; WindTurbineType4aIEC::~WindTurbineType4aIEC() {}; -bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType4aIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType4aIEC != nullptr) - return assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* WindTurbineType4aIEC_factory() { - return new WindTurbineType4aIEC; +bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType4aIEC* element = dynamic_cast(BaseClass_ptr1); + WindContPType4aIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType4aIEC != element2) + { + element->WindContPType4aIEC = element2; + return assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindTurbineType4aIEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC"), &WindTurbineType4aIEC_factory)); +const char WindTurbineType4aIEC::debugName[] = "WindTurbineType4aIEC"; +const char* WindTurbineType4aIEC::debugString() const +{ + return WindTurbineType4aIEC::debugName; } -void WindTurbineType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType4aIEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC"), &WindTurbineType4aIEC_factory)); +} -void WindTurbineType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC.WindContPType4aIEC"), &assign_WindTurbineType4aIEC_WindContPType4aIEC)); +void WindTurbineType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType4aIEC::debugName[] = "WindTurbineType4aIEC"; -const char* WindTurbineType4aIEC::debugString() +void WindTurbineType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType4aIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC.WindContPType4aIEC"), &assign_WindTurbineType4aIEC_WindContPType4aIEC)); } const BaseClassDefiner WindTurbineType4aIEC::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner WindTurbineType4aIEC::declare() return BaseClassDefiner(WindTurbineType4aIEC::addConstructToMap, WindTurbineType4aIEC::addPrimitiveAssignFnsToMap, WindTurbineType4aIEC::addClassAssignFnsToMap, WindTurbineType4aIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType4aIEC_factory() + { + return new WindTurbineType4aIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.hpp b/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.hpp index e60180f30..d8365200e 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType4aIEC.hpp @@ -1,38 +1,39 @@ #ifndef WindTurbineType4aIEC_H #define WindTurbineType4aIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenType4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindGenType4IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContPType4aIEC; -class WindContPType4aIEC; /* Wind turbine IEC Type 4A. Reference: IEC Standard 61400-27-1, section 6.5.5.2. */ - class WindTurbineType4aIEC: public WindGenType4IEC + class WindTurbineType4aIEC : public WindGenType4IEC { - public: - CIMPP::WindContPType4aIEC* WindContPType4aIEC; /* Wind control P type 4A model associated with this wind turbine type 4A model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType4aIEC(); - virtual ~WindTurbineType4aIEC(); - + ~WindTurbineType4aIEC() override; + + CIMPP::WindContPType4aIEC* WindContPType4aIEC; /* Wind control P type 4A model associated with this wind turbine type 4A model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType4aIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.cpp b/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.cpp index e04f05b99..d0d665581 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.cpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindGenType4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType4bIEC.hpp" +#include +#include + #include "WindContPType4bIEC.hpp" #include "WindMechIEC.hpp" using namespace CIMPP; -WindTurbineType4bIEC::WindTurbineType4bIEC(): WindContPType4bIEC(nullptr), WindMechIEC(nullptr) {}; - +WindTurbineType4bIEC::WindTurbineType4bIEC() : WindContPType4bIEC(nullptr), WindMechIEC(nullptr) {}; WindTurbineType4bIEC::~WindTurbineType4bIEC() {}; + + + bool assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType4bIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType4bIEC != nullptr) - return assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1); + WindContPType4bIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType4bIEC != element2) + { + element->WindContPType4bIEC = element2; + return assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindMechIEC_WindTurbineType4bIEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType4bIEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindMechIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindMechIEC != nullptr) - return assign_WindMechIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType4bIEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1); + WindMechIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindMechIEC != element2) + { + element->WindMechIEC = element2; + return assign_WindMechIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindTurbineType4bIEC_factory() { - return new WindTurbineType4bIEC; - } +const char WindTurbineType4bIEC::debugName[] = "WindTurbineType4bIEC"; +const char* WindTurbineType4bIEC::debugString() const +{ + return WindTurbineType4bIEC::debugName; } -void WindTurbineType4bIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindTurbineType4bIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC"), &WindTurbineType4bIEC_factory)); } -void WindTurbineType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindTurbineType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindContPType4bIEC"), &assign_WindTurbineType4bIEC_WindContPType4bIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindMechIEC"), &assign_WindTurbineType4bIEC_WindMechIEC)); +void WindTurbineType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType4bIEC::debugName[] = "WindTurbineType4bIEC"; -const char* WindTurbineType4bIEC::debugString() +void WindTurbineType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType4bIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindContPType4bIEC"), &assign_WindTurbineType4bIEC_WindContPType4bIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindMechIEC"), &assign_WindTurbineType4bIEC_WindMechIEC)); } const BaseClassDefiner WindTurbineType4bIEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindTurbineType4bIEC::declare() return BaseClassDefiner(WindTurbineType4bIEC::addConstructToMap, WindTurbineType4bIEC::addPrimitiveAssignFnsToMap, WindTurbineType4bIEC::addClassAssignFnsToMap, WindTurbineType4bIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType4bIEC_factory() + { + return new WindTurbineType4bIEC; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.hpp b/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.hpp index 77ce794fb..d7f049f14 100644 --- a/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.hpp +++ b/CGMES_2.4.15_16FEB2016/WindTurbineType4bIEC.hpp @@ -1,40 +1,41 @@ #ifndef WindTurbineType4bIEC_H #define WindTurbineType4bIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenType4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindGenType4IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContPType4bIEC; + class WindMechIEC; -class WindContPType4bIEC; -class WindMechIEC; /* Wind turbine IEC Type 4A. Reference: IEC Standard 61400-27-1, section 6.5.5.3. */ - class WindTurbineType4bIEC: public WindGenType4IEC + class WindTurbineType4bIEC : public WindGenType4IEC { - public: - CIMPP::WindContPType4bIEC* WindContPType4bIEC; /* Wind control P type 4B model associated with this wind turbine type 4B model. Default: 0 */ - CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 4B model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType4bIEC(); - virtual ~WindTurbineType4bIEC(); - + ~WindTurbineType4bIEC() override; + + CIMPP::WindContPType4bIEC* WindContPType4bIEC; /* Wind control P type 4B model associated with this wind turbine type 4B model. Default: 0 */ + CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 4B model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType4bIEC_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.cpp b/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.cpp index 830489779..d17ab6680 100644 --- a/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "WindTurbineType1or2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindType1or2UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; WindType1or2UserDefined::WindType1or2UserDefined() {}; - WindType1or2UserDefined::~WindType1or2UserDefined() {}; -bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindType1or2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindType1or2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass*, BaseClass*); +bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindType1or2UserDefined_factory() { - return new WindType1or2UserDefined; - } +const char WindType1or2UserDefined::debugName[] = "WindType1or2UserDefined"; +const char* WindType1or2UserDefined::debugString() const +{ + return WindType1or2UserDefined::debugName; } -void WindType1or2UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void WindType1or2UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined"), &WindType1or2UserDefined_factory)); } -void WindType1or2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindType1or2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined.proprietary"), &assign_WindType1or2UserDefined_proprietary)); - } - -void WindType1or2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined.ProprietaryParameterDynamics"), &assign_WindType1or2UserDefined_ProprietaryParameterDynamics)); } -const char WindType1or2UserDefined::debugName[] = "WindType1or2UserDefined"; -const char* WindType1or2UserDefined::debugString() +void WindType1or2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindType1or2UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined.ProprietaryParameterDynamics"), &assign_WindType1or2UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner WindType1or2UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner WindType1or2UserDefined::declare() return BaseClassDefiner(WindType1or2UserDefined::addConstructToMap, WindType1or2UserDefined::addPrimitiveAssignFnsToMap, WindType1or2UserDefined::addClassAssignFnsToMap, WindType1or2UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* WindType1or2UserDefined_factory() + { + return new WindType1or2UserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.hpp b/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.hpp index 5acd4b697..e411af40e 100644 --- a/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/WindType1or2UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef WindType1or2UserDefined_H #define WindType1or2UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType1or2Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Wind Type 1 or Type 2 function block whose dynamic behaviour is described by */ - class WindType1or2UserDefined: public WindTurbineType1or2Dynamics + class WindType1or2UserDefined : public WindTurbineType1or2Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindType1or2UserDefined(); - virtual ~WindType1or2UserDefined(); - + ~WindType1or2UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindType1or2UserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.cpp b/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.cpp index 7c3abd134..1224d7233 100644 --- a/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.cpp +++ b/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "WindTurbineType3or4Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindType3or4UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; WindType3or4UserDefined::WindType3or4UserDefined() {}; - WindType3or4UserDefined::~WindType3or4UserDefined() {}; -bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindType3or4UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindType3or4UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass*, BaseClass*); +bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindType3or4UserDefined_factory() { - return new WindType3or4UserDefined; - } +const char WindType3or4UserDefined::debugName[] = "WindType3or4UserDefined"; +const char* WindType3or4UserDefined::debugString() const +{ + return WindType3or4UserDefined::debugName; } -void WindType3or4UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void WindType3or4UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined"), &WindType3or4UserDefined_factory)); } -void WindType3or4UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindType3or4UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined.proprietary"), &assign_WindType3or4UserDefined_proprietary)); - } - -void WindType3or4UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined.ProprietaryParameterDynamics"), &assign_WindType3or4UserDefined_ProprietaryParameterDynamics)); } -const char WindType3or4UserDefined::debugName[] = "WindType3or4UserDefined"; -const char* WindType3or4UserDefined::debugString() +void WindType3or4UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindType3or4UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined.ProprietaryParameterDynamics"), &assign_WindType3or4UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner WindType3or4UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner WindType3or4UserDefined::declare() return BaseClassDefiner(WindType3or4UserDefined::addConstructToMap, WindType3or4UserDefined::addPrimitiveAssignFnsToMap, WindType3or4UserDefined::addClassAssignFnsToMap, WindType3or4UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* WindType3or4UserDefined_factory() + { + return new WindType3or4UserDefined; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.hpp b/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.hpp index 48b9d891e..32737770c 100644 --- a/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.hpp +++ b/CGMES_2.4.15_16FEB2016/WindType3or4UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef WindType3or4UserDefined_H #define WindType3or4UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType3or4Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Wind Type 3 or Type 4 function block whose dynamic behaviour is described by */ - class WindType3or4UserDefined: public WindTurbineType3or4Dynamics + class WindType3or4UserDefined : public WindTurbineType3or4Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindType3or4UserDefined(); - virtual ~WindType3or4UserDefined(); - + ~WindType3or4UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindType3or4UserDefined_factory(); diff --git a/CGMES_2.4.15_16FEB2016/WindingConnection.cpp b/CGMES_2.4.15_16FEB2016/WindingConnection.cpp index 680cd9da2..498dcbe94 100644 --- a/CGMES_2.4.15_16FEB2016/WindingConnection.cpp +++ b/CGMES_2.4.15_16FEB2016/WindingConnection.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindingConnection.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindingConnection& rop) +WindingConnection& WindingConnection::operator=(WindingConnection_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindingConnection::operator WindingConnection_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindingConnection::debugName[] = "WindingConnection"; +const char* WindingConnection::debugString() const +{ + return WindingConnection::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindingConnection& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -58,5 +89,47 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindingConnection& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindingConnection::D) + { + EnumSymbol = "D"; + } + if (obj.value == WindingConnection::Y) + { + EnumSymbol = "Y"; + } + if (obj.value == WindingConnection::Z) + { + EnumSymbol = "Z"; + } + if (obj.value == WindingConnection::Yn) + { + EnumSymbol = "Yn"; + } + if (obj.value == WindingConnection::Zn) + { + EnumSymbol = "Zn"; + } + if (obj.value == WindingConnection::A) + { + EnumSymbol = "A"; + } + if (obj.value == WindingConnection::I) + { + EnumSymbol = "I"; + } + + if (!EnumSymbol.empty()) + { + os << "WindingConnection." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_16FEB2016/WindingConnection.hpp b/CGMES_2.4.15_16FEB2016/WindingConnection.hpp index ba7c40617..398f89ecf 100644 --- a/CGMES_2.4.15_16FEB2016/WindingConnection.hpp +++ b/CGMES_2.4.15_16FEB2016/WindingConnection.hpp @@ -1,41 +1,66 @@ #ifndef WindingConnection_H #define WindingConnection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Winding connection type. */ - enum class WindingConnection + class WindingConnection { - /** - * Delta - */ - D, - /** - * Wye - */ - Y, - /** - * ZigZag - */ - Z, - /** - * Wye, with neutral brought out for grounding. - */ - Yn, - /** - * ZigZag, with neutral brought out for grounding. - */ - Zn, - /** - * Autotransformer common winding - */ - A, - /** - * Independent winding, for single-phase connections - */ - I, + public: + enum WindingConnection_ENUM + { + /** + * Delta + */ + D, + /** + * Wye + */ + Y, + /** + * ZigZag + */ + Z, + /** + * Wye, with neutral brought out for grounding. + */ + Yn, + /** + * ZigZag, with neutral brought out for grounding. + */ + Zn, + /** + * Autotransformer common winding + */ + A, + /** + * Independent winding, for single-phase connections + */ + I, + }; + + WindingConnection() : value(), initialized(false) {} + WindingConnection(WindingConnection_ENUM value) : value(value), initialized(true) {} + + WindingConnection& operator=(WindingConnection_ENUM rop); + operator WindingConnection_ENUM() const; + + WindingConnection_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindingConnection& rop); + friend std::ostream& operator<<(std::ostream& os, const WindingConnection& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindingConnection& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ACDCConverter.cpp b/CGMES_2.4.15_27JAN2020/ACDCConverter.cpp index 32d600540..8df7daeda 100644 --- a/CGMES_2.4.15_27JAN2020/ACDCConverter.cpp +++ b/CGMES_2.4.15_27JAN2020/ACDCConverter.cpp @@ -1,314 +1,348 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACDCConverter.hpp" +#include +#include + +#include "ACDCConverterDCTerminal.hpp" +#include "Terminal.hpp" #include "ApparentPower.hpp" +#include "CurrentFlow.hpp" #include "ActivePower.hpp" #include "Voltage.hpp" #include "Voltage.hpp" #include "Integer.hpp" +#include "ActivePower.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Voltage.hpp" #include "Resistance.hpp" #include "ActivePowerPerCurrentFlow.hpp" -#include "Voltage.hpp" -#include "ACDCConverterDCTerminal.hpp" -#include "Terminal.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" #include "ActivePower.hpp" #include "Voltage.hpp" -#include "CurrentFlow.hpp" -#include "ActivePower.hpp" +#include "Voltage.hpp" #include "Voltage.hpp" #include "Voltage.hpp" using namespace CIMPP; -ACDCConverter::ACDCConverter(): switchingLoss(nullptr), PccTerminal(nullptr) {}; - +ACDCConverter::ACDCConverter() : PccTerminal(nullptr) {}; ACDCConverter::~ACDCConverter() {}; +bool assign_ACDCConverter_baseS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->baseS; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_idc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->idc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_idleLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->idleLoss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_maxUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_minUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverter_switchingLoss(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - element->switchingLoss = dynamic_cast(BaseClass_ptr2); - if(element->switchingLoss != nullptr) - return true; - } - return false; +bool assign_ACDCConverter_numberOfValves(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->numberOfValves; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ACDCConverter_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverter_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ACDCConverter_poleLossP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->poleLossP; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Terminal_ConverterDCSides(BaseClass*, BaseClass*); -bool assign_ACDCConverter_PccTerminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - element->PccTerminal = dynamic_cast(BaseClass_ptr2); - if(element->PccTerminal != nullptr) - return assign_Terminal_ConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ACDCConverter_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ACDCConverter_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_resistiveLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistiveLoss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_switchingLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->switchingLoss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_targetPpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetPpcc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_targetUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_udc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACDCConverter_valveU0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valveU0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverter_baseS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->baseS; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass*, BaseClass*); +bool assign_ACDCConverter_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCConverter* element = dynamic_cast(BaseClass_ptr1); + ACDCConverterDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ACDCConverter_idleLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->idleLoss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_ConverterDCSides(BaseClass*, BaseClass*); +bool assign_ACDCConverter_PccTerminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCConverter* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PccTerminal != element2) + { + element->PccTerminal = element2; + return assign_Terminal_ConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ACDCConverter_maxUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_minUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_numberOfValves(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->numberOfValves; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_resistiveLoss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistiveLoss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_valveU0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valveU0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_targetPpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetPpcc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_targetUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_idc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->idc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_poleLossP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->poleLossP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACDCConverter_udc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ACDCConverter_factory() { - return new ACDCConverter; - } +const char ACDCConverter::debugName[] = "ACDCConverter"; +const char* ACDCConverter::debugString() const +{ + return ACDCConverter::debugName; } -void ACDCConverter::addConstructToMap(std::unordered_map& factory_map) { +void ACDCConverter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACDCConverter"), &ACDCConverter_factory)); } -void ACDCConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ACDCConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.baseS"), &assign_ACDCConverter_baseS)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.idc"), &assign_ACDCConverter_idc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.idleLoss"), &assign_ACDCConverter_idleLoss)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.maxUdc"), &assign_ACDCConverter_maxUdc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.minUdc"), &assign_ACDCConverter_minUdc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.numberOfValves"), &assign_ACDCConverter_numberOfValves)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.p"), &assign_ACDCConverter_p)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.poleLossP"), &assign_ACDCConverter_poleLossP)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.q"), &assign_ACDCConverter_q)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.ratedUdc"), &assign_ACDCConverter_ratedUdc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.resistiveLoss"), &assign_ACDCConverter_resistiveLoss)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.valveU0"), &assign_ACDCConverter_valveU0)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.p"), &assign_ACDCConverter_p)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.q"), &assign_ACDCConverter_q)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.switchingLoss"), &assign_ACDCConverter_switchingLoss)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.targetPpcc"), &assign_ACDCConverter_targetPpcc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.targetUdc"), &assign_ACDCConverter_targetUdc)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.idc"), &assign_ACDCConverter_idc)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.poleLossP"), &assign_ACDCConverter_poleLossP)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.uc"), &assign_ACDCConverter_uc)); assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.udc"), &assign_ACDCConverter_udc)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.valveU0"), &assign_ACDCConverter_valveU0)); } -void ACDCConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.switchingLoss"), &assign_ACDCConverter_switchingLoss)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.DCTerminals"), &assign_ACDCConverter_DCTerminals)); - assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.PccTerminal"), &assign_ACDCConverter_PccTerminal)); - } - -const char ACDCConverter::debugName[] = "ACDCConverter"; -const char* ACDCConverter::debugString() +void ACDCConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ACDCConverter::debugName; + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.DCTerminals"), &assign_ACDCConverter_DCTerminals)); + assign_map.insert(std::make_pair(std::string("cim:ACDCConverter.PccTerminal"), &assign_ACDCConverter_PccTerminal)); } const BaseClassDefiner ACDCConverter::declare() @@ -316,4 +350,10 @@ const BaseClassDefiner ACDCConverter::declare() return BaseClassDefiner(ACDCConverter::addConstructToMap, ACDCConverter::addPrimitiveAssignFnsToMap, ACDCConverter::addClassAssignFnsToMap, ACDCConverter::debugName); } - +namespace CIMPP +{ + BaseClass* ACDCConverter_factory() + { + return new ACDCConverter; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ACDCConverter.hpp b/CGMES_2.4.15_27JAN2020/ACDCConverter.hpp index a04363ea4..ea38875a1 100644 --- a/CGMES_2.4.15_27JAN2020/ACDCConverter.hpp +++ b/CGMES_2.4.15_27JAN2020/ACDCConverter.hpp @@ -1,65 +1,66 @@ #ifndef ACDCConverter_H #define ACDCConverter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "ApparentPower.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Voltage.hpp" +#include "ActivePowerPerCurrentFlow.hpp" +#include "ApparentPower.hpp" +#include "CurrentFlow.hpp" #include "Integer.hpp" -#include "Resistance.hpp" #include "ReactivePower.hpp" -#include "CurrentFlow.hpp" - -namespace CIMPP { +#include "Resistance.hpp" +#include "Voltage.hpp" +namespace CIMPP +{ + class ACDCConverterDCTerminal; + class Terminal; -class ActivePowerPerCurrentFlow; -class ACDCConverterDCTerminal; -class Terminal; /* A unit with valves for three phases, together with unit control equipment, essential protective and switching devices, DC storage capacitors, phase reactors and auxiliaries, if any, used for conversion. */ - class ACDCConverter: public ConductingEquipment + class ACDCConverter : public ConductingEquipment { - public: - CIMPP::ApparentPower baseS; /* Base apparent power of the converter pole. Default: nullptr */ - CIMPP::ActivePower idleLoss; /* Active power loss in pole at no power transfer. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Voltage maxUdc; /* The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Voltage minUdc; /* Min allowed converter DC voltage. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Integer numberOfValves; /* Number of valves in the converter. Used in loss calculations. Default: 0 */ - CIMPP::Voltage ratedUdc; /* Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::Resistance resistiveLoss; /* Converter configuration data used in power flow. Refer to poleLossP. Default: nullptr */ - CIMPP::ActivePowerPerCurrentFlow* switchingLoss; /* Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: nullptr */ - CIMPP::Voltage valveU0; /* Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: nullptr */ - std::list DCTerminals; /* Default: 0 */ - CIMPP::Terminal* PccTerminal; /* All converters` DC sides linked to this point of common coupling terminal. Default: 0 */ - CIMPP::ActivePower p; /* Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ - CIMPP::ActivePower targetPpcc; /* Real power injection target in AC grid, at point of common coupling. Default: nullptr */ - CIMPP::Voltage targetUdc; /* Target value for DC voltage magnitude. Default: nullptr */ - CIMPP::CurrentFlow idc; /* Converter DC current, also called Id. Converter state variable, result from power flow. Default: nullptr */ - CIMPP::ActivePower poleLossP; /* The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: nullptr */ - CIMPP::Voltage uc; /* Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: nullptr */ - CIMPP::Voltage udc; /* Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACDCConverter(); - virtual ~ACDCConverter(); - + ~ACDCConverter() override; + + std::list DCTerminals; /* Default: 0 */ + CIMPP::Terminal* PccTerminal; /* All converters` DC sides linked to this point of common coupling terminal. Default: 0 */ + CIMPP::ApparentPower baseS; /* Base apparent power of the converter pole. Default: nullptr */ + CIMPP::CurrentFlow idc; /* Converter DC current, also called Id. Converter state variable, result from power flow. Default: nullptr */ + CIMPP::ActivePower idleLoss; /* Active power loss in pole at no power transfer. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Voltage maxUdc; /* The maximum voltage on the DC side at which the converter should operate. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Voltage minUdc; /* Min allowed converter DC voltage. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Integer numberOfValves; /* Number of valves in the converter. Used in loss calculations. Default: 0 */ + CIMPP::ActivePower p; /* Active power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ + CIMPP::ActivePower poleLossP; /* The active power loss at a DC Pole = idleLoss + switchingLoss*|Idc| + resitiveLoss*Idc^2 For lossless operation Pdc=Pac For rectifier operation with losses Pdc=Pac-lossP For inverter operation with losses Pdc=Pac+lossP Converter state variable used in power flow. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power at the point of common coupling. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution in the case a simplified power flow model is used. Default: nullptr */ + CIMPP::Voltage ratedUdc; /* Rated converter DC voltage, also called UdN. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Resistance resistiveLoss; /* Converter configuration data used in power flow. Refer to poleLossP. Default: nullptr */ + CIMPP::ActivePowerPerCurrentFlow switchingLoss; /* Switching losses, relative to the base apparent power `baseS`. Refer to poleLossP. Default: nullptr */ + CIMPP::ActivePower targetPpcc; /* Real power injection target in AC grid, at point of common coupling. Default: nullptr */ + CIMPP::Voltage targetUdc; /* Target value for DC voltage magnitude. Default: nullptr */ + CIMPP::Voltage uc; /* Converter voltage, the voltage at the AC side of the bridge. Converter state variable, result from power flow. Default: nullptr */ + CIMPP::Voltage udc; /* Converter voltage at the DC side, also called Ud. Converter state variable, result from power flow. Default: nullptr */ + CIMPP::Voltage valveU0; /* Valve threshold voltage. Forward voltage drop when the valve is conducting. Used in loss calculations, i.e. the switchLoss depend on numberOfValves * valveU0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACDCConverter_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.cpp b/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.cpp index 47f114217..59998ff38 100644 --- a/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.cpp +++ b/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.cpp @@ -1,64 +1,72 @@ -#include -#include "DCBaseTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACDCConverterDCTerminal.hpp" +#include +#include + #include "ACDCConverter.hpp" #include "DCPolarityKind.hpp" using namespace CIMPP; -ACDCConverterDCTerminal::ACDCConverterDCTerminal(): DCConductingEquipment(nullptr) {}; - +ACDCConverterDCTerminal::ACDCConverterDCTerminal() : DCConductingEquipment(nullptr) {}; ACDCConverterDCTerminal::~ACDCConverterDCTerminal() {}; -bool assign_ACDCConverter_DCTerminals(BaseClass*, BaseClass*); -bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->DCConductingEquipment != nullptr) - return assign_ACDCConverter_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_ACDCConverterDCTerminal_polarity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->polarity; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACDCConverterDCTerminal_polarity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->polarity; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ACDCConverter_DCTerminals(BaseClass*, BaseClass*); +bool assign_ACDCConverterDCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCConverterDCTerminal* element = dynamic_cast(BaseClass_ptr1); + ACDCConverter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCConductingEquipment != element2) + { + element->DCConductingEquipment = element2; + return assign_ACDCConverter_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ACDCConverterDCTerminal_factory() { - return new ACDCConverterDCTerminal; - } + +const char ACDCConverterDCTerminal::debugName[] = "ACDCConverterDCTerminal"; +const char* ACDCConverterDCTerminal::debugString() const +{ + return ACDCConverterDCTerminal::debugName; } -void ACDCConverterDCTerminal::addConstructToMap(std::unordered_map& factory_map) { +void ACDCConverterDCTerminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal"), &ACDCConverterDCTerminal_factory)); } -void ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.polarity"), &assign_ACDCConverterDCTerminal_polarity)); +void ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.polarity"), &assign_ACDCConverterDCTerminal_polarity)); } -void ACDCConverterDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.DCConductingEquipment"), &assign_ACDCConverterDCTerminal_DCConductingEquipment)); - } - -const char ACDCConverterDCTerminal::debugName[] = "ACDCConverterDCTerminal"; -const char* ACDCConverterDCTerminal::debugString() +void ACDCConverterDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ACDCConverterDCTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:ACDCConverterDCTerminal.DCConductingEquipment"), &assign_ACDCConverterDCTerminal_DCConductingEquipment)); } const BaseClassDefiner ACDCConverterDCTerminal::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner ACDCConverterDCTerminal::declare() return BaseClassDefiner(ACDCConverterDCTerminal::addConstructToMap, ACDCConverterDCTerminal::addPrimitiveAssignFnsToMap, ACDCConverterDCTerminal::addClassAssignFnsToMap, ACDCConverterDCTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* ACDCConverterDCTerminal_factory() + { + return new ACDCConverterDCTerminal; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.hpp b/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.hpp index ad9e245e3..3096f6dad 100644 --- a/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.hpp +++ b/CGMES_2.4.15_27JAN2020/ACDCConverterDCTerminal.hpp @@ -1,40 +1,41 @@ #ifndef ACDCConverterDCTerminal_H #define ACDCConverterDCTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCBaseTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCBaseTerminal.hpp" +#include "BaseClassDefiner.hpp" #include "DCPolarityKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ACDCConverter; - -class ACDCConverter; /* A DC electrical connection point at the AC/DC converter. The AC/DC converter is electrically connected also to the AC side. The AC connection is inherited from the AC conducting equipment in the same way as any other AC equipment. The AC/DC converter DC terminal is separate from generic DC terminal to restrict the connection with the AC side to AC/DC converter and so that no other DC conducting equipment can be connected to the AC side. */ - class ACDCConverterDCTerminal: public DCBaseTerminal + class ACDCConverterDCTerminal : public DCBaseTerminal { - public: - CIMPP::ACDCConverter* DCConductingEquipment; /* Default: 0 */ - CIMPP::DCPolarityKind polarity; /* Represents the normal network polarity condition. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACDCConverterDCTerminal(); - virtual ~ACDCConverterDCTerminal(); - + ~ACDCConverterDCTerminal() override; + + CIMPP::ACDCConverter* DCConductingEquipment; /* Default: 0 */ + CIMPP::DCPolarityKind polarity; /* Represents the normal network polarity condition. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACDCConverterDCTerminal_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ACDCTerminal.cpp b/CGMES_2.4.15_27JAN2020/ACDCTerminal.cpp index 25946cf21..b1c7a092b 100644 --- a/CGMES_2.4.15_27JAN2020/ACDCTerminal.cpp +++ b/CGMES_2.4.15_27JAN2020/ACDCTerminal.cpp @@ -1,105 +1,128 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACDCTerminal.hpp" +#include +#include + #include "BusNameMarker.hpp" -#include "Integer.hpp" -#include "OperationalLimitSet.hpp" #include "Measurement.hpp" +#include "OperationalLimitSet.hpp" #include "Boolean.hpp" +#include "Integer.hpp" using namespace CIMPP; -ACDCTerminal::ACDCTerminal(): BusNameMarker(nullptr) {}; - +ACDCTerminal::ACDCTerminal() : BusNameMarker(nullptr) {}; ACDCTerminal::~ACDCTerminal() {}; -bool assign_BusNameMarker_Terminal(BaseClass*, BaseClass*); -bool assign_ACDCTerminal_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->BusNameMarker = dynamic_cast(BaseClass_ptr2); - if(element->BusNameMarker != nullptr) - return assign_BusNameMarker_Terminal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_ACDCTerminal_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimitSet.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->connected; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_ACDCTerminal_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_BusNameMarker_Terminal(BaseClass*, BaseClass*); +bool assign_ACDCTerminal_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCTerminal* element = dynamic_cast(BaseClass_ptr1); + BusNameMarker* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BusNameMarker != element2) + { + element->BusNameMarker = element2; + return assign_BusNameMarker_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} - -bool assign_ACDCTerminal_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Measurement_Terminal(BaseClass*, BaseClass*); +bool assign_ACDCTerminal_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCTerminal* element = dynamic_cast(BaseClass_ptr1); + Measurement* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Measurement_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_OperationalLimitSet_Terminal(BaseClass*, BaseClass*); +bool assign_ACDCTerminal_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ACDCTerminal* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimitSet.begin(), element->OperationalLimitSet.end(), element2) == element->OperationalLimitSet.end()) + { + element->OperationalLimitSet.push_back(element2); + return assign_OperationalLimitSet_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_ACDCTerminal_connected(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACDCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->connected; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ACDCTerminal_factory() { - return new ACDCTerminal; - } +const char ACDCTerminal::debugName[] = "ACDCTerminal"; +const char* ACDCTerminal::debugString() const +{ + return ACDCTerminal::debugName; } -void ACDCTerminal::addConstructToMap(std::unordered_map& factory_map) { +void ACDCTerminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACDCTerminal"), &ACDCTerminal_factory)); } -void ACDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber)); - assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.connected"), &assign_ACDCTerminal_connected)); +void ACDCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.connected"), &assign_ACDCTerminal_connected)); + assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.sequenceNumber"), &assign_ACDCTerminal_sequenceNumber)); } -void ACDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void ACDCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.BusNameMarker"), &assign_ACDCTerminal_BusNameMarker)); - assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.OperationalLimitSet"), &assign_ACDCTerminal_OperationalLimitSet)); assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.Measurements"), &assign_ACDCTerminal_Measurements)); - } - -const char ACDCTerminal::debugName[] = "ACDCTerminal"; -const char* ACDCTerminal::debugString() -{ - return ACDCTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:ACDCTerminal.OperationalLimitSet"), &assign_ACDCTerminal_OperationalLimitSet)); } const BaseClassDefiner ACDCTerminal::declare() @@ -107,4 +130,10 @@ const BaseClassDefiner ACDCTerminal::declare() return BaseClassDefiner(ACDCTerminal::addConstructToMap, ACDCTerminal::addPrimitiveAssignFnsToMap, ACDCTerminal::addClassAssignFnsToMap, ACDCTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* ACDCTerminal_factory() + { + return new ACDCTerminal; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ACDCTerminal.hpp b/CGMES_2.4.15_27JAN2020/ACDCTerminal.hpp index 350f54e35..1c5d0bc7d 100644 --- a/CGMES_2.4.15_27JAN2020/ACDCTerminal.hpp +++ b/CGMES_2.4.15_27JAN2020/ACDCTerminal.hpp @@ -1,46 +1,47 @@ #ifndef ACDCTerminal_H #define ACDCTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "Integer.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class BusNameMarker; + class Measurement; + class OperationalLimitSet; -class BusNameMarker; -class OperationalLimitSet; -class Measurement; /* An electrical connection point (AC or DC) to a piece of conducting equipment. Terminals are connected at physical connection points called connectivity nodes. */ - class ACDCTerminal: public IdentifiedObject + class ACDCTerminal : public IdentifiedObject { - public: - CIMPP::BusNameMarker* BusNameMarker; /* The bus name marker used to name the bus (topological node). Default: 0 */ - CIMPP::Integer sequenceNumber; /* The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the `starting point` for a two terminal branch. Default: 0 */ - std::list OperationalLimitSet; /* Default: 0 */ - std::list Measurements; /* Measurements associated with this terminal defining where the measurement is placed in the network topology. It may be used, for instance, to capture the sensor position, such as a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. Default: 0 */ - CIMPP::Boolean connected; /* The connected status is related to a bus-branch model and the topological node to terminal relation. True implies the terminal is connected to the related topological node and false implies it is not. In a bus-branch model, the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the topological node to terminal relation. A valid case is that conducting equipment can be connected in one end and open in the other. In particular for an AC line segment, where the reactive line charging can be significant, this is a relevant case. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACDCTerminal(); - virtual ~ACDCTerminal(); - + ~ACDCTerminal() override; + + CIMPP::BusNameMarker* BusNameMarker; /* The bus name marker used to name the bus (topological node). Default: 0 */ + std::list Measurements; /* Measurements associated with this terminal defining where the measurement is placed in the network topology. It may be used, for instance, to capture the sensor position, such as a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. Default: 0 */ + std::list OperationalLimitSet; /* Default: 0 */ + CIMPP::Boolean connected; /* The connected status is related to a bus-branch model and the topological node to terminal relation. True implies the terminal is connected to the related topological node and false implies it is not. In a bus-branch model, the connected status is used to tell if equipment is disconnected without having to change the connectivity described by the topological node to terminal relation. A valid case is that conducting equipment can be connected in one end and open in the other. In particular for an AC line segment, where the reactive line charging can be significant, this is a relevant case. Default: false */ + CIMPP::Integer sequenceNumber; /* The orientation of the terminal connections for a multiple terminal conducting equipment. The sequence numbering starts with 1 and additional terminals should follow in increasing order. The first terminal is the `starting point` for a two terminal branch. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACDCTerminal_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ACLineSegment.cpp b/CGMES_2.4.15_27JAN2020/ACLineSegment.cpp index 5ceb0b237..2843fb464 100644 --- a/CGMES_2.4.15_27JAN2020/ACLineSegment.cpp +++ b/CGMES_2.4.15_27JAN2020/ACLineSegment.cpp @@ -1,171 +1,180 @@ -#include -#include "Conductor.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ACLineSegment.hpp" +#include +#include + #include "Susceptance.hpp" -#include "Conductance.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" #include "Susceptance.hpp" #include "Conductance.hpp" +#include "Conductance.hpp" +#include "Resistance.hpp" #include "Resistance.hpp" #include "Temperature.hpp" #include "Reactance.hpp" +#include "Reactance.hpp" using namespace CIMPP; ACLineSegment::ACLineSegment() {}; - ACLineSegment::~ACLineSegment() {}; +bool assign_ACLineSegment_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_bch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_gch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_shortCircuitEndTemperature(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->shortCircuitEndTemperature; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ACLineSegment_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ACLineSegment_bch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_gch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_shortCircuitEndTemperature(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->shortCircuitEndTemperature; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ACLineSegment_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ACLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ACLineSegment_factory() { - return new ACLineSegment; - } +const char ACLineSegment::debugName[] = "ACLineSegment"; +const char* ACLineSegment::debugString() const +{ + return ACLineSegment::debugName; } -void ACLineSegment::addConstructToMap(std::unordered_map& factory_map) { +void ACLineSegment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ACLineSegment"), &ACLineSegment_factory)); } -void ACLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ACLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.b0ch"), &assign_ACLineSegment_b0ch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.bch"), &assign_ACLineSegment_bch)); + assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.g0ch"), &assign_ACLineSegment_g0ch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.gch"), &assign_ACLineSegment_gch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.r"), &assign_ACLineSegment_r)); - assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.x"), &assign_ACLineSegment_x)); - assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.b0ch"), &assign_ACLineSegment_b0ch)); - assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.g0ch"), &assign_ACLineSegment_g0ch)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.r0"), &assign_ACLineSegment_r0)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.shortCircuitEndTemperature"), &assign_ACLineSegment_shortCircuitEndTemperature)); + assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.x"), &assign_ACLineSegment_x)); assign_map.insert(std::make_pair(std::string("cim:ACLineSegment.x0"), &assign_ACLineSegment_x0)); } -void ACLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ACLineSegment::debugName[] = "ACLineSegment"; -const char* ACLineSegment::debugString() +void ACLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ACLineSegment::debugName; } const BaseClassDefiner ACLineSegment::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner ACLineSegment::declare() return BaseClassDefiner(ACLineSegment::addConstructToMap, ACLineSegment::addPrimitiveAssignFnsToMap, ACLineSegment::addClassAssignFnsToMap, ACLineSegment::debugName); } - +namespace CIMPP +{ + BaseClass* ACLineSegment_factory() + { + return new ACLineSegment; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ACLineSegment.hpp b/CGMES_2.4.15_27JAN2020/ACLineSegment.hpp index 580be3702..2f3f0ecc8 100644 --- a/CGMES_2.4.15_27JAN2020/ACLineSegment.hpp +++ b/CGMES_2.4.15_27JAN2020/ACLineSegment.hpp @@ -1,50 +1,51 @@ #ifndef ACLineSegment_H #define ACLineSegment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Conductor.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "Conductor.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" -#include "Resistance.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" +#include "Susceptance.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A wire or combination of wires, with consistent electrical characteristics, building a single electrical system, used to carry alternating current between points in the power system. For symmetrical, transposed 3ph lines, it is sufficient to use attributes of the line segment, which describe impedances and admittances for the entire length of the segment. Additionally impedances can be computed by using length and associated per length impedances. The BaseVoltage at the two ends of ACLineSegments in a Line shall have the same BaseVoltage.nominalVoltage. However, boundary lines may have slightly different BaseVoltage.nominalVoltages and variation is allowed. Larger voltage difference in general requires use of an equivalent branch. */ - class ACLineSegment: public Conductor + class ACLineSegment : public Conductor { - public: - CIMPP::Susceptance bch; /* Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. Default: nullptr */ - CIMPP::Conductance gch; /* Positive sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Resistance r; /* Positive sequence series resistance of the entire line section. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence series reactance of the entire line section. Default: nullptr */ - CIMPP::Susceptance b0ch; /* Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Conductance g0ch; /* Zero sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence series resistance of the entire line section. Default: nullptr */ - CIMPP::Temperature shortCircuitEndTemperature; /* Maximum permitted temperature at the end of SC for the calculation of minimum short-circuit currents. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence series reactance of the entire line section. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ACLineSegment(); - virtual ~ACLineSegment(); - + ~ACLineSegment() override; + + CIMPP::Susceptance b0ch; /* Zero sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Susceptance bch; /* Positive sequence shunt (charging) susceptance, uniformly distributed, of the entire line section. This value represents the full charging over the full length of the line. Default: nullptr */ + CIMPP::Conductance g0ch; /* Zero sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Conductance gch; /* Positive sequence shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence series resistance of the entire line section. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence series resistance of the entire line section. Default: nullptr */ + CIMPP::Temperature shortCircuitEndTemperature; /* Maximum permitted temperature at the end of SC for the calculation of minimum short-circuit currents. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence series reactance of the entire line section. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence series reactance of the entire line section. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ACLineSegment_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Accumulator.cpp b/CGMES_2.4.15_27JAN2020/Accumulator.cpp index 0b9c386bb..bc61e4d79 100644 --- a/CGMES_2.4.15_27JAN2020/Accumulator.cpp +++ b/CGMES_2.4.15_27JAN2020/Accumulator.cpp @@ -1,62 +1,76 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Accumulator.hpp" -#include "AccumulatorLimitSet.hpp" +#include +#include + #include "AccumulatorValue.hpp" +#include "AccumulatorLimitSet.hpp" using namespace CIMPP; Accumulator::Accumulator() {}; - Accumulator::~Accumulator() {}; -bool assign_Accumulator_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Accumulator* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->LimitSets.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_AccumulatorValue_Accumulator(BaseClass*, BaseClass*); +bool assign_Accumulator_AccumulatorValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Accumulator* element = dynamic_cast(BaseClass_ptr1); + AccumulatorValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->AccumulatorValues.begin(), element->AccumulatorValues.end(), element2) == element->AccumulatorValues.end()) + { + element->AccumulatorValues.push_back(element2); + return assign_AccumulatorValue_Accumulator(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Accumulator_AccumulatorValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Accumulator* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->AccumulatorValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_AccumulatorLimitSet_Measurements(BaseClass*, BaseClass*); +bool assign_Accumulator_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Accumulator* element = dynamic_cast(BaseClass_ptr1); + AccumulatorLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->LimitSets.begin(), element->LimitSets.end(), element2) == element->LimitSets.end()) + { + element->LimitSets.push_back(element2); + return assign_AccumulatorLimitSet_Measurements(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* Accumulator_factory() { - return new Accumulator; - } +const char Accumulator::debugName[] = "Accumulator"; +const char* Accumulator::debugString() const +{ + return Accumulator::debugName; } -void Accumulator::addConstructToMap(std::unordered_map& factory_map) { +void Accumulator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Accumulator"), &Accumulator_factory)); } -void Accumulator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Accumulator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Accumulator.LimitSets"), &assign_Accumulator_LimitSets)); - assign_map.insert(std::make_pair(std::string("cim:Accumulator.AccumulatorValues"), &assign_Accumulator_AccumulatorValues)); +void Accumulator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Accumulator::debugName[] = "Accumulator"; -const char* Accumulator::debugString() +void Accumulator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Accumulator::debugName; + assign_map.insert(std::make_pair(std::string("cim:Accumulator.AccumulatorValues"), &assign_Accumulator_AccumulatorValues)); + assign_map.insert(std::make_pair(std::string("cim:Accumulator.LimitSets"), &assign_Accumulator_LimitSets)); } const BaseClassDefiner Accumulator::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner Accumulator::declare() return BaseClassDefiner(Accumulator::addConstructToMap, Accumulator::addPrimitiveAssignFnsToMap, Accumulator::addClassAssignFnsToMap, Accumulator::debugName); } - +namespace CIMPP +{ + BaseClass* Accumulator_factory() + { + return new Accumulator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Accumulator.hpp b/CGMES_2.4.15_27JAN2020/Accumulator.hpp index e1cf32557..04682bcea 100644 --- a/CGMES_2.4.15_27JAN2020/Accumulator.hpp +++ b/CGMES_2.4.15_27JAN2020/Accumulator.hpp @@ -1,40 +1,41 @@ #ifndef Accumulator_H #define Accumulator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AccumulatorLimitSet; + class AccumulatorValue; -class AccumulatorLimitSet; -class AccumulatorValue; /* Accumulator represents an accumulated (counted) Measurement, e.g. an energy value. */ - class Accumulator: public Measurement + class Accumulator : public Measurement { - public: - std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ - std::list AccumulatorValues; /* Measurement to which this value is connected. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Accumulator(); - virtual ~Accumulator(); - + ~Accumulator() override; + + std::list AccumulatorValues; /* Measurement to which this value is connected. Default: 0 */ + std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Accumulator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorLimit.cpp b/CGMES_2.4.15_27JAN2020/AccumulatorLimit.cpp index 679b05eaf..93e5dbd54 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorLimit.cpp @@ -1,64 +1,72 @@ -#include -#include "Limit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorLimit.hpp" -#include "Integer.hpp" +#include +#include + #include "AccumulatorLimitSet.hpp" +#include "Integer.hpp" using namespace CIMPP; -AccumulatorLimit::AccumulatorLimit(): LimitSet(nullptr) {}; - +AccumulatorLimit::AccumulatorLimit() : LimitSet(nullptr) {}; AccumulatorLimit::~AccumulatorLimit() {}; -bool assign_AccumulatorLimitSet_Limits(BaseClass*, BaseClass*); -bool assign_AccumulatorLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->LimitSet = dynamic_cast(BaseClass_ptr2); - if(element->LimitSet != nullptr) - return assign_AccumulatorLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_AccumulatorLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AccumulatorLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AccumulatorLimitSet_Limits(BaseClass*, BaseClass*); +bool assign_AccumulatorLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorLimit* element = dynamic_cast(BaseClass_ptr1); + AccumulatorLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LimitSet != element2) + { + element->LimitSet = element2; + return assign_AccumulatorLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AccumulatorLimit_factory() { - return new AccumulatorLimit; - } +const char AccumulatorLimit::debugName[] = "AccumulatorLimit"; +const char* AccumulatorLimit::debugString() const +{ + return AccumulatorLimit::debugName; } -void AccumulatorLimit::addConstructToMap(std::unordered_map& factory_map) { +void AccumulatorLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AccumulatorLimit"), &AccumulatorLimit_factory)); } -void AccumulatorLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AccumulatorLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimit.value"), &assign_AccumulatorLimit_value)); - } - -void AccumulatorLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimit.LimitSet"), &assign_AccumulatorLimit_LimitSet)); } -const char AccumulatorLimit::debugName[] = "AccumulatorLimit"; -const char* AccumulatorLimit::debugString() +void AccumulatorLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AccumulatorLimit::debugName; + assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimit.LimitSet"), &assign_AccumulatorLimit_LimitSet)); } const BaseClassDefiner AccumulatorLimit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner AccumulatorLimit::declare() return BaseClassDefiner(AccumulatorLimit::addConstructToMap, AccumulatorLimit::addPrimitiveAssignFnsToMap, AccumulatorLimit::addClassAssignFnsToMap, AccumulatorLimit::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorLimit_factory() + { + return new AccumulatorLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorLimit.hpp b/CGMES_2.4.15_27JAN2020/AccumulatorLimit.hpp index 33542e26a..a5959d35c 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorLimit.hpp @@ -1,40 +1,41 @@ #ifndef AccumulatorLimit_H #define AccumulatorLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Limit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Limit.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class AccumulatorLimitSet; - -class AccumulatorLimitSet; /* Limit values for Accumulator measurements. */ - class AccumulatorLimit: public Limit + class AccumulatorLimit : public Limit { - public: - CIMPP::Integer value; /* The value to supervise against. The value is positive. Default: 0 */ - CIMPP::AccumulatorLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorLimit(); - virtual ~AccumulatorLimit(); - + ~AccumulatorLimit() override; + + CIMPP::AccumulatorLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ + CIMPP::Integer value; /* The value to supervise against. The value is positive. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.cpp b/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.cpp index efb6fad72..095a74310 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.cpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.cpp @@ -1,62 +1,76 @@ -#include -#include "LimitSet.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorLimitSet.hpp" -#include "Accumulator.hpp" +#include +#include + #include "AccumulatorLimit.hpp" +#include "Accumulator.hpp" using namespace CIMPP; AccumulatorLimitSet::AccumulatorLimitSet() {}; - AccumulatorLimitSet::~AccumulatorLimitSet() {}; -bool assign_AccumulatorLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_AccumulatorLimit_LimitSet(BaseClass*, BaseClass*); +bool assign_AccumulatorLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1); + AccumulatorLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Limits.begin(), element->Limits.end(), element2) == element->Limits.end()) + { + element->Limits.push_back(element2); + return assign_AccumulatorLimit_LimitSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_AccumulatorLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Limits.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Accumulator_LimitSets(BaseClass*, BaseClass*); +bool assign_AccumulatorLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorLimitSet* element = dynamic_cast(BaseClass_ptr1); + Accumulator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Accumulator_LimitSets(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* AccumulatorLimitSet_factory() { - return new AccumulatorLimitSet; - } +const char AccumulatorLimitSet::debugName[] = "AccumulatorLimitSet"; +const char* AccumulatorLimitSet::debugString() const +{ + return AccumulatorLimitSet::debugName; } -void AccumulatorLimitSet::addConstructToMap(std::unordered_map& factory_map) { +void AccumulatorLimitSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet"), &AccumulatorLimitSet_factory)); } -void AccumulatorLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void AccumulatorLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Measurements"), &assign_AccumulatorLimitSet_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Limits"), &assign_AccumulatorLimitSet_Limits)); +void AccumulatorLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char AccumulatorLimitSet::debugName[] = "AccumulatorLimitSet"; -const char* AccumulatorLimitSet::debugString() +void AccumulatorLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AccumulatorLimitSet::debugName; + assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Limits"), &assign_AccumulatorLimitSet_Limits)); + assign_map.insert(std::make_pair(std::string("cim:AccumulatorLimitSet.Measurements"), &assign_AccumulatorLimitSet_Measurements)); } const BaseClassDefiner AccumulatorLimitSet::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner AccumulatorLimitSet::declare() return BaseClassDefiner(AccumulatorLimitSet::addConstructToMap, AccumulatorLimitSet::addPrimitiveAssignFnsToMap, AccumulatorLimitSet::addClassAssignFnsToMap, AccumulatorLimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorLimitSet_factory() + { + return new AccumulatorLimitSet; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.hpp b/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.hpp index f95867e74..54cc2b628 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.hpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorLimitSet.hpp @@ -1,40 +1,41 @@ #ifndef AccumulatorLimitSet_H #define AccumulatorLimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LimitSet.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LimitSet.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Accumulator; + class AccumulatorLimit; -class Accumulator; -class AccumulatorLimit; /* An AccumulatorLimitSet specifies a set of Limits that are associated with an Accumulator measurement. */ - class AccumulatorLimitSet: public LimitSet + class AccumulatorLimitSet : public LimitSet { - public: - std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ - std::list Limits; /* The set of limits. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorLimitSet(); - virtual ~AccumulatorLimitSet(); - + ~AccumulatorLimitSet() override; + + std::list Limits; /* The set of limits. Default: 0 */ + std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorLimitSet_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorReset.cpp b/CGMES_2.4.15_27JAN2020/AccumulatorReset.cpp index cdfd14736..2a11e50b8 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorReset.cpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorReset.cpp @@ -1,49 +1,56 @@ -#include -#include "Control.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorReset.hpp" +#include +#include + #include "AccumulatorValue.hpp" using namespace CIMPP; -AccumulatorReset::AccumulatorReset(): AccumulatorValue(nullptr) {}; - +AccumulatorReset::AccumulatorReset() : AccumulatorValue(nullptr) {}; AccumulatorReset::~AccumulatorReset() {}; -bool assign_AccumulatorValue_AccumulatorReset(BaseClass*, BaseClass*); -bool assign_AccumulatorReset_AccumulatorValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorReset* element = dynamic_cast(BaseClass_ptr1)) { - element->AccumulatorValue = dynamic_cast(BaseClass_ptr2); - if(element->AccumulatorValue != nullptr) - return assign_AccumulatorValue_AccumulatorReset(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* AccumulatorReset_factory() { - return new AccumulatorReset; +bool assign_AccumulatorValue_AccumulatorReset(BaseClass*, BaseClass*); +bool assign_AccumulatorReset_AccumulatorValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorReset* element = dynamic_cast(BaseClass_ptr1); + AccumulatorValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AccumulatorValue != element2) + { + element->AccumulatorValue = element2; + return assign_AccumulatorValue_AccumulatorReset(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void AccumulatorReset::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:AccumulatorReset"), &AccumulatorReset_factory)); +const char AccumulatorReset::debugName[] = "AccumulatorReset"; +const char* AccumulatorReset::debugString() const +{ + return AccumulatorReset::debugName; } -void AccumulatorReset::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void AccumulatorReset::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:AccumulatorReset"), &AccumulatorReset_factory)); +} -void AccumulatorReset::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorReset.AccumulatorValue"), &assign_AccumulatorReset_AccumulatorValue)); +void AccumulatorReset::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char AccumulatorReset::debugName[] = "AccumulatorReset"; -const char* AccumulatorReset::debugString() +void AccumulatorReset::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AccumulatorReset::debugName; + assign_map.insert(std::make_pair(std::string("cim:AccumulatorReset.AccumulatorValue"), &assign_AccumulatorReset_AccumulatorValue)); } const BaseClassDefiner AccumulatorReset::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner AccumulatorReset::declare() return BaseClassDefiner(AccumulatorReset::addConstructToMap, AccumulatorReset::addPrimitiveAssignFnsToMap, AccumulatorReset::addClassAssignFnsToMap, AccumulatorReset::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorReset_factory() + { + return new AccumulatorReset; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorReset.hpp b/CGMES_2.4.15_27JAN2020/AccumulatorReset.hpp index 176064b6c..95415e7b0 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorReset.hpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorReset.hpp @@ -1,38 +1,39 @@ #ifndef AccumulatorReset_H #define AccumulatorReset_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Control.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Control.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AccumulatorValue; -class AccumulatorValue; /* This command reset the counter value to zero. */ - class AccumulatorReset: public Control + class AccumulatorReset : public Control { - public: - CIMPP::AccumulatorValue* AccumulatorValue; /* The accumulator value that is reset by the command. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorReset(); - virtual ~AccumulatorReset(); - + ~AccumulatorReset() override; + + CIMPP::AccumulatorValue* AccumulatorValue; /* The accumulator value that is reset by the command. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorReset_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorValue.cpp b/CGMES_2.4.15_27JAN2020/AccumulatorValue.cpp index ccb4f0df1..23e87f8d2 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorValue.cpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorValue.cpp @@ -1,76 +1,92 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AccumulatorValue.hpp" +#include +#include + #include "Accumulator.hpp" #include "AccumulatorReset.hpp" #include "Integer.hpp" using namespace CIMPP; -AccumulatorValue::AccumulatorValue(): Accumulator(nullptr), AccumulatorReset(nullptr) {}; - +AccumulatorValue::AccumulatorValue() : Accumulator(nullptr), AccumulatorReset(nullptr) {}; AccumulatorValue::~AccumulatorValue() {}; -bool assign_Accumulator_AccumulatorValues(BaseClass*, BaseClass*); -bool assign_AccumulatorValue_Accumulator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Accumulator = dynamic_cast(BaseClass_ptr2); - if(element->Accumulator != nullptr) - return assign_Accumulator_AccumulatorValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AccumulatorValue_AccumulatorReset(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) { - element->AccumulatorReset = dynamic_cast(BaseClass_ptr2); - if(element->AccumulatorReset != nullptr) - return true; - } - return false; -} - +bool assign_AccumulatorValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AccumulatorValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AccumulatorValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Accumulator_AccumulatorValues(BaseClass*, BaseClass*); +bool assign_AccumulatorValue_Accumulator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorValue* element = dynamic_cast(BaseClass_ptr1); + Accumulator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Accumulator != element2) + { + element->Accumulator = element2; + return assign_Accumulator_AccumulatorValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AccumulatorValue_factory() { - return new AccumulatorValue; +bool assign_AccumulatorReset_AccumulatorValue(BaseClass*, BaseClass*); +bool assign_AccumulatorValue_AccumulatorReset(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AccumulatorValue* element = dynamic_cast(BaseClass_ptr1); + AccumulatorReset* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AccumulatorReset != element2) + { + element->AccumulatorReset = element2; + return assign_AccumulatorReset_AccumulatorValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + +const char AccumulatorValue::debugName[] = "AccumulatorValue"; +const char* AccumulatorValue::debugString() const +{ + return AccumulatorValue::debugName; } -void AccumulatorValue::addConstructToMap(std::unordered_map& factory_map) { +void AccumulatorValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AccumulatorValue"), &AccumulatorValue_factory)); } -void AccumulatorValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.value"), &assign_AccumulatorValue_value)); +void AccumulatorValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.value"), &assign_AccumulatorValue_value)); } -void AccumulatorValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void AccumulatorValue::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.Accumulator"), &assign_AccumulatorValue_Accumulator)); assign_map.insert(std::make_pair(std::string("cim:AccumulatorValue.AccumulatorReset"), &assign_AccumulatorValue_AccumulatorReset)); - } - -const char AccumulatorValue::debugName[] = "AccumulatorValue"; -const char* AccumulatorValue::debugString() -{ - return AccumulatorValue::debugName; } const BaseClassDefiner AccumulatorValue::declare() @@ -78,4 +94,10 @@ const BaseClassDefiner AccumulatorValue::declare() return BaseClassDefiner(AccumulatorValue::addConstructToMap, AccumulatorValue::addPrimitiveAssignFnsToMap, AccumulatorValue::addClassAssignFnsToMap, AccumulatorValue::debugName); } - +namespace CIMPP +{ + BaseClass* AccumulatorValue_factory() + { + return new AccumulatorValue; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AccumulatorValue.hpp b/CGMES_2.4.15_27JAN2020/AccumulatorValue.hpp index a9b97b547..4a119c559 100644 --- a/CGMES_2.4.15_27JAN2020/AccumulatorValue.hpp +++ b/CGMES_2.4.15_27JAN2020/AccumulatorValue.hpp @@ -1,42 +1,43 @@ #ifndef AccumulatorValue_H #define AccumulatorValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Accumulator; + class AccumulatorReset; - -class Accumulator; -class AccumulatorReset; /* AccumulatorValue represents an accumulated (counted) MeasurementValue. */ - class AccumulatorValue: public MeasurementValue + class AccumulatorValue : public MeasurementValue { - public: - CIMPP::Accumulator* Accumulator; /* The values connected to this measurement. Default: 0 */ - CIMPP::AccumulatorReset* AccumulatorReset; /* The command that reset the accumulator value. Default: 0 */ - CIMPP::Integer value; /* The value to supervise. The value is positive. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AccumulatorValue(); - virtual ~AccumulatorValue(); - + ~AccumulatorValue() override; + + CIMPP::Accumulator* Accumulator; /* The values connected to this measurement. Default: 0 */ + CIMPP::AccumulatorReset* AccumulatorReset; /* The command that reset the accumulator value. Default: 0 */ + CIMPP::Integer value; /* The value to supervise. The value is positive. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AccumulatorValue_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ActivePower.cpp b/CGMES_2.4.15_27JAN2020/ActivePower.cpp index e422a62cc..d6f48a52a 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePower.cpp +++ b/CGMES_2.4.15_27JAN2020/ActivePower.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePower.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -ActivePower::ActivePower() {} -ActivePower::~ActivePower(){} +#include -ActivePower::ActivePower(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void ActivePower::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void ActivePower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +ActivePower& ActivePower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void ActivePower::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +ActivePower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char ActivePower::debugName[] = "ActivePower"; -const char* ActivePower::debugString() { +const char* ActivePower::debugString() const +{ return ActivePower::debugName; } - -const BaseClassDefiner ActivePower::declare() { - return BaseClassDefiner(ActivePower::addConstructToMap, ActivePower::addPrimitiveAssignFnsToMap, ActivePower::addClassAssignFnsToMap, ActivePower::debugName); +ActivePower& ActivePower::operator+=(const ActivePower& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - ActivePower& ActivePower::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - ActivePower& ActivePower::operator-=(const ActivePower& rhs) { - value -= rhs.value; - return *this; - } - - ActivePower& ActivePower::operator*=(const ActivePower& rhs) { - value *= rhs.value; - return *this; - } - - ActivePower& ActivePower::operator/=(const ActivePower& rhs) { - value /= rhs.value; - return *this; - } +ActivePower& ActivePower::operator-=(const ActivePower& rhs) +{ + value -= rhs.value; + return *this; +} - ActivePower& ActivePower::operator+=(const ActivePower& rhs) { - value += rhs.value; - return *this; - } +ActivePower& ActivePower::operator*=(const ActivePower& rhs) +{ + value *= rhs.value; + return *this; +} - ActivePower::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +ActivePower& ActivePower::operator/=(const ActivePower& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, ActivePower& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ActivePower& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const ActivePower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/ActivePower.hpp b/CGMES_2.4.15_27JAN2020/ActivePower.hpp index 06e848e44..d1a142af8 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePower.hpp +++ b/CGMES_2.4.15_27JAN2020/ActivePower.hpp @@ -1,38 +1,39 @@ #ifndef ActivePower_H #define ActivePower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class ActivePower : public BaseClass + /* + Product of RMS value of the voltage and the RMS value of the in-phase component of the current. + */ + class ActivePower { - public: - ActivePower(); - virtual ~ActivePower(); - ActivePower(long double value); - static const BaseClassDefiner declare(); - ActivePower& operator=(long double &rop); + ActivePower() : value(0.0), initialized(false) {} + ActivePower(long double value) : value(value), initialized(true) {} + + ActivePower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + ActivePower& operator+=(const ActivePower& rhs); ActivePower& operator-=(const ActivePower& rhs); ActivePower& operator*=(const ActivePower& rhs); ActivePower& operator/=(const ActivePower& rhs); + friend std::istream& operator>>(std::istream& lop, ActivePower& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const ActivePower& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ActivePowerLimit.cpp b/CGMES_2.4.15_27JAN2020/ActivePowerLimit.cpp index 6697e04c8..d95377339 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePowerLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/ActivePowerLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePowerLimit.hpp" +#include +#include + #include "ActivePower.hpp" using namespace CIMPP; ActivePowerLimit::ActivePowerLimit() {}; - ActivePowerLimit::~ActivePowerLimit() {}; +bool assign_ActivePowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ActivePowerLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ActivePowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ActivePowerLimit_factory() { - return new ActivePowerLimit; - } +const char ActivePowerLimit::debugName[] = "ActivePowerLimit"; +const char* ActivePowerLimit::debugString() const +{ + return ActivePowerLimit::debugName; } -void ActivePowerLimit::addConstructToMap(std::unordered_map& factory_map) { +void ActivePowerLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ActivePowerLimit"), &ActivePowerLimit_factory)); } -void ActivePowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ActivePowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ActivePowerLimit.value"), &assign_ActivePowerLimit_value)); } -void ActivePowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ActivePowerLimit::debugName[] = "ActivePowerLimit"; -const char* ActivePowerLimit::debugString() +void ActivePowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ActivePowerLimit::debugName; } const BaseClassDefiner ActivePowerLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner ActivePowerLimit::declare() return BaseClassDefiner(ActivePowerLimit::addConstructToMap, ActivePowerLimit::addPrimitiveAssignFnsToMap, ActivePowerLimit::addClassAssignFnsToMap, ActivePowerLimit::debugName); } - +namespace CIMPP +{ + BaseClass* ActivePowerLimit_factory() + { + return new ActivePowerLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ActivePowerLimit.hpp b/CGMES_2.4.15_27JAN2020/ActivePowerLimit.hpp index 5c0a031b9..bc0c71cdb 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePowerLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/ActivePowerLimit.hpp @@ -1,38 +1,39 @@ #ifndef ActivePowerLimit_H #define ActivePowerLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Limit on active power flow. */ - class ActivePowerLimit: public OperationalLimit + class ActivePowerLimit : public OperationalLimit { - public: - CIMPP::ActivePower value; /* Value of active power limit. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ActivePowerLimit(); - virtual ~ActivePowerLimit(); - + ~ActivePowerLimit() override; + + CIMPP::ActivePower value; /* Value of active power limit. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ActivePowerLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.cpp b/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.cpp index e03840cb5..ccc704f3a 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.cpp +++ b/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePowerPerCurrentFlow.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "Float.hpp" - -using namespace CIMPP; - -ActivePowerPerCurrentFlow::ActivePowerPerCurrentFlow(): value(nullptr) {}; - -ActivePowerPerCurrentFlow::~ActivePowerPerCurrentFlow() {}; - +#include +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; - - -bool assign_ActivePowerPerCurrentFlow_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - -bool assign_ActivePowerPerCurrentFlow_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerCurrentFlow_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerCurrentFlow_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerCurrentFlow_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerCurrentFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } - -namespace CIMPP { - BaseClass* ActivePowerPerCurrentFlow_factory() { - return new ActivePowerPerCurrentFlow; +ActivePowerPerCurrentFlow::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void ActivePowerPerCurrentFlow::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow"), &ActivePowerPerCurrentFlow_factory)); +const char ActivePowerPerCurrentFlow::debugName[] = "ActivePowerPerCurrentFlow"; +const char* ActivePowerPerCurrentFlow::debugString() const +{ + return ActivePowerPerCurrentFlow::debugName; } -void ActivePowerPerCurrentFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.denominatorMultiplier"), &assign_ActivePowerPerCurrentFlow_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.denominatorUnit"), &assign_ActivePowerPerCurrentFlow_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.multiplier"), &assign_ActivePowerPerCurrentFlow_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.unit"), &assign_ActivePowerPerCurrentFlow_unit)); - } +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator+=(const ActivePowerPerCurrentFlow& rhs) +{ + value += rhs.value; + return *this; +} -void ActivePowerPerCurrentFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerCurrentFlow.value"), &assign_ActivePowerPerCurrentFlow_value)); +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator-=(const ActivePowerPerCurrentFlow& rhs) +{ + value -= rhs.value; + return *this; } -const char ActivePowerPerCurrentFlow::debugName[] = "ActivePowerPerCurrentFlow"; -const char* ActivePowerPerCurrentFlow::debugString() +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator*=(const ActivePowerPerCurrentFlow& rhs) { - return ActivePowerPerCurrentFlow::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner ActivePowerPerCurrentFlow::declare() +ActivePowerPerCurrentFlow& ActivePowerPerCurrentFlow::operator/=(const ActivePowerPerCurrentFlow& rhs) { - return BaseClassDefiner(ActivePowerPerCurrentFlow::addConstructToMap, ActivePowerPerCurrentFlow::addPrimitiveAssignFnsToMap, ActivePowerPerCurrentFlow::addClassAssignFnsToMap, ActivePowerPerCurrentFlow::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ActivePowerPerCurrentFlow& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const ActivePowerPerCurrentFlow& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.hpp b/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.hpp index 27bea5b40..9f7c724db 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.hpp +++ b/CGMES_2.4.15_27JAN2020/ActivePowerPerCurrentFlow.hpp @@ -1,46 +1,36 @@ #ifndef ActivePowerPerCurrentFlow_H #define ActivePowerPerCurrentFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include +namespace CIMPP +{ + class ActivePowerPerCurrentFlow + { + public: + ActivePowerPerCurrentFlow() : value(0.0), initialized(false) {} + ActivePowerPerCurrentFlow(long double value) : value(value), initialized(true) {} -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" - -namespace CIMPP { - + ActivePowerPerCurrentFlow& operator=(long double rop); + operator long double() const; -class Float; - /* - - */ - class ActivePowerPerCurrentFlow: public BaseClass - { + long double value; + bool initialized; - public: - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::Float* value; /* Default: nullptr */ - static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - ActivePowerPerCurrentFlow(); - virtual ~ActivePowerPerCurrentFlow(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + ActivePowerPerCurrentFlow& operator+=(const ActivePowerPerCurrentFlow& rhs); + ActivePowerPerCurrentFlow& operator-=(const ActivePowerPerCurrentFlow& rhs); + ActivePowerPerCurrentFlow& operator*=(const ActivePowerPerCurrentFlow& rhs); + ActivePowerPerCurrentFlow& operator/=(const ActivePowerPerCurrentFlow& rhs); - BaseClass* ActivePowerPerCurrentFlow_factory(); + friend std::istream& operator>>(std::istream& lop, ActivePowerPerCurrentFlow& rop); + friend std::ostream& operator<<(std::ostream& os, const ActivePowerPerCurrentFlow& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.cpp b/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.cpp index c9a075670..9f3064d3a 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.cpp +++ b/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ActivePowerPerFrequency.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "Float.hpp" - -using namespace CIMPP; - -ActivePowerPerFrequency::ActivePowerPerFrequency(): value(nullptr) {}; - -ActivePowerPerFrequency::~ActivePowerPerFrequency() {}; - +#include +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; - - -bool assign_ActivePowerPerFrequency_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - -bool assign_ActivePowerPerFrequency_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerFrequency_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerFrequency_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ActivePowerPerFrequency_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ActivePowerPerFrequency* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +ActivePowerPerFrequency& ActivePowerPerFrequency::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } - -namespace CIMPP { - BaseClass* ActivePowerPerFrequency_factory() { - return new ActivePowerPerFrequency; +ActivePowerPerFrequency::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void ActivePowerPerFrequency::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency"), &ActivePowerPerFrequency_factory)); +const char ActivePowerPerFrequency::debugName[] = "ActivePowerPerFrequency"; +const char* ActivePowerPerFrequency::debugString() const +{ + return ActivePowerPerFrequency::debugName; } -void ActivePowerPerFrequency::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.denominatorMultiplier"), &assign_ActivePowerPerFrequency_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.denominatorUnit"), &assign_ActivePowerPerFrequency_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.multiplier"), &assign_ActivePowerPerFrequency_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.unit"), &assign_ActivePowerPerFrequency_unit)); - } +ActivePowerPerFrequency& ActivePowerPerFrequency::operator+=(const ActivePowerPerFrequency& rhs) +{ + value += rhs.value; + return *this; +} -void ActivePowerPerFrequency::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ActivePowerPerFrequency.value"), &assign_ActivePowerPerFrequency_value)); +ActivePowerPerFrequency& ActivePowerPerFrequency::operator-=(const ActivePowerPerFrequency& rhs) +{ + value -= rhs.value; + return *this; } -const char ActivePowerPerFrequency::debugName[] = "ActivePowerPerFrequency"; -const char* ActivePowerPerFrequency::debugString() +ActivePowerPerFrequency& ActivePowerPerFrequency::operator*=(const ActivePowerPerFrequency& rhs) { - return ActivePowerPerFrequency::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner ActivePowerPerFrequency::declare() +ActivePowerPerFrequency& ActivePowerPerFrequency::operator/=(const ActivePowerPerFrequency& rhs) { - return BaseClassDefiner(ActivePowerPerFrequency::addConstructToMap, ActivePowerPerFrequency::addPrimitiveAssignFnsToMap, ActivePowerPerFrequency::addClassAssignFnsToMap, ActivePowerPerFrequency::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ActivePowerPerFrequency& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const ActivePowerPerFrequency& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.hpp b/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.hpp index 51127c5dd..f8b5bd3ab 100644 --- a/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.hpp +++ b/CGMES_2.4.15_27JAN2020/ActivePowerPerFrequency.hpp @@ -1,46 +1,39 @@ #ifndef ActivePowerPerFrequency_H #define ActivePowerPerFrequency_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Active power variation with frequency. */ - class ActivePowerPerFrequency: public BaseClass + class ActivePowerPerFrequency { - public: - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::Float* value; /* Default: nullptr */ - + ActivePowerPerFrequency() : value(0.0), initialized(false) {} + ActivePowerPerFrequency(long double value) : value(value), initialized(true) {} + + ActivePowerPerFrequency& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - ActivePowerPerFrequency(); - virtual ~ActivePowerPerFrequency(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + ActivePowerPerFrequency& operator+=(const ActivePowerPerFrequency& rhs); + ActivePowerPerFrequency& operator-=(const ActivePowerPerFrequency& rhs); + ActivePowerPerFrequency& operator*=(const ActivePowerPerFrequency& rhs); + ActivePowerPerFrequency& operator/=(const ActivePowerPerFrequency& rhs); - BaseClass* ActivePowerPerFrequency_factory(); + friend std::istream& operator>>(std::istream& lop, ActivePowerPerFrequency& rop); + friend std::ostream& operator<<(std::ostream& os, const ActivePowerPerFrequency& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/Analog.cpp b/CGMES_2.4.15_27JAN2020/Analog.cpp index a4770d988..ed286e5f9 100644 --- a/CGMES_2.4.15_27JAN2020/Analog.cpp +++ b/CGMES_2.4.15_27JAN2020/Analog.cpp @@ -1,77 +1,92 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Analog.hpp" -#include "Boolean.hpp" +#include +#include + #include "AnalogValue.hpp" #include "AnalogLimitSet.hpp" +#include "Boolean.hpp" using namespace CIMPP; Analog::Analog() {}; - Analog::~Analog() {}; -bool assign_Analog_AnalogValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Analog* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->AnalogValues.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_Analog_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Analog* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveFlowIn; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Analog_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Analog* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->LimitSets.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + +bool assign_AnalogValue_Analog(BaseClass*, BaseClass*); +bool assign_Analog_AnalogValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Analog* element = dynamic_cast(BaseClass_ptr1); + AnalogValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->AnalogValues.begin(), element->AnalogValues.end(), element2) == element->AnalogValues.end()) + { + element->AnalogValues.push_back(element2); + return assign_AnalogValue_Analog(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - -bool assign_Analog_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Analog* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveFlowIn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AnalogLimitSet_Measurements(BaseClass*, BaseClass*); +bool assign_Analog_LimitSets(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Analog* element = dynamic_cast(BaseClass_ptr1); + AnalogLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->LimitSets.begin(), element->LimitSets.end(), element2) == element->LimitSets.end()) + { + element->LimitSets.push_back(element2); + return assign_AnalogLimitSet_Measurements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - -namespace CIMPP { - BaseClass* Analog_factory() { - return new Analog; - } +const char Analog::debugName[] = "Analog"; +const char* Analog::debugString() const +{ + return Analog::debugName; } -void Analog::addConstructToMap(std::unordered_map& factory_map) { +void Analog::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Analog"), &Analog_factory)); } -void Analog::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Analog::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Analog.positiveFlowIn"), &assign_Analog_positiveFlowIn)); - } - -void Analog::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Analog.AnalogValues"), &assign_Analog_AnalogValues)); - assign_map.insert(std::make_pair(std::string("cim:Analog.LimitSets"), &assign_Analog_LimitSets)); } -const char Analog::debugName[] = "Analog"; -const char* Analog::debugString() +void Analog::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Analog::debugName; + assign_map.insert(std::make_pair(std::string("cim:Analog.AnalogValues"), &assign_Analog_AnalogValues)); + assign_map.insert(std::make_pair(std::string("cim:Analog.LimitSets"), &assign_Analog_LimitSets)); } const BaseClassDefiner Analog::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner Analog::declare() return BaseClassDefiner(Analog::addConstructToMap, Analog::addPrimitiveAssignFnsToMap, Analog::addClassAssignFnsToMap, Analog::debugName); } - +namespace CIMPP +{ + BaseClass* Analog_factory() + { + return new Analog; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Analog.hpp b/CGMES_2.4.15_27JAN2020/Analog.hpp index 38bdaa8ab..bbe3e8612 100644 --- a/CGMES_2.4.15_27JAN2020/Analog.hpp +++ b/CGMES_2.4.15_27JAN2020/Analog.hpp @@ -1,42 +1,43 @@ #ifndef Analog_H #define Analog_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class AnalogLimitSet; + class AnalogValue; -class AnalogValue; -class AnalogLimitSet; /* Analog represents an analog Measurement. */ - class Analog: public Measurement + class Analog : public Measurement { - public: - CIMPP::Boolean positiveFlowIn; /* If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. Default: false */ - std::list AnalogValues; /* Measurement to which this value is connected. Default: 0 */ - std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Analog(); - virtual ~Analog(); - + ~Analog() override; + + std::list AnalogValues; /* Measurement to which this value is connected. Default: 0 */ + std::list LimitSets; /* The Measurements using the LimitSet. Default: 0 */ + CIMPP::Boolean positiveFlowIn; /* If true then this measurement is an active power, reactive power or current with the convention that a positive value measured at the Terminal means power is flowing into the related PowerSystemResource. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Analog_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AnalogControl.cpp b/CGMES_2.4.15_27JAN2020/AnalogControl.cpp index c376b103f..535c82dea 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogControl.cpp +++ b/CGMES_2.4.15_27JAN2020/AnalogControl.cpp @@ -1,79 +1,88 @@ -#include -#include "Control.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogControl.hpp" +#include +#include + +#include "AnalogValue.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "AnalogValue.hpp" using namespace CIMPP; -AnalogControl::AnalogControl(): AnalogValue(nullptr) {}; - +AnalogControl::AnalogControl() : AnalogValue(nullptr) {}; AnalogControl::~AnalogControl() {}; +bool assign_AnalogControl_maxValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AnalogValue_AnalogControl(BaseClass*, BaseClass*); -bool assign_AnalogControl_AnalogValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogControl* element = dynamic_cast(BaseClass_ptr1)) { - element->AnalogValue = dynamic_cast(BaseClass_ptr2); - if(element->AnalogValue != nullptr) - return assign_AnalogValue_AnalogControl(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_AnalogControl_minValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AnalogControl_maxValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AnalogValue_AnalogControl(BaseClass*, BaseClass*); +bool assign_AnalogControl_AnalogValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogControl* element = dynamic_cast(BaseClass_ptr1); + AnalogValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AnalogValue != element2) + { + element->AnalogValue = element2; + return assign_AnalogValue_AnalogControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_AnalogControl_minValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* AnalogControl_factory() { - return new AnalogControl; - } +const char AnalogControl::debugName[] = "AnalogControl"; +const char* AnalogControl::debugString() const +{ + return AnalogControl::debugName; } -void AnalogControl::addConstructToMap(std::unordered_map& factory_map) { +void AnalogControl::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogControl"), &AnalogControl_factory)); } -void AnalogControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AnalogControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AnalogControl.maxValue"), &assign_AnalogControl_maxValue)); assign_map.insert(std::make_pair(std::string("cim:AnalogControl.minValue"), &assign_AnalogControl_minValue)); - } - -void AnalogControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogControl.AnalogValue"), &assign_AnalogControl_AnalogValue)); } -const char AnalogControl::debugName[] = "AnalogControl"; -const char* AnalogControl::debugString() +void AnalogControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AnalogControl::debugName; + assign_map.insert(std::make_pair(std::string("cim:AnalogControl.AnalogValue"), &assign_AnalogControl_AnalogValue)); } const BaseClassDefiner AnalogControl::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner AnalogControl::declare() return BaseClassDefiner(AnalogControl::addConstructToMap, AnalogControl::addPrimitiveAssignFnsToMap, AnalogControl::addClassAssignFnsToMap, AnalogControl::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogControl_factory() + { + return new AnalogControl; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AnalogControl.hpp b/CGMES_2.4.15_27JAN2020/AnalogControl.hpp index 6be2810ab..758a9446b 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogControl.hpp +++ b/CGMES_2.4.15_27JAN2020/AnalogControl.hpp @@ -1,41 +1,42 @@ #ifndef AnalogControl_H #define AnalogControl_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Control.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Control.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class AnalogValue; - -class AnalogValue; /* An analog control used for supervisory control. */ - class AnalogControl: public Control + class AnalogControl : public Control { - public: - CIMPP::Simple_Float maxValue; /* Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ - CIMPP::Simple_Float minValue; /* Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ - CIMPP::AnalogValue* AnalogValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogControl(); - virtual ~AnalogControl(); - + ~AnalogControl() override; + + CIMPP::AnalogValue* AnalogValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ + CIMPP::Simple_Float maxValue; /* Normal value range maximum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ + CIMPP::Simple_Float minValue; /* Normal value range minimum for any of the Control.value. Used for scaling, e.g. in bar graphs. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogControl_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AnalogLimit.cpp b/CGMES_2.4.15_27JAN2020/AnalogLimit.cpp index c71b50087..272232d9d 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/AnalogLimit.cpp @@ -1,64 +1,72 @@ -#include -#include "Limit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogLimit.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "AnalogLimitSet.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; -AnalogLimit::AnalogLimit(): LimitSet(nullptr) {}; - +AnalogLimit::AnalogLimit() : LimitSet(nullptr) {}; AnalogLimit::~AnalogLimit() {}; -bool assign_AnalogLimitSet_Limits(BaseClass*, BaseClass*); -bool assign_AnalogLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->LimitSet = dynamic_cast(BaseClass_ptr2); - if(element->LimitSet != nullptr) - return assign_AnalogLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_AnalogLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AnalogLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AnalogLimitSet_Limits(BaseClass*, BaseClass*); +bool assign_AnalogLimit_LimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogLimit* element = dynamic_cast(BaseClass_ptr1); + AnalogLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LimitSet != element2) + { + element->LimitSet = element2; + return assign_AnalogLimitSet_Limits(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AnalogLimit_factory() { - return new AnalogLimit; - } +const char AnalogLimit::debugName[] = "AnalogLimit"; +const char* AnalogLimit::debugString() const +{ + return AnalogLimit::debugName; } -void AnalogLimit::addConstructToMap(std::unordered_map& factory_map) { +void AnalogLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogLimit"), &AnalogLimit_factory)); } -void AnalogLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AnalogLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AnalogLimit.value"), &assign_AnalogLimit_value)); - } - -void AnalogLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogLimit.LimitSet"), &assign_AnalogLimit_LimitSet)); } -const char AnalogLimit::debugName[] = "AnalogLimit"; -const char* AnalogLimit::debugString() +void AnalogLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AnalogLimit::debugName; + assign_map.insert(std::make_pair(std::string("cim:AnalogLimit.LimitSet"), &assign_AnalogLimit_LimitSet)); } const BaseClassDefiner AnalogLimit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner AnalogLimit::declare() return BaseClassDefiner(AnalogLimit::addConstructToMap, AnalogLimit::addPrimitiveAssignFnsToMap, AnalogLimit::addClassAssignFnsToMap, AnalogLimit::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogLimit_factory() + { + return new AnalogLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AnalogLimit.hpp b/CGMES_2.4.15_27JAN2020/AnalogLimit.hpp index 966da9276..52cc400d3 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/AnalogLimit.hpp @@ -1,40 +1,41 @@ #ifndef AnalogLimit_H #define AnalogLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Limit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Limit.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class AnalogLimitSet; - -class AnalogLimitSet; /* Limit values for Analog measurements. */ - class AnalogLimit: public Limit + class AnalogLimit : public Limit { - public: - CIMPP::Simple_Float value; /* The value to supervise against. Default: nullptr */ - CIMPP::AnalogLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogLimit(); - virtual ~AnalogLimit(); - + ~AnalogLimit() override; + + CIMPP::AnalogLimitSet* LimitSet; /* The limit values used for supervision of Measurements. Default: 0 */ + CIMPP::Simple_Float value; /* The value to supervise against. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AnalogLimitSet.cpp b/CGMES_2.4.15_27JAN2020/AnalogLimitSet.cpp index f912f49cb..242bdb236 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogLimitSet.cpp +++ b/CGMES_2.4.15_27JAN2020/AnalogLimitSet.cpp @@ -1,62 +1,76 @@ -#include -#include "LimitSet.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogLimitSet.hpp" -#include "Analog.hpp" +#include +#include + #include "AnalogLimit.hpp" +#include "Analog.hpp" using namespace CIMPP; AnalogLimitSet::AnalogLimitSet() {}; - AnalogLimitSet::~AnalogLimitSet() {}; -bool assign_AnalogLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_AnalogLimit_LimitSet(BaseClass*, BaseClass*); +bool assign_AnalogLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1); + AnalogLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Limits.begin(), element->Limits.end(), element2) == element->Limits.end()) + { + element->Limits.push_back(element2); + return assign_AnalogLimit_LimitSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_AnalogLimitSet_Limits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Limits.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Analog_LimitSets(BaseClass*, BaseClass*); +bool assign_AnalogLimitSet_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogLimitSet* element = dynamic_cast(BaseClass_ptr1); + Analog* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Analog_LimitSets(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* AnalogLimitSet_factory() { - return new AnalogLimitSet; - } +const char AnalogLimitSet::debugName[] = "AnalogLimitSet"; +const char* AnalogLimitSet::debugString() const +{ + return AnalogLimitSet::debugName; } -void AnalogLimitSet::addConstructToMap(std::unordered_map& factory_map) { +void AnalogLimitSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogLimitSet"), &AnalogLimitSet_factory)); } -void AnalogLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void AnalogLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Measurements"), &assign_AnalogLimitSet_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Limits"), &assign_AnalogLimitSet_Limits)); +void AnalogLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char AnalogLimitSet::debugName[] = "AnalogLimitSet"; -const char* AnalogLimitSet::debugString() +void AnalogLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AnalogLimitSet::debugName; + assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Limits"), &assign_AnalogLimitSet_Limits)); + assign_map.insert(std::make_pair(std::string("cim:AnalogLimitSet.Measurements"), &assign_AnalogLimitSet_Measurements)); } const BaseClassDefiner AnalogLimitSet::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner AnalogLimitSet::declare() return BaseClassDefiner(AnalogLimitSet::addConstructToMap, AnalogLimitSet::addPrimitiveAssignFnsToMap, AnalogLimitSet::addClassAssignFnsToMap, AnalogLimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogLimitSet_factory() + { + return new AnalogLimitSet; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AnalogLimitSet.hpp b/CGMES_2.4.15_27JAN2020/AnalogLimitSet.hpp index 2ecb2b94e..463efd26b 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogLimitSet.hpp +++ b/CGMES_2.4.15_27JAN2020/AnalogLimitSet.hpp @@ -1,40 +1,41 @@ #ifndef AnalogLimitSet_H #define AnalogLimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LimitSet.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LimitSet.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Analog; + class AnalogLimit; -class Analog; -class AnalogLimit; /* An AnalogLimitSet specifies a set of Limits that are associated with an Analog measurement. */ - class AnalogLimitSet: public LimitSet + class AnalogLimitSet : public LimitSet { - public: - std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ - std::list Limits; /* The set of limits. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogLimitSet(); - virtual ~AnalogLimitSet(); - + ~AnalogLimitSet() override; + + std::list Limits; /* The set of limits. Default: 0 */ + std::list Measurements; /* A measurement may have zero or more limit ranges defined for it. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogLimitSet_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AnalogValue.cpp b/CGMES_2.4.15_27JAN2020/AnalogValue.cpp index dc9c42dfa..852593e60 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogValue.cpp +++ b/CGMES_2.4.15_27JAN2020/AnalogValue.cpp @@ -1,76 +1,92 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AnalogValue.hpp" +#include +#include + #include "Analog.hpp" #include "AnalogControl.hpp" #include "Simple_Float.hpp" using namespace CIMPP; -AnalogValue::AnalogValue(): Analog(nullptr), AnalogControl(nullptr) {}; - +AnalogValue::AnalogValue() : Analog(nullptr), AnalogControl(nullptr) {}; AnalogValue::~AnalogValue() {}; -bool assign_Analog_AnalogValues(BaseClass*, BaseClass*); -bool assign_AnalogValue_Analog(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Analog = dynamic_cast(BaseClass_ptr2); - if(element->Analog != nullptr) - return assign_Analog_AnalogValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AnalogValue_AnalogControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AnalogValue* element = dynamic_cast(BaseClass_ptr1)) { - element->AnalogControl = dynamic_cast(BaseClass_ptr2); - if(element->AnalogControl != nullptr) - return true; - } - return false; -} - +bool assign_AnalogValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AnalogValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AnalogValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AnalogValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Analog_AnalogValues(BaseClass*, BaseClass*); +bool assign_AnalogValue_Analog(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogValue* element = dynamic_cast(BaseClass_ptr1); + Analog* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Analog != element2) + { + element->Analog = element2; + return assign_Analog_AnalogValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AnalogValue_factory() { - return new AnalogValue; +bool assign_AnalogControl_AnalogValue(BaseClass*, BaseClass*); +bool assign_AnalogValue_AnalogControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AnalogValue* element = dynamic_cast(BaseClass_ptr1); + AnalogControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AnalogControl != element2) + { + element->AnalogControl = element2; + return assign_AnalogControl_AnalogValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + +const char AnalogValue::debugName[] = "AnalogValue"; +const char* AnalogValue::debugString() const +{ + return AnalogValue::debugName; } -void AnalogValue::addConstructToMap(std::unordered_map& factory_map) { +void AnalogValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AnalogValue"), &AnalogValue_factory)); } -void AnalogValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AnalogValue.value"), &assign_AnalogValue_value)); +void AnalogValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:AnalogValue.value"), &assign_AnalogValue_value)); } -void AnalogValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void AnalogValue::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AnalogValue.Analog"), &assign_AnalogValue_Analog)); assign_map.insert(std::make_pair(std::string("cim:AnalogValue.AnalogControl"), &assign_AnalogValue_AnalogControl)); - } - -const char AnalogValue::debugName[] = "AnalogValue"; -const char* AnalogValue::debugString() -{ - return AnalogValue::debugName; } const BaseClassDefiner AnalogValue::declare() @@ -78,4 +94,10 @@ const BaseClassDefiner AnalogValue::declare() return BaseClassDefiner(AnalogValue::addConstructToMap, AnalogValue::addPrimitiveAssignFnsToMap, AnalogValue::addClassAssignFnsToMap, AnalogValue::debugName); } - +namespace CIMPP +{ + BaseClass* AnalogValue_factory() + { + return new AnalogValue; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AnalogValue.hpp b/CGMES_2.4.15_27JAN2020/AnalogValue.hpp index 59d5219e9..41f13d9b0 100644 --- a/CGMES_2.4.15_27JAN2020/AnalogValue.hpp +++ b/CGMES_2.4.15_27JAN2020/AnalogValue.hpp @@ -1,42 +1,43 @@ #ifndef AnalogValue_H #define AnalogValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Analog; + class AnalogControl; - -class Analog; -class AnalogControl; /* AnalogValue represents an analog MeasurementValue. */ - class AnalogValue: public MeasurementValue + class AnalogValue : public MeasurementValue { - public: - CIMPP::Analog* Analog; /* The values connected to this measurement. Default: 0 */ - CIMPP::AnalogControl* AnalogControl; /* The MeasurementValue that is controlled. Default: 0 */ - CIMPP::Simple_Float value; /* The value to supervise. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AnalogValue(); - virtual ~AnalogValue(); - + ~AnalogValue() override; + + CIMPP::Analog* Analog; /* The values connected to this measurement. Default: 0 */ + CIMPP::AnalogControl* AnalogControl; /* The MeasurementValue that is controlled. Default: 0 */ + CIMPP::Simple_Float value; /* The value to supervise. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AnalogValue_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AngleDegrees.cpp b/CGMES_2.4.15_27JAN2020/AngleDegrees.cpp index 6651b2ed8..01475444f 100644 --- a/CGMES_2.4.15_27JAN2020/AngleDegrees.cpp +++ b/CGMES_2.4.15_27JAN2020/AngleDegrees.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AngleDegrees.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -AngleDegrees::AngleDegrees() {} -AngleDegrees::~AngleDegrees(){} +#include -AngleDegrees::AngleDegrees(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void AngleDegrees::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void AngleDegrees::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +AngleDegrees& AngleDegrees::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void AngleDegrees::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +AngleDegrees::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char AngleDegrees::debugName[] = "AngleDegrees"; -const char* AngleDegrees::debugString() { +const char* AngleDegrees::debugString() const +{ return AngleDegrees::debugName; } - -const BaseClassDefiner AngleDegrees::declare() { - return BaseClassDefiner(AngleDegrees::addConstructToMap, AngleDegrees::addPrimitiveAssignFnsToMap, AngleDegrees::addClassAssignFnsToMap, AngleDegrees::debugName); +AngleDegrees& AngleDegrees::operator+=(const AngleDegrees& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - AngleDegrees& AngleDegrees::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - AngleDegrees& AngleDegrees::operator-=(const AngleDegrees& rhs) { - value -= rhs.value; - return *this; - } - - AngleDegrees& AngleDegrees::operator*=(const AngleDegrees& rhs) { - value *= rhs.value; - return *this; - } - - AngleDegrees& AngleDegrees::operator/=(const AngleDegrees& rhs) { - value /= rhs.value; - return *this; - } +AngleDegrees& AngleDegrees::operator-=(const AngleDegrees& rhs) +{ + value -= rhs.value; + return *this; +} - AngleDegrees& AngleDegrees::operator+=(const AngleDegrees& rhs) { - value += rhs.value; - return *this; - } +AngleDegrees& AngleDegrees::operator*=(const AngleDegrees& rhs) +{ + value *= rhs.value; + return *this; +} - AngleDegrees::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +AngleDegrees& AngleDegrees::operator/=(const AngleDegrees& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, AngleDegrees& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, AngleDegrees& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const AngleDegrees& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/AngleDegrees.hpp b/CGMES_2.4.15_27JAN2020/AngleDegrees.hpp index c8603c675..39204363b 100644 --- a/CGMES_2.4.15_27JAN2020/AngleDegrees.hpp +++ b/CGMES_2.4.15_27JAN2020/AngleDegrees.hpp @@ -1,38 +1,39 @@ #ifndef AngleDegrees_H #define AngleDegrees_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class AngleDegrees : public BaseClass + /* + Measurement of angle in degrees. + */ + class AngleDegrees { - public: - AngleDegrees(); - virtual ~AngleDegrees(); - AngleDegrees(long double value); - static const BaseClassDefiner declare(); - AngleDegrees& operator=(long double &rop); + AngleDegrees() : value(0.0), initialized(false) {} + AngleDegrees(long double value) : value(value), initialized(true) {} + + AngleDegrees& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + AngleDegrees& operator+=(const AngleDegrees& rhs); AngleDegrees& operator-=(const AngleDegrees& rhs); AngleDegrees& operator*=(const AngleDegrees& rhs); AngleDegrees& operator/=(const AngleDegrees& rhs); + friend std::istream& operator>>(std::istream& lop, AngleDegrees& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const AngleDegrees& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/AngleRadians.cpp b/CGMES_2.4.15_27JAN2020/AngleRadians.cpp index 88132505b..bd1b77dbb 100644 --- a/CGMES_2.4.15_27JAN2020/AngleRadians.cpp +++ b/CGMES_2.4.15_27JAN2020/AngleRadians.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AngleRadians.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -AngleRadians::AngleRadians() {} -AngleRadians::~AngleRadians(){} +#include -AngleRadians::AngleRadians(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void AngleRadians::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void AngleRadians::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +AngleRadians& AngleRadians::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void AngleRadians::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +AngleRadians::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char AngleRadians::debugName[] = "AngleRadians"; -const char* AngleRadians::debugString() { +const char* AngleRadians::debugString() const +{ return AngleRadians::debugName; } - -const BaseClassDefiner AngleRadians::declare() { - return BaseClassDefiner(AngleRadians::addConstructToMap, AngleRadians::addPrimitiveAssignFnsToMap, AngleRadians::addClassAssignFnsToMap, AngleRadians::debugName); +AngleRadians& AngleRadians::operator+=(const AngleRadians& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - AngleRadians& AngleRadians::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - AngleRadians& AngleRadians::operator-=(const AngleRadians& rhs) { - value -= rhs.value; - return *this; - } - - AngleRadians& AngleRadians::operator*=(const AngleRadians& rhs) { - value *= rhs.value; - return *this; - } - - AngleRadians& AngleRadians::operator/=(const AngleRadians& rhs) { - value /= rhs.value; - return *this; - } +AngleRadians& AngleRadians::operator-=(const AngleRadians& rhs) +{ + value -= rhs.value; + return *this; +} - AngleRadians& AngleRadians::operator+=(const AngleRadians& rhs) { - value += rhs.value; - return *this; - } +AngleRadians& AngleRadians::operator*=(const AngleRadians& rhs) +{ + value *= rhs.value; + return *this; +} - AngleRadians::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +AngleRadians& AngleRadians::operator/=(const AngleRadians& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, AngleRadians& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, AngleRadians& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const AngleRadians& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/AngleRadians.hpp b/CGMES_2.4.15_27JAN2020/AngleRadians.hpp index 99ad6cce1..2ac29ff28 100644 --- a/CGMES_2.4.15_27JAN2020/AngleRadians.hpp +++ b/CGMES_2.4.15_27JAN2020/AngleRadians.hpp @@ -1,38 +1,39 @@ #ifndef AngleRadians_H #define AngleRadians_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class AngleRadians : public BaseClass + /* + Phase angle in radians. + */ + class AngleRadians { - public: - AngleRadians(); - virtual ~AngleRadians(); - AngleRadians(long double value); - static const BaseClassDefiner declare(); - AngleRadians& operator=(long double &rop); + AngleRadians() : value(0.0), initialized(false) {} + AngleRadians(long double value) : value(value), initialized(true) {} + + AngleRadians& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + AngleRadians& operator+=(const AngleRadians& rhs); AngleRadians& operator-=(const AngleRadians& rhs); AngleRadians& operator*=(const AngleRadians& rhs); AngleRadians& operator/=(const AngleRadians& rhs); + friend std::istream& operator>>(std::istream& lop, AngleRadians& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const AngleRadians& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ApparentPower.cpp b/CGMES_2.4.15_27JAN2020/ApparentPower.cpp index d62bbb332..0b8976a61 100644 --- a/CGMES_2.4.15_27JAN2020/ApparentPower.cpp +++ b/CGMES_2.4.15_27JAN2020/ApparentPower.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ApparentPower.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -ApparentPower::ApparentPower() {} -ApparentPower::~ApparentPower(){} +#include -ApparentPower::ApparentPower(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void ApparentPower::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void ApparentPower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +ApparentPower& ApparentPower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void ApparentPower::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +ApparentPower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char ApparentPower::debugName[] = "ApparentPower"; -const char* ApparentPower::debugString() { +const char* ApparentPower::debugString() const +{ return ApparentPower::debugName; } - -const BaseClassDefiner ApparentPower::declare() { - return BaseClassDefiner(ApparentPower::addConstructToMap, ApparentPower::addPrimitiveAssignFnsToMap, ApparentPower::addClassAssignFnsToMap, ApparentPower::debugName); +ApparentPower& ApparentPower::operator+=(const ApparentPower& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - ApparentPower& ApparentPower::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - ApparentPower& ApparentPower::operator-=(const ApparentPower& rhs) { - value -= rhs.value; - return *this; - } - - ApparentPower& ApparentPower::operator*=(const ApparentPower& rhs) { - value *= rhs.value; - return *this; - } - - ApparentPower& ApparentPower::operator/=(const ApparentPower& rhs) { - value /= rhs.value; - return *this; - } +ApparentPower& ApparentPower::operator-=(const ApparentPower& rhs) +{ + value -= rhs.value; + return *this; +} - ApparentPower& ApparentPower::operator+=(const ApparentPower& rhs) { - value += rhs.value; - return *this; - } +ApparentPower& ApparentPower::operator*=(const ApparentPower& rhs) +{ + value *= rhs.value; + return *this; +} - ApparentPower::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +ApparentPower& ApparentPower::operator/=(const ApparentPower& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, ApparentPower& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ApparentPower& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const ApparentPower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/ApparentPower.hpp b/CGMES_2.4.15_27JAN2020/ApparentPower.hpp index 0614d5728..bcb8201e6 100644 --- a/CGMES_2.4.15_27JAN2020/ApparentPower.hpp +++ b/CGMES_2.4.15_27JAN2020/ApparentPower.hpp @@ -1,38 +1,39 @@ #ifndef ApparentPower_H #define ApparentPower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class ApparentPower : public BaseClass + /* + Product of the RMS value of the voltage and the RMS value of the current. + */ + class ApparentPower { - public: - ApparentPower(); - virtual ~ApparentPower(); - ApparentPower(long double value); - static const BaseClassDefiner declare(); - ApparentPower& operator=(long double &rop); + ApparentPower() : value(0.0), initialized(false) {} + ApparentPower(long double value) : value(value), initialized(true) {} + + ApparentPower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + ApparentPower& operator+=(const ApparentPower& rhs); ApparentPower& operator-=(const ApparentPower& rhs); ApparentPower& operator*=(const ApparentPower& rhs); ApparentPower& operator/=(const ApparentPower& rhs); + friend std::istream& operator>>(std::istream& lop, ApparentPower& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const ApparentPower& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.cpp b/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.cpp index 8daa9d935..a4c8c9843 100644 --- a/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ApparentPowerLimit.hpp" +#include +#include + #include "ApparentPower.hpp" using namespace CIMPP; ApparentPowerLimit::ApparentPowerLimit() {}; - ApparentPowerLimit::~ApparentPowerLimit() {}; +bool assign_ApparentPowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ApparentPowerLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ApparentPowerLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ApparentPowerLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ApparentPowerLimit_factory() { - return new ApparentPowerLimit; - } +const char ApparentPowerLimit::debugName[] = "ApparentPowerLimit"; +const char* ApparentPowerLimit::debugString() const +{ + return ApparentPowerLimit::debugName; } -void ApparentPowerLimit::addConstructToMap(std::unordered_map& factory_map) { +void ApparentPowerLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ApparentPowerLimit"), &ApparentPowerLimit_factory)); } -void ApparentPowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ApparentPowerLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ApparentPowerLimit.value"), &assign_ApparentPowerLimit_value)); } -void ApparentPowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ApparentPowerLimit::debugName[] = "ApparentPowerLimit"; -const char* ApparentPowerLimit::debugString() +void ApparentPowerLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ApparentPowerLimit::debugName; } const BaseClassDefiner ApparentPowerLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner ApparentPowerLimit::declare() return BaseClassDefiner(ApparentPowerLimit::addConstructToMap, ApparentPowerLimit::addPrimitiveAssignFnsToMap, ApparentPowerLimit::addClassAssignFnsToMap, ApparentPowerLimit::debugName); } - +namespace CIMPP +{ + BaseClass* ApparentPowerLimit_factory() + { + return new ApparentPowerLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.hpp b/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.hpp index 3af1691f8..3d95bd8fe 100644 --- a/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/ApparentPowerLimit.hpp @@ -1,38 +1,39 @@ #ifndef ApparentPowerLimit_H #define ApparentPowerLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "ApparentPower.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Apparent power limit. */ - class ApparentPowerLimit: public OperationalLimit + class ApparentPowerLimit : public OperationalLimit { - public: - CIMPP::ApparentPower value; /* The apparent power limit. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ApparentPowerLimit(); - virtual ~ApparentPowerLimit(); - + ~ApparentPowerLimit() override; + + CIMPP::ApparentPower value; /* The apparent power limit. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ApparentPowerLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Area.cpp b/CGMES_2.4.15_27JAN2020/Area.cpp index 236e60bec..4a7457802 100644 --- a/CGMES_2.4.15_27JAN2020/Area.cpp +++ b/CGMES_2.4.15_27JAN2020/Area.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Area.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Area::Area() {} -Area::~Area(){} +#include -Area::Area(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Area::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Area::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Area& Area::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Area::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Area::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Area::debugName[] = "Area"; -const char* Area::debugString() { +const char* Area::debugString() const +{ return Area::debugName; } - -const BaseClassDefiner Area::declare() { - return BaseClassDefiner(Area::addConstructToMap, Area::addPrimitiveAssignFnsToMap, Area::addClassAssignFnsToMap, Area::debugName); +Area& Area::operator+=(const Area& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Area& Area::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Area& Area::operator-=(const Area& rhs) { - value -= rhs.value; - return *this; - } - - Area& Area::operator*=(const Area& rhs) { - value *= rhs.value; - return *this; - } - - Area& Area::operator/=(const Area& rhs) { - value /= rhs.value; - return *this; - } +Area& Area::operator-=(const Area& rhs) +{ + value -= rhs.value; + return *this; +} - Area& Area::operator+=(const Area& rhs) { - value += rhs.value; - return *this; - } +Area& Area::operator*=(const Area& rhs) +{ + value *= rhs.value; + return *this; +} - Area::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Area& Area::operator/=(const Area& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Area& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Area& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Area& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Area.hpp b/CGMES_2.4.15_27JAN2020/Area.hpp index 6434bed58..681c909b6 100644 --- a/CGMES_2.4.15_27JAN2020/Area.hpp +++ b/CGMES_2.4.15_27JAN2020/Area.hpp @@ -1,38 +1,39 @@ #ifndef Area_H #define Area_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Area : public BaseClass + /* + Area. + */ + class Area { - public: - Area(); - virtual ~Area(); - Area(long double value); - static const BaseClassDefiner declare(); - Area& operator=(long double &rop); + Area() : value(0.0), initialized(false) {} + Area(long double value) : value(value), initialized(true) {} + + Area& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Area& operator+=(const Area& rhs); Area& operator-=(const Area& rhs); Area& operator*=(const Area& rhs); Area& operator/=(const Area& rhs); + friend std::istream& operator>>(std::istream& lop, Area& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Area& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachine.cpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachine.cpp index 791dce8e5..bfaa21afb 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachine.cpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachine.cpp @@ -1,195 +1,216 @@ -#include -#include "RotatingMachine.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachine.hpp" -#include "Frequency.hpp" -#include "RotationSpeed.hpp" +#include +#include + +#include "AsynchronousMachineDynamics.hpp" +#include "AsynchronousMachineKind.hpp" #include "Boolean.hpp" #include "PerCent.hpp" #include "Simple_Float.hpp" +#include "Frequency.hpp" +#include "RotationSpeed.hpp" #include "Integer.hpp" #include "ActivePower.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" -#include "AsynchronousMachineKind.hpp" -#include "AsynchronousMachineDynamics.hpp" using namespace CIMPP; -AsynchronousMachine::AsynchronousMachine(): nominalSpeed(nullptr), AsynchronousMachineDynamics(nullptr) {}; - +AsynchronousMachine::AsynchronousMachine() : AsynchronousMachineDynamics(nullptr) {}; AsynchronousMachine::~AsynchronousMachine() {}; -bool assign_AsynchronousMachine_nominalSpeed(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->nominalSpeed = dynamic_cast(BaseClass_ptr2); - if(element->nominalSpeed != nullptr) - return true; - } - return false; +bool assign_AsynchronousMachine_asynchronousMachineType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->asynchronousMachineType; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_AsynchronousMachine_converterFedDrive(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->converterFedDrive; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_efficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efficiency; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_iaIrRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iaIrRatio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_nominalFrequency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalFrequency; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_nominalSpeed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalSpeed; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_polePairNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->polePairNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_ratedMechanicalPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedMechanicalPower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachine_reversible(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->reversible; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return true; - } - return false; +bool assign_AsynchronousMachine_rxLockedRotorRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rxLockedRotorRatio; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_AsynchronousMachine_nominalFrequency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalFrequency; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass*, BaseClass*); +bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_AsynchronousMachine_converterFedDrive(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->converterFedDrive; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_efficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efficiency; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_iaIrRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iaIrRatio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_polePairNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->polePairNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachine_ratedMechanicalPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedMechanicalPower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_AsynchronousMachine_reversible(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->reversible; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_AsynchronousMachine_rxLockedRotorRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rxLockedRotorRatio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_AsynchronousMachine_asynchronousMachineType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->asynchronousMachineType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* AsynchronousMachine_factory() { - return new AsynchronousMachine; - } + + + + + +const char AsynchronousMachine::debugName[] = "AsynchronousMachine"; +const char* AsynchronousMachine::debugString() const +{ + return AsynchronousMachine::debugName; } -void AsynchronousMachine::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachine::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachine"), &AsynchronousMachine_factory)); } -void AsynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalFrequency"), &assign_AsynchronousMachine_nominalFrequency)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.converterFedDrive"), &assign_AsynchronousMachine_converterFedDrive)); +void AsynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.asynchronousMachineType"), &assign_AsynchronousMachine_asynchronousMachineType)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.converterFedDrive"), &assign_AsynchronousMachine_converterFedDrive)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.efficiency"), &assign_AsynchronousMachine_efficiency)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.iaIrRatio"), &assign_AsynchronousMachine_iaIrRatio)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalFrequency"), &assign_AsynchronousMachine_nominalFrequency)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalSpeed"), &assign_AsynchronousMachine_nominalSpeed)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.polePairNumber"), &assign_AsynchronousMachine_polePairNumber)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.ratedMechanicalPower"), &assign_AsynchronousMachine_ratedMechanicalPower)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.reversible"), &assign_AsynchronousMachine_reversible)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.rxLockedRotorRatio"), &assign_AsynchronousMachine_rxLockedRotorRatio)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.asynchronousMachineType"), &assign_AsynchronousMachine_asynchronousMachineType)); - } - -void AsynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.nominalSpeed"), &assign_AsynchronousMachine_nominalSpeed)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.AsynchronousMachineDynamics"), &assign_AsynchronousMachine_AsynchronousMachineDynamics)); } -const char AsynchronousMachine::debugName[] = "AsynchronousMachine"; -const char* AsynchronousMachine::debugString() +void AsynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachine::debugName; + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachine.AsynchronousMachineDynamics"), &assign_AsynchronousMachine_AsynchronousMachineDynamics)); } const BaseClassDefiner AsynchronousMachine::declare() @@ -197,4 +218,10 @@ const BaseClassDefiner AsynchronousMachine::declare() return BaseClassDefiner(AsynchronousMachine::addConstructToMap, AsynchronousMachine::addPrimitiveAssignFnsToMap, AsynchronousMachine::addClassAssignFnsToMap, AsynchronousMachine::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachine_factory() + { + return new AsynchronousMachine; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachine.hpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachine.hpp index 82d13a70a..70f2dc771 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachine.hpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachine.hpp @@ -1,56 +1,57 @@ #ifndef AsynchronousMachine_H #define AsynchronousMachine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachine.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Frequency.hpp" +#include "RotatingMachine.hpp" +#include "BaseClassDefiner.hpp" +#include "ActivePower.hpp" +#include "AsynchronousMachineKind.hpp" #include "Boolean.hpp" +#include "Frequency.hpp" +#include "Integer.hpp" #include "PerCent.hpp" +#include "RotationSpeed.hpp" #include "Simple_Float.hpp" -#include "Integer.hpp" -#include "ActivePower.hpp" -#include "AsynchronousMachineKind.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class AsynchronousMachineDynamics; -class RotationSpeed; -class AsynchronousMachineDynamics; /* A rotating machine whose shaft rotates asynchronously with the electrical field. Also known as an induction machine with no external connection to the rotor windings, e.g squirrel-cage induction machine. */ - class AsynchronousMachine: public RotatingMachine + class AsynchronousMachine : public RotatingMachine { - public: - CIMPP::Frequency nominalFrequency; /* Nameplate data indicates if the machine is 50 or 60 Hz. Default: nullptr */ - CIMPP::RotationSpeed* nominalSpeed; /* Nameplate data. Depends on the slip and number of pole pairs. Default: nullptr */ - CIMPP::Boolean converterFedDrive; /* Indicates whether the machine is a converter fed drive. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::PerCent efficiency; /* Efficiency of the asynchronous machine at nominal operation in percent. Indicator for converter drive motors. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float iaIrRatio; /* Ratio of locked-rotor current to the rated current of the motor (Ia/Ir). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Integer polePairNumber; /* Number of pole pairs of stator. Used for short circuit data exchange according to IEC 60909 Default: 0 */ - CIMPP::ActivePower ratedMechanicalPower; /* Rated mechanical power (Pr in the IEC 60909-0). Used for short circuit data exchange according to IEC 60909. Default: nullptr */ - CIMPP::Boolean reversible; /* Indicates for converter drive motors if the power can be reversible. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::Simple_Float rxLockedRotorRatio; /* Locked rotor ratio (R/X). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::AsynchronousMachineKind asynchronousMachineType; /* Indicates the type of Asynchronous Machine (motor or generator). Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine dynamics model used to describe dynamic behavior of this asynchronous machine. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachine(); - virtual ~AsynchronousMachine(); - + ~AsynchronousMachine() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine dynamics model used to describe dynamic behavior of this asynchronous machine. Default: 0 */ + CIMPP::AsynchronousMachineKind asynchronousMachineType; /* Indicates the type of Asynchronous Machine (motor or generator). Default: 0 */ + CIMPP::Boolean converterFedDrive; /* Indicates whether the machine is a converter fed drive. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::PerCent efficiency; /* Efficiency of the asynchronous machine at nominal operation in percent. Indicator for converter drive motors. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float iaIrRatio; /* Ratio of locked-rotor current to the rated current of the motor (Ia/Ir). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Frequency nominalFrequency; /* Nameplate data indicates if the machine is 50 or 60 Hz. Default: nullptr */ + CIMPP::RotationSpeed nominalSpeed; /* Nameplate data. Depends on the slip and number of pole pairs. Default: nullptr */ + CIMPP::Integer polePairNumber; /* Number of pole pairs of stator. Used for short circuit data exchange according to IEC 60909 Default: 0 */ + CIMPP::ActivePower ratedMechanicalPower; /* Rated mechanical power (Pr in the IEC 60909-0). Used for short circuit data exchange according to IEC 60909. Default: nullptr */ + CIMPP::Boolean reversible; /* Indicates for converter drive motors if the power can be reversible. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::Simple_Float rxLockedRotorRatio; /* Locked rotor ratio (R/X). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachine_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.cpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.cpp index a059ace41..f811c69f4 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.cpp @@ -1,85 +1,116 @@ -#include -#include "RotatingMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineDynamics.hpp" +#include +#include + #include "AsynchronousMachine.hpp" #include "MechanicalLoadDynamics.hpp" -#include "WindTurbineType1or2Dynamics.hpp" #include "TurbineGovernorDynamics.hpp" +#include "WindTurbineType1or2Dynamics.hpp" using namespace CIMPP; -AsynchronousMachineDynamics::AsynchronousMachineDynamics(): AsynchronousMachine(nullptr), MechanicalLoadDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr), TurbineGovernorDynamics(nullptr) {}; - +AsynchronousMachineDynamics::AsynchronousMachineDynamics() : AsynchronousMachine(nullptr), MechanicalLoadDynamics(nullptr), TurbineGovernorDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr) {}; AsynchronousMachineDynamics::~AsynchronousMachineDynamics() {}; -bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass*, BaseClass*); -bool assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachine = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachine != nullptr) - return assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->MechanicalLoadDynamics = dynamic_cast(BaseClass_ptr2); - if(element->MechanicalLoadDynamics != nullptr) - return true; - } - return false; -} -bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2Dynamics != nullptr) - return true; - } - return false; -} -bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineGovernorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->TurbineGovernorDynamics != nullptr) - return true; - } - return false; -} +bool assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_AsynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachine != element2) + { + element->AsynchronousMachine = element2; + return assign_AsynchronousMachine_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + MechanicalLoadDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MechanicalLoadDynamics != element2) + { + element->MechanicalLoadDynamics = element2; + return assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineGovernorDynamics != element2) + { + element->TurbineGovernorDynamics = element2; + return assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* AsynchronousMachineDynamics_factory() { - return new AsynchronousMachineDynamics; +bool assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2Dynamics != element2) + { + element->WindTurbineType1or2Dynamics = element2; + return assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + +const char AsynchronousMachineDynamics::debugName[] = "AsynchronousMachineDynamics"; +const char* AsynchronousMachineDynamics::debugString() const +{ + return AsynchronousMachineDynamics::debugName; } -void AsynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics"), &AsynchronousMachineDynamics_factory)); } -void AsynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void AsynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void AsynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void AsynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.AsynchronousMachine"), &assign_AsynchronousMachineDynamics_AsynchronousMachine)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.MechanicalLoadDynamics"), &assign_AsynchronousMachineDynamics_MechanicalLoadDynamics)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.WindTurbineType1or2Dynamics"), &assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.TurbineGovernorDynamics"), &assign_AsynchronousMachineDynamics_TurbineGovernorDynamics)); -} - -const char AsynchronousMachineDynamics::debugName[] = "AsynchronousMachineDynamics"; -const char* AsynchronousMachineDynamics::debugString() -{ - return AsynchronousMachineDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineDynamics.WindTurbineType1or2Dynamics"), &assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics)); } const BaseClassDefiner AsynchronousMachineDynamics::declare() @@ -87,4 +118,10 @@ const BaseClassDefiner AsynchronousMachineDynamics::declare() return BaseClassDefiner(AsynchronousMachineDynamics::addConstructToMap, AsynchronousMachineDynamics::addPrimitiveAssignFnsToMap, AsynchronousMachineDynamics::addClassAssignFnsToMap, AsynchronousMachineDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineDynamics_factory() + { + return new AsynchronousMachineDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.hpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.hpp index 8febb5864..f38f33eab 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineDynamics.hpp @@ -1,44 +1,45 @@ #ifndef AsynchronousMachineDynamics_H #define AsynchronousMachineDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RotatingMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachine; + class MechanicalLoadDynamics; + class TurbineGovernorDynamics; + class WindTurbineType1or2Dynamics; -class AsynchronousMachine; -class MechanicalLoadDynamics; -class WindTurbineType1or2Dynamics; -class TurbineGovernorDynamics; /* Asynchronous machine whose behaviour is described by reference to a standard model expressed in either time constant reactance form or equivalent circuit form */ - class AsynchronousMachineDynamics: public RotatingMachineDynamics + class AsynchronousMachineDynamics : public RotatingMachineDynamics { - public: - CIMPP::AsynchronousMachine* AsynchronousMachine; /* Asynchronous machine to which this asynchronous machine dynamics model applies. Default: 0 */ - CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this asynchronous machine model. Default: 0 */ - CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator type 1 or 2 model associated with this asynchronous machine model. Default: 0 */ - CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor model associated with this asynchronous machine model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineDynamics(); - virtual ~AsynchronousMachineDynamics(); - + ~AsynchronousMachineDynamics() override; + + CIMPP::AsynchronousMachine* AsynchronousMachine; /* Asynchronous machine to which this asynchronous machine dynamics model applies. Default: 0 */ + CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this asynchronous machine model. Default: 0 */ + CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor model associated with this asynchronous machine model. Default: 0 */ + CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator type 1 or 2 model associated with this asynchronous machine model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.cpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.cpp index 30dd6fe46..b9fb954b4 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.cpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.cpp @@ -1,7 +1,11 @@ -#include -#include "AsynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineEquivalentCircuit.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -11,101 +15,102 @@ using namespace CIMPP; AsynchronousMachineEquivalentCircuit::AsynchronousMachineEquivalentCircuit() {}; - AsynchronousMachineEquivalentCircuit::~AsynchronousMachineEquivalentCircuit() {}; +bool assign_AsynchronousMachineEquivalentCircuit_rr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_rr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_xlr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xlr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_xlr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xlr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineEquivalentCircuit_xm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AsynchronousMachineEquivalentCircuit_xm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_rr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_xlr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xlr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_rr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineEquivalentCircuit_xlr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xlr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* AsynchronousMachineEquivalentCircuit_factory() { - return new AsynchronousMachineEquivalentCircuit; - } +const char AsynchronousMachineEquivalentCircuit::debugName[] = "AsynchronousMachineEquivalentCircuit"; +const char* AsynchronousMachineEquivalentCircuit::debugString() const +{ + return AsynchronousMachineEquivalentCircuit::debugName; } -void AsynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit"), &AsynchronousMachineEquivalentCircuit_factory)); } -void AsynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xm"), &assign_AsynchronousMachineEquivalentCircuit_xm)); +void AsynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.rr1"), &assign_AsynchronousMachineEquivalentCircuit_rr1)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xlr1"), &assign_AsynchronousMachineEquivalentCircuit_xlr1)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.rr2"), &assign_AsynchronousMachineEquivalentCircuit_rr2)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xlr1"), &assign_AsynchronousMachineEquivalentCircuit_xlr1)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xlr2"), &assign_AsynchronousMachineEquivalentCircuit_xlr2)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineEquivalentCircuit.xm"), &assign_AsynchronousMachineEquivalentCircuit_xm)); } -void AsynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char AsynchronousMachineEquivalentCircuit::debugName[] = "AsynchronousMachineEquivalentCircuit"; -const char* AsynchronousMachineEquivalentCircuit::debugString() +void AsynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachineEquivalentCircuit::debugName; } const BaseClassDefiner AsynchronousMachineEquivalentCircuit::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner AsynchronousMachineEquivalentCircuit::declare() return BaseClassDefiner(AsynchronousMachineEquivalentCircuit::addConstructToMap, AsynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap, AsynchronousMachineEquivalentCircuit::addClassAssignFnsToMap, AsynchronousMachineEquivalentCircuit::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineEquivalentCircuit_factory() + { + return new AsynchronousMachineEquivalentCircuit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.hpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.hpp index b35af9d7b..5519c7eba 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.hpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineEquivalentCircuit.hpp @@ -1,42 +1,43 @@ #ifndef AsynchronousMachineEquivalentCircuit_H #define AsynchronousMachineEquivalentCircuit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AsynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AsynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The electrical equations of all variations of the asynchronous model are based on the AsynchronousEquivalentCircuit diagram for the direct and quadrature axes, with two equivalent rotor windings in each axis. = + = + * / ( + ) = + * * / ( * + * + * ) = ( + ) / ( * ) = ( * + * + * ) / ( * * (+ ) Same equations using CIM attributes from AsynchronousMachineTimeConstantReactance class on left of = sign and AsynchronousMachineEquivalentCircuit class on right (except as noted): xs = xm + RotatingMachineDynamics.statorLeakageReactance xp = RotatingMachineDynamics.statorLeakageReactance + xm * xlr1 / (xm + xlr1) xpp = RotatingMachineDynamics.statorLeakageReactance + xm * xlr1* xlr2 / (xm * xlr1 + xm * xlr2 + xlr1 * xlr2) tpo = (xm + xlr1) / (2*pi*nominal frequency * rr1) tppo = (xm * xlr1 + xm * xlr2 + xlr1 * xlr2) / (2*pi*nominal frequency * rr2 * (xm + xlr1). */ - class AsynchronousMachineEquivalentCircuit: public AsynchronousMachineDynamics + class AsynchronousMachineEquivalentCircuit : public AsynchronousMachineDynamics { - public: - CIMPP::PU xm; /* Magnetizing reactance. Default: nullptr */ - CIMPP::PU rr1; /* Damper 1 winding resistance. Default: nullptr */ - CIMPP::PU xlr1; /* Damper 1 winding leakage reactance. Default: nullptr */ - CIMPP::PU rr2; /* Damper 2 winding resistance. Default: nullptr */ - CIMPP::PU xlr2; /* Damper 2 winding leakage reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineEquivalentCircuit(); - virtual ~AsynchronousMachineEquivalentCircuit(); - + ~AsynchronousMachineEquivalentCircuit() override; + + CIMPP::PU rr1; /* Damper 1 winding resistance. Default: nullptr */ + CIMPP::PU rr2; /* Damper 2 winding resistance. Default: nullptr */ + CIMPP::PU xlr1; /* Damper 1 winding leakage reactance. Default: nullptr */ + CIMPP::PU xlr2; /* Damper 2 winding leakage reactance. Default: nullptr */ + CIMPP::PU xm; /* Magnetizing reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineEquivalentCircuit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.cpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.cpp index 219cfc23e..d9b39ecb0 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.cpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::AsynchronousMachineKind& rop) +AsynchronousMachineKind& AsynchronousMachineKind::operator=(AsynchronousMachineKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +AsynchronousMachineKind::operator AsynchronousMachineKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char AsynchronousMachineKind::debugName[] = "AsynchronousMachineKind"; +const char* AsynchronousMachineKind::debugString() const +{ + return AsynchronousMachineKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, AsynchronousMachineKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const AsynchronousMachineKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == AsynchronousMachineKind::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == AsynchronousMachineKind::motor) + { + EnumSymbol = "motor"; + } + + if (!EnumSymbol.empty()) + { + os << "AsynchronousMachineKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.hpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.hpp index af35aae99..8b8e54e57 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.hpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineKind.hpp @@ -1,21 +1,46 @@ #ifndef AsynchronousMachineKind_H #define AsynchronousMachineKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Kind of Asynchronous Machine. */ - enum class AsynchronousMachineKind + class AsynchronousMachineKind { - /** - * The Asynchronous Machine is a generator. - */ - generator, - /** - * The Asynchronous Machine is a motor. - */ - motor, + public: + enum AsynchronousMachineKind_ENUM + { + /** + * The Asynchronous Machine is a generator. + */ + generator, + /** + * The Asynchronous Machine is a motor. + */ + motor, + }; + + AsynchronousMachineKind() : value(), initialized(false) {} + AsynchronousMachineKind(AsynchronousMachineKind_ENUM value) : value(value), initialized(true) {} + + AsynchronousMachineKind& operator=(AsynchronousMachineKind_ENUM rop); + operator AsynchronousMachineKind_ENUM() const; + + AsynchronousMachineKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, AsynchronousMachineKind& rop); + friend std::ostream& operator<<(std::ostream& os, const AsynchronousMachineKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::AsynchronousMachineKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.cpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.cpp index f5bfbc5d0..94ba0f056 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.cpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.cpp @@ -1,111 +1,116 @@ -#include -#include "AsynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineTimeConstantReactance.hpp" +#include +#include + +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; AsynchronousMachineTimeConstantReactance::AsynchronousMachineTimeConstantReactance() {}; - AsynchronousMachineTimeConstantReactance::~AsynchronousMachineTimeConstantReactance() {}; +bool assign_AsynchronousMachineTimeConstantReactance_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_xpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_AsynchronousMachineTimeConstantReactance_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_AsynchronousMachineTimeConstantReactance_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_xpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_AsynchronousMachineTimeConstantReactance_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* AsynchronousMachineTimeConstantReactance_factory() { - return new AsynchronousMachineTimeConstantReactance; - } +const char AsynchronousMachineTimeConstantReactance::debugName[] = "AsynchronousMachineTimeConstantReactance"; +const char* AsynchronousMachineTimeConstantReactance::debugString() const +{ + return AsynchronousMachineTimeConstantReactance::debugName; } -void AsynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance"), &AsynchronousMachineTimeConstantReactance_factory)); } -void AsynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xs"), &assign_AsynchronousMachineTimeConstantReactance_xs)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xp"), &assign_AsynchronousMachineTimeConstantReactance_xp)); - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xpp"), &assign_AsynchronousMachineTimeConstantReactance_xpp)); +void AsynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.tpo"), &assign_AsynchronousMachineTimeConstantReactance_tpo)); assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.tppo"), &assign_AsynchronousMachineTimeConstantReactance_tppo)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xp"), &assign_AsynchronousMachineTimeConstantReactance_xp)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xpp"), &assign_AsynchronousMachineTimeConstantReactance_xpp)); + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineTimeConstantReactance.xs"), &assign_AsynchronousMachineTimeConstantReactance_xs)); } -void AsynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char AsynchronousMachineTimeConstantReactance::debugName[] = "AsynchronousMachineTimeConstantReactance"; -const char* AsynchronousMachineTimeConstantReactance::debugString() +void AsynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachineTimeConstantReactance::debugName; } const BaseClassDefiner AsynchronousMachineTimeConstantReactance::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner AsynchronousMachineTimeConstantReactance::declare() return BaseClassDefiner(AsynchronousMachineTimeConstantReactance::addConstructToMap, AsynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap, AsynchronousMachineTimeConstantReactance::addClassAssignFnsToMap, AsynchronousMachineTimeConstantReactance::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineTimeConstantReactance_factory() + { + return new AsynchronousMachineTimeConstantReactance; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.hpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.hpp index 4f3e1237c..41439b66e 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.hpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineTimeConstantReactance.hpp @@ -1,43 +1,44 @@ #ifndef AsynchronousMachineTimeConstantReactance_H #define AsynchronousMachineTimeConstantReactance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AsynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AsynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The parameters used for models expressed in time constant reactance form include: */ - class AsynchronousMachineTimeConstantReactance: public AsynchronousMachineDynamics + class AsynchronousMachineTimeConstantReactance : public AsynchronousMachineDynamics { - public: - CIMPP::PU xs; /* Synchronous reactance (Xs) (>= X`). Typical Value = 1.8. Default: nullptr */ - CIMPP::PU xp; /* Transient reactance (unsaturated) (X`) (>=X``). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU xpp; /* Subtransient reactance (unsaturated) (X``) (> Xl). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tpo; /* Transient rotor time constant (T`o) (> T``o). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tppo; /* Subtransient rotor time constant (T``o) (> 0). Typical Value = 0.03. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineTimeConstantReactance(); - virtual ~AsynchronousMachineTimeConstantReactance(); - + ~AsynchronousMachineTimeConstantReactance() override; + + CIMPP::Seconds tpo; /* Transient rotor time constant (T`o) (> T``o). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tppo; /* Subtransient rotor time constant (T``o) (> 0). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU xp; /* Transient reactance (unsaturated) (X`) (>=X``). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU xpp; /* Subtransient reactance (unsaturated) (X``) (> Xl). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU xs; /* Synchronous reactance (Xs) (>= X`). Typical Value = 1.8. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineTimeConstantReactance_factory(); diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.cpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.cpp index 6d883be59..d156c07b9 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "AsynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "AsynchronousMachineUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; AsynchronousMachineUserDefined::AsynchronousMachineUserDefined() {}; - AsynchronousMachineUserDefined::~AsynchronousMachineUserDefined() {}; -bool assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_AsynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_AsynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass*, BaseClass*); +bool assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + AsynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* AsynchronousMachineUserDefined_factory() { - return new AsynchronousMachineUserDefined; - } +const char AsynchronousMachineUserDefined::debugName[] = "AsynchronousMachineUserDefined"; +const char* AsynchronousMachineUserDefined::debugString() const +{ + return AsynchronousMachineUserDefined::debugName; } -void AsynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void AsynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined"), &AsynchronousMachineUserDefined_factory)); } -void AsynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void AsynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined.proprietary"), &assign_AsynchronousMachineUserDefined_proprietary)); - } - -void AsynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics)); } -const char AsynchronousMachineUserDefined::debugName[] = "AsynchronousMachineUserDefined"; -const char* AsynchronousMachineUserDefined::debugString() +void AsynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return AsynchronousMachineUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:AsynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner AsynchronousMachineUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner AsynchronousMachineUserDefined::declare() return BaseClassDefiner(AsynchronousMachineUserDefined::addConstructToMap, AsynchronousMachineUserDefined::addPrimitiveAssignFnsToMap, AsynchronousMachineUserDefined::addClassAssignFnsToMap, AsynchronousMachineUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* AsynchronousMachineUserDefined_factory() + { + return new AsynchronousMachineUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.hpp b/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.hpp index 41cb98f81..cd49c741b 100644 --- a/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/AsynchronousMachineUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef AsynchronousMachineUserDefined_H #define AsynchronousMachineUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AsynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AsynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Asynchronous machine whose dynamic behaviour is described by a user-defined model. */ - class AsynchronousMachineUserDefined: public AsynchronousMachineDynamics + class AsynchronousMachineUserDefined : public AsynchronousMachineDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ AsynchronousMachineUserDefined(); - virtual ~AsynchronousMachineUserDefined(); - + ~AsynchronousMachineUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* AsynchronousMachineUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/BaseVoltage.cpp b/CGMES_2.4.15_27JAN2020/BaseVoltage.cpp index 6b1513f67..606b000c3 100644 --- a/CGMES_2.4.15_27JAN2020/BaseVoltage.cpp +++ b/CGMES_2.4.15_27JAN2020/BaseVoltage.cpp @@ -1,103 +1,132 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BaseVoltage.hpp" -#include "Voltage.hpp" +#include +#include + #include "ConductingEquipment.hpp" -#include "VoltageLevel.hpp" -#include "TransformerEnd.hpp" #include "TopologicalNode.hpp" +#include "TransformerEnd.hpp" +#include "VoltageLevel.hpp" +#include "Voltage.hpp" using namespace CIMPP; BaseVoltage::BaseVoltage() {}; - BaseVoltage::~BaseVoltage() {}; -bool assign_BaseVoltage_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConductingEquipment.push_back(dynamic_cast(BaseClass_ptr2)); + + + +bool assign_BaseVoltage_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalVoltage; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_BaseVoltage_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VoltageLevel.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + +bool assign_ConductingEquipment_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + ConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConductingEquipment.begin(), element->ConductingEquipment.end(), element2) == element->ConductingEquipment.end()) + { + element->ConductingEquipment.push_back(element2); + return assign_ConductingEquipment_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_BaseVoltage_TransformerEnds(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TransformerEnds.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNode.begin(), element->TopologicalNode.end(), element2) == element->TopologicalNode.end()) + { + element->TopologicalNode.push_back(element2); + return assign_TopologicalNode_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_BaseVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TransformerEnd_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_TransformerEnds(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TransformerEnds.begin(), element->TransformerEnds.end(), element2) == element->TransformerEnds.end()) + { + element->TransformerEnds.push_back(element2); + return assign_TransformerEnd_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - -bool assign_BaseVoltage_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BaseVoltage* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalVoltage; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_VoltageLevel_BaseVoltage(BaseClass*, BaseClass*); +bool assign_BaseVoltage_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BaseVoltage* element = dynamic_cast(BaseClass_ptr1); + VoltageLevel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VoltageLevel.begin(), element->VoltageLevel.end(), element2) == element->VoltageLevel.end()) + { + element->VoltageLevel.push_back(element2); + return assign_VoltageLevel_BaseVoltage(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* BaseVoltage_factory() { - return new BaseVoltage; - } +const char BaseVoltage::debugName[] = "BaseVoltage"; +const char* BaseVoltage::debugString() const +{ + return BaseVoltage::debugName; } -void BaseVoltage::addConstructToMap(std::unordered_map& factory_map) { +void BaseVoltage::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BaseVoltage"), &BaseVoltage_factory)); } -void BaseVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void BaseVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.nominalVoltage"), &assign_BaseVoltage_nominalVoltage)); - } - -void BaseVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.ConductingEquipment"), &assign_BaseVoltage_ConductingEquipment)); - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.VoltageLevel"), &assign_BaseVoltage_VoltageLevel)); - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TransformerEnds"), &assign_BaseVoltage_TransformerEnds)); - assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TopologicalNode"), &assign_BaseVoltage_TopologicalNode)); } -const char BaseVoltage::debugName[] = "BaseVoltage"; -const char* BaseVoltage::debugString() +void BaseVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BaseVoltage::debugName; + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.ConductingEquipment"), &assign_BaseVoltage_ConductingEquipment)); + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TopologicalNode"), &assign_BaseVoltage_TopologicalNode)); + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.TransformerEnds"), &assign_BaseVoltage_TransformerEnds)); + assign_map.insert(std::make_pair(std::string("cim:BaseVoltage.VoltageLevel"), &assign_BaseVoltage_VoltageLevel)); } const BaseClassDefiner BaseVoltage::declare() @@ -105,4 +134,10 @@ const BaseClassDefiner BaseVoltage::declare() return BaseClassDefiner(BaseVoltage::addConstructToMap, BaseVoltage::addPrimitiveAssignFnsToMap, BaseVoltage::addClassAssignFnsToMap, BaseVoltage::debugName); } - +namespace CIMPP +{ + BaseClass* BaseVoltage_factory() + { + return new BaseVoltage; + } +} diff --git a/CGMES_2.4.15_27JAN2020/BaseVoltage.hpp b/CGMES_2.4.15_27JAN2020/BaseVoltage.hpp index 11ec6714e..063a85c09 100644 --- a/CGMES_2.4.15_27JAN2020/BaseVoltage.hpp +++ b/CGMES_2.4.15_27JAN2020/BaseVoltage.hpp @@ -1,46 +1,47 @@ #ifndef BaseVoltage_H #define BaseVoltage_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ConductingEquipment; + class TopologicalNode; + class TransformerEnd; + class VoltageLevel; - -class ConductingEquipment; -class VoltageLevel; -class TransformerEnd; -class TopologicalNode; /* Defines a system base voltage which is referenced. */ - class BaseVoltage: public IdentifiedObject + class BaseVoltage : public IdentifiedObject { - public: - CIMPP::Voltage nominalVoltage; /* The power system resource`s base voltage. Default: nullptr */ - std::list ConductingEquipment; /* Base voltage of this conducting equipment. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ - std::list VoltageLevel; /* The voltage levels having this base voltage. Default: 0 */ - std::list TransformerEnds; /* Transformer ends at the base voltage. This is essential for PU calculation. Default: 0 */ - std::list TopologicalNode; /* The topological nodes at the base voltage. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BaseVoltage(); - virtual ~BaseVoltage(); - + ~BaseVoltage() override; + + std::list ConductingEquipment; /* Base voltage of this conducting equipment. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ + std::list TopologicalNode; /* The topological nodes at the base voltage. Default: 0 */ + std::list TransformerEnds; /* Transformer ends at the base voltage. This is essential for PU calculation. Default: 0 */ + std::list VoltageLevel; /* The voltage levels having this base voltage. Default: 0 */ + CIMPP::Voltage nominalVoltage; /* The power system resource`s base voltage. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BaseVoltage_factory(); diff --git a/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.cpp b/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.cpp index 8d87cdc00..a860a0268 100644 --- a/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.cpp @@ -1,78 +1,84 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BasicIntervalSchedule.hpp" +#include +#include + #include "DateTime.hpp" #include "UnitSymbol.hpp" #include "UnitSymbol.hpp" using namespace CIMPP; -BasicIntervalSchedule::BasicIntervalSchedule(): startTime(nullptr) {}; - +BasicIntervalSchedule::BasicIntervalSchedule() {}; BasicIntervalSchedule::~BasicIntervalSchedule() {}; -bool assign_BasicIntervalSchedule_startTime(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->startTime = dynamic_cast(BaseClass_ptr2); - if(element->startTime != nullptr) - return true; - } - return false; +bool assign_BasicIntervalSchedule_startTime(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + element->startTime = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_BasicIntervalSchedule_value1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value1Unit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_BasicIntervalSchedule_value2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value2Unit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_BasicIntervalSchedule_value1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value1Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_BasicIntervalSchedule_value2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BasicIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value2Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* BasicIntervalSchedule_factory() { - return new BasicIntervalSchedule; - } +const char BasicIntervalSchedule::debugName[] = "BasicIntervalSchedule"; +const char* BasicIntervalSchedule::debugString() const +{ + return BasicIntervalSchedule::debugName; } -void BasicIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) { +void BasicIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule"), &BasicIntervalSchedule_factory)); } -void BasicIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.value1Unit"), &assign_BasicIntervalSchedule_value1Unit)); +void BasicIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.startTime"), &assign_BasicIntervalSchedule_startTime)); + assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.value1Unit"), &assign_BasicIntervalSchedule_value1Unit)); assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.value2Unit"), &assign_BasicIntervalSchedule_value2Unit)); } -void BasicIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BasicIntervalSchedule.startTime"), &assign_BasicIntervalSchedule_startTime)); - } - -const char BasicIntervalSchedule::debugName[] = "BasicIntervalSchedule"; -const char* BasicIntervalSchedule::debugString() +void BasicIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BasicIntervalSchedule::debugName; } const BaseClassDefiner BasicIntervalSchedule::declare() @@ -80,4 +86,10 @@ const BaseClassDefiner BasicIntervalSchedule::declare() return BaseClassDefiner(BasicIntervalSchedule::addConstructToMap, BasicIntervalSchedule::addPrimitiveAssignFnsToMap, BasicIntervalSchedule::addClassAssignFnsToMap, BasicIntervalSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* BasicIntervalSchedule_factory() + { + return new BasicIntervalSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.hpp b/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.hpp index ab0558475..f6234c2db 100644 --- a/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/BasicIntervalSchedule.hpp @@ -1,41 +1,42 @@ #ifndef BasicIntervalSchedule_H #define BasicIntervalSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "DateTime.hpp" #include "UnitSymbol.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class DateTime; /* Schedule of values at points in time. */ - class BasicIntervalSchedule: public IdentifiedObject + class BasicIntervalSchedule : public IdentifiedObject { - public: - CIMPP::DateTime* startTime; /* The time for the first time point. Default: '' */ - CIMPP::UnitSymbol value1Unit; /* Value1 units of measure. Default: 0 */ - CIMPP::UnitSymbol value2Unit; /* Value2 units of measure. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BasicIntervalSchedule(); - virtual ~BasicIntervalSchedule(); - + ~BasicIntervalSchedule() override; + + CIMPP::DateTime startTime; /* The time for the first time point. Default: '' */ + CIMPP::UnitSymbol value1Unit; /* Value1 units of measure. Default: 0 */ + CIMPP::UnitSymbol value2Unit; /* Value2 units of measure. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BasicIntervalSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Bay.cpp b/CGMES_2.4.15_27JAN2020/Bay.cpp index 14dddc78f..0213393ce 100644 --- a/CGMES_2.4.15_27JAN2020/Bay.cpp +++ b/CGMES_2.4.15_27JAN2020/Bay.cpp @@ -1,49 +1,56 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Bay.hpp" +#include +#include + #include "VoltageLevel.hpp" using namespace CIMPP; -Bay::Bay(): VoltageLevel(nullptr) {}; - +Bay::Bay() : VoltageLevel(nullptr) {}; Bay::~Bay() {}; -bool assign_VoltageLevel_Bays(BaseClass*, BaseClass*); -bool assign_Bay_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Bay* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageLevel = dynamic_cast(BaseClass_ptr2); - if(element->VoltageLevel != nullptr) - return assign_VoltageLevel_Bays(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* Bay_factory() { - return new Bay; +bool assign_VoltageLevel_Bays(BaseClass*, BaseClass*); +bool assign_Bay_VoltageLevel(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Bay* element = dynamic_cast(BaseClass_ptr1); + VoltageLevel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageLevel != element2) + { + element->VoltageLevel = element2; + return assign_VoltageLevel_Bays(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void Bay::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:Bay"), &Bay_factory)); +const char Bay::debugName[] = "Bay"; +const char* Bay::debugString() const +{ + return Bay::debugName; } -void Bay::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void Bay::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:Bay"), &Bay_factory)); +} -void Bay::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Bay.VoltageLevel"), &assign_Bay_VoltageLevel)); +void Bay::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Bay::debugName[] = "Bay"; -const char* Bay::debugString() +void Bay::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Bay::debugName; + assign_map.insert(std::make_pair(std::string("cim:Bay.VoltageLevel"), &assign_Bay_VoltageLevel)); } const BaseClassDefiner Bay::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner Bay::declare() return BaseClassDefiner(Bay::addConstructToMap, Bay::addPrimitiveAssignFnsToMap, Bay::addClassAssignFnsToMap, Bay::debugName); } - +namespace CIMPP +{ + BaseClass* Bay_factory() + { + return new Bay; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Bay.hpp b/CGMES_2.4.15_27JAN2020/Bay.hpp index b3bcfc4fe..4f08b2d5e 100644 --- a/CGMES_2.4.15_27JAN2020/Bay.hpp +++ b/CGMES_2.4.15_27JAN2020/Bay.hpp @@ -1,38 +1,39 @@ #ifndef Bay_H #define Bay_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class VoltageLevel; -class VoltageLevel; /* A collection of power system resources (within a given substation) including conducting equipment, protection relays, measurements, and telemetry. A bay typically represents a physical grouping related to modularization of equipment. */ - class Bay: public EquipmentContainer + class Bay : public EquipmentContainer { - public: - CIMPP::VoltageLevel* VoltageLevel; /* The voltage level containing this bay. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Bay(); - virtual ~Bay(); - + ~Bay() override; + + CIMPP::VoltageLevel* VoltageLevel; /* The voltage level containing this bay. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Bay_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Breaker.cpp b/CGMES_2.4.15_27JAN2020/Breaker.cpp index d45b7e553..ecee41d5b 100644 --- a/CGMES_2.4.15_27JAN2020/Breaker.cpp +++ b/CGMES_2.4.15_27JAN2020/Breaker.cpp @@ -1,36 +1,36 @@ -#include -#include "ProtectedSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Breaker.hpp" +#include +#include + using namespace CIMPP; Breaker::Breaker() {}; - Breaker::~Breaker() {}; -namespace CIMPP { - BaseClass* Breaker_factory() { - return new Breaker; - } +const char Breaker::debugName[] = "Breaker"; +const char* Breaker::debugString() const +{ + return Breaker::debugName; } -void Breaker::addConstructToMap(std::unordered_map& factory_map) { +void Breaker::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Breaker"), &Breaker_factory)); } -void Breaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Breaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Breaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Breaker::debugName[] = "Breaker"; -const char* Breaker::debugString() +void Breaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Breaker::debugName; } const BaseClassDefiner Breaker::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Breaker::declare() return BaseClassDefiner(Breaker::addConstructToMap, Breaker::addPrimitiveAssignFnsToMap, Breaker::addClassAssignFnsToMap, Breaker::debugName); } - +namespace CIMPP +{ + BaseClass* Breaker_factory() + { + return new Breaker; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Breaker.hpp b/CGMES_2.4.15_27JAN2020/Breaker.hpp index 3f4783b3a..b1047a3fd 100644 --- a/CGMES_2.4.15_27JAN2020/Breaker.hpp +++ b/CGMES_2.4.15_27JAN2020/Breaker.hpp @@ -1,36 +1,37 @@ #ifndef Breaker_H #define Breaker_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ProtectedSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ProtectedSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A mechanical switching device capable of making, carrying, and breaking currents under normal circuit conditions and also making, carrying for a specified time, and breaking currents under specified abnormal circuit conditions e.g. those of short circuit. */ - class Breaker: public ProtectedSwitch + class Breaker : public ProtectedSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Breaker(); - virtual ~Breaker(); - + ~Breaker() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Breaker_factory(); diff --git a/CGMES_2.4.15_27JAN2020/BusNameMarker.cpp b/CGMES_2.4.15_27JAN2020/BusNameMarker.cpp index 2277d6c25..a3e65dbd1 100644 --- a/CGMES_2.4.15_27JAN2020/BusNameMarker.cpp +++ b/CGMES_2.4.15_27JAN2020/BusNameMarker.cpp @@ -1,77 +1,92 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BusNameMarker.hpp" -#include "Integer.hpp" +#include +#include + #include "ReportingGroup.hpp" #include "ACDCTerminal.hpp" +#include "Integer.hpp" using namespace CIMPP; -BusNameMarker::BusNameMarker(): ReportingGroup(nullptr) {}; - +BusNameMarker::BusNameMarker() : ReportingGroup(nullptr) {}; BusNameMarker::~BusNameMarker() {}; -bool assign_ReportingGroup_BusNameMarker(BaseClass*, BaseClass*); -bool assign_BusNameMarker_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) { - element->ReportingGroup = dynamic_cast(BaseClass_ptr2); - if(element->ReportingGroup != nullptr) - return assign_ReportingGroup_BusNameMarker(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_BusNameMarker_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminal.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_BusNameMarker_priority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->priority; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_BusNameMarker_priority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BusNameMarker* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->priority; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ReportingGroup_BusNameMarker(BaseClass*, BaseClass*); +bool assign_BusNameMarker_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BusNameMarker* element = dynamic_cast(BaseClass_ptr1); + ReportingGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ReportingGroup != element2) + { + element->ReportingGroup = element2; + return assign_ReportingGroup_BusNameMarker(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_ACDCTerminal_BusNameMarker(BaseClass*, BaseClass*); +bool assign_BusNameMarker_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + BusNameMarker* element = dynamic_cast(BaseClass_ptr1); + ACDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminal.begin(), element->Terminal.end(), element2) == element->Terminal.end()) + { + element->Terminal.push_back(element2); + return assign_ACDCTerminal_BusNameMarker(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* BusNameMarker_factory() { - return new BusNameMarker; - } +const char BusNameMarker::debugName[] = "BusNameMarker"; +const char* BusNameMarker::debugString() const +{ + return BusNameMarker::debugName; } -void BusNameMarker::addConstructToMap(std::unordered_map& factory_map) { +void BusNameMarker::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BusNameMarker"), &BusNameMarker_factory)); } -void BusNameMarker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void BusNameMarker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.priority"), &assign_BusNameMarker_priority)); - } - -void BusNameMarker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.ReportingGroup"), &assign_BusNameMarker_ReportingGroup)); - assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.Terminal"), &assign_BusNameMarker_Terminal)); } -const char BusNameMarker::debugName[] = "BusNameMarker"; -const char* BusNameMarker::debugString() +void BusNameMarker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BusNameMarker::debugName; + assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.ReportingGroup"), &assign_BusNameMarker_ReportingGroup)); + assign_map.insert(std::make_pair(std::string("cim:BusNameMarker.Terminal"), &assign_BusNameMarker_Terminal)); } const BaseClassDefiner BusNameMarker::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner BusNameMarker::declare() return BaseClassDefiner(BusNameMarker::addConstructToMap, BusNameMarker::addPrimitiveAssignFnsToMap, BusNameMarker::addClassAssignFnsToMap, BusNameMarker::debugName); } - +namespace CIMPP +{ + BaseClass* BusNameMarker_factory() + { + return new BusNameMarker; + } +} diff --git a/CGMES_2.4.15_27JAN2020/BusNameMarker.hpp b/CGMES_2.4.15_27JAN2020/BusNameMarker.hpp index 992a10da9..353cf9798 100644 --- a/CGMES_2.4.15_27JAN2020/BusNameMarker.hpp +++ b/CGMES_2.4.15_27JAN2020/BusNameMarker.hpp @@ -1,42 +1,43 @@ #ifndef BusNameMarker_H #define BusNameMarker_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ACDCTerminal; + class ReportingGroup; - -class ReportingGroup; -class ACDCTerminal; /* Used to apply user standard names to topology buses. Typically used for "bus/branch" case generation. Associated with one or more terminals that are normally connected with the bus name. The associated terminals are normally connected by non-retained switches. For a ring bus station configuration, all busbar terminals in the ring are typically associated. For a breaker and a half scheme, both busbars would normally be associated. For a ring bus, all busbars would normally be associated. For a "straight" busbar configuration, normally only the main terminal at the busbar would be associated. */ - class BusNameMarker: public IdentifiedObject + class BusNameMarker : public IdentifiedObject { - public: - CIMPP::Integer priority; /* Priority of bus name marker for use as topology bus name. Use 0 for don t care. Use 1 for highest priority. Use 2 as priority is less than 1 and so on. Default: 0 */ - CIMPP::ReportingGroup* ReportingGroup; /* The bus name markers that belong to this reporting group. Default: 0 */ - std::list Terminal; /* The terminals associated with this bus name marker. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BusNameMarker(); - virtual ~BusNameMarker(); - + ~BusNameMarker() override; + + CIMPP::ReportingGroup* ReportingGroup; /* The bus name markers that belong to this reporting group. Default: 0 */ + std::list Terminal; /* The terminals associated with this bus name marker. Default: 0 */ + CIMPP::Integer priority; /* Priority of bus name marker for use as topology bus name. Use 0 for don t care. Use 1 for highest priority. Use 2 as priority is less than 1 and so on. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BusNameMarker_factory(); diff --git a/CGMES_2.4.15_27JAN2020/BusbarSection.cpp b/CGMES_2.4.15_27JAN2020/BusbarSection.cpp index 2b6e7a9a0..eff584525 100644 --- a/CGMES_2.4.15_27JAN2020/BusbarSection.cpp +++ b/CGMES_2.4.15_27JAN2020/BusbarSection.cpp @@ -1,51 +1,52 @@ -#include -#include "Connector.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "BusbarSection.hpp" +#include +#include + #include "CurrentFlow.hpp" using namespace CIMPP; BusbarSection::BusbarSection() {}; - BusbarSection::~BusbarSection() {}; +bool assign_BusbarSection_ipMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (BusbarSection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ipMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_BusbarSection_ipMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(BusbarSection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ipMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* BusbarSection_factory() { - return new BusbarSection; - } +const char BusbarSection::debugName[] = "BusbarSection"; +const char* BusbarSection::debugString() const +{ + return BusbarSection::debugName; } -void BusbarSection::addConstructToMap(std::unordered_map& factory_map) { +void BusbarSection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:BusbarSection"), &BusbarSection_factory)); } -void BusbarSection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void BusbarSection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:BusbarSection.ipMax"), &assign_BusbarSection_ipMax)); } -void BusbarSection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char BusbarSection::debugName[] = "BusbarSection"; -const char* BusbarSection::debugString() +void BusbarSection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return BusbarSection::debugName; } const BaseClassDefiner BusbarSection::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner BusbarSection::declare() return BaseClassDefiner(BusbarSection::addConstructToMap, BusbarSection::addPrimitiveAssignFnsToMap, BusbarSection::addClassAssignFnsToMap, BusbarSection::debugName); } - +namespace CIMPP +{ + BaseClass* BusbarSection_factory() + { + return new BusbarSection; + } +} diff --git a/CGMES_2.4.15_27JAN2020/BusbarSection.hpp b/CGMES_2.4.15_27JAN2020/BusbarSection.hpp index aa0d1e41f..46d62de78 100644 --- a/CGMES_2.4.15_27JAN2020/BusbarSection.hpp +++ b/CGMES_2.4.15_27JAN2020/BusbarSection.hpp @@ -1,38 +1,39 @@ #ifndef BusbarSection_H #define BusbarSection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Connector.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Connector.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation. Voltage measurements are typically obtained from VoltageTransformers that are connected to busbar sections. A bus bar section may have many physical terminals but for analysis is modelled with exactly one logical terminal. */ - class BusbarSection: public Connector + class BusbarSection : public Connector { - public: - CIMPP::CurrentFlow ipMax; /* Maximum allowable peak short-circuit current of busbar (Ipmax in the IEC 60909-0). Mechanical limit of the busbar in the substation itself. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ BusbarSection(); - virtual ~BusbarSection(); - + ~BusbarSection() override; + + CIMPP::CurrentFlow ipMax; /* Maximum allowable peak short-circuit current of busbar (Ipmax in the IEC 60909-0). Mechanical limit of the busbar in the substation itself. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* BusbarSection_factory(); diff --git a/CGMES_2.4.15_27JAN2020/CIMClassList.hpp b/CGMES_2.4.15_27JAN2020/CIMClassList.hpp index 959524475..8a65daee6 100644 --- a/CGMES_2.4.15_27JAN2020/CIMClassList.hpp +++ b/CGMES_2.4.15_27JAN2020/CIMClassList.hpp @@ -1,440 +1,409 @@ #ifndef CIMCLASSLIST_H #define CIMCLASSLIST_H -using namespace CIMPP; +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include -static std::list CIMClassList = { - ACDCConverter::declare(), - ACDCConverterDCTerminal::declare(), - ACDCTerminal::declare(), - ACLineSegment::declare(), - Accumulator::declare(), - AccumulatorLimit::declare(), - AccumulatorLimitSet::declare(), - AccumulatorReset::declare(), - AccumulatorValue::declare(), - ActivePower::declare(), - ActivePowerLimit::declare(), - ActivePowerPerCurrentFlow::declare(), - ActivePowerPerFrequency::declare(), - Analog::declare(), - AnalogControl::declare(), - AnalogLimit::declare(), - AnalogLimitSet::declare(), - AnalogValue::declare(), - AngleDegrees::declare(), - AngleRadians::declare(), - ApparentPower::declare(), - ApparentPowerLimit::declare(), - Area::declare(), - AsynchronousMachine::declare(), - AsynchronousMachineDynamics::declare(), - AsynchronousMachineEquivalentCircuit::declare(), - AsynchronousMachineTimeConstantReactance::declare(), - AsynchronousMachineUserDefined::declare(), - BaseVoltage::declare(), - BasicIntervalSchedule::declare(), - Bay::declare(), - Boolean::declare(), - Breaker::declare(), - BusNameMarker::declare(), - BusbarSection::declare(), - Capacitance::declare(), - CapacitancePerLength::declare(), - Command::declare(), - Conductance::declare(), - ConductingEquipment::declare(), - Conductor::declare(), - ConformLoad::declare(), - ConformLoadGroup::declare(), - ConformLoadSchedule::declare(), - ConnectivityNode::declare(), - ConnectivityNodeContainer::declare(), - Connector::declare(), - Control::declare(), - ControlArea::declare(), - ControlAreaGeneratingUnit::declare(), - CoordinateSystem::declare(), - CsConverter::declare(), - CurrentFlow::declare(), - CurrentLimit::declare(), - Curve::declare(), - CurveData::declare(), - DCBaseTerminal::declare(), - DCBreaker::declare(), - DCBusbar::declare(), - DCChopper::declare(), - DCConductingEquipment::declare(), - DCConverterUnit::declare(), - DCDisconnector::declare(), - DCEquipmentContainer::declare(), - DCGround::declare(), - DCLine::declare(), - DCLineSegment::declare(), - DCNode::declare(), - DCSeriesDevice::declare(), - DCShunt::declare(), - DCSwitch::declare(), - DCTerminal::declare(), - DCTopologicalIsland::declare(), - DCTopologicalNode::declare(), - Date::declare(), - DateTime::declare(), - DayType::declare(), - Decimal::declare(), - Diagram::declare(), - DiagramLayoutVersion::declare(), - DiagramObject::declare(), - DiagramObjectGluePoint::declare(), - DiagramObjectPoint::declare(), - DiagramObjectStyle::declare(), - DiagramStyle::declare(), - DiscExcContIEEEDEC1A::declare(), - DiscExcContIEEEDEC2A::declare(), - DiscExcContIEEEDEC3A::declare(), - Disconnector::declare(), - DiscontinuousExcitationControlDynamics::declare(), - DiscontinuousExcitationControlUserDefined::declare(), - Discrete::declare(), - DiscreteValue::declare(), - DynamicsFunctionBlock::declare(), - DynamicsVersion::declare(), - EarthFaultCompensator::declare(), - EnergyArea::declare(), - EnergyConsumer::declare(), - EnergySchedulingType::declare(), - EnergySource::declare(), - Equipment::declare(), - EquipmentBoundaryVersion::declare(), - EquipmentContainer::declare(), - EquipmentVersion::declare(), - EquivalentBranch::declare(), - EquivalentEquipment::declare(), - EquivalentInjection::declare(), - EquivalentNetwork::declare(), - EquivalentShunt::declare(), - ExcAC1A::declare(), - ExcAC2A::declare(), - ExcAC3A::declare(), - ExcAC4A::declare(), - ExcAC5A::declare(), - ExcAC6A::declare(), - ExcAC8B::declare(), - ExcANS::declare(), - ExcAVR1::declare(), - ExcAVR2::declare(), - ExcAVR3::declare(), - ExcAVR4::declare(), - ExcAVR5::declare(), - ExcAVR7::declare(), - ExcBBC::declare(), - ExcCZ::declare(), - ExcDC1A::declare(), - ExcDC2A::declare(), - ExcDC3A1::declare(), - ExcDC3A::declare(), - ExcELIN1::declare(), - ExcELIN2::declare(), - ExcHU::declare(), - ExcIEEEAC1A::declare(), - ExcIEEEAC2A::declare(), - ExcIEEEAC3A::declare(), - ExcIEEEAC4A::declare(), - ExcIEEEAC5A::declare(), - ExcIEEEAC6A::declare(), - ExcIEEEAC7B::declare(), - ExcIEEEAC8B::declare(), - ExcIEEEDC1A::declare(), - ExcIEEEDC2A::declare(), - ExcIEEEDC3A::declare(), - ExcIEEEDC4B::declare(), - ExcIEEEST1A::declare(), - ExcIEEEST2A::declare(), - ExcIEEEST3A::declare(), - ExcIEEEST4B::declare(), - ExcIEEEST5B::declare(), - ExcIEEEST6B::declare(), - ExcIEEEST7B::declare(), - ExcOEX3T::declare(), - ExcPIC::declare(), - ExcREXS::declare(), - ExcSCRX::declare(), - ExcSEXS::declare(), - ExcSK::declare(), - ExcST1A::declare(), - ExcST2A::declare(), - ExcST3A::declare(), - ExcST4B::declare(), - ExcST6B::declare(), - ExcST7B::declare(), - ExcitationSystemDynamics::declare(), - ExcitationSystemUserDefined::declare(), - ExternalNetworkInjection::declare(), - Float::declare(), - FossilFuel::declare(), - Frequency::declare(), - GenICompensationForGenJ::declare(), - GeneratingUnit::declare(), - GeographicalLocationVersion::declare(), - GeographicalRegion::declare(), - GovCT1::declare(), - GovCT2::declare(), - GovGAST1::declare(), - GovGAST2::declare(), - GovGAST3::declare(), - GovGAST4::declare(), - GovGAST::declare(), - GovGASTWD::declare(), - GovHydro1::declare(), - GovHydro2::declare(), - GovHydro3::declare(), - GovHydro4::declare(), - GovHydroDD::declare(), - GovHydroFrancis::declare(), - GovHydroIEEE0::declare(), - GovHydroIEEE2::declare(), - GovHydroPID2::declare(), - GovHydroPID::declare(), - GovHydroPelton::declare(), - GovHydroR::declare(), - GovHydroWEH::declare(), - GovHydroWPID::declare(), - GovSteam0::declare(), - GovSteam1::declare(), - GovSteam2::declare(), - GovSteamCC::declare(), - GovSteamEU::declare(), - GovSteamFV2::declare(), - GovSteamFV3::declare(), - GovSteamFV4::declare(), - GovSteamIEEE1::declare(), - GovSteamSGO::declare(), - GrossToNetActivePowerCurve::declare(), - Ground::declare(), - GroundDisconnector::declare(), - GroundingImpedance::declare(), - HydroGeneratingUnit::declare(), - HydroPowerPlant::declare(), - HydroPump::declare(), - IdentifiedObject::declare(), - Inductance::declare(), - InductancePerLength::declare(), - Integer::declare(), - Junction::declare(), - Length::declare(), - Limit::declare(), - LimitSet::declare(), - Line::declare(), - LinearShuntCompensator::declare(), - LoadAggregate::declare(), - LoadArea::declare(), - LoadBreakSwitch::declare(), - LoadComposite::declare(), - LoadDynamics::declare(), - LoadGenericNonLinear::declare(), - LoadGroup::declare(), - LoadMotor::declare(), - LoadResponseCharacteristic::declare(), - LoadStatic::declare(), - LoadUserDefined::declare(), - Location::declare(), - Measurement::declare(), - MeasurementValue::declare(), - MeasurementValueQuality::declare(), - MeasurementValueSource::declare(), - MechLoad1::declare(), - MechanicalLoadDynamics::declare(), - MechanicalLoadUserDefined::declare(), - Money::declare(), - MonthDay::declare(), - MutualCoupling::declare(), - NonConformLoad::declare(), - NonConformLoadGroup::declare(), - NonConformLoadSchedule::declare(), - NonlinearShuntCompensator::declare(), - NonlinearShuntCompensatorPoint::declare(), - NuclearGeneratingUnit::declare(), - OperationalLimit::declare(), - OperationalLimitSet::declare(), - OperationalLimitType::declare(), - OverexcLim2::declare(), - OverexcLimIEEE::declare(), - OverexcLimX1::declare(), - OverexcLimX2::declare(), - OverexcitationLimiterDynamics::declare(), - OverexcitationLimiterUserDefined::declare(), - PFVArControllerType1Dynamics::declare(), - PFVArControllerType1UserDefined::declare(), - PFVArControllerType2Dynamics::declare(), - PFVArControllerType2UserDefined::declare(), - PFVArType1IEEEPFController::declare(), - PFVArType1IEEEVArController::declare(), - PFVArType2Common1::declare(), - PFVArType2IEEEPFController::declare(), - PFVArType2IEEEVArController::declare(), - PU::declare(), - PerCent::declare(), - PerLengthDCLineParameter::declare(), - PetersenCoil::declare(), - PhaseTapChanger::declare(), - PhaseTapChangerAsymmetrical::declare(), - PhaseTapChangerLinear::declare(), - PhaseTapChangerNonLinear::declare(), - PhaseTapChangerSymmetrical::declare(), - PhaseTapChangerTable::declare(), - PhaseTapChangerTablePoint::declare(), - PhaseTapChangerTabular::declare(), - PositionPoint::declare(), - PowerSystemResource::declare(), - PowerSystemStabilizerDynamics::declare(), - PowerSystemStabilizerUserDefined::declare(), - PowerTransformer::declare(), - PowerTransformerEnd::declare(), - ProprietaryParameterDynamics::declare(), - ProtectedSwitch::declare(), - Pss1::declare(), - Pss1A::declare(), - Pss2B::declare(), - Pss2ST::declare(), - Pss5::declare(), - PssELIN2::declare(), - PssIEEE1A::declare(), - PssIEEE2B::declare(), - PssIEEE3B::declare(), - PssIEEE4B::declare(), - PssPTIST1::declare(), - PssPTIST3::declare(), - PssSB4::declare(), - PssSH::declare(), - PssSK::declare(), - PssWECC::declare(), - Quality61850::declare(), - RaiseLowerCommand::declare(), - RatioTapChanger::declare(), - RatioTapChangerTable::declare(), - RatioTapChangerTablePoint::declare(), - Reactance::declare(), - ReactiveCapabilityCurve::declare(), - ReactivePower::declare(), - RegularIntervalSchedule::declare(), - RegularTimePoint::declare(), - RegulatingCondEq::declare(), - RegulatingControl::declare(), - RegulationSchedule::declare(), - RemoteInputSignal::declare(), - ReportingGroup::declare(), - Resistance::declare(), - ResistancePerLength::declare(), - RotatingMachine::declare(), - RotatingMachineDynamics::declare(), - RotationSpeed::declare(), - Season::declare(), - SeasonDayTypeSchedule::declare(), - Seconds::declare(), - SeriesCompensator::declare(), - SetPoint::declare(), - ShuntCompensator::declare(), - Simple_Float::declare(), - SolarGeneratingUnit::declare(), - StateVariablesVersion::declare(), - StaticVarCompensator::declare(), - StationSupply::declare(), - SteadyStateHypothesisVersion::declare(), - StringMeasurement::declare(), - StringMeasurementValue::declare(), - SubGeographicalRegion::declare(), - SubLoadArea::declare(), - Substation::declare(), - Susceptance::declare(), - SvInjection::declare(), - SvPowerFlow::declare(), - SvShuntCompensatorSections::declare(), - SvStatus::declare(), - SvTapStep::declare(), - SvVoltage::declare(), - Switch::declare(), - SwitchSchedule::declare(), - SynchronousMachine::declare(), - SynchronousMachineDetailed::declare(), - SynchronousMachineDynamics::declare(), - SynchronousMachineEquivalentCircuit::declare(), - SynchronousMachineSimplified::declare(), - SynchronousMachineTimeConstantReactance::declare(), - SynchronousMachineUserDefined::declare(), - TapChanger::declare(), - TapChangerControl::declare(), - TapChangerTablePoint::declare(), - TapSchedule::declare(), - Temperature::declare(), - Terminal::declare(), - TextDiagramObject::declare(), - ThermalGeneratingUnit::declare(), - TieFlow::declare(), - TopologicalIsland::declare(), - TopologicalNode::declare(), - TopologyBoundaryVersion::declare(), - TopologyVersion::declare(), - TransformerEnd::declare(), - TurbLCFB1::declare(), - TurbineGovernorDynamics::declare(), - TurbineGovernorUserDefined::declare(), - TurbineLoadControllerDynamics::declare(), - TurbineLoadControllerUserDefined::declare(), - UnderexcLim2Simplified::declare(), - UnderexcLimIEEE1::declare(), - UnderexcLimIEEE2::declare(), - UnderexcLimX1::declare(), - UnderexcLimX2::declare(), - UnderexcitationLimiterDynamics::declare(), - UnderexcitationLimiterUserDefined::declare(), - VAdjIEEE::declare(), - VCompIEEEType1::declare(), - VCompIEEEType2::declare(), - ValueAliasSet::declare(), - ValueToAlias::declare(), - VisibilityLayer::declare(), - Voltage::declare(), - VoltageAdjusterDynamics::declare(), - VoltageAdjusterUserDefined::declare(), - VoltageCompensatorDynamics::declare(), - VoltageCompensatorUserDefined::declare(), - VoltageLevel::declare(), - VoltageLimit::declare(), - VoltagePerReactivePower::declare(), - VolumeFlowRate::declare(), - VsCapabilityCurve::declare(), - VsConverter::declare(), - WindAeroConstIEC::declare(), - WindAeroLinearIEC::declare(), - WindContCurrLimIEC::declare(), - WindContPType3IEC::declare(), - WindContPType4aIEC::declare(), - WindContPType4bIEC::declare(), - WindContPitchAngleIEC::declare(), - WindContQIEC::declare(), - WindContRotorRIEC::declare(), - WindDynamicsLookupTable::declare(), - WindGenTurbineType1IEC::declare(), - WindGenTurbineType2IEC::declare(), - WindGenTurbineType3IEC::declare(), - WindGenTurbineType3aIEC::declare(), - WindGenTurbineType3bIEC::declare(), - WindGenType4IEC::declare(), - WindGeneratingUnit::declare(), - WindMechIEC::declare(), - WindPitchContEmulIEC::declare(), - WindPlantDynamics::declare(), - WindPlantFreqPcontrolIEC::declare(), - WindPlantIEC::declare(), - WindPlantReactiveControlIEC::declare(), - WindPlantUserDefined::declare(), - WindProtectionIEC::declare(), - WindTurbineType1or2Dynamics::declare(), - WindTurbineType1or2IEC::declare(), - WindTurbineType3or4Dynamics::declare(), - WindTurbineType3or4IEC::declare(), - WindTurbineType4aIEC::declare(), - WindTurbineType4bIEC::declare(), - WindType1or2UserDefined::declare(), - WindType3or4UserDefined::declare(), - UnknownType::declare() }; +#include "IEC61970.hpp" +using namespace CIMPP; +static std::list CIMClassList = +{ + ACDCConverter::declare(), + ACDCConverterDCTerminal::declare(), + ACDCTerminal::declare(), + ACLineSegment::declare(), + Accumulator::declare(), + AccumulatorLimit::declare(), + AccumulatorLimitSet::declare(), + AccumulatorReset::declare(), + AccumulatorValue::declare(), + ActivePowerLimit::declare(), + Analog::declare(), + AnalogControl::declare(), + AnalogLimit::declare(), + AnalogLimitSet::declare(), + AnalogValue::declare(), + ApparentPowerLimit::declare(), + AsynchronousMachine::declare(), + AsynchronousMachineDynamics::declare(), + AsynchronousMachineEquivalentCircuit::declare(), + AsynchronousMachineTimeConstantReactance::declare(), + AsynchronousMachineUserDefined::declare(), + BaseVoltage::declare(), + BasicIntervalSchedule::declare(), + Bay::declare(), + Breaker::declare(), + BusNameMarker::declare(), + BusbarSection::declare(), + Command::declare(), + ConductingEquipment::declare(), + Conductor::declare(), + ConformLoad::declare(), + ConformLoadGroup::declare(), + ConformLoadSchedule::declare(), + ConnectivityNode::declare(), + ConnectivityNodeContainer::declare(), + Connector::declare(), + Control::declare(), + ControlArea::declare(), + ControlAreaGeneratingUnit::declare(), + CoordinateSystem::declare(), + CsConverter::declare(), + CurrentLimit::declare(), + Curve::declare(), + CurveData::declare(), + DCBaseTerminal::declare(), + DCBreaker::declare(), + DCBusbar::declare(), + DCChopper::declare(), + DCConductingEquipment::declare(), + DCConverterUnit::declare(), + DCDisconnector::declare(), + DCEquipmentContainer::declare(), + DCGround::declare(), + DCLine::declare(), + DCLineSegment::declare(), + DCNode::declare(), + DCSeriesDevice::declare(), + DCShunt::declare(), + DCSwitch::declare(), + DCTerminal::declare(), + DCTopologicalIsland::declare(), + DCTopologicalNode::declare(), + DayType::declare(), + Diagram::declare(), + DiagramLayoutVersion::declare(), + DiagramObject::declare(), + DiagramObjectGluePoint::declare(), + DiagramObjectPoint::declare(), + DiagramObjectStyle::declare(), + DiagramStyle::declare(), + DiscExcContIEEEDEC1A::declare(), + DiscExcContIEEEDEC2A::declare(), + DiscExcContIEEEDEC3A::declare(), + Disconnector::declare(), + DiscontinuousExcitationControlDynamics::declare(), + DiscontinuousExcitationControlUserDefined::declare(), + Discrete::declare(), + DiscreteValue::declare(), + DynamicsFunctionBlock::declare(), + DynamicsVersion::declare(), + EarthFaultCompensator::declare(), + EnergyArea::declare(), + EnergyConsumer::declare(), + EnergySchedulingType::declare(), + EnergySource::declare(), + Equipment::declare(), + EquipmentBoundaryVersion::declare(), + EquipmentContainer::declare(), + EquipmentVersion::declare(), + EquivalentBranch::declare(), + EquivalentEquipment::declare(), + EquivalentInjection::declare(), + EquivalentNetwork::declare(), + EquivalentShunt::declare(), + ExcAC1A::declare(), + ExcAC2A::declare(), + ExcAC3A::declare(), + ExcAC4A::declare(), + ExcAC5A::declare(), + ExcAC6A::declare(), + ExcAC8B::declare(), + ExcANS::declare(), + ExcAVR1::declare(), + ExcAVR2::declare(), + ExcAVR3::declare(), + ExcAVR4::declare(), + ExcAVR5::declare(), + ExcAVR7::declare(), + ExcBBC::declare(), + ExcCZ::declare(), + ExcDC1A::declare(), + ExcDC2A::declare(), + ExcDC3A::declare(), + ExcDC3A1::declare(), + ExcELIN1::declare(), + ExcELIN2::declare(), + ExcHU::declare(), + ExcIEEEAC1A::declare(), + ExcIEEEAC2A::declare(), + ExcIEEEAC3A::declare(), + ExcIEEEAC4A::declare(), + ExcIEEEAC5A::declare(), + ExcIEEEAC6A::declare(), + ExcIEEEAC7B::declare(), + ExcIEEEAC8B::declare(), + ExcIEEEDC1A::declare(), + ExcIEEEDC2A::declare(), + ExcIEEEDC3A::declare(), + ExcIEEEDC4B::declare(), + ExcIEEEST1A::declare(), + ExcIEEEST2A::declare(), + ExcIEEEST3A::declare(), + ExcIEEEST4B::declare(), + ExcIEEEST5B::declare(), + ExcIEEEST6B::declare(), + ExcIEEEST7B::declare(), + ExcOEX3T::declare(), + ExcPIC::declare(), + ExcREXS::declare(), + ExcSCRX::declare(), + ExcSEXS::declare(), + ExcSK::declare(), + ExcST1A::declare(), + ExcST2A::declare(), + ExcST3A::declare(), + ExcST4B::declare(), + ExcST6B::declare(), + ExcST7B::declare(), + ExcitationSystemDynamics::declare(), + ExcitationSystemUserDefined::declare(), + ExternalNetworkInjection::declare(), + FossilFuel::declare(), + GenICompensationForGenJ::declare(), + GeneratingUnit::declare(), + GeographicalLocationVersion::declare(), + GeographicalRegion::declare(), + GovCT1::declare(), + GovCT2::declare(), + GovGAST::declare(), + GovGAST1::declare(), + GovGAST2::declare(), + GovGAST3::declare(), + GovGAST4::declare(), + GovGASTWD::declare(), + GovHydro1::declare(), + GovHydro2::declare(), + GovHydro3::declare(), + GovHydro4::declare(), + GovHydroDD::declare(), + GovHydroFrancis::declare(), + GovHydroIEEE0::declare(), + GovHydroIEEE2::declare(), + GovHydroPID::declare(), + GovHydroPID2::declare(), + GovHydroPelton::declare(), + GovHydroR::declare(), + GovHydroWEH::declare(), + GovHydroWPID::declare(), + GovSteam0::declare(), + GovSteam1::declare(), + GovSteam2::declare(), + GovSteamCC::declare(), + GovSteamEU::declare(), + GovSteamFV2::declare(), + GovSteamFV3::declare(), + GovSteamFV4::declare(), + GovSteamIEEE1::declare(), + GovSteamSGO::declare(), + GrossToNetActivePowerCurve::declare(), + Ground::declare(), + GroundDisconnector::declare(), + GroundingImpedance::declare(), + HydroGeneratingUnit::declare(), + HydroPowerPlant::declare(), + HydroPump::declare(), + IdentifiedObject::declare(), + Junction::declare(), + Limit::declare(), + LimitSet::declare(), + Line::declare(), + LinearShuntCompensator::declare(), + LoadAggregate::declare(), + LoadArea::declare(), + LoadBreakSwitch::declare(), + LoadComposite::declare(), + LoadDynamics::declare(), + LoadGenericNonLinear::declare(), + LoadGroup::declare(), + LoadMotor::declare(), + LoadResponseCharacteristic::declare(), + LoadStatic::declare(), + LoadUserDefined::declare(), + Location::declare(), + Measurement::declare(), + MeasurementValue::declare(), + MeasurementValueQuality::declare(), + MeasurementValueSource::declare(), + MechLoad1::declare(), + MechanicalLoadDynamics::declare(), + MechanicalLoadUserDefined::declare(), + MutualCoupling::declare(), + NonConformLoad::declare(), + NonConformLoadGroup::declare(), + NonConformLoadSchedule::declare(), + NonlinearShuntCompensator::declare(), + NonlinearShuntCompensatorPoint::declare(), + NuclearGeneratingUnit::declare(), + OperationalLimit::declare(), + OperationalLimitSet::declare(), + OperationalLimitType::declare(), + OverexcLim2::declare(), + OverexcLimIEEE::declare(), + OverexcLimX1::declare(), + OverexcLimX2::declare(), + OverexcitationLimiterDynamics::declare(), + OverexcitationLimiterUserDefined::declare(), + PFVArControllerType1Dynamics::declare(), + PFVArControllerType1UserDefined::declare(), + PFVArControllerType2Dynamics::declare(), + PFVArControllerType2UserDefined::declare(), + PFVArType1IEEEPFController::declare(), + PFVArType1IEEEVArController::declare(), + PFVArType2Common1::declare(), + PFVArType2IEEEPFController::declare(), + PFVArType2IEEEVArController::declare(), + PerLengthDCLineParameter::declare(), + PetersenCoil::declare(), + PhaseTapChanger::declare(), + PhaseTapChangerAsymmetrical::declare(), + PhaseTapChangerLinear::declare(), + PhaseTapChangerNonLinear::declare(), + PhaseTapChangerSymmetrical::declare(), + PhaseTapChangerTable::declare(), + PhaseTapChangerTablePoint::declare(), + PhaseTapChangerTabular::declare(), + PositionPoint::declare(), + PowerSystemResource::declare(), + PowerSystemStabilizerDynamics::declare(), + PowerSystemStabilizerUserDefined::declare(), + PowerTransformer::declare(), + PowerTransformerEnd::declare(), + ProprietaryParameterDynamics::declare(), + ProtectedSwitch::declare(), + Pss1::declare(), + Pss1A::declare(), + Pss2B::declare(), + Pss2ST::declare(), + Pss5::declare(), + PssELIN2::declare(), + PssIEEE1A::declare(), + PssIEEE2B::declare(), + PssIEEE3B::declare(), + PssIEEE4B::declare(), + PssPTIST1::declare(), + PssPTIST3::declare(), + PssSB4::declare(), + PssSH::declare(), + PssSK::declare(), + PssWECC::declare(), + Quality61850::declare(), + RaiseLowerCommand::declare(), + RatioTapChanger::declare(), + RatioTapChangerTable::declare(), + RatioTapChangerTablePoint::declare(), + ReactiveCapabilityCurve::declare(), + RegularIntervalSchedule::declare(), + RegularTimePoint::declare(), + RegulatingCondEq::declare(), + RegulatingControl::declare(), + RegulationSchedule::declare(), + RemoteInputSignal::declare(), + ReportingGroup::declare(), + RotatingMachine::declare(), + RotatingMachineDynamics::declare(), + Season::declare(), + SeasonDayTypeSchedule::declare(), + SeriesCompensator::declare(), + SetPoint::declare(), + ShuntCompensator::declare(), + SolarGeneratingUnit::declare(), + StateVariablesVersion::declare(), + StaticVarCompensator::declare(), + StationSupply::declare(), + SteadyStateHypothesisVersion::declare(), + StringMeasurement::declare(), + StringMeasurementValue::declare(), + SubGeographicalRegion::declare(), + SubLoadArea::declare(), + Substation::declare(), + SvInjection::declare(), + SvPowerFlow::declare(), + SvShuntCompensatorSections::declare(), + SvStatus::declare(), + SvTapStep::declare(), + SvVoltage::declare(), + Switch::declare(), + SwitchSchedule::declare(), + SynchronousMachine::declare(), + SynchronousMachineDetailed::declare(), + SynchronousMachineDynamics::declare(), + SynchronousMachineEquivalentCircuit::declare(), + SynchronousMachineSimplified::declare(), + SynchronousMachineTimeConstantReactance::declare(), + SynchronousMachineUserDefined::declare(), + TapChanger::declare(), + TapChangerControl::declare(), + TapChangerTablePoint::declare(), + TapSchedule::declare(), + Terminal::declare(), + TextDiagramObject::declare(), + ThermalGeneratingUnit::declare(), + TieFlow::declare(), + TopologicalIsland::declare(), + TopologicalNode::declare(), + TopologyBoundaryVersion::declare(), + TopologyVersion::declare(), + TransformerEnd::declare(), + TurbLCFB1::declare(), + TurbineGovernorDynamics::declare(), + TurbineGovernorUserDefined::declare(), + TurbineLoadControllerDynamics::declare(), + TurbineLoadControllerUserDefined::declare(), + UnderexcLim2Simplified::declare(), + UnderexcLimIEEE1::declare(), + UnderexcLimIEEE2::declare(), + UnderexcLimX1::declare(), + UnderexcLimX2::declare(), + UnderexcitationLimiterDynamics::declare(), + UnderexcitationLimiterUserDefined::declare(), + VAdjIEEE::declare(), + VCompIEEEType1::declare(), + VCompIEEEType2::declare(), + ValueAliasSet::declare(), + ValueToAlias::declare(), + VisibilityLayer::declare(), + VoltageAdjusterDynamics::declare(), + VoltageAdjusterUserDefined::declare(), + VoltageCompensatorDynamics::declare(), + VoltageCompensatorUserDefined::declare(), + VoltageLevel::declare(), + VoltageLimit::declare(), + VsCapabilityCurve::declare(), + VsConverter::declare(), + WindAeroConstIEC::declare(), + WindAeroLinearIEC::declare(), + WindContCurrLimIEC::declare(), + WindContPType3IEC::declare(), + WindContPType4aIEC::declare(), + WindContPType4bIEC::declare(), + WindContPitchAngleIEC::declare(), + WindContQIEC::declare(), + WindContRotorRIEC::declare(), + WindDynamicsLookupTable::declare(), + WindGenTurbineType1IEC::declare(), + WindGenTurbineType2IEC::declare(), + WindGenTurbineType3IEC::declare(), + WindGenTurbineType3aIEC::declare(), + WindGenTurbineType3bIEC::declare(), + WindGenType4IEC::declare(), + WindGeneratingUnit::declare(), + WindMechIEC::declare(), + WindPitchContEmulIEC::declare(), + WindPlantDynamics::declare(), + WindPlantFreqPcontrolIEC::declare(), + WindPlantIEC::declare(), + WindPlantReactiveControlIEC::declare(), + WindPlantUserDefined::declare(), + WindProtectionIEC::declare(), + WindTurbineType1or2Dynamics::declare(), + WindTurbineType1or2IEC::declare(), + WindTurbineType3or4Dynamics::declare(), + WindTurbineType3or4IEC::declare(), + WindTurbineType4aIEC::declare(), + WindTurbineType4bIEC::declare(), + WindType1or2UserDefined::declare(), + WindType3or4UserDefined::declare(), + UnknownType::declare(), +}; #endif // CIMCLASSLIST_H diff --git a/CGMES_2.4.15_27JAN2020/Capacitance.cpp b/CGMES_2.4.15_27JAN2020/Capacitance.cpp index f3f7f180f..79261bc63 100644 --- a/CGMES_2.4.15_27JAN2020/Capacitance.cpp +++ b/CGMES_2.4.15_27JAN2020/Capacitance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Capacitance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Capacitance::Capacitance() {} -Capacitance::~Capacitance(){} +#include -Capacitance::Capacitance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Capacitance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Capacitance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Capacitance& Capacitance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Capacitance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Capacitance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Capacitance::debugName[] = "Capacitance"; -const char* Capacitance::debugString() { +const char* Capacitance::debugString() const +{ return Capacitance::debugName; } - -const BaseClassDefiner Capacitance::declare() { - return BaseClassDefiner(Capacitance::addConstructToMap, Capacitance::addPrimitiveAssignFnsToMap, Capacitance::addClassAssignFnsToMap, Capacitance::debugName); +Capacitance& Capacitance::operator+=(const Capacitance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Capacitance& Capacitance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Capacitance& Capacitance::operator-=(const Capacitance& rhs) { - value -= rhs.value; - return *this; - } - - Capacitance& Capacitance::operator*=(const Capacitance& rhs) { - value *= rhs.value; - return *this; - } - - Capacitance& Capacitance::operator/=(const Capacitance& rhs) { - value /= rhs.value; - return *this; - } +Capacitance& Capacitance::operator-=(const Capacitance& rhs) +{ + value -= rhs.value; + return *this; +} - Capacitance& Capacitance::operator+=(const Capacitance& rhs) { - value += rhs.value; - return *this; - } +Capacitance& Capacitance::operator*=(const Capacitance& rhs) +{ + value *= rhs.value; + return *this; +} - Capacitance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Capacitance& Capacitance::operator/=(const Capacitance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Capacitance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Capacitance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Capacitance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Capacitance.hpp b/CGMES_2.4.15_27JAN2020/Capacitance.hpp index 0c3f2a9bd..0f2f8bad2 100644 --- a/CGMES_2.4.15_27JAN2020/Capacitance.hpp +++ b/CGMES_2.4.15_27JAN2020/Capacitance.hpp @@ -1,38 +1,39 @@ #ifndef Capacitance_H #define Capacitance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Capacitance : public BaseClass + /* + Capacitive part of reactance (imaginary part of impedance), at rated frequency. + */ + class Capacitance { - public: - Capacitance(); - virtual ~Capacitance(); - Capacitance(long double value); - static const BaseClassDefiner declare(); - Capacitance& operator=(long double &rop); + Capacitance() : value(0.0), initialized(false) {} + Capacitance(long double value) : value(value), initialized(true) {} + + Capacitance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Capacitance& operator+=(const Capacitance& rhs); Capacitance& operator-=(const Capacitance& rhs); Capacitance& operator*=(const Capacitance& rhs); Capacitance& operator/=(const Capacitance& rhs); + friend std::istream& operator>>(std::istream& lop, Capacitance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Capacitance& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/CapacitancePerLength.cpp b/CGMES_2.4.15_27JAN2020/CapacitancePerLength.cpp index b1456470a..213af0ce1 100644 --- a/CGMES_2.4.15_27JAN2020/CapacitancePerLength.cpp +++ b/CGMES_2.4.15_27JAN2020/CapacitancePerLength.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CapacitancePerLength.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -CapacitancePerLength::CapacitancePerLength(): value(nullptr) {}; - -CapacitancePerLength::~CapacitancePerLength() {}; - - -bool assign_CapacitancePerLength_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_CapacitancePerLength_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CapacitancePerLength_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_CapacitancePerLength_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_CapacitancePerLength_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CapacitancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +CapacitancePerLength& CapacitancePerLength::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* CapacitancePerLength_factory() { - return new CapacitancePerLength; +CapacitancePerLength::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void CapacitancePerLength::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:CapacitancePerLength"), &CapacitancePerLength_factory)); +const char CapacitancePerLength::debugName[] = "CapacitancePerLength"; +const char* CapacitancePerLength::debugString() const +{ + return CapacitancePerLength::debugName; } -void CapacitancePerLength::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.unit"), &assign_CapacitancePerLength_unit)); - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.multiplier"), &assign_CapacitancePerLength_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.denominatorUnit"), &assign_CapacitancePerLength_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.denominatorMultiplier"), &assign_CapacitancePerLength_denominatorMultiplier)); +CapacitancePerLength& CapacitancePerLength::operator+=(const CapacitancePerLength& rhs) +{ + value += rhs.value; + return *this; } -void CapacitancePerLength::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CapacitancePerLength.value"), &assign_CapacitancePerLength_value)); - } +CapacitancePerLength& CapacitancePerLength::operator-=(const CapacitancePerLength& rhs) +{ + value -= rhs.value; + return *this; +} -const char CapacitancePerLength::debugName[] = "CapacitancePerLength"; -const char* CapacitancePerLength::debugString() +CapacitancePerLength& CapacitancePerLength::operator*=(const CapacitancePerLength& rhs) { - return CapacitancePerLength::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner CapacitancePerLength::declare() +CapacitancePerLength& CapacitancePerLength::operator/=(const CapacitancePerLength& rhs) { - return BaseClassDefiner(CapacitancePerLength::addConstructToMap, CapacitancePerLength::addPrimitiveAssignFnsToMap, CapacitancePerLength::addClassAssignFnsToMap, CapacitancePerLength::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CapacitancePerLength& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const CapacitancePerLength& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CapacitancePerLength.hpp b/CGMES_2.4.15_27JAN2020/CapacitancePerLength.hpp index efdfe0dbb..b38d961b2 100644 --- a/CGMES_2.4.15_27JAN2020/CapacitancePerLength.hpp +++ b/CGMES_2.4.15_27JAN2020/CapacitancePerLength.hpp @@ -1,46 +1,39 @@ #ifndef CapacitancePerLength_H #define CapacitancePerLength_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Capacitance per unit of length. */ - class CapacitancePerLength: public BaseClass + class CapacitancePerLength { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + CapacitancePerLength() : value(0.0), initialized(false) {} + CapacitancePerLength(long double value) : value(value), initialized(true) {} + + CapacitancePerLength& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - CapacitancePerLength(); - virtual ~CapacitancePerLength(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + CapacitancePerLength& operator+=(const CapacitancePerLength& rhs); + CapacitancePerLength& operator-=(const CapacitancePerLength& rhs); + CapacitancePerLength& operator*=(const CapacitancePerLength& rhs); + CapacitancePerLength& operator/=(const CapacitancePerLength& rhs); - BaseClass* CapacitancePerLength_factory(); + friend std::istream& operator>>(std::istream& lop, CapacitancePerLength& rop); + friend std::ostream& operator<<(std::ostream& os, const CapacitancePerLength& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/Command.cpp b/CGMES_2.4.15_27JAN2020/Command.cpp index 15de14f4a..3c4de5e5f 100644 --- a/CGMES_2.4.15_27JAN2020/Command.cpp +++ b/CGMES_2.4.15_27JAN2020/Command.cpp @@ -1,92 +1,108 @@ -#include -#include "Control.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Command.hpp" -#include "Integer.hpp" -#include "Integer.hpp" +#include +#include + #include "DiscreteValue.hpp" #include "ValueAliasSet.hpp" +#include "Integer.hpp" +#include "Integer.hpp" using namespace CIMPP; -Command::Command(): DiscreteValue(nullptr), ValueAliasSet(nullptr) {}; - +Command::Command() : DiscreteValue(nullptr), ValueAliasSet(nullptr) {}; Command::~Command() {}; -bool assign_DiscreteValue_Command(BaseClass*, BaseClass*); -bool assign_Command_DiscreteValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscreteValue = dynamic_cast(BaseClass_ptr2); - if(element->DiscreteValue != nullptr) - return assign_DiscreteValue_Command(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Command_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Command* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ValueAliasSet_Commands(BaseClass*, BaseClass*); -bool assign_Command_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_Commands(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Command_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Command* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Command_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiscreteValue_Command(BaseClass*, BaseClass*); +bool assign_Command_DiscreteValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Command* element = dynamic_cast(BaseClass_ptr1); + DiscreteValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscreteValue != element2) + { + element->DiscreteValue = element2; + return assign_DiscreteValue_Command(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Command_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Command* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ValueAliasSet_Commands(BaseClass*, BaseClass*); +bool assign_Command_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Command* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_Commands(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* Command_factory() { - return new Command; - } +const char Command::debugName[] = "Command"; +const char* Command::debugString() const +{ + return Command::debugName; } -void Command::addConstructToMap(std::unordered_map& factory_map) { +void Command::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Command"), &Command_factory)); } -void Command::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Command::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Command.normalValue"), &assign_Command_normalValue)); assign_map.insert(std::make_pair(std::string("cim:Command.value"), &assign_Command_value)); - } - -void Command::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Command.DiscreteValue"), &assign_Command_DiscreteValue)); - assign_map.insert(std::make_pair(std::string("cim:Command.ValueAliasSet"), &assign_Command_ValueAliasSet)); } -const char Command::debugName[] = "Command"; -const char* Command::debugString() +void Command::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Command::debugName; + assign_map.insert(std::make_pair(std::string("cim:Command.DiscreteValue"), &assign_Command_DiscreteValue)); + assign_map.insert(std::make_pair(std::string("cim:Command.ValueAliasSet"), &assign_Command_ValueAliasSet)); } const BaseClassDefiner Command::declare() @@ -94,4 +110,10 @@ const BaseClassDefiner Command::declare() return BaseClassDefiner(Command::addConstructToMap, Command::addPrimitiveAssignFnsToMap, Command::addClassAssignFnsToMap, Command::debugName); } - +namespace CIMPP +{ + BaseClass* Command_factory() + { + return new Command; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Command.hpp b/CGMES_2.4.15_27JAN2020/Command.hpp index 31d352bee..5131e4978 100644 --- a/CGMES_2.4.15_27JAN2020/Command.hpp +++ b/CGMES_2.4.15_27JAN2020/Command.hpp @@ -1,43 +1,44 @@ #ifndef Command_H #define Command_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Control.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Control.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiscreteValue; + class ValueAliasSet; - -class DiscreteValue; -class ValueAliasSet; /* A Command is a discrete control used for supervisory control. */ - class Command: public Control + class Command : public Control { - public: - CIMPP::Integer normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: 0 */ - CIMPP::Integer value; /* The value representing the actuator output. Default: 0 */ - CIMPP::DiscreteValue* DiscreteValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Command(); - virtual ~Command(); - + ~Command() override; + + CIMPP::DiscreteValue* DiscreteValue; /* The Control variable associated with the MeasurementValue. Default: 0 */ + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ + CIMPP::Integer normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: 0 */ + CIMPP::Integer value; /* The value representing the actuator output. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Command_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Conductance.cpp b/CGMES_2.4.15_27JAN2020/Conductance.cpp index c21f4ceed..a9bb89d1f 100644 --- a/CGMES_2.4.15_27JAN2020/Conductance.cpp +++ b/CGMES_2.4.15_27JAN2020/Conductance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Conductance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Conductance::Conductance() {} -Conductance::~Conductance(){} +#include -Conductance::Conductance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Conductance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Conductance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Conductance& Conductance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Conductance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Conductance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Conductance::debugName[] = "Conductance"; -const char* Conductance::debugString() { +const char* Conductance::debugString() const +{ return Conductance::debugName; } - -const BaseClassDefiner Conductance::declare() { - return BaseClassDefiner(Conductance::addConstructToMap, Conductance::addPrimitiveAssignFnsToMap, Conductance::addClassAssignFnsToMap, Conductance::debugName); +Conductance& Conductance::operator+=(const Conductance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Conductance& Conductance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Conductance& Conductance::operator-=(const Conductance& rhs) { - value -= rhs.value; - return *this; - } - - Conductance& Conductance::operator*=(const Conductance& rhs) { - value *= rhs.value; - return *this; - } - - Conductance& Conductance::operator/=(const Conductance& rhs) { - value /= rhs.value; - return *this; - } +Conductance& Conductance::operator-=(const Conductance& rhs) +{ + value -= rhs.value; + return *this; +} - Conductance& Conductance::operator+=(const Conductance& rhs) { - value += rhs.value; - return *this; - } +Conductance& Conductance::operator*=(const Conductance& rhs) +{ + value *= rhs.value; + return *this; +} - Conductance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Conductance& Conductance::operator/=(const Conductance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Conductance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Conductance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Conductance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Conductance.hpp b/CGMES_2.4.15_27JAN2020/Conductance.hpp index 98d5ad4dc..6a99df04e 100644 --- a/CGMES_2.4.15_27JAN2020/Conductance.hpp +++ b/CGMES_2.4.15_27JAN2020/Conductance.hpp @@ -1,38 +1,39 @@ #ifndef Conductance_H #define Conductance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Conductance : public BaseClass + /* + Factor by which voltage must be multiplied to give corresponding power lost from a circuit. Real part of admittance. + */ + class Conductance { - public: - Conductance(); - virtual ~Conductance(); - Conductance(long double value); - static const BaseClassDefiner declare(); - Conductance& operator=(long double &rop); + Conductance() : value(0.0), initialized(false) {} + Conductance(long double value) : value(value), initialized(true) {} + + Conductance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Conductance& operator+=(const Conductance& rhs); Conductance& operator-=(const Conductance& rhs); Conductance& operator*=(const Conductance& rhs); Conductance& operator/=(const Conductance& rhs); + friend std::istream& operator>>(std::istream& lop, Conductance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Conductance& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ConductingEquipment.cpp b/CGMES_2.4.15_27JAN2020/ConductingEquipment.cpp index 3e52b5bdc..75fda89e3 100644 --- a/CGMES_2.4.15_27JAN2020/ConductingEquipment.cpp +++ b/CGMES_2.4.15_27JAN2020/ConductingEquipment.cpp @@ -1,74 +1,96 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConductingEquipment.hpp" +#include +#include + #include "BaseVoltage.hpp" -#include "Terminal.hpp" #include "SvStatus.hpp" +#include "Terminal.hpp" using namespace CIMPP; -ConductingEquipment::ConductingEquipment(): BaseVoltage(nullptr), SvStatus(nullptr) {}; - +ConductingEquipment::ConductingEquipment() : BaseVoltage(nullptr), SvStatus(nullptr) {}; ConductingEquipment::~ConductingEquipment() {}; + + + + bool assign_BaseVoltage_ConductingEquipment(BaseClass*, BaseClass*); -bool assign_ConductingEquipment_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ConductingEquipment_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ConductingEquipment_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_SvStatus_ConductingEquipment(BaseClass*, BaseClass*); +bool assign_ConductingEquipment_SvStatus(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + SvStatus* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvStatus != element2) + { + element->SvStatus = element2; + return assign_SvStatus_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ConductingEquipment_SvStatus(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - element->SvStatus = dynamic_cast(BaseClass_ptr2); - if(element->SvStatus != nullptr) - return true; - } - return false; +bool assign_Terminal_ConductingEquipment(BaseClass*, BaseClass*); +bool assign_ConductingEquipment_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminals.begin(), element->Terminals.end(), element2) == element->Terminals.end()) + { + element->Terminals.push_back(element2); + return assign_Terminal_ConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* ConductingEquipment_factory() { - return new ConductingEquipment; - } +const char ConductingEquipment::debugName[] = "ConductingEquipment"; +const char* ConductingEquipment::debugString() const +{ + return ConductingEquipment::debugName; } -void ConductingEquipment::addConstructToMap(std::unordered_map& factory_map) { +void ConductingEquipment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConductingEquipment"), &ConductingEquipment_factory)); } -void ConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.BaseVoltage"), &assign_ConductingEquipment_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.Terminals"), &assign_ConductingEquipment_Terminals)); - assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.SvStatus"), &assign_ConductingEquipment_SvStatus)); +void ConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConductingEquipment::debugName[] = "ConductingEquipment"; -const char* ConductingEquipment::debugString() +void ConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConductingEquipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.BaseVoltage"), &assign_ConductingEquipment_BaseVoltage)); + assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.SvStatus"), &assign_ConductingEquipment_SvStatus)); + assign_map.insert(std::make_pair(std::string("cim:ConductingEquipment.Terminals"), &assign_ConductingEquipment_Terminals)); } const BaseClassDefiner ConductingEquipment::declare() @@ -76,4 +98,10 @@ const BaseClassDefiner ConductingEquipment::declare() return BaseClassDefiner(ConductingEquipment::addConstructToMap, ConductingEquipment::addPrimitiveAssignFnsToMap, ConductingEquipment::addClassAssignFnsToMap, ConductingEquipment::debugName); } - +namespace CIMPP +{ + BaseClass* ConductingEquipment_factory() + { + return new ConductingEquipment; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ConductingEquipment.hpp b/CGMES_2.4.15_27JAN2020/ConductingEquipment.hpp index ba09d6921..5454b4a05 100644 --- a/CGMES_2.4.15_27JAN2020/ConductingEquipment.hpp +++ b/CGMES_2.4.15_27JAN2020/ConductingEquipment.hpp @@ -1,42 +1,43 @@ #ifndef ConductingEquipment_H #define ConductingEquipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class BaseVoltage; + class SvStatus; + class Terminal; -class BaseVoltage; -class Terminal; -class SvStatus; /* The parts of the AC power system that are designed to carry current or that are conductively connected through terminals. */ - class ConductingEquipment: public Equipment + class ConductingEquipment : public Equipment { - public: - CIMPP::BaseVoltage* BaseVoltage; /* All conducting equipment with this base voltage. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ - std::list Terminals; /* Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ - CIMPP::SvStatus* SvStatus; /* The status state variable associated with this conducting equipment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConductingEquipment(); - virtual ~ConductingEquipment(); - + ~ConductingEquipment() override; + + CIMPP::BaseVoltage* BaseVoltage; /* All conducting equipment with this base voltage. Use only when there is no voltage level container used and only one base voltage applies. For example, not used for transformers. Default: 0 */ + CIMPP::SvStatus* SvStatus; /* The status state variable associated with this conducting equipment. Default: 0 */ + std::list Terminals; /* Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConductingEquipment_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Conductor.cpp b/CGMES_2.4.15_27JAN2020/Conductor.cpp index 1a0d8eaec..f91f1c615 100644 --- a/CGMES_2.4.15_27JAN2020/Conductor.cpp +++ b/CGMES_2.4.15_27JAN2020/Conductor.cpp @@ -1,51 +1,52 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Conductor.hpp" +#include +#include + #include "Length.hpp" using namespace CIMPP; Conductor::Conductor() {}; - Conductor::~Conductor() {}; +bool assign_Conductor_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Conductor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->length; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Conductor_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Conductor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->length; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Conductor_factory() { - return new Conductor; - } +const char Conductor::debugName[] = "Conductor"; +const char* Conductor::debugString() const +{ + return Conductor::debugName; } -void Conductor::addConstructToMap(std::unordered_map& factory_map) { +void Conductor::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Conductor"), &Conductor_factory)); } -void Conductor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Conductor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Conductor.length"), &assign_Conductor_length)); } -void Conductor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Conductor::debugName[] = "Conductor"; -const char* Conductor::debugString() +void Conductor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Conductor::debugName; } const BaseClassDefiner Conductor::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner Conductor::declare() return BaseClassDefiner(Conductor::addConstructToMap, Conductor::addPrimitiveAssignFnsToMap, Conductor::addClassAssignFnsToMap, Conductor::debugName); } - +namespace CIMPP +{ + BaseClass* Conductor_factory() + { + return new Conductor; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Conductor.hpp b/CGMES_2.4.15_27JAN2020/Conductor.hpp index 12e8cba7c..f94265788 100644 --- a/CGMES_2.4.15_27JAN2020/Conductor.hpp +++ b/CGMES_2.4.15_27JAN2020/Conductor.hpp @@ -1,38 +1,39 @@ #ifndef Conductor_H #define Conductor_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Length.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Combination of conducting material with consistent electrical characteristics, building a single electrical system, used to carry current between points in the power system. */ - class Conductor: public ConductingEquipment + class Conductor : public ConductingEquipment { - public: - CIMPP::Length length; /* Segment length for calculating line section capabilities Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Conductor(); - virtual ~Conductor(); - + ~Conductor() override; + + CIMPP::Length length; /* Segment length for calculating line section capabilities Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Conductor_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ConformLoad.cpp b/CGMES_2.4.15_27JAN2020/ConformLoad.cpp index 5f030ae04..068ca38a5 100644 --- a/CGMES_2.4.15_27JAN2020/ConformLoad.cpp +++ b/CGMES_2.4.15_27JAN2020/ConformLoad.cpp @@ -1,49 +1,56 @@ -#include -#include "EnergyConsumer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConformLoad.hpp" +#include +#include + #include "ConformLoadGroup.hpp" using namespace CIMPP; -ConformLoad::ConformLoad(): LoadGroup(nullptr) {}; - +ConformLoad::ConformLoad() : LoadGroup(nullptr) {}; ConformLoad::~ConformLoad() {}; -bool assign_ConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); -bool assign_ConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoad* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->LoadGroup != nullptr) - return assign_ConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* ConformLoad_factory() { - return new ConformLoad; +bool assign_ConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); +bool assign_ConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoad* element = dynamic_cast(BaseClass_ptr1); + ConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadGroup != element2) + { + element->LoadGroup = element2; + return assign_ConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ConformLoad::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ConformLoad"), &ConformLoad_factory)); +const char ConformLoad::debugName[] = "ConformLoad"; +const char* ConformLoad::debugString() const +{ + return ConformLoad::debugName; } -void ConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ConformLoad::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ConformLoad"), &ConformLoad_factory)); +} -void ConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConformLoad.LoadGroup"), &assign_ConformLoad_LoadGroup)); +void ConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConformLoad::debugName[] = "ConformLoad"; -const char* ConformLoad::debugString() +void ConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConformLoad::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConformLoad.LoadGroup"), &assign_ConformLoad_LoadGroup)); } const BaseClassDefiner ConformLoad::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner ConformLoad::declare() return BaseClassDefiner(ConformLoad::addConstructToMap, ConformLoad::addPrimitiveAssignFnsToMap, ConformLoad::addClassAssignFnsToMap, ConformLoad::debugName); } - +namespace CIMPP +{ + BaseClass* ConformLoad_factory() + { + return new ConformLoad; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ConformLoad.hpp b/CGMES_2.4.15_27JAN2020/ConformLoad.hpp index 6c10592b3..d124b28eb 100644 --- a/CGMES_2.4.15_27JAN2020/ConformLoad.hpp +++ b/CGMES_2.4.15_27JAN2020/ConformLoad.hpp @@ -1,38 +1,39 @@ #ifndef ConformLoad_H #define ConformLoad_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyConsumer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyConsumer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConformLoadGroup; -class ConformLoadGroup; /* ConformLoad represent loads that follow a daily load change pattern where the pattern can be used to scale the load with a system load. */ - class ConformLoad: public EnergyConsumer + class ConformLoad : public EnergyConsumer { - public: - CIMPP::ConformLoadGroup* LoadGroup; /* Group of this ConformLoad. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConformLoad(); - virtual ~ConformLoad(); - + ~ConformLoad() override; + + CIMPP::ConformLoadGroup* LoadGroup; /* Group of this ConformLoad. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConformLoad_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ConformLoadGroup.cpp b/CGMES_2.4.15_27JAN2020/ConformLoadGroup.cpp index 58f726f62..de8dedb23 100644 --- a/CGMES_2.4.15_27JAN2020/ConformLoadGroup.cpp +++ b/CGMES_2.4.15_27JAN2020/ConformLoadGroup.cpp @@ -1,62 +1,76 @@ -#include -#include "LoadGroup.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConformLoadGroup.hpp" -#include "ConformLoad.hpp" +#include +#include + #include "ConformLoadSchedule.hpp" +#include "ConformLoad.hpp" using namespace CIMPP; ConformLoadGroup::ConformLoadGroup() {}; - ConformLoadGroup::~ConformLoadGroup() {}; -bool assign_ConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumers.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_ConformLoadSchedule_ConformLoadGroup(BaseClass*, BaseClass*); +bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + ConformLoadSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConformLoadSchedules.begin(), element->ConformLoadSchedules.end(), element2) == element->ConformLoadSchedules.end()) + { + element->ConformLoadSchedules.push_back(element2); + return assign_ConformLoadSchedule_ConformLoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConformLoadSchedules.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_ConformLoad_LoadGroup(BaseClass*, BaseClass*); +bool assign_ConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + ConformLoad* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumers.begin(), element->EnergyConsumers.end(), element2) == element->EnergyConsumers.end()) + { + element->EnergyConsumers.push_back(element2); + return assign_ConformLoad_LoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ConformLoadGroup_factory() { - return new ConformLoadGroup; - } +const char ConformLoadGroup::debugName[] = "ConformLoadGroup"; +const char* ConformLoadGroup::debugString() const +{ + return ConformLoadGroup::debugName; } -void ConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) { +void ConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConformLoadGroup"), &ConformLoadGroup_factory)); } -void ConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.EnergyConsumers"), &assign_ConformLoadGroup_EnergyConsumers)); - assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.ConformLoadSchedules"), &assign_ConformLoadGroup_ConformLoadSchedules)); +void ConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConformLoadGroup::debugName[] = "ConformLoadGroup"; -const char* ConformLoadGroup::debugString() +void ConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConformLoadGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.ConformLoadSchedules"), &assign_ConformLoadGroup_ConformLoadSchedules)); + assign_map.insert(std::make_pair(std::string("cim:ConformLoadGroup.EnergyConsumers"), &assign_ConformLoadGroup_EnergyConsumers)); } const BaseClassDefiner ConformLoadGroup::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ConformLoadGroup::declare() return BaseClassDefiner(ConformLoadGroup::addConstructToMap, ConformLoadGroup::addPrimitiveAssignFnsToMap, ConformLoadGroup::addClassAssignFnsToMap, ConformLoadGroup::debugName); } - +namespace CIMPP +{ + BaseClass* ConformLoadGroup_factory() + { + return new ConformLoadGroup; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ConformLoadGroup.hpp b/CGMES_2.4.15_27JAN2020/ConformLoadGroup.hpp index 01cc3c0cd..0ea15d628 100644 --- a/CGMES_2.4.15_27JAN2020/ConformLoadGroup.hpp +++ b/CGMES_2.4.15_27JAN2020/ConformLoadGroup.hpp @@ -1,40 +1,41 @@ #ifndef ConformLoadGroup_H #define ConformLoadGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadGroup.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LoadGroup.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConformLoad; + class ConformLoadSchedule; -class ConformLoad; -class ConformLoadSchedule; /* A group of loads conforming to an allocation pattern. */ - class ConformLoadGroup: public LoadGroup + class ConformLoadGroup : public LoadGroup { - public: - std::list EnergyConsumers; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ - std::list ConformLoadSchedules; /* The ConformLoadSchedules in the ConformLoadGroup. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConformLoadGroup(); - virtual ~ConformLoadGroup(); - + ~ConformLoadGroup() override; + + std::list ConformLoadSchedules; /* The ConformLoadSchedules in the ConformLoadGroup. Default: 0 */ + std::list EnergyConsumers; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConformLoadGroup_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.cpp b/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.cpp index bcf5a576d..e3f173e5e 100644 --- a/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConformLoadSchedule.hpp" +#include +#include + #include "ConformLoadGroup.hpp" using namespace CIMPP; -ConformLoadSchedule::ConformLoadSchedule(): ConformLoadGroup(nullptr) {}; - +ConformLoadSchedule::ConformLoadSchedule() : ConformLoadGroup(nullptr) {}; ConformLoadSchedule::~ConformLoadSchedule() {}; -bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass*, BaseClass*); -bool assign_ConformLoadSchedule_ConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->ConformLoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->ConformLoadGroup != nullptr) - return assign_ConformLoadGroup_ConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* ConformLoadSchedule_factory() { - return new ConformLoadSchedule; +bool assign_ConformLoadGroup_ConformLoadSchedules(BaseClass*, BaseClass*); +bool assign_ConformLoadSchedule_ConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1); + ConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConformLoadGroup != element2) + { + element->ConformLoadGroup = element2; + return assign_ConformLoadGroup_ConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule"), &ConformLoadSchedule_factory)); +const char ConformLoadSchedule::debugName[] = "ConformLoadSchedule"; +const char* ConformLoadSchedule::debugString() const +{ + return ConformLoadSchedule::debugName; } -void ConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule"), &ConformLoadSchedule_factory)); +} -void ConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule.ConformLoadGroup"), &assign_ConformLoadSchedule_ConformLoadGroup)); +void ConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConformLoadSchedule::debugName[] = "ConformLoadSchedule"; -const char* ConformLoadSchedule::debugString() +void ConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConformLoadSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConformLoadSchedule.ConformLoadGroup"), &assign_ConformLoadSchedule_ConformLoadGroup)); } const BaseClassDefiner ConformLoadSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner ConformLoadSchedule::declare() return BaseClassDefiner(ConformLoadSchedule::addConstructToMap, ConformLoadSchedule::addPrimitiveAssignFnsToMap, ConformLoadSchedule::addClassAssignFnsToMap, ConformLoadSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* ConformLoadSchedule_factory() + { + return new ConformLoadSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.hpp b/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.hpp index bfc522ac8..6d7a42782 100644 --- a/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/ConformLoadSchedule.hpp @@ -1,38 +1,39 @@ #ifndef ConformLoadSchedule_H #define ConformLoadSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConformLoadGroup; -class ConformLoadGroup; /* A curve of load versus time (X-axis) showing the active power values (Y1-axis) and reactive power (Y2-axis) for each unit of the period covered. This curve represents a typical pattern of load over the time period for a given day type and season. */ - class ConformLoadSchedule: public SeasonDayTypeSchedule + class ConformLoadSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::ConformLoadGroup* ConformLoadGroup; /* The ConformLoadGroup where the ConformLoadSchedule belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConformLoadSchedule(); - virtual ~ConformLoadSchedule(); - + ~ConformLoadSchedule() override; + + CIMPP::ConformLoadGroup* ConformLoadGroup; /* The ConformLoadGroup where the ConformLoadSchedule belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConformLoadSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ConnectivityNode.cpp b/CGMES_2.4.15_27JAN2020/ConnectivityNode.cpp index 61062496c..b0282bde9 100644 --- a/CGMES_2.4.15_27JAN2020/ConnectivityNode.cpp +++ b/CGMES_2.4.15_27JAN2020/ConnectivityNode.cpp @@ -1,9 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConnectivityNode.hpp" -#include "Terminal.hpp" +#include +#include + #include "ConnectivityNodeContainer.hpp" +#include "Terminal.hpp" #include "TopologicalNode.hpp" #include "Boolean.hpp" #include "String.hpp" @@ -15,68 +19,32 @@ using namespace CIMPP; -ConnectivityNode::ConnectivityNode(): ConnectivityNodeContainer(nullptr), TopologicalNode(nullptr) {}; - +ConnectivityNode::ConnectivityNode() : ConnectivityNodeContainer(nullptr), TopologicalNode(nullptr) {}; ConnectivityNode::~ConnectivityNode() {}; -bool assign_ConnectivityNode_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; - } - } - return false; -} - -bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass*, BaseClass*); -bool assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - element->ConnectivityNodeContainer = dynamic_cast(BaseClass_ptr2); - if(element->ConnectivityNodeContainer != nullptr) - return assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TopologicalNode_ConnectivityNodes(BaseClass*, BaseClass*); -bool assign_ConnectivityNode_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - - - - - - - -bool assign_ConnectivityNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->boundaryPoint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ConnectivityNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->boundaryPoint; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ConnectivityNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +52,12 @@ bool assign_ConnectivityNode_fromEndIsoCode(std::stringstream &buffer, BaseClass return false; } -bool assign_ConnectivityNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +65,12 @@ bool assign_ConnectivityNode_fromEndName(std::stringstream &buffer, BaseClass* B return false; } -bool assign_ConnectivityNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +78,12 @@ bool assign_ConnectivityNode_fromEndNameTso(std::stringstream &buffer, BaseClass return false; } -bool assign_ConnectivityNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +91,12 @@ bool assign_ConnectivityNode_toEndIsoCode(std::stringstream &buffer, BaseClass* return false; } -bool assign_ConnectivityNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +104,12 @@ bool assign_ConnectivityNode_toEndName(std::stringstream &buffer, BaseClass* Bas return false; } -bool assign_ConnectivityNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_ConnectivityNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ConnectivityNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,18 +117,79 @@ bool assign_ConnectivityNode_toEndNameTso(std::stringstream &buffer, BaseClass* return false; } -namespace CIMPP { - BaseClass* ConnectivityNode_factory() { - return new ConnectivityNode; + +bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass*, BaseClass*); +bool assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNode* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNodeContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConnectivityNodeContainer != element2) + { + element->ConnectivityNodeContainer = element2; + return assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ConnectivityNode::addConstructToMap(std::unordered_map& factory_map) { +bool assign_Terminal_ConnectivityNode(BaseClass*, BaseClass*); +bool assign_ConnectivityNode_Terminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNode* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminals.begin(), element->Terminals.end(), element2) == element->Terminals.end()) + { + element->Terminals.push_back(element2); + return assign_Terminal_ConnectivityNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TopologicalNode_ConnectivityNodes(BaseClass*, BaseClass*); +bool assign_ConnectivityNode_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNode* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_ConnectivityNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + + + +const char ConnectivityNode::debugName[] = "ConnectivityNode"; +const char* ConnectivityNode::debugString() const +{ + return ConnectivityNode::debugName; +} + +void ConnectivityNode::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConnectivityNode"), &ConnectivityNode_factory)); } -void ConnectivityNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.boundaryPoint"), &assign_ConnectivityNode_boundaryPoint)); +void ConnectivityNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.boundaryPoint"), &assign_ConnectivityNode_boundaryPoint)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.fromEndIsoCode"), &assign_ConnectivityNode_fromEndIsoCode)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.fromEndName"), &assign_ConnectivityNode_fromEndName)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.fromEndNameTso"), &assign_ConnectivityNode_fromEndNameTso)); @@ -159,16 +198,11 @@ void ConnectivityNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.Terminals"), &assign_ConnectivityNode_Terminals)); +void ConnectivityNode::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.ConnectivityNodeContainer"), &assign_ConnectivityNode_ConnectivityNodeContainer)); + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.Terminals"), &assign_ConnectivityNode_Terminals)); assign_map.insert(std::make_pair(std::string("cim:ConnectivityNode.TopologicalNode"), &assign_ConnectivityNode_TopologicalNode)); - } - -const char ConnectivityNode::debugName[] = "ConnectivityNode"; -const char* ConnectivityNode::debugString() -{ - return ConnectivityNode::debugName; } const BaseClassDefiner ConnectivityNode::declare() @@ -176,4 +210,10 @@ const BaseClassDefiner ConnectivityNode::declare() return BaseClassDefiner(ConnectivityNode::addConstructToMap, ConnectivityNode::addPrimitiveAssignFnsToMap, ConnectivityNode::addClassAssignFnsToMap, ConnectivityNode::debugName); } - +namespace CIMPP +{ + BaseClass* ConnectivityNode_factory() + { + return new ConnectivityNode; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ConnectivityNode.hpp b/CGMES_2.4.15_27JAN2020/ConnectivityNode.hpp index 58c9d92f9..cf94752de 100644 --- a/CGMES_2.4.15_27JAN2020/ConnectivityNode.hpp +++ b/CGMES_2.4.15_27JAN2020/ConnectivityNode.hpp @@ -1,51 +1,52 @@ #ifndef ConnectivityNode_H #define ConnectivityNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "String.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ConnectivityNodeContainer; + class Terminal; + class TopologicalNode; -class Terminal; -class ConnectivityNodeContainer; -class TopologicalNode; /* Connectivity nodes are points where terminals of AC conducting equipment are connected together with zero impedance. */ - class ConnectivityNode: public IdentifiedObject + class ConnectivityNode : public IdentifiedObject { - public: - std::list Terminals; /* The connectivity node to which this terminal connects with zero impedance. Default: 0 */ - CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* Container of this connectivity node. Default: 0 */ - CIMPP::TopologicalNode* TopologicalNode; /* The connectivity nodes combine together to form this topological node. May depend on the current state of switches in the network. Default: 0 */ - CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ - CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConnectivityNode(); - virtual ~ConnectivityNode(); - + ~ConnectivityNode() override; + + CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* Container of this connectivity node. Default: 0 */ + std::list Terminals; /* The connectivity node to which this terminal connects with zero impedance. Default: 0 */ + CIMPP::TopologicalNode* TopologicalNode; /* The topological node to which this connectivity node is assigned. May depend on the current state of switches in the network. Default: 0 */ + CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ + CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConnectivityNode_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.cpp b/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.cpp index f9b396575..a5ed6251f 100644 --- a/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.cpp +++ b/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.cpp @@ -1,62 +1,76 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ConnectivityNodeContainer.hpp" +#include +#include + #include "ConnectivityNode.hpp" #include "TopologicalNode.hpp" using namespace CIMPP; ConnectivityNodeContainer::ConnectivityNodeContainer() {}; - ConnectivityNodeContainer::~ConnectivityNodeContainer() {}; -bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConnectivityNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass*, BaseClass*); +bool assign_ConnectivityNodeContainer_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConnectivityNodes.begin(), element->ConnectivityNodes.end(), element2) == element->ConnectivityNodes.end()) + { + element->ConnectivityNodes.push_back(element2); + return assign_ConnectivityNode_ConnectivityNodeContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass*, BaseClass*); +bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ConnectivityNodeContainer* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNode.begin(), element->TopologicalNode.end(), element2) == element->TopologicalNode.end()) + { + element->TopologicalNode.push_back(element2); + return assign_TopologicalNode_ConnectivityNodeContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ConnectivityNodeContainer_factory() { - return new ConnectivityNodeContainer; - } +const char ConnectivityNodeContainer::debugName[] = "ConnectivityNodeContainer"; +const char* ConnectivityNodeContainer::debugString() const +{ + return ConnectivityNodeContainer::debugName; } -void ConnectivityNodeContainer::addConstructToMap(std::unordered_map& factory_map) { +void ConnectivityNodeContainer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer"), &ConnectivityNodeContainer_factory)); } -void ConnectivityNodeContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ConnectivityNodeContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.ConnectivityNodes"), &assign_ConnectivityNodeContainer_ConnectivityNodes)); - assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.TopologicalNode"), &assign_ConnectivityNodeContainer_TopologicalNode)); +void ConnectivityNodeContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ConnectivityNodeContainer::debugName[] = "ConnectivityNodeContainer"; -const char* ConnectivityNodeContainer::debugString() +void ConnectivityNodeContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ConnectivityNodeContainer::debugName; + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.ConnectivityNodes"), &assign_ConnectivityNodeContainer_ConnectivityNodes)); + assign_map.insert(std::make_pair(std::string("cim:ConnectivityNodeContainer.TopologicalNode"), &assign_ConnectivityNodeContainer_TopologicalNode)); } const BaseClassDefiner ConnectivityNodeContainer::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ConnectivityNodeContainer::declare() return BaseClassDefiner(ConnectivityNodeContainer::addConstructToMap, ConnectivityNodeContainer::addPrimitiveAssignFnsToMap, ConnectivityNodeContainer::addClassAssignFnsToMap, ConnectivityNodeContainer::debugName); } - +namespace CIMPP +{ + BaseClass* ConnectivityNodeContainer_factory() + { + return new ConnectivityNodeContainer; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.hpp b/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.hpp index dc14dea02..0b188b41b 100644 --- a/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.hpp +++ b/CGMES_2.4.15_27JAN2020/ConnectivityNodeContainer.hpp @@ -1,40 +1,41 @@ #ifndef ConnectivityNodeContainer_H #define ConnectivityNodeContainer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ConnectivityNode; + class TopologicalNode; -class ConnectivityNode; -class TopologicalNode; /* A base class for all objects that may contain connectivity nodes or topological nodes. */ - class ConnectivityNodeContainer: public PowerSystemResource + class ConnectivityNodeContainer : public PowerSystemResource { - public: - std::list ConnectivityNodes; /* Connectivity nodes which belong to this connectivity node container. Default: 0 */ - std::list TopologicalNode; /* The topological nodes which belong to this connectivity node container. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ConnectivityNodeContainer(); - virtual ~ConnectivityNodeContainer(); - + ~ConnectivityNodeContainer() override; + + std::list ConnectivityNodes; /* Connectivity nodes which belong to this connectivity node container. Default: 0 */ + std::list TopologicalNode; /* The topological nodes which belong to this connectivity node container. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ConnectivityNodeContainer_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Connector.cpp b/CGMES_2.4.15_27JAN2020/Connector.cpp index e4754630f..55025d4c6 100644 --- a/CGMES_2.4.15_27JAN2020/Connector.cpp +++ b/CGMES_2.4.15_27JAN2020/Connector.cpp @@ -1,36 +1,36 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Connector.hpp" +#include +#include + using namespace CIMPP; Connector::Connector() {}; - Connector::~Connector() {}; -namespace CIMPP { - BaseClass* Connector_factory() { - return new Connector; - } +const char Connector::debugName[] = "Connector"; +const char* Connector::debugString() const +{ + return Connector::debugName; } -void Connector::addConstructToMap(std::unordered_map& factory_map) { +void Connector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Connector"), &Connector_factory)); } -void Connector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Connector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Connector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Connector::debugName[] = "Connector"; -const char* Connector::debugString() +void Connector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Connector::debugName; } const BaseClassDefiner Connector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Connector::declare() return BaseClassDefiner(Connector::addConstructToMap, Connector::addPrimitiveAssignFnsToMap, Connector::addClassAssignFnsToMap, Connector::debugName); } - +namespace CIMPP +{ + BaseClass* Connector_factory() + { + return new Connector; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Connector.hpp b/CGMES_2.4.15_27JAN2020/Connector.hpp index 6322a9360..9c7e0b2a4 100644 --- a/CGMES_2.4.15_27JAN2020/Connector.hpp +++ b/CGMES_2.4.15_27JAN2020/Connector.hpp @@ -1,36 +1,37 @@ #ifndef Connector_H #define Connector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A conductor, or group of conductors, with negligible impedance, that serve to connect other conducting equipment within a single substation and are modelled with a single logical terminal. */ - class Connector: public ConductingEquipment + class Connector : public ConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Connector(); - virtual ~Connector(); - + ~Connector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Connector_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Control.cpp b/CGMES_2.4.15_27JAN2020/Control.cpp index 75af44fa1..9aba93e37 100644 --- a/CGMES_2.4.15_27JAN2020/Control.cpp +++ b/CGMES_2.4.15_27JAN2020/Control.cpp @@ -1,49 +1,70 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Control.hpp" +#include +#include + +#include "PowerSystemResource.hpp" #include "String.hpp" #include "Boolean.hpp" #include "DateTime.hpp" #include "UnitMultiplier.hpp" #include "UnitSymbol.hpp" -#include "PowerSystemResource.hpp" using namespace CIMPP; -Control::Control(): timeStamp(nullptr), PowerSystemResource(nullptr) {}; - +Control::Control() : PowerSystemResource(nullptr) {}; Control::~Control() {}; - -bool assign_Control_timeStamp(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - element->timeStamp = dynamic_cast(BaseClass_ptr2); - if(element->timeStamp != nullptr) - return true; - } - return false; +bool assign_Control_controlType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + element->controlType = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } - - -bool assign_PowerSystemResource_Controls(BaseClass*, BaseClass*); -bool assign_Control_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemResource = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemResource != nullptr) - return assign_PowerSystemResource_Controls(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Control_operationInProgress(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operationInProgress; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_Control_timeStamp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + element->timeStamp = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Control_controlType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - element->controlType = buffer.str(); - if(buffer.fail()) +bool assign_Control_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitMultiplier; + if (buffer.fail()) return false; else return true; @@ -51,70 +72,65 @@ bool assign_Control_controlType(std::stringstream &buffer, BaseClass* BaseClass_ return false; } -bool assign_Control_operationInProgress(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operationInProgress; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Control_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Control* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitSymbol; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Control_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PowerSystemResource_Controls(BaseClass*, BaseClass*); +bool assign_Control_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Control* element = dynamic_cast(BaseClass_ptr1); + PowerSystemResource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemResource != element2) + { + element->PowerSystemResource = element2; + return assign_PowerSystemResource_Controls(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Control_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Control* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitSymbol; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Control_factory() { - return new Control; - } + + + +const char Control::debugName[] = "Control"; +const char* Control::debugString() const +{ + return Control::debugName; } -void Control::addConstructToMap(std::unordered_map& factory_map) { +void Control::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Control"), &Control_factory)); } -void Control::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Control::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Control.controlType"), &assign_Control_controlType)); assign_map.insert(std::make_pair(std::string("cim:Control.operationInProgress"), &assign_Control_operationInProgress)); - assign_map.insert(std::make_pair(std::string("cim:Control.unitMultiplier"), &assign_Control_unitMultiplier)); + assign_map.insert(std::make_pair(std::string("cim:Control.timeStamp"), &assign_Control_timeStamp)); + assign_map.insert(std::make_pair(std::string("cim:Control.unitMultiplier"), &assign_Control_unitMultiplier)); assign_map.insert(std::make_pair(std::string("cim:Control.unitSymbol"), &assign_Control_unitSymbol)); - } - -void Control::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Control.timeStamp"), &assign_Control_timeStamp)); - assign_map.insert(std::make_pair(std::string("cim:Control.PowerSystemResource"), &assign_Control_PowerSystemResource)); } -const char Control::debugName[] = "Control"; -const char* Control::debugString() +void Control::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Control::debugName; + assign_map.insert(std::make_pair(std::string("cim:Control.PowerSystemResource"), &assign_Control_PowerSystemResource)); } const BaseClassDefiner Control::declare() @@ -122,4 +138,10 @@ const BaseClassDefiner Control::declare() return BaseClassDefiner(Control::addConstructToMap, Control::addPrimitiveAssignFnsToMap, Control::addClassAssignFnsToMap, Control::debugName); } - +namespace CIMPP +{ + BaseClass* Control_factory() + { + return new Control; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Control.hpp b/CGMES_2.4.15_27JAN2020/Control.hpp index 0eda4c1bb..8d2c55032 100644 --- a/CGMES_2.4.15_27JAN2020/Control.hpp +++ b/CGMES_2.4.15_27JAN2020/Control.hpp @@ -1,48 +1,49 @@ #ifndef Control_H #define Control_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "String.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "DateTime.hpp" +#include "String.hpp" #include "UnitMultiplier.hpp" #include "UnitSymbol.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PowerSystemResource; -class DateTime; -class PowerSystemResource; /* Control is used for supervisory/device control. It represents control outputs that are used to change the state in a process, e.g. close or open breaker, a set point value or a raise lower command. */ - class Control: public IdentifiedObject + class Control : public IdentifiedObject { - public: - CIMPP::String controlType; /* Specifies the type of Control, e.g. BreakerOn/Off, GeneratorVoltageSetPoint, TieLineFlow etc. The ControlType.name shall be unique among all specified types and describe the type. Default: '' */ - CIMPP::Boolean operationInProgress; /* Indicates that a client is currently sending control commands that has not completed. Default: false */ - CIMPP::DateTime* timeStamp; /* The last time a control output was sent. Default: '' */ - CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the controlled quantity. Default: 0 */ - CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the controlled quantity. Default: 0 */ - CIMPP::PowerSystemResource* PowerSystemResource; /* The controller outputs used to actually govern a regulating device, e.g. the magnetization of a synchronous machine or capacitor bank breaker actuator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Control(); - virtual ~Control(); - + ~Control() override; + + CIMPP::PowerSystemResource* PowerSystemResource; /* The controller outputs used to actually govern a regulating device, e.g. the magnetization of a synchronous machine or capacitor bank breaker actuator. Default: 0 */ + CIMPP::String controlType; /* Specifies the type of Control, e.g. BreakerOn/Off, GeneratorVoltageSetPoint, TieLineFlow etc. The ControlType.name shall be unique among all specified types and describe the type. Default: '' */ + CIMPP::Boolean operationInProgress; /* Indicates that a client is currently sending control commands that has not completed. Default: false */ + CIMPP::DateTime timeStamp; /* The last time a control output was sent. Default: '' */ + CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the controlled quantity. Default: 0 */ + CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the controlled quantity. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Control_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ControlArea.cpp b/CGMES_2.4.15_27JAN2020/ControlArea.cpp index a86d19b3c..81143d238 100644 --- a/CGMES_2.4.15_27JAN2020/ControlArea.cpp +++ b/CGMES_2.4.15_27JAN2020/ControlArea.cpp @@ -1,120 +1,144 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ControlArea.hpp" -#include "ControlAreaTypeKind.hpp" -#include "TieFlow.hpp" +#include +#include + #include "ControlAreaGeneratingUnit.hpp" #include "EnergyArea.hpp" +#include "TieFlow.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" +#include "ControlAreaTypeKind.hpp" using namespace CIMPP; -ControlArea::ControlArea(): EnergyArea(nullptr) {}; - +ControlArea::ControlArea() : EnergyArea(nullptr) {}; ControlArea::~ControlArea() {}; -bool assign_ControlArea_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TieFlow.push_back(dynamic_cast(BaseClass_ptr2)); + + +bool assign_ControlArea_netInterchange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ControlArea* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->netInterchange; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ControlAreaGeneratingUnit.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ControlArea_pTolerance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ControlArea* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pTolerance; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_EnergyArea_ControlArea(BaseClass*, BaseClass*); -bool assign_ControlArea_EnergyArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - element->EnergyArea = dynamic_cast(BaseClass_ptr2); - if(element->EnergyArea != nullptr) - return assign_EnergyArea_ControlArea(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ControlArea_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ControlArea* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->type; + if (buffer.fail()) + return false; + else + return true; + } + return false; } - - -bool assign_ControlArea_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ControlAreaGeneratingUnit_ControlArea(BaseClass*, BaseClass*); +bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlArea* element = dynamic_cast(BaseClass_ptr1); + ControlAreaGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ControlAreaGeneratingUnit.begin(), element->ControlAreaGeneratingUnit.end(), element2) == element->ControlAreaGeneratingUnit.end()) + { + element->ControlAreaGeneratingUnit.push_back(element2); + return assign_ControlAreaGeneratingUnit_ControlArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_EnergyArea_ControlArea(BaseClass*, BaseClass*); +bool assign_ControlArea_EnergyArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlArea* element = dynamic_cast(BaseClass_ptr1); + EnergyArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EnergyArea != element2) + { + element->EnergyArea = element2; + return assign_EnergyArea_ControlArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_TieFlow_ControlArea(BaseClass*, BaseClass*); +bool assign_ControlArea_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlArea* element = dynamic_cast(BaseClass_ptr1); + TieFlow* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TieFlow.begin(), element->TieFlow.end(), element2) == element->TieFlow.end()) + { + element->TieFlow.push_back(element2); + return assign_TieFlow_ControlArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_ControlArea_netInterchange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->netInterchange; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ControlArea_pTolerance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ControlArea* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pTolerance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ControlArea_factory() { - return new ControlArea; - } +const char ControlArea::debugName[] = "ControlArea"; +const char* ControlArea::debugString() const +{ + return ControlArea::debugName; } -void ControlArea::addConstructToMap(std::unordered_map& factory_map) { +void ControlArea::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ControlArea"), &ControlArea_factory)); } -void ControlArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ControlArea.type"), &assign_ControlArea_type)); - assign_map.insert(std::make_pair(std::string("cim:ControlArea.netInterchange"), &assign_ControlArea_netInterchange)); +void ControlArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ControlArea.netInterchange"), &assign_ControlArea_netInterchange)); assign_map.insert(std::make_pair(std::string("cim:ControlArea.pTolerance"), &assign_ControlArea_pTolerance)); + assign_map.insert(std::make_pair(std::string("cim:ControlArea.type"), &assign_ControlArea_type)); } -void ControlArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ControlArea.TieFlow"), &assign_ControlArea_TieFlow)); +void ControlArea::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ControlArea.ControlAreaGeneratingUnit"), &assign_ControlArea_ControlAreaGeneratingUnit)); assign_map.insert(std::make_pair(std::string("cim:ControlArea.EnergyArea"), &assign_ControlArea_EnergyArea)); - } - -const char ControlArea::debugName[] = "ControlArea"; -const char* ControlArea::debugString() -{ - return ControlArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:ControlArea.TieFlow"), &assign_ControlArea_TieFlow)); } const BaseClassDefiner ControlArea::declare() @@ -122,4 +146,10 @@ const BaseClassDefiner ControlArea::declare() return BaseClassDefiner(ControlArea::addConstructToMap, ControlArea::addPrimitiveAssignFnsToMap, ControlArea::addClassAssignFnsToMap, ControlArea::debugName); } - +namespace CIMPP +{ + BaseClass* ControlArea_factory() + { + return new ControlArea; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ControlArea.hpp b/CGMES_2.4.15_27JAN2020/ControlArea.hpp index 22ecc359d..69d562f82 100644 --- a/CGMES_2.4.15_27JAN2020/ControlArea.hpp +++ b/CGMES_2.4.15_27JAN2020/ControlArea.hpp @@ -1,47 +1,48 @@ #ifndef ControlArea_H #define ControlArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "ControlAreaTypeKind.hpp" +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "ControlAreaTypeKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ControlAreaGeneratingUnit; + class EnergyArea; + class TieFlow; -class TieFlow; -class ControlAreaGeneratingUnit; -class EnergyArea; /* A control areais a grouping of generating units and/or loads and a cutset of tie lines (as terminals) which may be used for a variety of purposes including automatic generation control, powerflow solution area interchange control specification, and input to load forecasting. Note that any number of overlapping control area specifications can be superimposed on the physical model. */ - class ControlArea: public PowerSystemResource + class ControlArea : public PowerSystemResource { - public: - CIMPP::ControlAreaTypeKind type; /* The primary type of control area definition used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. A control area specified with primary type of automatic generation control could still be forecast and used as an interchange area in power flow analysis. Default: 0 */ - std::list TieFlow; /* The tie flows associated with the control area. Default: 0 */ - std::list ControlAreaGeneratingUnit; /* The generating unit specificaitons for the control area. Default: 0 */ - CIMPP::EnergyArea* EnergyArea; /* The energy area that is forecast from this control area specification. Default: 0 */ - CIMPP::ActivePower netInterchange; /* The specified positive net interchange into the control area, i.e. positive sign means flow in to the area. Default: nullptr */ - CIMPP::ActivePower pTolerance; /* Active power net interchange tolerance Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ControlArea(); - virtual ~ControlArea(); - + ~ControlArea() override; + + std::list ControlAreaGeneratingUnit; /* The generating unit specificaitons for the control area. Default: 0 */ + CIMPP::EnergyArea* EnergyArea; /* The energy area that is forecast from this control area specification. Default: 0 */ + std::list TieFlow; /* The tie flows associated with the control area. Default: 0 */ + CIMPP::ActivePower netInterchange; /* The specified positive net interchange into the control area, i.e. positive sign means flow in to the area. Default: nullptr */ + CIMPP::ActivePower pTolerance; /* Active power net interchange tolerance Default: nullptr */ + CIMPP::ControlAreaTypeKind type; /* The primary type of control area definition used to determine if this is used for automatic generation control, for planning interchange control, or other purposes. A control area specified with primary type of automatic generation control could still be forecast and used as an interchange area in power flow analysis. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ControlArea_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.cpp index a9f06554d..40ad5b42f 100644 --- a/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ControlAreaGeneratingUnit.hpp" -#include "GeneratingUnit.hpp" +#include +#include + #include "ControlArea.hpp" +#include "GeneratingUnit.hpp" using namespace CIMPP; -ControlAreaGeneratingUnit::ControlAreaGeneratingUnit(): GeneratingUnit(nullptr), ControlArea(nullptr) {}; - +ControlAreaGeneratingUnit::ControlAreaGeneratingUnit() : ControlArea(nullptr), GeneratingUnit(nullptr) {}; ControlAreaGeneratingUnit::~ControlAreaGeneratingUnit() {}; -bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); -bool assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->GeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->GeneratingUnit != nullptr) - return assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); -bool assign_ControlAreaGeneratingUnit_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->ControlArea = dynamic_cast(BaseClass_ptr2); - if(element->ControlArea != nullptr) - return assign_ControlArea_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ControlArea_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); +bool assign_ControlAreaGeneratingUnit_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + ControlArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ControlArea != element2) + { + element->ControlArea = element2; + return assign_ControlArea_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* ControlAreaGeneratingUnit_factory() { - return new ControlAreaGeneratingUnit; +bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass*, BaseClass*); +bool assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ControlAreaGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + GeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->GeneratingUnit != element2) + { + element->GeneratingUnit = element2; + return assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ControlAreaGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit"), &ControlAreaGeneratingUnit_factory)); +const char ControlAreaGeneratingUnit::debugName[] = "ControlAreaGeneratingUnit"; +const char* ControlAreaGeneratingUnit::debugString() const +{ + return ControlAreaGeneratingUnit::debugName; } -void ControlAreaGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ControlAreaGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit"), &ControlAreaGeneratingUnit_factory)); +} -void ControlAreaGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.GeneratingUnit"), &assign_ControlAreaGeneratingUnit_GeneratingUnit)); - assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.ControlArea"), &assign_ControlAreaGeneratingUnit_ControlArea)); +void ControlAreaGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ControlAreaGeneratingUnit::debugName[] = "ControlAreaGeneratingUnit"; -const char* ControlAreaGeneratingUnit::debugString() +void ControlAreaGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ControlAreaGeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.ControlArea"), &assign_ControlAreaGeneratingUnit_ControlArea)); + assign_map.insert(std::make_pair(std::string("cim:ControlAreaGeneratingUnit.GeneratingUnit"), &assign_ControlAreaGeneratingUnit_GeneratingUnit)); } const BaseClassDefiner ControlAreaGeneratingUnit::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ControlAreaGeneratingUnit::declare() return BaseClassDefiner(ControlAreaGeneratingUnit::addConstructToMap, ControlAreaGeneratingUnit::addPrimitiveAssignFnsToMap, ControlAreaGeneratingUnit::addClassAssignFnsToMap, ControlAreaGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* ControlAreaGeneratingUnit_factory() + { + return new ControlAreaGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.hpp index 80d838c5f..96eb060c9 100644 --- a/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/ControlAreaGeneratingUnit.hpp @@ -1,40 +1,41 @@ #ifndef ControlAreaGeneratingUnit_H #define ControlAreaGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ControlArea; + class GeneratingUnit; -class GeneratingUnit; -class ControlArea; /* A control area generating unit. This class is needed so that alternate control area definitions may include the same generating unit. Note only one instance within a control area should reference a specific generating unit. */ - class ControlAreaGeneratingUnit: public IdentifiedObject + class ControlAreaGeneratingUnit : public IdentifiedObject { - public: - CIMPP::GeneratingUnit* GeneratingUnit; /* The generating unit specified for this control area. Note that a control area should include a GeneratingUnit only once. Default: 0 */ - CIMPP::ControlArea* ControlArea; /* The parent control area for the generating unit specifications. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ControlAreaGeneratingUnit(); - virtual ~ControlAreaGeneratingUnit(); - + ~ControlAreaGeneratingUnit() override; + + CIMPP::ControlArea* ControlArea; /* The parent control area for the generating unit specifications. Default: 0 */ + CIMPP::GeneratingUnit* GeneratingUnit; /* The generating unit specified for this control area. Note that a control area should include a GeneratingUnit only once. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ControlAreaGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.cpp b/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.cpp index 46a651a3f..48f6c0cb5 100644 --- a/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ControlAreaTypeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ControlAreaTypeKind& rop) +ControlAreaTypeKind& ControlAreaTypeKind::operator=(ControlAreaTypeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ControlAreaTypeKind::operator ControlAreaTypeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ControlAreaTypeKind::debugName[] = "ControlAreaTypeKind"; +const char* ControlAreaTypeKind::debugString() const +{ + return ControlAreaTypeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ControlAreaTypeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ControlAreaTypeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ControlAreaTypeKind::AGC) + { + EnumSymbol = "AGC"; + } + if (obj.value == ControlAreaTypeKind::Forecast) + { + EnumSymbol = "Forecast"; + } + if (obj.value == ControlAreaTypeKind::Interchange) + { + EnumSymbol = "Interchange"; + } + + if (!EnumSymbol.empty()) + { + os << "ControlAreaTypeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.hpp b/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.hpp index d111ce9ae..025df1d5c 100644 --- a/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ControlAreaTypeKind.hpp @@ -1,25 +1,50 @@ #ifndef ControlAreaTypeKind_H #define ControlAreaTypeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The type of control area. */ - enum class ControlAreaTypeKind + class ControlAreaTypeKind { - /** - * Used for automatic generation control. - */ - AGC, - /** - * Used for load forecast. - */ - Forecast, - /** - * Used for interchange specification or control. - */ - Interchange, + public: + enum ControlAreaTypeKind_ENUM + { + /** + * Used for automatic generation control. + */ + AGC, + /** + * Used for load forecast. + */ + Forecast, + /** + * Used for interchange specification or control. + */ + Interchange, + }; + + ControlAreaTypeKind() : value(), initialized(false) {} + ControlAreaTypeKind(ControlAreaTypeKind_ENUM value) : value(value), initialized(true) {} + + ControlAreaTypeKind& operator=(ControlAreaTypeKind_ENUM rop); + operator ControlAreaTypeKind_ENUM() const; + + ControlAreaTypeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ControlAreaTypeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ControlAreaTypeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ControlAreaTypeKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/CoordinateSystem.cpp b/CGMES_2.4.15_27JAN2020/CoordinateSystem.cpp index e37246668..c4d4dd7f2 100644 --- a/CGMES_2.4.15_27JAN2020/CoordinateSystem.cpp +++ b/CGMES_2.4.15_27JAN2020/CoordinateSystem.cpp @@ -1,63 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CoordinateSystem.hpp" -#include "String.hpp" +#include +#include + #include "Location.hpp" +#include "String.hpp" using namespace CIMPP; CoordinateSystem::CoordinateSystem() {}; - CoordinateSystem::~CoordinateSystem() {}; -bool assign_CoordinateSystem_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(CoordinateSystem* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Location.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_CoordinateSystem_crsUrn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CoordinateSystem* element = dynamic_cast(BaseClass_ptr1)) + { + element->crsUrn = buffer.str(); + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_CoordinateSystem_crsUrn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CoordinateSystem* element = dynamic_cast(BaseClass_ptr1)) { - element->crsUrn = buffer.str(); - if(buffer.fail()) - return false; - else - return true; +bool assign_Location_CoordinateSystem(BaseClass*, BaseClass*); +bool assign_CoordinateSystem_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + CoordinateSystem* element = dynamic_cast(BaseClass_ptr1); + Location* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Location.begin(), element->Location.end(), element2) == element->Location.end()) + { + element->Location.push_back(element2); + return assign_Location_CoordinateSystem(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } return false; } -namespace CIMPP { - BaseClass* CoordinateSystem_factory() { - return new CoordinateSystem; - } +const char CoordinateSystem::debugName[] = "CoordinateSystem"; +const char* CoordinateSystem::debugString() const +{ + return CoordinateSystem::debugName; } -void CoordinateSystem::addConstructToMap(std::unordered_map& factory_map) { +void CoordinateSystem::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CoordinateSystem"), &CoordinateSystem_factory)); } -void CoordinateSystem::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CoordinateSystem::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:CoordinateSystem.crsUrn"), &assign_CoordinateSystem_crsUrn)); - } - -void CoordinateSystem::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CoordinateSystem.Location"), &assign_CoordinateSystem_Location)); } -const char CoordinateSystem::debugName[] = "CoordinateSystem"; -const char* CoordinateSystem::debugString() +void CoordinateSystem::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CoordinateSystem::debugName; + assign_map.insert(std::make_pair(std::string("cim:CoordinateSystem.Location"), &assign_CoordinateSystem_Location)); } const BaseClassDefiner CoordinateSystem::declare() @@ -65,4 +74,10 @@ const BaseClassDefiner CoordinateSystem::declare() return BaseClassDefiner(CoordinateSystem::addConstructToMap, CoordinateSystem::addPrimitiveAssignFnsToMap, CoordinateSystem::addClassAssignFnsToMap, CoordinateSystem::debugName); } - +namespace CIMPP +{ + BaseClass* CoordinateSystem_factory() + { + return new CoordinateSystem; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CoordinateSystem.hpp b/CGMES_2.4.15_27JAN2020/CoordinateSystem.hpp index 5202e0375..e3b72d8ce 100644 --- a/CGMES_2.4.15_27JAN2020/CoordinateSystem.hpp +++ b/CGMES_2.4.15_27JAN2020/CoordinateSystem.hpp @@ -1,40 +1,41 @@ #ifndef CoordinateSystem_H #define CoordinateSystem_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Location; - -class Location; /* Coordinate reference system. */ - class CoordinateSystem: public IdentifiedObject + class CoordinateSystem : public IdentifiedObject { - public: - CIMPP::String crsUrn; /* A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define `Location.PositionPoints`. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc:def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry web site http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. Default: '' */ - std::list Location; /* All locations described with position points in this coordinate system. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CoordinateSystem(); - virtual ~CoordinateSystem(); - + ~CoordinateSystem() override; + + std::list Location; /* All locations described with position points in this coordinate system. Default: 0 */ + CIMPP::String crsUrn; /* A Uniform Resource Name (URN) for the coordinate reference system (crs) used to define `Location.PositionPoints`. An example would be the European Petroleum Survey Group (EPSG) code for a coordinate reference system, defined in URN under the Open Geospatial Consortium (OGC) namespace as: urn:ogc:def:uom:EPSG::XXXX, where XXXX is an EPSG code (a full list of codes can be found at the EPSG Registry web site http://www.epsg-registry.org/). To define the coordinate system as being WGS84 (latitude, longitude) using an EPSG OGC, this attribute would be urn:ogc:def:uom:EPSG::4236. A profile should limit this code to a set of allowed URNs agreed to by all sending and receiving parties. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CoordinateSystem_factory(); diff --git a/CGMES_2.4.15_27JAN2020/CsConverter.cpp b/CGMES_2.4.15_27JAN2020/CsConverter.cpp index 57dfc3311..3998e98e5 100644 --- a/CGMES_2.4.15_27JAN2020/CsConverter.cpp +++ b/CGMES_2.4.15_27JAN2020/CsConverter.cpp @@ -1,246 +1,260 @@ -#include -#include "ACDCConverter.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CsConverter.hpp" +#include +#include + #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" -#include "CurrentFlow.hpp" #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" #include "CurrentFlow.hpp" +#include "AngleDegrees.hpp" +#include "AngleDegrees.hpp" #include "CurrentFlow.hpp" #include "CsOperatingModeKind.hpp" #include "CsPpccControlKind.hpp" -#include "AngleDegrees.hpp" -#include "AngleDegrees.hpp" #include "CurrentFlow.hpp" #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" +#include "CurrentFlow.hpp" using namespace CIMPP; CsConverter::CsConverter() {}; - CsConverter::~CsConverter() {}; +bool assign_CsConverter_alpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->alpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_gamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_maxAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxAlpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_maxGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxGamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_maxIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_minAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minAlpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_minGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minGamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_minIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operatingMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pPccControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_ratedIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_targetAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetAlpha; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_targetGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetGamma; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CsConverter_targetIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetIdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_CsConverter_maxAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxAlpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_maxGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxGamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_maxIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_minAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minAlpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CsConverter_minGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minGamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_minIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_ratedIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operatingMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pPccControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_targetAlpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetAlpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_targetGamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetGamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_targetIdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetIdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_alpha(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->alpha; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_CsConverter_gamma(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gamma; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* CsConverter_factory() { - return new CsConverter; - } + + + + + + + + + + +const char CsConverter::debugName[] = "CsConverter"; +const char* CsConverter::debugString() const +{ + return CsConverter::debugName; } -void CsConverter::addConstructToMap(std::unordered_map& factory_map) { +void CsConverter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CsConverter"), &CsConverter_factory)); } -void CsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:CsConverter.alpha"), &assign_CsConverter_alpha)); + assign_map.insert(std::make_pair(std::string("cim:CsConverter.gamma"), &assign_CsConverter_gamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.maxAlpha"), &assign_CsConverter_maxAlpha)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.maxGamma"), &assign_CsConverter_maxGamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.maxIdc"), &assign_CsConverter_maxIdc)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.minAlpha"), &assign_CsConverter_minAlpha)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.minGamma"), &assign_CsConverter_minGamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.minIdc"), &assign_CsConverter_minIdc)); - assign_map.insert(std::make_pair(std::string("cim:CsConverter.ratedIdc"), &assign_CsConverter_ratedIdc)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.operatingMode"), &assign_CsConverter_operatingMode)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.pPccControl"), &assign_CsConverter_pPccControl)); + assign_map.insert(std::make_pair(std::string("cim:CsConverter.ratedIdc"), &assign_CsConverter_ratedIdc)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.targetAlpha"), &assign_CsConverter_targetAlpha)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.targetGamma"), &assign_CsConverter_targetGamma)); assign_map.insert(std::make_pair(std::string("cim:CsConverter.targetIdc"), &assign_CsConverter_targetIdc)); - assign_map.insert(std::make_pair(std::string("cim:CsConverter.alpha"), &assign_CsConverter_alpha)); - assign_map.insert(std::make_pair(std::string("cim:CsConverter.gamma"), &assign_CsConverter_gamma)); } -void CsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char CsConverter::debugName[] = "CsConverter"; -const char* CsConverter::debugString() +void CsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CsConverter::debugName; } const BaseClassDefiner CsConverter::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner CsConverter::declare() return BaseClassDefiner(CsConverter::addConstructToMap, CsConverter::addPrimitiveAssignFnsToMap, CsConverter::addClassAssignFnsToMap, CsConverter::debugName); } - +namespace CIMPP +{ + BaseClass* CsConverter_factory() + { + return new CsConverter; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CsConverter.hpp b/CGMES_2.4.15_27JAN2020/CsConverter.hpp index 354356e32..b17bc6252 100644 --- a/CGMES_2.4.15_27JAN2020/CsConverter.hpp +++ b/CGMES_2.4.15_27JAN2020/CsConverter.hpp @@ -1,54 +1,55 @@ #ifndef CsConverter_H #define CsConverter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCConverter.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ACDCConverter.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -#include "CurrentFlow.hpp" #include "CsOperatingModeKind.hpp" #include "CsPpccControlKind.hpp" +#include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* DC side of the current source converter (CSC). */ - class CsConverter: public ACDCConverter + class CsConverter : public ACDCConverter { - public: - CIMPP::AngleDegrees maxAlpha; /* Maximum firing angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::AngleDegrees maxGamma; /* Maximum extinction angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow maxIdc; /* The maximum direct current (Id) on the DC side at which the converter should operate. Converter configuration data use in power flow. Default: nullptr */ - CIMPP::AngleDegrees minAlpha; /* Minimum firing angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::AngleDegrees minGamma; /* Minimum extinction angle. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow minIdc; /* The minimum direct current (Id) on the DC side at which the converter should operate. CSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow ratedIdc; /* Rated converter DC current, also called IdN. Converter configuration data used in power flow. Default: nullptr */ - CIMPP::CsOperatingModeKind operatingMode; /* Indicates whether the DC pole is operating as an inverter or as a rectifier. CSC control variable used in power flow. Default: 0 */ - CIMPP::CsPpccControlKind pPccControl; /* Default: 0 */ - CIMPP::AngleDegrees targetAlpha; /* Target firing angle. CSC control variable used in power flow. Default: nullptr */ - CIMPP::AngleDegrees targetGamma; /* Target extinction angle. CSC control variable used in power flow. Default: nullptr */ - CIMPP::CurrentFlow targetIdc; /* DC current target value. CSC control variable used in power flow. Default: nullptr */ - CIMPP::AngleDegrees alpha; /* Firing angle, typical value between 10 and 18 degrees for a rectifier. CSC state variable, result from power flow. Default: nullptr */ - CIMPP::AngleDegrees gamma; /* Extinction angle. CSC state variable, result from power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CsConverter(); - virtual ~CsConverter(); - + ~CsConverter() override; + + CIMPP::AngleDegrees alpha; /* Firing angle, typical value between 10 and 18 degrees for a rectifier. CSC state variable, result from power flow. Default: nullptr */ + CIMPP::AngleDegrees gamma; /* Extinction angle. CSC state variable, result from power flow. Default: nullptr */ + CIMPP::AngleDegrees maxAlpha; /* Maximum firing angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::AngleDegrees maxGamma; /* Maximum extinction angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::CurrentFlow maxIdc; /* The maximum direct current (Id) on the DC side at which the converter should operate. Converter configuration data use in power flow. Default: nullptr */ + CIMPP::AngleDegrees minAlpha; /* Minimum firing angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::AngleDegrees minGamma; /* Minimum extinction angle. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::CurrentFlow minIdc; /* The minimum direct current (Id) on the DC side at which the converter should operate. CSC configuration data used in power flow. Default: nullptr */ + CIMPP::CsOperatingModeKind operatingMode; /* Indicates whether the DC pole is operating as an inverter or as a rectifier. CSC control variable used in power flow. Default: 0 */ + CIMPP::CsPpccControlKind pPccControl; /* Default: 0 */ + CIMPP::CurrentFlow ratedIdc; /* Rated converter DC current, also called IdN. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::AngleDegrees targetAlpha; /* Target firing angle. CSC control variable used in power flow. Default: nullptr */ + CIMPP::AngleDegrees targetGamma; /* Target extinction angle. CSC control variable used in power flow. Default: nullptr */ + CIMPP::CurrentFlow targetIdc; /* DC current target value. CSC control variable used in power flow. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CsConverter_factory(); diff --git a/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.cpp b/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.cpp index a5c91bcad..61074c399 100644 --- a/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.cpp +++ b/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CsOperatingModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::CsOperatingModeKind& rop) +CsOperatingModeKind& CsOperatingModeKind::operator=(CsOperatingModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +CsOperatingModeKind::operator CsOperatingModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char CsOperatingModeKind::debugName[] = "CsOperatingModeKind"; +const char* CsOperatingModeKind::debugString() const +{ + return CsOperatingModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CsOperatingModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const CsOperatingModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == CsOperatingModeKind::inverter) + { + EnumSymbol = "inverter"; + } + if (obj.value == CsOperatingModeKind::rectifier) + { + EnumSymbol = "rectifier"; + } + + if (!EnumSymbol.empty()) + { + os << "CsOperatingModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.hpp b/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.hpp index bd6a1f51d..eb2af30bf 100644 --- a/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.hpp +++ b/CGMES_2.4.15_27JAN2020/CsOperatingModeKind.hpp @@ -1,21 +1,46 @@ #ifndef CsOperatingModeKind_H #define CsOperatingModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Operating mode for HVDC line operating as Current Source Converter. */ - enum class CsOperatingModeKind + class CsOperatingModeKind { - /** - * Operating as inverter - */ - inverter, - /** - * Operating as rectifier. - */ - rectifier, + public: + enum CsOperatingModeKind_ENUM + { + /** + * Operating as inverter + */ + inverter, + /** + * Operating as rectifier. + */ + rectifier, + }; + + CsOperatingModeKind() : value(), initialized(false) {} + CsOperatingModeKind(CsOperatingModeKind_ENUM value) : value(value), initialized(true) {} + + CsOperatingModeKind& operator=(CsOperatingModeKind_ENUM rop); + operator CsOperatingModeKind_ENUM() const; + + CsOperatingModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, CsOperatingModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const CsOperatingModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::CsOperatingModeKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/CsPpccControlKind.cpp b/CGMES_2.4.15_27JAN2020/CsPpccControlKind.cpp index 7dab2997c..e4e9aa9b2 100644 --- a/CGMES_2.4.15_27JAN2020/CsPpccControlKind.cpp +++ b/CGMES_2.4.15_27JAN2020/CsPpccControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CsPpccControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::CsPpccControlKind& rop) +CsPpccControlKind& CsPpccControlKind::operator=(CsPpccControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +CsPpccControlKind::operator CsPpccControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char CsPpccControlKind::debugName[] = "CsPpccControlKind"; +const char* CsPpccControlKind::debugString() const +{ + return CsPpccControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CsPpccControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const CsPpccControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == CsPpccControlKind::activePower) + { + EnumSymbol = "activePower"; + } + if (obj.value == CsPpccControlKind::dcVoltage) + { + EnumSymbol = "dcVoltage"; + } + if (obj.value == CsPpccControlKind::dcCurrent) + { + EnumSymbol = "dcCurrent"; + } + + if (!EnumSymbol.empty()) + { + os << "CsPpccControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CsPpccControlKind.hpp b/CGMES_2.4.15_27JAN2020/CsPpccControlKind.hpp index 049a5127f..3c17709fb 100644 --- a/CGMES_2.4.15_27JAN2020/CsPpccControlKind.hpp +++ b/CGMES_2.4.15_27JAN2020/CsPpccControlKind.hpp @@ -1,25 +1,50 @@ #ifndef CsPpccControlKind_H #define CsPpccControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Active power control modes for HVDC line operating as Current Source Converter. */ - enum class CsPpccControlKind + class CsPpccControlKind { - /** - * Active power control at AC side. - */ - activePower, - /** - * DC voltage control. - */ - dcVoltage, - /** - * DC current control - */ - dcCurrent, + public: + enum CsPpccControlKind_ENUM + { + /** + * Active power control at AC side. + */ + activePower, + /** + * DC voltage control. + */ + dcVoltage, + /** + * DC current control + */ + dcCurrent, + }; + + CsPpccControlKind() : value(), initialized(false) {} + CsPpccControlKind(CsPpccControlKind_ENUM value) : value(value), initialized(true) {} + + CsPpccControlKind& operator=(CsPpccControlKind_ENUM rop); + operator CsPpccControlKind_ENUM() const; + + CsPpccControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, CsPpccControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const CsPpccControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::CsPpccControlKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/Currency.cpp b/CGMES_2.4.15_27JAN2020/Currency.cpp index 360e9e694..0a4518071 100644 --- a/CGMES_2.4.15_27JAN2020/Currency.cpp +++ b/CGMES_2.4.15_27JAN2020/Currency.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Currency.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::Currency& rop) +Currency& Currency::operator=(Currency_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +Currency::operator Currency_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Currency::debugName[] = "Currency"; +const char* Currency::debugString() const +{ + return Currency::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Currency& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -93,5 +124,75 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const Currency& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == Currency::USD) + { + EnumSymbol = "USD"; + } + if (obj.value == Currency::EUR) + { + EnumSymbol = "EUR"; + } + if (obj.value == Currency::AUD) + { + EnumSymbol = "AUD"; + } + if (obj.value == Currency::CAD) + { + EnumSymbol = "CAD"; + } + if (obj.value == Currency::CHF) + { + EnumSymbol = "CHF"; + } + if (obj.value == Currency::CNY) + { + EnumSymbol = "CNY"; + } + if (obj.value == Currency::DKK) + { + EnumSymbol = "DKK"; + } + if (obj.value == Currency::GBP) + { + EnumSymbol = "GBP"; + } + if (obj.value == Currency::JPY) + { + EnumSymbol = "JPY"; + } + if (obj.value == Currency::NOK) + { + EnumSymbol = "NOK"; + } + if (obj.value == Currency::RUR) + { + EnumSymbol = "RUR"; + } + if (obj.value == Currency::SEK) + { + EnumSymbol = "SEK"; + } + if (obj.value == Currency::INR) + { + EnumSymbol = "INR"; + } + if (obj.value == Currency::other) + { + EnumSymbol = "other"; + } + + if (!EnumSymbol.empty()) + { + os << "Currency." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Currency.hpp b/CGMES_2.4.15_27JAN2020/Currency.hpp index 552514a04..f4de85751 100644 --- a/CGMES_2.4.15_27JAN2020/Currency.hpp +++ b/CGMES_2.4.15_27JAN2020/Currency.hpp @@ -1,69 +1,94 @@ #ifndef Currency_H #define Currency_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Monetary currencies. Apologies for this list not being exhaustive. */ - enum class Currency + class Currency { - /** - * US dollar - */ - USD, - /** - * European euro - */ - EUR, - /** - * Australian dollar - */ - AUD, - /** - * Canadian dollar - */ - CAD, - /** - * Swiss francs - */ - CHF, - /** - * Chinese yuan renminbi - */ - CNY, - /** - * Danish crown - */ - DKK, - /** - * British pound - */ - GBP, - /** - * Japanese yen - */ - JPY, - /** - * Norwegian crown - */ - NOK, - /** - * Russian ruble - */ - RUR, - /** - * Swedish crown - */ - SEK, - /** - * India rupees - */ - INR, - /** - * Another type of currency. - */ - other, + public: + enum Currency_ENUM + { + /** + * US dollar + */ + USD, + /** + * European euro + */ + EUR, + /** + * Australian dollar + */ + AUD, + /** + * Canadian dollar + */ + CAD, + /** + * Swiss francs + */ + CHF, + /** + * Chinese yuan renminbi + */ + CNY, + /** + * Danish crown + */ + DKK, + /** + * British pound + */ + GBP, + /** + * Japanese yen + */ + JPY, + /** + * Norwegian crown + */ + NOK, + /** + * Russian ruble + */ + RUR, + /** + * Swedish crown + */ + SEK, + /** + * India rupees + */ + INR, + /** + * Another type of currency. + */ + other, + }; + + Currency() : value(), initialized(false) {} + Currency(Currency_ENUM value) : value(value), initialized(true) {} + + Currency& operator=(Currency_ENUM rop); + operator Currency_ENUM() const; + + Currency_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Currency& rop); + friend std::ostream& operator<<(std::ostream& os, const Currency& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::Currency& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/CurrentFlow.cpp b/CGMES_2.4.15_27JAN2020/CurrentFlow.cpp index 9a05de0c9..56f73af6e 100644 --- a/CGMES_2.4.15_27JAN2020/CurrentFlow.cpp +++ b/CGMES_2.4.15_27JAN2020/CurrentFlow.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurrentFlow.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -CurrentFlow::CurrentFlow() {} -CurrentFlow::~CurrentFlow(){} +#include -CurrentFlow::CurrentFlow(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void CurrentFlow::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void CurrentFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +CurrentFlow& CurrentFlow::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void CurrentFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +CurrentFlow::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char CurrentFlow::debugName[] = "CurrentFlow"; -const char* CurrentFlow::debugString() { +const char* CurrentFlow::debugString() const +{ return CurrentFlow::debugName; } - -const BaseClassDefiner CurrentFlow::declare() { - return BaseClassDefiner(CurrentFlow::addConstructToMap, CurrentFlow::addPrimitiveAssignFnsToMap, CurrentFlow::addClassAssignFnsToMap, CurrentFlow::debugName); +CurrentFlow& CurrentFlow::operator+=(const CurrentFlow& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - CurrentFlow& CurrentFlow::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - CurrentFlow& CurrentFlow::operator-=(const CurrentFlow& rhs) { - value -= rhs.value; - return *this; - } - - CurrentFlow& CurrentFlow::operator*=(const CurrentFlow& rhs) { - value *= rhs.value; - return *this; - } - - CurrentFlow& CurrentFlow::operator/=(const CurrentFlow& rhs) { - value /= rhs.value; - return *this; - } +CurrentFlow& CurrentFlow::operator-=(const CurrentFlow& rhs) +{ + value -= rhs.value; + return *this; +} - CurrentFlow& CurrentFlow::operator+=(const CurrentFlow& rhs) { - value += rhs.value; - return *this; - } +CurrentFlow& CurrentFlow::operator*=(const CurrentFlow& rhs) +{ + value *= rhs.value; + return *this; +} - CurrentFlow::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +CurrentFlow& CurrentFlow::operator/=(const CurrentFlow& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, CurrentFlow& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CurrentFlow& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const CurrentFlow& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/CurrentFlow.hpp b/CGMES_2.4.15_27JAN2020/CurrentFlow.hpp index 72b277753..0f38f0f07 100644 --- a/CGMES_2.4.15_27JAN2020/CurrentFlow.hpp +++ b/CGMES_2.4.15_27JAN2020/CurrentFlow.hpp @@ -1,38 +1,39 @@ #ifndef CurrentFlow_H #define CurrentFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class CurrentFlow : public BaseClass + /* + Electrical current with sign convention: positive flow is out of the conducting equipment into the connectivity node. Can be both AC and DC. + */ + class CurrentFlow { - public: - CurrentFlow(); - virtual ~CurrentFlow(); - CurrentFlow(long double value); - static const BaseClassDefiner declare(); - CurrentFlow& operator=(long double &rop); + CurrentFlow() : value(0.0), initialized(false) {} + CurrentFlow(long double value) : value(value), initialized(true) {} + + CurrentFlow& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + CurrentFlow& operator+=(const CurrentFlow& rhs); CurrentFlow& operator-=(const CurrentFlow& rhs); CurrentFlow& operator*=(const CurrentFlow& rhs); CurrentFlow& operator/=(const CurrentFlow& rhs); + friend std::istream& operator>>(std::istream& lop, CurrentFlow& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const CurrentFlow& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/CurrentLimit.cpp b/CGMES_2.4.15_27JAN2020/CurrentLimit.cpp index 684b7a490..5572e0f4c 100644 --- a/CGMES_2.4.15_27JAN2020/CurrentLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/CurrentLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurrentLimit.hpp" +#include +#include + #include "CurrentFlow.hpp" using namespace CIMPP; CurrentLimit::CurrentLimit() {}; - CurrentLimit::~CurrentLimit() {}; +bool assign_CurrentLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurrentLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_CurrentLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurrentLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* CurrentLimit_factory() { - return new CurrentLimit; - } +const char CurrentLimit::debugName[] = "CurrentLimit"; +const char* CurrentLimit::debugString() const +{ + return CurrentLimit::debugName; } -void CurrentLimit::addConstructToMap(std::unordered_map& factory_map) { +void CurrentLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CurrentLimit"), &CurrentLimit_factory)); } -void CurrentLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void CurrentLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:CurrentLimit.value"), &assign_CurrentLimit_value)); } -void CurrentLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char CurrentLimit::debugName[] = "CurrentLimit"; -const char* CurrentLimit::debugString() +void CurrentLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CurrentLimit::debugName; } const BaseClassDefiner CurrentLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner CurrentLimit::declare() return BaseClassDefiner(CurrentLimit::addConstructToMap, CurrentLimit::addPrimitiveAssignFnsToMap, CurrentLimit::addClassAssignFnsToMap, CurrentLimit::debugName); } - +namespace CIMPP +{ + BaseClass* CurrentLimit_factory() + { + return new CurrentLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CurrentLimit.hpp b/CGMES_2.4.15_27JAN2020/CurrentLimit.hpp index a6b1f55e0..2b608fa40 100644 --- a/CGMES_2.4.15_27JAN2020/CurrentLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/CurrentLimit.hpp @@ -1,38 +1,39 @@ #ifndef CurrentLimit_H #define CurrentLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Operational limit on current. */ - class CurrentLimit: public OperationalLimit + class CurrentLimit : public OperationalLimit { - public: - CIMPP::CurrentFlow value; /* Limit on current flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CurrentLimit(); - virtual ~CurrentLimit(); - + ~CurrentLimit() override; + + CIMPP::CurrentFlow value; /* Limit on current flow. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CurrentLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Curve.cpp b/CGMES_2.4.15_27JAN2020/Curve.cpp index d5f3fdc24..e25ece428 100644 --- a/CGMES_2.4.15_27JAN2020/Curve.cpp +++ b/CGMES_2.4.15_27JAN2020/Curve.cpp @@ -1,109 +1,120 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Curve.hpp" +#include +#include + +#include "CurveData.hpp" #include "CurveStyle.hpp" #include "UnitSymbol.hpp" #include "UnitSymbol.hpp" #include "UnitSymbol.hpp" -#include "CurveData.hpp" using namespace CIMPP; Curve::Curve() {}; - Curve::~Curve() {}; +bool assign_Curve_curveStyle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->curveStyle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Curve_xUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xUnit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Curve_y1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y1Unit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Curve_CurveDatas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->CurveDatas.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Curve_y2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Curve* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y2Unit; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Curve_curveStyle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->curveStyle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_CurveData_Curve(BaseClass*, BaseClass*); +bool assign_Curve_CurveDatas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Curve* element = dynamic_cast(BaseClass_ptr1); + CurveData* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->CurveDatas.begin(), element->CurveDatas.end(), element2) == element->CurveDatas.end()) + { + element->CurveDatas.push_back(element2); + return assign_CurveData_Curve(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Curve_xUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Curve_y1Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y1Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Curve_y2Unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Curve* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y2Unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Curve_factory() { - return new Curve; - } +const char Curve::debugName[] = "Curve"; +const char* Curve::debugString() const +{ + return Curve::debugName; } -void Curve::addConstructToMap(std::unordered_map& factory_map) { +void Curve::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Curve"), &Curve_factory)); } -void Curve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Curve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Curve.curveStyle"), &assign_Curve_curveStyle)); assign_map.insert(std::make_pair(std::string("cim:Curve.xUnit"), &assign_Curve_xUnit)); assign_map.insert(std::make_pair(std::string("cim:Curve.y1Unit"), &assign_Curve_y1Unit)); assign_map.insert(std::make_pair(std::string("cim:Curve.y2Unit"), &assign_Curve_y2Unit)); - } - -void Curve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Curve.CurveDatas"), &assign_Curve_CurveDatas)); } -const char Curve::debugName[] = "Curve"; -const char* Curve::debugString() +void Curve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Curve::debugName; + assign_map.insert(std::make_pair(std::string("cim:Curve.CurveDatas"), &assign_Curve_CurveDatas)); } const BaseClassDefiner Curve::declare() @@ -111,4 +122,10 @@ const BaseClassDefiner Curve::declare() return BaseClassDefiner(Curve::addConstructToMap, Curve::addPrimitiveAssignFnsToMap, Curve::addClassAssignFnsToMap, Curve::debugName); } - +namespace CIMPP +{ + BaseClass* Curve_factory() + { + return new Curve; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Curve.hpp b/CGMES_2.4.15_27JAN2020/Curve.hpp index b305bb602..5a634c3df 100644 --- a/CGMES_2.4.15_27JAN2020/Curve.hpp +++ b/CGMES_2.4.15_27JAN2020/Curve.hpp @@ -1,44 +1,45 @@ #ifndef Curve_H #define Curve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "CurveStyle.hpp" #include "UnitSymbol.hpp" -namespace CIMPP { +namespace CIMPP +{ + class CurveData; - -class CurveData; /* A multi-purpose curve or functional relationship between an independent variable (X-axis) and dependent (Y-axis) variables. */ - class Curve: public IdentifiedObject + class Curve : public IdentifiedObject { - public: - CIMPP::CurveStyle curveStyle; /* The style or shape of the curve. Default: 0 */ - CIMPP::UnitSymbol xUnit; /* The X-axis units of measure. Default: 0 */ - CIMPP::UnitSymbol y1Unit; /* The Y1-axis units of measure. Default: 0 */ - CIMPP::UnitSymbol y2Unit; /* The Y2-axis units of measure. Default: 0 */ - std::list CurveDatas; /* The curve of this curve data point. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Curve(); - virtual ~Curve(); - + ~Curve() override; + + std::list CurveDatas; /* The curve of this curve data point. Default: 0 */ + CIMPP::CurveStyle curveStyle; /* The style or shape of the curve. Default: 0 */ + CIMPP::UnitSymbol xUnit; /* The X-axis units of measure. Default: 0 */ + CIMPP::UnitSymbol y1Unit; /* The Y1-axis units of measure. Default: 0 */ + CIMPP::UnitSymbol y2Unit; /* The Y2-axis units of measure. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Curve_factory(); diff --git a/CGMES_2.4.15_27JAN2020/CurveData.cpp b/CGMES_2.4.15_27JAN2020/CurveData.cpp index 652aafc9a..85447066e 100644 --- a/CGMES_2.4.15_27JAN2020/CurveData.cpp +++ b/CGMES_2.4.15_27JAN2020/CurveData.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurveData.hpp" +#include +#include + #include "Curve.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -9,86 +13,92 @@ using namespace CIMPP; -CurveData::CurveData(): Curve(nullptr) {}; - +CurveData::CurveData() : Curve(nullptr) {}; CurveData::~CurveData() {}; -bool assign_Curve_CurveDatas(BaseClass*, BaseClass*); -bool assign_CurveData_Curve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - element->Curve = dynamic_cast(BaseClass_ptr2); - if(element->Curve != nullptr) - return assign_Curve_CurveDatas(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_CurveData_xvalue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurveData* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xvalue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CurveData_y1value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurveData* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y1value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_CurveData_y2value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (CurveData* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y2value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_CurveData_xvalue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xvalue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Curve_CurveDatas(BaseClass*, BaseClass*); +bool assign_CurveData_Curve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + CurveData* element = dynamic_cast(BaseClass_ptr1); + Curve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Curve != element2) + { + element->Curve = element2; + return assign_Curve_CurveDatas(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_CurveData_y1value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y1value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_CurveData_y2value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(CurveData* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y2value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* CurveData_factory() { - return new CurveData; - } + +const char CurveData::debugName[] = "CurveData"; +const char* CurveData::debugString() const +{ + return CurveData::debugName; } -void CurveData::addConstructToMap(std::unordered_map& factory_map) { +void CurveData::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:CurveData"), &CurveData_factory)); } -void CurveData::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CurveData.xvalue"), &assign_CurveData_xvalue)); +void CurveData::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:CurveData.xvalue"), &assign_CurveData_xvalue)); assign_map.insert(std::make_pair(std::string("cim:CurveData.y1value"), &assign_CurveData_y1value)); assign_map.insert(std::make_pair(std::string("cim:CurveData.y2value"), &assign_CurveData_y2value)); } -void CurveData::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:CurveData.Curve"), &assign_CurveData_Curve)); - } - -const char CurveData::debugName[] = "CurveData"; -const char* CurveData::debugString() +void CurveData::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return CurveData::debugName; + assign_map.insert(std::make_pair(std::string("cim:CurveData.Curve"), &assign_CurveData_Curve)); } const BaseClassDefiner CurveData::declare() @@ -96,4 +106,10 @@ const BaseClassDefiner CurveData::declare() return BaseClassDefiner(CurveData::addConstructToMap, CurveData::addPrimitiveAssignFnsToMap, CurveData::addClassAssignFnsToMap, CurveData::debugName); } - +namespace CIMPP +{ + BaseClass* CurveData_factory() + { + return new CurveData; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CurveData.hpp b/CGMES_2.4.15_27JAN2020/CurveData.hpp index 0a0e0cf75..d728a8062 100644 --- a/CGMES_2.4.15_27JAN2020/CurveData.hpp +++ b/CGMES_2.4.15_27JAN2020/CurveData.hpp @@ -1,42 +1,43 @@ #ifndef CurveData_H #define CurveData_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Curve; - -class Curve; /* Multi-purpose data points for defining a curve. The use of this generic class is discouraged if a more specific class can be used to specify the x and y axis values along with their specific data types. */ - class CurveData: public BaseClass + class CurveData : public BaseClass { - public: - CIMPP::Curve* Curve; /* The point data values that define this curve. Default: 0 */ - CIMPP::Simple_Float xvalue; /* The data value of the X-axis variable, depending on the X-axis units. Default: nullptr */ - CIMPP::Simple_Float y1value; /* The data value of the first Y-axis variable, depending on the Y-axis units. Default: nullptr */ - CIMPP::Simple_Float y2value; /* The data value of the second Y-axis variable (if present), depending on the Y-axis units. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ CurveData(); - virtual ~CurveData(); - + ~CurveData() override; + + CIMPP::Curve* Curve; /* The point data values that define this curve. Default: 0 */ + CIMPP::Simple_Float xvalue; /* The data value of the X-axis variable, depending on the X-axis units. Default: nullptr */ + CIMPP::Simple_Float y1value; /* The data value of the first Y-axis variable, depending on the Y-axis units. Default: nullptr */ + CIMPP::Simple_Float y2value; /* The data value of the second Y-axis variable (if present), depending on the Y-axis units. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* CurveData_factory(); diff --git a/CGMES_2.4.15_27JAN2020/CurveStyle.cpp b/CGMES_2.4.15_27JAN2020/CurveStyle.cpp index b53fe27a8..d28696151 100644 --- a/CGMES_2.4.15_27JAN2020/CurveStyle.cpp +++ b/CGMES_2.4.15_27JAN2020/CurveStyle.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "CurveStyle.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::CurveStyle& rop) +CurveStyle& CurveStyle::operator=(CurveStyle_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +CurveStyle::operator CurveStyle_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char CurveStyle::debugName[] = "CurveStyle"; +const char* CurveStyle::debugString() const +{ + return CurveStyle::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, CurveStyle& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const CurveStyle& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == CurveStyle::constantYValue) + { + EnumSymbol = "constantYValue"; + } + if (obj.value == CurveStyle::straightLineYValues) + { + EnumSymbol = "straightLineYValues"; + } + + if (!EnumSymbol.empty()) + { + os << "CurveStyle." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/CurveStyle.hpp b/CGMES_2.4.15_27JAN2020/CurveStyle.hpp index 81789d1d0..72f95568c 100644 --- a/CGMES_2.4.15_27JAN2020/CurveStyle.hpp +++ b/CGMES_2.4.15_27JAN2020/CurveStyle.hpp @@ -1,21 +1,46 @@ #ifndef CurveStyle_H #define CurveStyle_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Style or shape of curve. */ - enum class CurveStyle + class CurveStyle { - /** - * The Y-axis values are assumed constant until the next curve point and prior to the first curve point. - */ - constantYValue, - /** - * The Y-axis values are assumed to be a straight line between values. Also known as linear interpolation. - */ - straightLineYValues, + public: + enum CurveStyle_ENUM + { + /** + * The Y-axis values are assumed constant until the next curve point and prior to the first curve point. + */ + constantYValue, + /** + * The Y-axis values are assumed to be a straight line between values. Also known as linear interpolation. + */ + straightLineYValues, + }; + + CurveStyle() : value(), initialized(false) {} + CurveStyle(CurveStyle_ENUM value) : value(value), initialized(true) {} + + CurveStyle& operator=(CurveStyle_ENUM rop); + operator CurveStyle_ENUM() const; + + CurveStyle_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, CurveStyle& rop); + friend std::ostream& operator<<(std::ostream& os, const CurveStyle& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::CurveStyle& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/DCBaseTerminal.cpp b/CGMES_2.4.15_27JAN2020/DCBaseTerminal.cpp index 5869dcb56..9f9ea9862 100644 --- a/CGMES_2.4.15_27JAN2020/DCBaseTerminal.cpp +++ b/CGMES_2.4.15_27JAN2020/DCBaseTerminal.cpp @@ -1,62 +1,76 @@ -#include -#include "ACDCTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCBaseTerminal.hpp" +#include +#include + #include "DCNode.hpp" #include "DCTopologicalNode.hpp" using namespace CIMPP; -DCBaseTerminal::DCBaseTerminal(): DCNode(nullptr), DCTopologicalNode(nullptr) {}; - +DCBaseTerminal::DCBaseTerminal() : DCNode(nullptr), DCTopologicalNode(nullptr) {}; DCBaseTerminal::~DCBaseTerminal() {}; + + + bool assign_DCNode_DCTerminals(BaseClass*, BaseClass*); -bool assign_DCBaseTerminal_DCNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCNode = dynamic_cast(BaseClass_ptr2); - if(element->DCNode != nullptr) - return assign_DCNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCBaseTerminal_DCNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1); + DCNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCNode != element2) + { + element->DCNode = element2; + return assign_DCNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_DCTopologicalNode_DCTerminals(BaseClass*, BaseClass*); -bool assign_DCBaseTerminal_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCTopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->DCTopologicalNode != nullptr) - return assign_DCTopologicalNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCBaseTerminal_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCBaseTerminal* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCTopologicalNode != element2) + { + element->DCTopologicalNode = element2; + return assign_DCTopologicalNode_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* DCBaseTerminal_factory() { - return new DCBaseTerminal; - } +const char DCBaseTerminal::debugName[] = "DCBaseTerminal"; +const char* DCBaseTerminal::debugString() const +{ + return DCBaseTerminal::debugName; } -void DCBaseTerminal::addConstructToMap(std::unordered_map& factory_map) { +void DCBaseTerminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCBaseTerminal"), &DCBaseTerminal_factory)); } -void DCBaseTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCBaseTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCNode"), &assign_DCBaseTerminal_DCNode)); - assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCTopologicalNode"), &assign_DCBaseTerminal_DCTopologicalNode)); +void DCBaseTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCBaseTerminal::debugName[] = "DCBaseTerminal"; -const char* DCBaseTerminal::debugString() +void DCBaseTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCBaseTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCNode"), &assign_DCBaseTerminal_DCNode)); + assign_map.insert(std::make_pair(std::string("cim:DCBaseTerminal.DCTopologicalNode"), &assign_DCBaseTerminal_DCTopologicalNode)); } const BaseClassDefiner DCBaseTerminal::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner DCBaseTerminal::declare() return BaseClassDefiner(DCBaseTerminal::addConstructToMap, DCBaseTerminal::addPrimitiveAssignFnsToMap, DCBaseTerminal::addClassAssignFnsToMap, DCBaseTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* DCBaseTerminal_factory() + { + return new DCBaseTerminal; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCBaseTerminal.hpp b/CGMES_2.4.15_27JAN2020/DCBaseTerminal.hpp index f5592438c..b46fc2e82 100644 --- a/CGMES_2.4.15_27JAN2020/DCBaseTerminal.hpp +++ b/CGMES_2.4.15_27JAN2020/DCBaseTerminal.hpp @@ -1,40 +1,41 @@ #ifndef DCBaseTerminal_H #define DCBaseTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ACDCTerminal.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCNode; + class DCTopologicalNode; -class DCNode; -class DCTopologicalNode; /* An electrical connection point at a piece of DC conducting equipment. DC terminals are connected at one physical DC node that may have multiple DC terminals connected. A DC node is similar to an AC connectivity node. The model enforces that DC connections are distinct from AC connections. */ - class DCBaseTerminal: public ACDCTerminal + class DCBaseTerminal : public ACDCTerminal { - public: - CIMPP::DCNode* DCNode; /* Default: 0 */ - CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.Terminal. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCBaseTerminal(); - virtual ~DCBaseTerminal(); - + ~DCBaseTerminal() override; + + CIMPP::DCNode* DCNode; /* Default: 0 */ + CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.Terminal. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCBaseTerminal_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCBreaker.cpp b/CGMES_2.4.15_27JAN2020/DCBreaker.cpp index 67c2f58d0..c862f40e9 100644 --- a/CGMES_2.4.15_27JAN2020/DCBreaker.cpp +++ b/CGMES_2.4.15_27JAN2020/DCBreaker.cpp @@ -1,36 +1,36 @@ -#include -#include "DCSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCBreaker.hpp" +#include +#include + using namespace CIMPP; DCBreaker::DCBreaker() {}; - DCBreaker::~DCBreaker() {}; -namespace CIMPP { - BaseClass* DCBreaker_factory() { - return new DCBreaker; - } +const char DCBreaker::debugName[] = "DCBreaker"; +const char* DCBreaker::debugString() const +{ + return DCBreaker::debugName; } -void DCBreaker::addConstructToMap(std::unordered_map& factory_map) { +void DCBreaker::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCBreaker"), &DCBreaker_factory)); } -void DCBreaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCBreaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCBreaker::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCBreaker::debugName[] = "DCBreaker"; -const char* DCBreaker::debugString() +void DCBreaker::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCBreaker::debugName; } const BaseClassDefiner DCBreaker::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCBreaker::declare() return BaseClassDefiner(DCBreaker::addConstructToMap, DCBreaker::addPrimitiveAssignFnsToMap, DCBreaker::addClassAssignFnsToMap, DCBreaker::debugName); } - +namespace CIMPP +{ + BaseClass* DCBreaker_factory() + { + return new DCBreaker; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCBreaker.hpp b/CGMES_2.4.15_27JAN2020/DCBreaker.hpp index 9881bced3..a360a1425 100644 --- a/CGMES_2.4.15_27JAN2020/DCBreaker.hpp +++ b/CGMES_2.4.15_27JAN2020/DCBreaker.hpp @@ -1,36 +1,37 @@ #ifndef DCBreaker_H #define DCBreaker_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A breaker within a DC system. */ - class DCBreaker: public DCSwitch + class DCBreaker : public DCSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCBreaker(); - virtual ~DCBreaker(); - + ~DCBreaker() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCBreaker_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCBusbar.cpp b/CGMES_2.4.15_27JAN2020/DCBusbar.cpp index 86b7bec9e..587b722fb 100644 --- a/CGMES_2.4.15_27JAN2020/DCBusbar.cpp +++ b/CGMES_2.4.15_27JAN2020/DCBusbar.cpp @@ -1,36 +1,36 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCBusbar.hpp" +#include +#include + using namespace CIMPP; DCBusbar::DCBusbar() {}; - DCBusbar::~DCBusbar() {}; -namespace CIMPP { - BaseClass* DCBusbar_factory() { - return new DCBusbar; - } +const char DCBusbar::debugName[] = "DCBusbar"; +const char* DCBusbar::debugString() const +{ + return DCBusbar::debugName; } -void DCBusbar::addConstructToMap(std::unordered_map& factory_map) { +void DCBusbar::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCBusbar"), &DCBusbar_factory)); } -void DCBusbar::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCBusbar::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCBusbar::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCBusbar::debugName[] = "DCBusbar"; -const char* DCBusbar::debugString() +void DCBusbar::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCBusbar::debugName; } const BaseClassDefiner DCBusbar::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCBusbar::declare() return BaseClassDefiner(DCBusbar::addConstructToMap, DCBusbar::addPrimitiveAssignFnsToMap, DCBusbar::addClassAssignFnsToMap, DCBusbar::debugName); } - +namespace CIMPP +{ + BaseClass* DCBusbar_factory() + { + return new DCBusbar; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCBusbar.hpp b/CGMES_2.4.15_27JAN2020/DCBusbar.hpp index ed35a82ca..4e9f6c039 100644 --- a/CGMES_2.4.15_27JAN2020/DCBusbar.hpp +++ b/CGMES_2.4.15_27JAN2020/DCBusbar.hpp @@ -1,36 +1,37 @@ #ifndef DCBusbar_H #define DCBusbar_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A busbar within a DC system. */ - class DCBusbar: public DCConductingEquipment + class DCBusbar : public DCConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCBusbar(); - virtual ~DCBusbar(); - + ~DCBusbar() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCBusbar_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCChopper.cpp b/CGMES_2.4.15_27JAN2020/DCChopper.cpp index 1dd84a7f0..f196636fd 100644 --- a/CGMES_2.4.15_27JAN2020/DCChopper.cpp +++ b/CGMES_2.4.15_27JAN2020/DCChopper.cpp @@ -1,36 +1,36 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCChopper.hpp" +#include +#include + using namespace CIMPP; DCChopper::DCChopper() {}; - DCChopper::~DCChopper() {}; -namespace CIMPP { - BaseClass* DCChopper_factory() { - return new DCChopper; - } +const char DCChopper::debugName[] = "DCChopper"; +const char* DCChopper::debugString() const +{ + return DCChopper::debugName; } -void DCChopper::addConstructToMap(std::unordered_map& factory_map) { +void DCChopper::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCChopper"), &DCChopper_factory)); } -void DCChopper::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCChopper::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCChopper::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCChopper::debugName[] = "DCChopper"; -const char* DCChopper::debugString() +void DCChopper::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCChopper::debugName; } const BaseClassDefiner DCChopper::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCChopper::declare() return BaseClassDefiner(DCChopper::addConstructToMap, DCChopper::addPrimitiveAssignFnsToMap, DCChopper::addClassAssignFnsToMap, DCChopper::debugName); } - +namespace CIMPP +{ + BaseClass* DCChopper_factory() + { + return new DCChopper; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCChopper.hpp b/CGMES_2.4.15_27JAN2020/DCChopper.hpp index 4d0e8b710..674d2c2db 100644 --- a/CGMES_2.4.15_27JAN2020/DCChopper.hpp +++ b/CGMES_2.4.15_27JAN2020/DCChopper.hpp @@ -1,36 +1,37 @@ #ifndef DCChopper_H #define DCChopper_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Low resistance equipment used in the internal DC circuit to balance voltages. It has typically positive and negative pole terminals and a ground. */ - class DCChopper: public DCConductingEquipment + class DCChopper : public DCConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCChopper(); - virtual ~DCChopper(); - + ~DCChopper() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCChopper_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCConductingEquipment.cpp b/CGMES_2.4.15_27JAN2020/DCConductingEquipment.cpp index 81adcb3a5..30cbbdd8e 100644 --- a/CGMES_2.4.15_27JAN2020/DCConductingEquipment.cpp +++ b/CGMES_2.4.15_27JAN2020/DCConductingEquipment.cpp @@ -1,49 +1,56 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCConductingEquipment.hpp" +#include +#include + #include "DCTerminal.hpp" using namespace CIMPP; DCConductingEquipment::DCConductingEquipment() {}; - DCConductingEquipment::~DCConductingEquipment() {}; -bool assign_DCConductingEquipment_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCConductingEquipment* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_DCTerminal_DCConductingEquipment(BaseClass*, BaseClass*); +bool assign_DCConductingEquipment_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCConductingEquipment* element = dynamic_cast(BaseClass_ptr1); + DCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_DCTerminal_DCConductingEquipment(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DCConductingEquipment_factory() { - return new DCConductingEquipment; - } +const char DCConductingEquipment::debugName[] = "DCConductingEquipment"; +const char* DCConductingEquipment::debugString() const +{ + return DCConductingEquipment::debugName; } -void DCConductingEquipment::addConstructToMap(std::unordered_map& factory_map) { +void DCConductingEquipment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCConductingEquipment"), &DCConductingEquipment_factory)); } -void DCConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCConductingEquipment.DCTerminals"), &assign_DCConductingEquipment_DCTerminals)); +void DCConductingEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCConductingEquipment::debugName[] = "DCConductingEquipment"; -const char* DCConductingEquipment::debugString() +void DCConductingEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCConductingEquipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCConductingEquipment.DCTerminals"), &assign_DCConductingEquipment_DCTerminals)); } const BaseClassDefiner DCConductingEquipment::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCConductingEquipment::declare() return BaseClassDefiner(DCConductingEquipment::addConstructToMap, DCConductingEquipment::addPrimitiveAssignFnsToMap, DCConductingEquipment::addClassAssignFnsToMap, DCConductingEquipment::debugName); } - +namespace CIMPP +{ + BaseClass* DCConductingEquipment_factory() + { + return new DCConductingEquipment; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCConductingEquipment.hpp b/CGMES_2.4.15_27JAN2020/DCConductingEquipment.hpp index 0d7485a42..e9c204a64 100644 --- a/CGMES_2.4.15_27JAN2020/DCConductingEquipment.hpp +++ b/CGMES_2.4.15_27JAN2020/DCConductingEquipment.hpp @@ -1,38 +1,39 @@ #ifndef DCConductingEquipment_H #define DCConductingEquipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCTerminal; -class DCTerminal; /* The parts of the DC power system that are designed to carry current or that are conductively connected through DC terminals. */ - class DCConductingEquipment: public Equipment + class DCConductingEquipment : public Equipment { - public: - std::list DCTerminals; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCConductingEquipment(); - virtual ~DCConductingEquipment(); - + ~DCConductingEquipment() override; + + std::list DCTerminals; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCConductingEquipment_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.cpp b/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.cpp index 65190ceed..723e4594e 100644 --- a/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.cpp +++ b/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCConverterOperatingModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::DCConverterOperatingModeKind& rop) +DCConverterOperatingModeKind& DCConverterOperatingModeKind::operator=(DCConverterOperatingModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +DCConverterOperatingModeKind::operator DCConverterOperatingModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char DCConverterOperatingModeKind::debugName[] = "DCConverterOperatingModeKind"; +const char* DCConverterOperatingModeKind::debugString() const +{ + return DCConverterOperatingModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, DCConverterOperatingModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const DCConverterOperatingModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == DCConverterOperatingModeKind::bipolar) + { + EnumSymbol = "bipolar"; + } + if (obj.value == DCConverterOperatingModeKind::monopolarMetallicReturn) + { + EnumSymbol = "monopolarMetallicReturn"; + } + if (obj.value == DCConverterOperatingModeKind::monopolarGroundReturn) + { + EnumSymbol = "monopolarGroundReturn"; + } + + if (!EnumSymbol.empty()) + { + os << "DCConverterOperatingModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.hpp b/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.hpp index 310b5f1a1..eb7c9c456 100644 --- a/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.hpp +++ b/CGMES_2.4.15_27JAN2020/DCConverterOperatingModeKind.hpp @@ -1,25 +1,50 @@ #ifndef DCConverterOperatingModeKind_H #define DCConverterOperatingModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The operating mode of an HVDC bipole. */ - enum class DCConverterOperatingModeKind + class DCConverterOperatingModeKind { - /** - * Bipolar operation. - */ - bipolar, - /** - * Monopolar operation with metallic return - */ - monopolarMetallicReturn, - /** - * Monopolar operation with ground return - */ - monopolarGroundReturn, + public: + enum DCConverterOperatingModeKind_ENUM + { + /** + * Bipolar operation. + */ + bipolar, + /** + * Monopolar operation with metallic return + */ + monopolarMetallicReturn, + /** + * Monopolar operation with ground return + */ + monopolarGroundReturn, + }; + + DCConverterOperatingModeKind() : value(), initialized(false) {} + DCConverterOperatingModeKind(DCConverterOperatingModeKind_ENUM value) : value(value), initialized(true) {} + + DCConverterOperatingModeKind& operator=(DCConverterOperatingModeKind_ENUM rop); + operator DCConverterOperatingModeKind_ENUM() const; + + DCConverterOperatingModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, DCConverterOperatingModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const DCConverterOperatingModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::DCConverterOperatingModeKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/DCConverterUnit.cpp b/CGMES_2.4.15_27JAN2020/DCConverterUnit.cpp index 96b619c55..737004e53 100644 --- a/CGMES_2.4.15_27JAN2020/DCConverterUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/DCConverterUnit.cpp @@ -1,64 +1,72 @@ -#include -#include "DCEquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCConverterUnit.hpp" -#include "DCConverterOperatingModeKind.hpp" +#include +#include + #include "Substation.hpp" +#include "DCConverterOperatingModeKind.hpp" using namespace CIMPP; -DCConverterUnit::DCConverterUnit(): Substation(nullptr) {}; - +DCConverterUnit::DCConverterUnit() : Substation(nullptr) {}; DCConverterUnit::~DCConverterUnit() {}; -bool assign_Substation_DCConverterUnit(BaseClass*, BaseClass*); -bool assign_DCConverterUnit_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCConverterUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->Substation = dynamic_cast(BaseClass_ptr2); - if(element->Substation != nullptr) - return assign_Substation_DCConverterUnit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCConverterUnit_operationMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCConverterUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operationMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_DCConverterUnit_operationMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCConverterUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operationMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Substation_DCConverterUnit(BaseClass*, BaseClass*); +bool assign_DCConverterUnit_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCConverterUnit* element = dynamic_cast(BaseClass_ptr1); + Substation* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Substation != element2) + { + element->Substation = element2; + return assign_Substation_DCConverterUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* DCConverterUnit_factory() { - return new DCConverterUnit; - } +const char DCConverterUnit::debugName[] = "DCConverterUnit"; +const char* DCConverterUnit::debugString() const +{ + return DCConverterUnit::debugName; } -void DCConverterUnit::addConstructToMap(std::unordered_map& factory_map) { +void DCConverterUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCConverterUnit"), &DCConverterUnit_factory)); } -void DCConverterUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCConverterUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCConverterUnit.operationMode"), &assign_DCConverterUnit_operationMode)); - } - -void DCConverterUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCConverterUnit.Substation"), &assign_DCConverterUnit_Substation)); } -const char DCConverterUnit::debugName[] = "DCConverterUnit"; -const char* DCConverterUnit::debugString() +void DCConverterUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCConverterUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCConverterUnit.Substation"), &assign_DCConverterUnit_Substation)); } const BaseClassDefiner DCConverterUnit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner DCConverterUnit::declare() return BaseClassDefiner(DCConverterUnit::addConstructToMap, DCConverterUnit::addPrimitiveAssignFnsToMap, DCConverterUnit::addClassAssignFnsToMap, DCConverterUnit::debugName); } - +namespace CIMPP +{ + BaseClass* DCConverterUnit_factory() + { + return new DCConverterUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCConverterUnit.hpp b/CGMES_2.4.15_27JAN2020/DCConverterUnit.hpp index 721c00ebf..642a2abbd 100644 --- a/CGMES_2.4.15_27JAN2020/DCConverterUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/DCConverterUnit.hpp @@ -1,40 +1,41 @@ #ifndef DCConverterUnit_H #define DCConverterUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCEquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCEquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" #include "DCConverterOperatingModeKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Substation; - -class Substation; /* Indivisible operative unit comprising all equipment between the point of common coupling on the AC side and the point of common coupling - DC side, essentially one or more converters, together with one or more converter transformers, converter control equipment, essential protective and switching devices and auxiliaries, if any, used for conversion. */ - class DCConverterUnit: public DCEquipmentContainer + class DCConverterUnit : public DCEquipmentContainer { - public: - CIMPP::DCConverterOperatingModeKind operationMode; /* Default: 0 */ - CIMPP::Substation* Substation; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCConverterUnit(); - virtual ~DCConverterUnit(); - + ~DCConverterUnit() override; + + CIMPP::Substation* Substation; /* Default: 0 */ + CIMPP::DCConverterOperatingModeKind operationMode; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCConverterUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCDisconnector.cpp b/CGMES_2.4.15_27JAN2020/DCDisconnector.cpp index 30f8ab4a5..9386681a3 100644 --- a/CGMES_2.4.15_27JAN2020/DCDisconnector.cpp +++ b/CGMES_2.4.15_27JAN2020/DCDisconnector.cpp @@ -1,36 +1,36 @@ -#include -#include "DCSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCDisconnector.hpp" +#include +#include + using namespace CIMPP; DCDisconnector::DCDisconnector() {}; - DCDisconnector::~DCDisconnector() {}; -namespace CIMPP { - BaseClass* DCDisconnector_factory() { - return new DCDisconnector; - } +const char DCDisconnector::debugName[] = "DCDisconnector"; +const char* DCDisconnector::debugString() const +{ + return DCDisconnector::debugName; } -void DCDisconnector::addConstructToMap(std::unordered_map& factory_map) { +void DCDisconnector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCDisconnector"), &DCDisconnector_factory)); } -void DCDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCDisconnector::debugName[] = "DCDisconnector"; -const char* DCDisconnector::debugString() +void DCDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCDisconnector::debugName; } const BaseClassDefiner DCDisconnector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCDisconnector::declare() return BaseClassDefiner(DCDisconnector::addConstructToMap, DCDisconnector::addPrimitiveAssignFnsToMap, DCDisconnector::addClassAssignFnsToMap, DCDisconnector::debugName); } - +namespace CIMPP +{ + BaseClass* DCDisconnector_factory() + { + return new DCDisconnector; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCDisconnector.hpp b/CGMES_2.4.15_27JAN2020/DCDisconnector.hpp index e713ad0b4..11f5da74c 100644 --- a/CGMES_2.4.15_27JAN2020/DCDisconnector.hpp +++ b/CGMES_2.4.15_27JAN2020/DCDisconnector.hpp @@ -1,36 +1,37 @@ #ifndef DCDisconnector_H #define DCDisconnector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A disconnector within a DC system. */ - class DCDisconnector: public DCSwitch + class DCDisconnector : public DCSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCDisconnector(); - virtual ~DCDisconnector(); - + ~DCDisconnector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCDisconnector_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.cpp b/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.cpp index 767ceaa5c..6fbe46186 100644 --- a/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.cpp +++ b/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.cpp @@ -1,62 +1,76 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCEquipmentContainer.hpp" +#include +#include + #include "DCNode.hpp" #include "DCTopologicalNode.hpp" using namespace CIMPP; DCEquipmentContainer::DCEquipmentContainer() {}; - DCEquipmentContainer::~DCEquipmentContainer() {}; -bool assign_DCEquipmentContainer_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_DCNode_DCEquipmentContainer(BaseClass*, BaseClass*); +bool assign_DCEquipmentContainer_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1); + DCNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCNodes.begin(), element->DCNodes.end(), element2) == element->DCNodes.end()) + { + element->DCNodes.push_back(element2); + return assign_DCNode_DCEquipmentContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_DCTopologicalNode_DCEquipmentContainer(BaseClass*, BaseClass*); +bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCEquipmentContainer* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTopologicalNode.begin(), element->DCTopologicalNode.end(), element2) == element->DCTopologicalNode.end()) + { + element->DCTopologicalNode.push_back(element2); + return assign_DCTopologicalNode_DCEquipmentContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* DCEquipmentContainer_factory() { - return new DCEquipmentContainer; - } +const char DCEquipmentContainer::debugName[] = "DCEquipmentContainer"; +const char* DCEquipmentContainer::debugString() const +{ + return DCEquipmentContainer::debugName; } -void DCEquipmentContainer::addConstructToMap(std::unordered_map& factory_map) { +void DCEquipmentContainer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer"), &DCEquipmentContainer_factory)); } -void DCEquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCEquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCNodes"), &assign_DCEquipmentContainer_DCNodes)); - assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCTopologicalNode"), &assign_DCEquipmentContainer_DCTopologicalNode)); +void DCEquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCEquipmentContainer::debugName[] = "DCEquipmentContainer"; -const char* DCEquipmentContainer::debugString() +void DCEquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCEquipmentContainer::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCNodes"), &assign_DCEquipmentContainer_DCNodes)); + assign_map.insert(std::make_pair(std::string("cim:DCEquipmentContainer.DCTopologicalNode"), &assign_DCEquipmentContainer_DCTopologicalNode)); } const BaseClassDefiner DCEquipmentContainer::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner DCEquipmentContainer::declare() return BaseClassDefiner(DCEquipmentContainer::addConstructToMap, DCEquipmentContainer::addPrimitiveAssignFnsToMap, DCEquipmentContainer::addClassAssignFnsToMap, DCEquipmentContainer::debugName); } - +namespace CIMPP +{ + BaseClass* DCEquipmentContainer_factory() + { + return new DCEquipmentContainer; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.hpp b/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.hpp index ac3cf9339..2f5ac385e 100644 --- a/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.hpp +++ b/CGMES_2.4.15_27JAN2020/DCEquipmentContainer.hpp @@ -1,40 +1,41 @@ #ifndef DCEquipmentContainer_H #define DCEquipmentContainer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCNode; + class DCTopologicalNode; -class DCNode; -class DCTopologicalNode; /* A modeling construct to provide a root class for containment of DC as well as AC equipment. The class differ from the EquipmentContaner for AC in that it may also contain DCNodes. Hence it can contain both AC and DC equipment. */ - class DCEquipmentContainer: public EquipmentContainer + class DCEquipmentContainer : public EquipmentContainer { - public: - std::list DCNodes; /* Default: 0 */ - std::list DCTopologicalNode; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCEquipmentContainer(); - virtual ~DCEquipmentContainer(); - + ~DCEquipmentContainer() override; + + std::list DCNodes; /* Default: 0 */ + std::list DCTopologicalNode; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCEquipmentContainer_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCGround.cpp b/CGMES_2.4.15_27JAN2020/DCGround.cpp index 056f90ccd..713715e26 100644 --- a/CGMES_2.4.15_27JAN2020/DCGround.cpp +++ b/CGMES_2.4.15_27JAN2020/DCGround.cpp @@ -1,66 +1,68 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCGround.hpp" +#include +#include + #include "Inductance.hpp" #include "Resistance.hpp" using namespace CIMPP; DCGround::DCGround() {}; - DCGround::~DCGround() {}; +bool assign_DCGround_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCGround* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCGround_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCGround* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DCGround_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCGround* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCGround_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCGround* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCGround_factory() { - return new DCGround; - } +const char DCGround::debugName[] = "DCGround"; +const char* DCGround::debugString() const +{ + return DCGround::debugName; } -void DCGround::addConstructToMap(std::unordered_map& factory_map) { +void DCGround::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCGround"), &DCGround_factory)); } -void DCGround::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCGround::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCGround.inductance"), &assign_DCGround_inductance)); assign_map.insert(std::make_pair(std::string("cim:DCGround.r"), &assign_DCGround_r)); } -void DCGround::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DCGround::debugName[] = "DCGround"; -const char* DCGround::debugString() +void DCGround::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCGround::debugName; } const BaseClassDefiner DCGround::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner DCGround::declare() return BaseClassDefiner(DCGround::addConstructToMap, DCGround::addPrimitiveAssignFnsToMap, DCGround::addClassAssignFnsToMap, DCGround::debugName); } - +namespace CIMPP +{ + BaseClass* DCGround_factory() + { + return new DCGround; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCGround.hpp b/CGMES_2.4.15_27JAN2020/DCGround.hpp index 172a4d182..9da13df9f 100644 --- a/CGMES_2.4.15_27JAN2020/DCGround.hpp +++ b/CGMES_2.4.15_27JAN2020/DCGround.hpp @@ -1,40 +1,41 @@ #ifndef DCGround_H #define DCGround_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Inductance.hpp" #include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A ground within a DC system. */ - class DCGround: public DCConductingEquipment + class DCGround : public DCConductingEquipment { - public: - CIMPP::Inductance inductance; /* Inductance to ground. Default: nullptr */ - CIMPP::Resistance r; /* Resistance to ground. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCGround(); - virtual ~DCGround(); - + ~DCGround() override; + + CIMPP::Inductance inductance; /* Inductance to ground. Default: nullptr */ + CIMPP::Resistance r; /* Resistance to ground. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCGround_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCLine.cpp b/CGMES_2.4.15_27JAN2020/DCLine.cpp index 42ef2be2c..98bc5d517 100644 --- a/CGMES_2.4.15_27JAN2020/DCLine.cpp +++ b/CGMES_2.4.15_27JAN2020/DCLine.cpp @@ -1,49 +1,56 @@ -#include -#include "DCEquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCLine.hpp" +#include +#include + #include "SubGeographicalRegion.hpp" using namespace CIMPP; -DCLine::DCLine(): Region(nullptr) {}; - +DCLine::DCLine() : Region(nullptr) {}; DCLine::~DCLine() {}; -bool assign_SubGeographicalRegion_DCLines(BaseClass*, BaseClass*); -bool assign_DCLine_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCLine* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_SubGeographicalRegion_DCLines(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* DCLine_factory() { - return new DCLine; +bool assign_SubGeographicalRegion_DCLines(BaseClass*, BaseClass*); +bool assign_DCLine_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCLine* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_SubGeographicalRegion_DCLines(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DCLine::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DCLine"), &DCLine_factory)); +const char DCLine::debugName[] = "DCLine"; +const char* DCLine::debugString() const +{ + return DCLine::debugName; } -void DCLine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DCLine::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DCLine"), &DCLine_factory)); +} -void DCLine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCLine.Region"), &assign_DCLine_Region)); +void DCLine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCLine::debugName[] = "DCLine"; -const char* DCLine::debugString() +void DCLine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCLine::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCLine.Region"), &assign_DCLine_Region)); } const BaseClassDefiner DCLine::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCLine::declare() return BaseClassDefiner(DCLine::addConstructToMap, DCLine::addPrimitiveAssignFnsToMap, DCLine::addClassAssignFnsToMap, DCLine::debugName); } - +namespace CIMPP +{ + BaseClass* DCLine_factory() + { + return new DCLine; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCLine.hpp b/CGMES_2.4.15_27JAN2020/DCLine.hpp index 488ceeab8..24bd47128 100644 --- a/CGMES_2.4.15_27JAN2020/DCLine.hpp +++ b/CGMES_2.4.15_27JAN2020/DCLine.hpp @@ -1,38 +1,39 @@ #ifndef DCLine_H #define DCLine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCEquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCEquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubGeographicalRegion; -class SubGeographicalRegion; /* Overhead lines and/or cables connecting two or more HVDC substations. */ - class DCLine: public DCEquipmentContainer + class DCLine : public DCEquipmentContainer { - public: - CIMPP::SubGeographicalRegion* Region; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCLine(); - virtual ~DCLine(); - + ~DCLine() override; + + CIMPP::SubGeographicalRegion* Region; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCLine_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCLineSegment.cpp b/CGMES_2.4.15_27JAN2020/DCLineSegment.cpp index 754295ba8..394d99e04 100644 --- a/CGMES_2.4.15_27JAN2020/DCLineSegment.cpp +++ b/CGMES_2.4.15_27JAN2020/DCLineSegment.cpp @@ -1,109 +1,120 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCLineSegment.hpp" +#include +#include + +#include "PerLengthDCLineParameter.hpp" #include "Capacitance.hpp" #include "Inductance.hpp" -#include "Resistance.hpp" #include "Length.hpp" -#include "PerLengthDCLineParameter.hpp" +#include "Resistance.hpp" using namespace CIMPP; -DCLineSegment::DCLineSegment(): PerLengthParameter(nullptr) {}; - +DCLineSegment::DCLineSegment() : PerLengthParameter(nullptr) {}; DCLineSegment::~DCLineSegment() {}; +bool assign_DCLineSegment_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCLineSegment_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCLineSegment_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->length; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass*, BaseClass*); -bool assign_DCLineSegment_PerLengthParameter(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - element->PerLengthParameter = dynamic_cast(BaseClass_ptr2); - if(element->PerLengthParameter != nullptr) - return assign_PerLengthDCLineParameter_DCLineSegments(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCLineSegment_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_DCLineSegment_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->capacitance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass*, BaseClass*); +bool assign_DCLineSegment_PerLengthParameter(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCLineSegment* element = dynamic_cast(BaseClass_ptr1); + PerLengthDCLineParameter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PerLengthParameter != element2) + { + element->PerLengthParameter = element2; + return assign_PerLengthDCLineParameter_DCLineSegments(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DCLineSegment_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCLineSegment_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCLineSegment_length(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCLineSegment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->length; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCLineSegment_factory() { - return new DCLineSegment; - } +const char DCLineSegment::debugName[] = "DCLineSegment"; +const char* DCLineSegment::debugString() const +{ + return DCLineSegment::debugName; } -void DCLineSegment::addConstructToMap(std::unordered_map& factory_map) { +void DCLineSegment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCLineSegment"), &DCLineSegment_factory)); } -void DCLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCLineSegment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.capacitance"), &assign_DCLineSegment_capacitance)); assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.inductance"), &assign_DCLineSegment_inductance)); - assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.resistance"), &assign_DCLineSegment_resistance)); assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.length"), &assign_DCLineSegment_length)); - } - -void DCLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.PerLengthParameter"), &assign_DCLineSegment_PerLengthParameter)); + assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.resistance"), &assign_DCLineSegment_resistance)); } -const char DCLineSegment::debugName[] = "DCLineSegment"; -const char* DCLineSegment::debugString() +void DCLineSegment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCLineSegment::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCLineSegment.PerLengthParameter"), &assign_DCLineSegment_PerLengthParameter)); } const BaseClassDefiner DCLineSegment::declare() @@ -111,4 +122,10 @@ const BaseClassDefiner DCLineSegment::declare() return BaseClassDefiner(DCLineSegment::addConstructToMap, DCLineSegment::addPrimitiveAssignFnsToMap, DCLineSegment::addClassAssignFnsToMap, DCLineSegment::debugName); } - +namespace CIMPP +{ + BaseClass* DCLineSegment_factory() + { + return new DCLineSegment; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCLineSegment.hpp b/CGMES_2.4.15_27JAN2020/DCLineSegment.hpp index 84efef3ee..784cb35e4 100644 --- a/CGMES_2.4.15_27JAN2020/DCLineSegment.hpp +++ b/CGMES_2.4.15_27JAN2020/DCLineSegment.hpp @@ -1,46 +1,47 @@ #ifndef DCLineSegment_H #define DCLineSegment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Capacitance.hpp" #include "Inductance.hpp" -#include "Resistance.hpp" #include "Length.hpp" +#include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PerLengthDCLineParameter; -class PerLengthDCLineParameter; /* A wire or combination of wires not insulated from one another, with consistent electrical characteristics, used to carry direct current between points in the DC region of the power system. */ - class DCLineSegment: public DCConductingEquipment + class DCLineSegment : public DCConductingEquipment { - public: - CIMPP::Capacitance capacitance; /* Capacitance of the DC line segment. Significant for cables only. Default: nullptr */ - CIMPP::Inductance inductance; /* Inductance of the DC line segment. Neglectable compared with DCSeriesDevice used for smoothing. Default: nullptr */ - CIMPP::Resistance resistance; /* Resistance of the DC line segment. Default: nullptr */ - CIMPP::Length length; /* Segment length for calculating line section capabilities. Default: nullptr */ - CIMPP::PerLengthDCLineParameter* PerLengthParameter; /* Set of per-length parameters for this line segment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCLineSegment(); - virtual ~DCLineSegment(); - + ~DCLineSegment() override; + + CIMPP::PerLengthDCLineParameter* PerLengthParameter; /* Set of per-length parameters for this line segment. Default: 0 */ + CIMPP::Capacitance capacitance; /* Capacitance of the DC line segment. Significant for cables only. Default: nullptr */ + CIMPP::Inductance inductance; /* Inductance of the DC line segment. Neglectable compared with DCSeriesDevice used for smoothing. Default: nullptr */ + CIMPP::Length length; /* Segment length for calculating line section capabilities. Default: nullptr */ + CIMPP::Resistance resistance; /* Resistance of the DC line segment. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCLineSegment_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCNode.cpp b/CGMES_2.4.15_27JAN2020/DCNode.cpp index b0d6cb77e..d47580458 100644 --- a/CGMES_2.4.15_27JAN2020/DCNode.cpp +++ b/CGMES_2.4.15_27JAN2020/DCNode.cpp @@ -1,75 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCNode.hpp" -#include "DCBaseTerminal.hpp" +#include +#include + #include "DCEquipmentContainer.hpp" +#include "DCBaseTerminal.hpp" #include "DCTopologicalNode.hpp" using namespace CIMPP; -DCNode::DCNode(): DCEquipmentContainer(nullptr), DCTopologicalNode(nullptr) {}; - +DCNode::DCNode() : DCEquipmentContainer(nullptr), DCTopologicalNode(nullptr) {}; DCNode::~DCNode() {}; -bool assign_DCNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_DCEquipmentContainer_DCNodes(BaseClass*, BaseClass*); +bool assign_DCNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCNode* element = dynamic_cast(BaseClass_ptr1); + DCEquipmentContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCEquipmentContainer != element2) + { + element->DCEquipmentContainer = element2; + return assign_DCEquipmentContainer_DCNodes(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_DCEquipmentContainer_DCNodes(BaseClass*, BaseClass*); -bool assign_DCNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCEquipmentContainer = dynamic_cast(BaseClass_ptr2); - if(element->DCEquipmentContainer != nullptr) - return assign_DCEquipmentContainer_DCNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCBaseTerminal_DCNode(BaseClass*, BaseClass*); +bool assign_DCNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCNode* element = dynamic_cast(BaseClass_ptr1); + DCBaseTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_DCBaseTerminal_DCNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_DCTopologicalNode_DCNodes(BaseClass*, BaseClass*); -bool assign_DCNode_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCTopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->DCTopologicalNode != nullptr) - return assign_DCTopologicalNode_DCNodes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCNode_DCTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCNode* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCTopologicalNode != element2) + { + element->DCTopologicalNode = element2; + return assign_DCTopologicalNode_DCNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* DCNode_factory() { - return new DCNode; - } +const char DCNode::debugName[] = "DCNode"; +const char* DCNode::debugString() const +{ + return DCNode::debugName; } -void DCNode::addConstructToMap(std::unordered_map& factory_map) { +void DCNode::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCNode"), &DCNode_factory)); } -void DCNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTerminals"), &assign_DCNode_DCTerminals)); - assign_map.insert(std::make_pair(std::string("cim:DCNode.DCEquipmentContainer"), &assign_DCNode_DCEquipmentContainer)); - assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTopologicalNode"), &assign_DCNode_DCTopologicalNode)); +void DCNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCNode::debugName[] = "DCNode"; -const char* DCNode::debugString() +void DCNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCNode::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCNode.DCEquipmentContainer"), &assign_DCNode_DCEquipmentContainer)); + assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTerminals"), &assign_DCNode_DCTerminals)); + assign_map.insert(std::make_pair(std::string("cim:DCNode.DCTopologicalNode"), &assign_DCNode_DCTopologicalNode)); } const BaseClassDefiner DCNode::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner DCNode::declare() return BaseClassDefiner(DCNode::addConstructToMap, DCNode::addPrimitiveAssignFnsToMap, DCNode::addClassAssignFnsToMap, DCNode::debugName); } - +namespace CIMPP +{ + BaseClass* DCNode_factory() + { + return new DCNode; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCNode.hpp b/CGMES_2.4.15_27JAN2020/DCNode.hpp index 0b3ef9a96..14ceecae1 100644 --- a/CGMES_2.4.15_27JAN2020/DCNode.hpp +++ b/CGMES_2.4.15_27JAN2020/DCNode.hpp @@ -1,42 +1,43 @@ #ifndef DCNode_H #define DCNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCBaseTerminal; + class DCEquipmentContainer; + class DCTopologicalNode; -class DCBaseTerminal; -class DCEquipmentContainer; -class DCTopologicalNode; /* DC nodes are points where terminals of DC conducting equipment are connected together with zero impedance. */ - class DCNode: public IdentifiedObject + class DCNode : public IdentifiedObject { - public: - std::list DCTerminals; /* Default: 0 */ - CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ - CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.ConnectivityNodes. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCNode(); - virtual ~DCNode(); - + ~DCNode() override; + + CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ + std::list DCTerminals; /* Default: 0 */ + CIMPP::DCTopologicalNode* DCTopologicalNode; /* See association end TopologicalNode.ConnectivityNodes. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCNode_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCPolarityKind.cpp b/CGMES_2.4.15_27JAN2020/DCPolarityKind.cpp index 774aff923..a1a646248 100644 --- a/CGMES_2.4.15_27JAN2020/DCPolarityKind.cpp +++ b/CGMES_2.4.15_27JAN2020/DCPolarityKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCPolarityKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::DCPolarityKind& rop) +DCPolarityKind& DCPolarityKind::operator=(DCPolarityKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +DCPolarityKind::operator DCPolarityKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char DCPolarityKind::debugName[] = "DCPolarityKind"; +const char* DCPolarityKind::debugString() const +{ + return DCPolarityKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, DCPolarityKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const DCPolarityKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == DCPolarityKind::positive) + { + EnumSymbol = "positive"; + } + if (obj.value == DCPolarityKind::middle) + { + EnumSymbol = "middle"; + } + if (obj.value == DCPolarityKind::negative) + { + EnumSymbol = "negative"; + } + + if (!EnumSymbol.empty()) + { + os << "DCPolarityKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCPolarityKind.hpp b/CGMES_2.4.15_27JAN2020/DCPolarityKind.hpp index 1004c1183..8b3bd24e9 100644 --- a/CGMES_2.4.15_27JAN2020/DCPolarityKind.hpp +++ b/CGMES_2.4.15_27JAN2020/DCPolarityKind.hpp @@ -1,25 +1,50 @@ #ifndef DCPolarityKind_H #define DCPolarityKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Polarity for DC circuits. */ - enum class DCPolarityKind + class DCPolarityKind { - /** - * Positive pole. - */ - positive, - /** - * Middle pole, potentially grounded. - */ - middle, - /** - * Negative pole. - */ - negative, + public: + enum DCPolarityKind_ENUM + { + /** + * Positive pole. + */ + positive, + /** + * Middle pole, potentially grounded. + */ + middle, + /** + * Negative pole. + */ + negative, + }; + + DCPolarityKind() : value(), initialized(false) {} + DCPolarityKind(DCPolarityKind_ENUM value) : value(value), initialized(true) {} + + DCPolarityKind& operator=(DCPolarityKind_ENUM rop); + operator DCPolarityKind_ENUM() const; + + DCPolarityKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, DCPolarityKind& rop); + friend std::ostream& operator<<(std::ostream& os, const DCPolarityKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::DCPolarityKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/DCSeriesDevice.cpp b/CGMES_2.4.15_27JAN2020/DCSeriesDevice.cpp index 2d2ac6fa7..6cc87ef0e 100644 --- a/CGMES_2.4.15_27JAN2020/DCSeriesDevice.cpp +++ b/CGMES_2.4.15_27JAN2020/DCSeriesDevice.cpp @@ -1,81 +1,84 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCSeriesDevice.hpp" +#include +#include + #include "Inductance.hpp" -#include "Resistance.hpp" #include "Voltage.hpp" +#include "Resistance.hpp" using namespace CIMPP; DCSeriesDevice::DCSeriesDevice() {}; - DCSeriesDevice::~DCSeriesDevice() {}; +bool assign_DCSeriesDevice_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCSeriesDevice_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCSeriesDevice_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DCSeriesDevice_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCSeriesDevice_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCSeriesDevice_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCSeriesDevice* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCSeriesDevice_factory() { - return new DCSeriesDevice; - } +const char DCSeriesDevice::debugName[] = "DCSeriesDevice"; +const char* DCSeriesDevice::debugString() const +{ + return DCSeriesDevice::debugName; } -void DCSeriesDevice::addConstructToMap(std::unordered_map& factory_map) { +void DCSeriesDevice::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCSeriesDevice"), &DCSeriesDevice_factory)); } -void DCSeriesDevice::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCSeriesDevice::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.inductance"), &assign_DCSeriesDevice_inductance)); - assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.resistance"), &assign_DCSeriesDevice_resistance)); assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.ratedUdc"), &assign_DCSeriesDevice_ratedUdc)); + assign_map.insert(std::make_pair(std::string("cim:DCSeriesDevice.resistance"), &assign_DCSeriesDevice_resistance)); } -void DCSeriesDevice::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DCSeriesDevice::debugName[] = "DCSeriesDevice"; -const char* DCSeriesDevice::debugString() +void DCSeriesDevice::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCSeriesDevice::debugName; } const BaseClassDefiner DCSeriesDevice::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner DCSeriesDevice::declare() return BaseClassDefiner(DCSeriesDevice::addConstructToMap, DCSeriesDevice::addPrimitiveAssignFnsToMap, DCSeriesDevice::addClassAssignFnsToMap, DCSeriesDevice::debugName); } - +namespace CIMPP +{ + BaseClass* DCSeriesDevice_factory() + { + return new DCSeriesDevice; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCSeriesDevice.hpp b/CGMES_2.4.15_27JAN2020/DCSeriesDevice.hpp index ffee38162..e8ac734b6 100644 --- a/CGMES_2.4.15_27JAN2020/DCSeriesDevice.hpp +++ b/CGMES_2.4.15_27JAN2020/DCSeriesDevice.hpp @@ -1,42 +1,43 @@ #ifndef DCSeriesDevice_H #define DCSeriesDevice_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Inductance.hpp" #include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A series device within the DC system, typically a reactor used for filtering or smoothing. Needed for transient and short circuit studies. */ - class DCSeriesDevice: public DCConductingEquipment + class DCSeriesDevice : public DCConductingEquipment { - public: - CIMPP::Inductance inductance; /* Inductance of the device. Default: nullptr */ - CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ - CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCSeriesDevice(); - virtual ~DCSeriesDevice(); - + ~DCSeriesDevice() override; + + CIMPP::Inductance inductance; /* Inductance of the device. Default: nullptr */ + CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCSeriesDevice_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCShunt.cpp b/CGMES_2.4.15_27JAN2020/DCShunt.cpp index 8848b26e6..b99cbcb41 100644 --- a/CGMES_2.4.15_27JAN2020/DCShunt.cpp +++ b/CGMES_2.4.15_27JAN2020/DCShunt.cpp @@ -1,81 +1,84 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCShunt.hpp" +#include +#include + #include "Capacitance.hpp" -#include "Resistance.hpp" #include "Voltage.hpp" +#include "Resistance.hpp" using namespace CIMPP; DCShunt::DCShunt() {}; - DCShunt::~DCShunt() {}; +bool assign_DCShunt_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCShunt_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedUdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DCShunt_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DCShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DCShunt_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->capacitance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCShunt_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->resistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DCShunt_ratedUdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DCShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedUdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DCShunt_factory() { - return new DCShunt; - } +const char DCShunt::debugName[] = "DCShunt"; +const char* DCShunt::debugString() const +{ + return DCShunt::debugName; } -void DCShunt::addConstructToMap(std::unordered_map& factory_map) { +void DCShunt::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCShunt"), &DCShunt_factory)); } -void DCShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DCShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DCShunt.capacitance"), &assign_DCShunt_capacitance)); - assign_map.insert(std::make_pair(std::string("cim:DCShunt.resistance"), &assign_DCShunt_resistance)); assign_map.insert(std::make_pair(std::string("cim:DCShunt.ratedUdc"), &assign_DCShunt_ratedUdc)); + assign_map.insert(std::make_pair(std::string("cim:DCShunt.resistance"), &assign_DCShunt_resistance)); } -void DCShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DCShunt::debugName[] = "DCShunt"; -const char* DCShunt::debugString() +void DCShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCShunt::debugName; } const BaseClassDefiner DCShunt::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner DCShunt::declare() return BaseClassDefiner(DCShunt::addConstructToMap, DCShunt::addPrimitiveAssignFnsToMap, DCShunt::addClassAssignFnsToMap, DCShunt::debugName); } - +namespace CIMPP +{ + BaseClass* DCShunt_factory() + { + return new DCShunt; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCShunt.hpp b/CGMES_2.4.15_27JAN2020/DCShunt.hpp index c59ae93b2..bc316c530 100644 --- a/CGMES_2.4.15_27JAN2020/DCShunt.hpp +++ b/CGMES_2.4.15_27JAN2020/DCShunt.hpp @@ -1,42 +1,43 @@ #ifndef DCShunt_H #define DCShunt_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Capacitance.hpp" #include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A shunt device within the DC system, typically used for filtering. Needed for transient and short circuit studies. */ - class DCShunt: public DCConductingEquipment + class DCShunt : public DCConductingEquipment { - public: - CIMPP::Capacitance capacitance; /* Capacitance of the DC shunt. Default: nullptr */ - CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ - CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCShunt(); - virtual ~DCShunt(); - + ~DCShunt() override; + + CIMPP::Capacitance capacitance; /* Capacitance of the DC shunt. Default: nullptr */ + CIMPP::Voltage ratedUdc; /* Rated DC device voltage. Converter configuration data used in power flow. Default: nullptr */ + CIMPP::Resistance resistance; /* Resistance of the DC device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCShunt_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCSwitch.cpp b/CGMES_2.4.15_27JAN2020/DCSwitch.cpp index 91d94c952..6ad07472d 100644 --- a/CGMES_2.4.15_27JAN2020/DCSwitch.cpp +++ b/CGMES_2.4.15_27JAN2020/DCSwitch.cpp @@ -1,36 +1,36 @@ -#include -#include "DCConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCSwitch.hpp" +#include +#include + using namespace CIMPP; DCSwitch::DCSwitch() {}; - DCSwitch::~DCSwitch() {}; -namespace CIMPP { - BaseClass* DCSwitch_factory() { - return new DCSwitch; - } +const char DCSwitch::debugName[] = "DCSwitch"; +const char* DCSwitch::debugString() const +{ + return DCSwitch::debugName; } -void DCSwitch::addConstructToMap(std::unordered_map& factory_map) { +void DCSwitch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCSwitch"), &DCSwitch_factory)); } -void DCSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void DCSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DCSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCSwitch::debugName[] = "DCSwitch"; -const char* DCSwitch::debugString() +void DCSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCSwitch::debugName; } const BaseClassDefiner DCSwitch::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner DCSwitch::declare() return BaseClassDefiner(DCSwitch::addConstructToMap, DCSwitch::addPrimitiveAssignFnsToMap, DCSwitch::addClassAssignFnsToMap, DCSwitch::debugName); } - +namespace CIMPP +{ + BaseClass* DCSwitch_factory() + { + return new DCSwitch; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCSwitch.hpp b/CGMES_2.4.15_27JAN2020/DCSwitch.hpp index cd3de7e0e..76e968ca7 100644 --- a/CGMES_2.4.15_27JAN2020/DCSwitch.hpp +++ b/CGMES_2.4.15_27JAN2020/DCSwitch.hpp @@ -1,36 +1,37 @@ #ifndef DCSwitch_H #define DCSwitch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A switch within the DC system. */ - class DCSwitch: public DCConductingEquipment + class DCSwitch : public DCConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCSwitch(); - virtual ~DCSwitch(); - + ~DCSwitch() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCSwitch_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCTerminal.cpp b/CGMES_2.4.15_27JAN2020/DCTerminal.cpp index b9715feb9..b9b3832c1 100644 --- a/CGMES_2.4.15_27JAN2020/DCTerminal.cpp +++ b/CGMES_2.4.15_27JAN2020/DCTerminal.cpp @@ -1,49 +1,56 @@ -#include -#include "DCBaseTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCTerminal.hpp" +#include +#include + #include "DCConductingEquipment.hpp" using namespace CIMPP; -DCTerminal::DCTerminal(): DCConductingEquipment(nullptr) {}; - +DCTerminal::DCTerminal() : DCConductingEquipment(nullptr) {}; DCTerminal::~DCTerminal() {}; -bool assign_DCConductingEquipment_DCTerminals(BaseClass*, BaseClass*); -bool assign_DCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTerminal* element = dynamic_cast(BaseClass_ptr1)) { - element->DCConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->DCConductingEquipment != nullptr) - return assign_DCConductingEquipment_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* DCTerminal_factory() { - return new DCTerminal; +bool assign_DCConductingEquipment_DCTerminals(BaseClass*, BaseClass*); +bool assign_DCTerminal_DCConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTerminal* element = dynamic_cast(BaseClass_ptr1); + DCConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCConductingEquipment != element2) + { + element->DCConductingEquipment = element2; + return assign_DCConductingEquipment_DCTerminals(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DCTerminal::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DCTerminal"), &DCTerminal_factory)); +const char DCTerminal::debugName[] = "DCTerminal"; +const char* DCTerminal::debugString() const +{ + return DCTerminal::debugName; } -void DCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DCTerminal::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DCTerminal"), &DCTerminal_factory)); +} -void DCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCTerminal.DCConductingEquipment"), &assign_DCTerminal_DCConductingEquipment)); +void DCTerminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCTerminal::debugName[] = "DCTerminal"; -const char* DCTerminal::debugString() +void DCTerminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCTerminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCTerminal.DCConductingEquipment"), &assign_DCTerminal_DCConductingEquipment)); } const BaseClassDefiner DCTerminal::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCTerminal::declare() return BaseClassDefiner(DCTerminal::addConstructToMap, DCTerminal::addPrimitiveAssignFnsToMap, DCTerminal::addClassAssignFnsToMap, DCTerminal::debugName); } - +namespace CIMPP +{ + BaseClass* DCTerminal_factory() + { + return new DCTerminal; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCTerminal.hpp b/CGMES_2.4.15_27JAN2020/DCTerminal.hpp index f5c1daab8..39dc6c3d3 100644 --- a/CGMES_2.4.15_27JAN2020/DCTerminal.hpp +++ b/CGMES_2.4.15_27JAN2020/DCTerminal.hpp @@ -1,38 +1,39 @@ #ifndef DCTerminal_H #define DCTerminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DCBaseTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DCBaseTerminal.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCConductingEquipment; -class DCConductingEquipment; /* An electrical connection point to generic DC conducting equipment. */ - class DCTerminal: public DCBaseTerminal + class DCTerminal : public DCBaseTerminal { - public: - CIMPP::DCConductingEquipment* DCConductingEquipment; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCTerminal(); - virtual ~DCTerminal(); - + ~DCTerminal() override; + + CIMPP::DCConductingEquipment* DCConductingEquipment; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCTerminal_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.cpp b/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.cpp index 285cbcf1b..a764d3e3e 100644 --- a/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.cpp +++ b/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCTopologicalIsland.hpp" +#include +#include + #include "DCTopologicalNode.hpp" using namespace CIMPP; DCTopologicalIsland::DCTopologicalIsland() {}; - DCTopologicalIsland::~DCTopologicalIsland() {}; -bool assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalIsland* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTopologicalNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_DCTopologicalNode_DCTopologicalIsland(BaseClass*, BaseClass*); +bool assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalIsland* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTopologicalNodes.begin(), element->DCTopologicalNodes.end(), element2) == element->DCTopologicalNodes.end()) + { + element->DCTopologicalNodes.push_back(element2); + return assign_DCTopologicalNode_DCTopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DCTopologicalIsland_factory() { - return new DCTopologicalIsland; - } +const char DCTopologicalIsland::debugName[] = "DCTopologicalIsland"; +const char* DCTopologicalIsland::debugString() const +{ + return DCTopologicalIsland::debugName; } -void DCTopologicalIsland::addConstructToMap(std::unordered_map& factory_map) { +void DCTopologicalIsland::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DCTopologicalIsland"), &DCTopologicalIsland_factory)); } -void DCTopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DCTopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalIsland.DCTopologicalNodes"), &assign_DCTopologicalIsland_DCTopologicalNodes)); +void DCTopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCTopologicalIsland::debugName[] = "DCTopologicalIsland"; -const char* DCTopologicalIsland::debugString() +void DCTopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCTopologicalIsland::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalIsland.DCTopologicalNodes"), &assign_DCTopologicalIsland_DCTopologicalNodes)); } const BaseClassDefiner DCTopologicalIsland::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DCTopologicalIsland::declare() return BaseClassDefiner(DCTopologicalIsland::addConstructToMap, DCTopologicalIsland::addPrimitiveAssignFnsToMap, DCTopologicalIsland::addClassAssignFnsToMap, DCTopologicalIsland::debugName); } - +namespace CIMPP +{ + BaseClass* DCTopologicalIsland_factory() + { + return new DCTopologicalIsland; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.hpp b/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.hpp index aeb6cd1f4..7a2e853f2 100644 --- a/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.hpp +++ b/CGMES_2.4.15_27JAN2020/DCTopologicalIsland.hpp @@ -1,38 +1,39 @@ #ifndef DCTopologicalIsland_H #define DCTopologicalIsland_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCTopologicalNode; -class DCTopologicalNode; /* An electrically connected subset of the network. DC topological islands can change as the current network state changes: e.g. due to - disconnect switches or breakers change state in a SCADA/EMS - manual creation, change or deletion of topological nodes in a planning tool. */ - class DCTopologicalIsland: public IdentifiedObject + class DCTopologicalIsland : public IdentifiedObject { - public: - std::list DCTopologicalNodes; /* Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCTopologicalIsland(); - virtual ~DCTopologicalIsland(); - + ~DCTopologicalIsland() override; + + std::list DCTopologicalNodes; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCTopologicalIsland_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DCTopologicalNode.cpp b/CGMES_2.4.15_27JAN2020/DCTopologicalNode.cpp index d64589024..5a31638d6 100644 --- a/CGMES_2.4.15_27JAN2020/DCTopologicalNode.cpp +++ b/CGMES_2.4.15_27JAN2020/DCTopologicalNode.cpp @@ -1,87 +1,116 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DCTopologicalNode.hpp" -#include "DCTopologicalIsland.hpp" -#include "DCBaseTerminal.hpp" +#include +#include + #include "DCEquipmentContainer.hpp" #include "DCNode.hpp" +#include "DCBaseTerminal.hpp" +#include "DCTopologicalIsland.hpp" using namespace CIMPP; -DCTopologicalNode::DCTopologicalNode(): DCTopologicalIsland(nullptr), DCEquipmentContainer(nullptr) {}; - +DCTopologicalNode::DCTopologicalNode() : DCEquipmentContainer(nullptr), DCTopologicalIsland(nullptr) {}; DCTopologicalNode::~DCTopologicalNode() {}; -bool assign_DCTopologicalNode_DCTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCTopologicalIsland = dynamic_cast(BaseClass_ptr2); - if(element->DCTopologicalIsland != nullptr) - return true; - } - return false; -} -bool assign_DCTopologicalNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCTerminals.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCEquipmentContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCEquipmentContainer != element2) + { + element->DCEquipmentContainer = element2; + return assign_DCEquipmentContainer_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_DCEquipmentContainer_DCTopologicalNode(BaseClass*, BaseClass*); -bool assign_DCTopologicalNode_DCEquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->DCEquipmentContainer = dynamic_cast(BaseClass_ptr2); - if(element->DCEquipmentContainer != nullptr) - return assign_DCEquipmentContainer_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DCNode_DCTopologicalNode(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCNodes.begin(), element->DCNodes.end(), element2) == element->DCNodes.end()) + { + element->DCNodes.push_back(element2); + return assign_DCNode_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DCTopologicalNode_DCNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_DCBaseTerminal_DCTopologicalNode(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCTerminals(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCBaseTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCTerminals.begin(), element->DCTerminals.end(), element2) == element->DCTerminals.end()) + { + element->DCTerminals.push_back(element2); + return assign_DCBaseTerminal_DCTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - -namespace CIMPP { - BaseClass* DCTopologicalNode_factory() { - return new DCTopologicalNode; +bool assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass*, BaseClass*); +bool assign_DCTopologicalNode_DCTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DCTopologicalNode* element = dynamic_cast(BaseClass_ptr1); + DCTopologicalIsland* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DCTopologicalIsland != element2) + { + element->DCTopologicalIsland = element2; + return assign_DCTopologicalIsland_DCTopologicalNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DCTopologicalNode::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DCTopologicalNode"), &DCTopologicalNode_factory)); +const char DCTopologicalNode::debugName[] = "DCTopologicalNode"; +const char* DCTopologicalNode::debugString() const +{ + return DCTopologicalNode::debugName; } -void DCTopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DCTopologicalNode::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DCTopologicalNode"), &DCTopologicalNode_factory)); +} -void DCTopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTopologicalIsland"), &assign_DCTopologicalNode_DCTopologicalIsland)); - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTerminals"), &assign_DCTopologicalNode_DCTerminals)); - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCEquipmentContainer"), &assign_DCTopologicalNode_DCEquipmentContainer)); - assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCNodes"), &assign_DCTopologicalNode_DCNodes)); +void DCTopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DCTopologicalNode::debugName[] = "DCTopologicalNode"; -const char* DCTopologicalNode::debugString() +void DCTopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DCTopologicalNode::debugName; + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCEquipmentContainer"), &assign_DCTopologicalNode_DCEquipmentContainer)); + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCNodes"), &assign_DCTopologicalNode_DCNodes)); + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTerminals"), &assign_DCTopologicalNode_DCTerminals)); + assign_map.insert(std::make_pair(std::string("cim:DCTopologicalNode.DCTopologicalIsland"), &assign_DCTopologicalNode_DCTopologicalIsland)); } const BaseClassDefiner DCTopologicalNode::declare() @@ -89,4 +118,10 @@ const BaseClassDefiner DCTopologicalNode::declare() return BaseClassDefiner(DCTopologicalNode::addConstructToMap, DCTopologicalNode::addPrimitiveAssignFnsToMap, DCTopologicalNode::addClassAssignFnsToMap, DCTopologicalNode::debugName); } - +namespace CIMPP +{ + BaseClass* DCTopologicalNode_factory() + { + return new DCTopologicalNode; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DCTopologicalNode.hpp b/CGMES_2.4.15_27JAN2020/DCTopologicalNode.hpp index 877f508fb..b7006a6b3 100644 --- a/CGMES_2.4.15_27JAN2020/DCTopologicalNode.hpp +++ b/CGMES_2.4.15_27JAN2020/DCTopologicalNode.hpp @@ -1,44 +1,45 @@ #ifndef DCTopologicalNode_H #define DCTopologicalNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCBaseTerminal; + class DCEquipmentContainer; + class DCNode; + class DCTopologicalIsland; -class DCTopologicalIsland; -class DCBaseTerminal; -class DCEquipmentContainer; -class DCNode; /* DC bus. */ - class DCTopologicalNode: public IdentifiedObject + class DCTopologicalNode : public IdentifiedObject { - public: - CIMPP::DCTopologicalIsland* DCTopologicalIsland; /* Default: 0 */ - std::list DCTerminals; /* See association end Terminal.TopologicalNode. Default: 0 */ - CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ - std::list DCNodes; /* See association end ConnectivityNode.TopologicalNode. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DCTopologicalNode(); - virtual ~DCTopologicalNode(); - + ~DCTopologicalNode() override; + + CIMPP::DCEquipmentContainer* DCEquipmentContainer; /* Default: 0 */ + std::list DCNodes; /* See association end ConnectivityNode.TopologicalNode. Default: 0 */ + std::list DCTerminals; /* See association end Terminal.TopologicalNode. Default: 0 */ + CIMPP::DCTopologicalIsland* DCTopologicalIsland; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DCTopologicalNode_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Date.cpp b/CGMES_2.4.15_27JAN2020/Date.cpp new file mode 100644 index 000000000..6bcf3159e --- /dev/null +++ b/CGMES_2.4.15_27JAN2020/Date.cpp @@ -0,0 +1,49 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ +#include "Date.hpp" + +#include "../src/CIMExceptions.hpp" + +using namespace CIMPP; + +Date& Date::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; +} + +Date::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Date::debugName[] = "Date"; +const char* Date::debugString() const +{ + return Date::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Date& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + + std::ostream& operator<<(std::ostream& os, const Date& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Date.hpp b/CGMES_2.4.15_27JAN2020/Date.hpp new file mode 100644 index 000000000..e2063f08d --- /dev/null +++ b/CGMES_2.4.15_27JAN2020/Date.hpp @@ -0,0 +1,35 @@ +#ifndef Date_H +#define Date_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + +#include +#include +#include + +namespace CIMPP +{ + /* + Date as "yyyy-mm-dd", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddZ". A local timezone relative UTC is specified as "yyyy-mm-dd(+/-)hh:mm". + */ + class Date + { + public: + Date() : initialized(false) {} + Date(const std::string& value) : value(value), initialized(true) {} + + Date& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Date& rop); + friend std::ostream& operator<<(std::ostream& os, const Date& obj); + }; +} +#endif diff --git a/CGMES_2.4.15_27JAN2020/DateTime.cpp b/CGMES_2.4.15_27JAN2020/DateTime.cpp index 97315713b..866aa87b0 100644 --- a/CGMES_2.4.15_27JAN2020/DateTime.cpp +++ b/CGMES_2.4.15_27JAN2020/DateTime.cpp @@ -1,41 +1,49 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DateTime.hpp" +#include "../src/CIMExceptions.hpp" using namespace CIMPP; -DateTime::DateTime() {}; - -DateTime::~DateTime() {}; - - - -namespace CIMPP { - BaseClass* DateTime_factory() { - return new DateTime; - } -} - -void DateTime::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DateTime"), &DateTime_factory)); -} - -void DateTime::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +DateTime& DateTime::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; } -void DateTime::addClassAssignFnsToMap(std::unordered_map& assign_map) { +DateTime::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; } const char DateTime::debugName[] = "DateTime"; -const char* DateTime::debugString() +const char* DateTime::debugString() const { return DateTime::debugName; } -const BaseClassDefiner DateTime::declare() +namespace CIMPP { - return BaseClassDefiner(DateTime::addConstructToMap, DateTime::addPrimitiveAssignFnsToMap, DateTime::addClassAssignFnsToMap, DateTime::debugName); -} - + std::istream& operator>>(std::istream& lop, DateTime& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const DateTime& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DateTime.hpp b/CGMES_2.4.15_27JAN2020/DateTime.hpp index 43fe97eba..745e7583b 100644 --- a/CGMES_2.4.15_27JAN2020/DateTime.hpp +++ b/CGMES_2.4.15_27JAN2020/DateTime.hpp @@ -1,38 +1,35 @@ #ifndef DateTime_H #define DateTime_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { - +#include +#include +#include +namespace CIMPP +{ /* Date and time as "yyyy-mm-ddThh:mm:ss.sss", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddThh:mm:ss.sssZ". A local timezone relative UTC is specified as "yyyy-mm-ddThh:mm:ss.sss-hh:mm". The second component (shown here as "ss.sss") could have any number of digits in its fractional part to allow any kind of precision beyond seconds. */ - class DateTime: public BaseClass + class DateTime { - public: - + DateTime() : initialized(false) {} + DateTime(const std::string& value) : value(value), initialized(true) {} + + DateTime& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - DateTime(); - virtual ~DateTime(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; + friend std::istream& operator>>(std::istream& lop, DateTime& rop); + friend std::ostream& operator<<(std::ostream& os, const DateTime& obj); }; - - BaseClass* DateTime_factory(); } #endif diff --git a/CGMES_2.4.15_27JAN2020/DayType.cpp b/CGMES_2.4.15_27JAN2020/DayType.cpp index 0f8ebddda..e53f29f9f 100644 --- a/CGMES_2.4.15_27JAN2020/DayType.cpp +++ b/CGMES_2.4.15_27JAN2020/DayType.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DayType.hpp" +#include +#include + #include "SeasonDayTypeSchedule.hpp" using namespace CIMPP; DayType::DayType() {}; - DayType::~DayType() {}; -bool assign_DayType_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DayType* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SeasonDayTypeSchedules.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_SeasonDayTypeSchedule_DayType(BaseClass*, BaseClass*); +bool assign_DayType_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DayType* element = dynamic_cast(BaseClass_ptr1); + SeasonDayTypeSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SeasonDayTypeSchedules.begin(), element->SeasonDayTypeSchedules.end(), element2) == element->SeasonDayTypeSchedules.end()) + { + element->SeasonDayTypeSchedules.push_back(element2); + return assign_SeasonDayTypeSchedule_DayType(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DayType_factory() { - return new DayType; - } +const char DayType::debugName[] = "DayType"; +const char* DayType::debugString() const +{ + return DayType::debugName; } -void DayType::addConstructToMap(std::unordered_map& factory_map) { +void DayType::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DayType"), &DayType_factory)); } -void DayType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DayType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DayType.SeasonDayTypeSchedules"), &assign_DayType_SeasonDayTypeSchedules)); +void DayType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DayType::debugName[] = "DayType"; -const char* DayType::debugString() +void DayType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DayType::debugName; + assign_map.insert(std::make_pair(std::string("cim:DayType.SeasonDayTypeSchedules"), &assign_DayType_SeasonDayTypeSchedules)); } const BaseClassDefiner DayType::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DayType::declare() return BaseClassDefiner(DayType::addConstructToMap, DayType::addPrimitiveAssignFnsToMap, DayType::addClassAssignFnsToMap, DayType::debugName); } - +namespace CIMPP +{ + BaseClass* DayType_factory() + { + return new DayType; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DayType.hpp b/CGMES_2.4.15_27JAN2020/DayType.hpp index 5242c9393..578cabc93 100644 --- a/CGMES_2.4.15_27JAN2020/DayType.hpp +++ b/CGMES_2.4.15_27JAN2020/DayType.hpp @@ -1,38 +1,39 @@ #ifndef DayType_H #define DayType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SeasonDayTypeSchedule; -class SeasonDayTypeSchedule; /* Group of similar days. For example it could be used to represent weekdays, weekend, or holidays. */ - class DayType: public IdentifiedObject + class DayType : public IdentifiedObject { - public: - std::list SeasonDayTypeSchedules; /* DayType for the Schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DayType(); - virtual ~DayType(); - + ~DayType() override; + + std::list SeasonDayTypeSchedules; /* DayType for the Schedule. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DayType_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Decimal.cpp b/CGMES_2.4.15_27JAN2020/Decimal.cpp index 8556ce687..98be5f30e 100644 --- a/CGMES_2.4.15_27JAN2020/Decimal.cpp +++ b/CGMES_2.4.15_27JAN2020/Decimal.cpp @@ -1,41 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Decimal.hpp" +#include -using namespace CIMPP; - -Decimal::Decimal() {}; - -Decimal::~Decimal() {}; +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; +Decimal& Decimal::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -namespace CIMPP { - BaseClass* Decimal_factory() { - return new Decimal; +Decimal::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void Decimal::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:Decimal"), &Decimal_factory)); +const char Decimal::debugName[] = "Decimal"; +const char* Decimal::debugString() const +{ + return Decimal::debugName; } -void Decimal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +Decimal& Decimal::operator+=(const Decimal& rhs) +{ + value += rhs.value; + return *this; } -void Decimal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +Decimal& Decimal::operator-=(const Decimal& rhs) +{ + value -= rhs.value; + return *this; } -const char Decimal::debugName[] = "Decimal"; -const char* Decimal::debugString() +Decimal& Decimal::operator*=(const Decimal& rhs) { - return Decimal::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner Decimal::declare() +Decimal& Decimal::operator/=(const Decimal& rhs) { - return BaseClassDefiner(Decimal::addConstructToMap, Decimal::addPrimitiveAssignFnsToMap, Decimal::addClassAssignFnsToMap, Decimal::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Decimal& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const Decimal& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Decimal.hpp b/CGMES_2.4.15_27JAN2020/Decimal.hpp index 659729ccc..fa74e37f8 100644 --- a/CGMES_2.4.15_27JAN2020/Decimal.hpp +++ b/CGMES_2.4.15_27JAN2020/Decimal.hpp @@ -1,38 +1,39 @@ #ifndef Decimal_H #define Decimal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { - +#include +#include +namespace CIMPP +{ /* Decimal is the base-10 notational system for representing real numbers. */ - class Decimal: public BaseClass + class Decimal { - public: - + Decimal() : value(0.0), initialized(false) {} + Decimal(long double value) : value(value), initialized(true) {} + + Decimal& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - Decimal(); - virtual ~Decimal(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + Decimal& operator+=(const Decimal& rhs); + Decimal& operator-=(const Decimal& rhs); + Decimal& operator*=(const Decimal& rhs); + Decimal& operator/=(const Decimal& rhs); - BaseClass* Decimal_factory(); + friend std::istream& operator>>(std::istream& lop, Decimal& rop); + friend std::ostream& operator<<(std::ostream& os, const Decimal& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/Diagram.cpp b/CGMES_2.4.15_27JAN2020/Diagram.cpp index 744e0555a..c90822887 100644 --- a/CGMES_2.4.15_27JAN2020/Diagram.cpp +++ b/CGMES_2.4.15_27JAN2020/Diagram.cpp @@ -1,137 +1,156 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Diagram.hpp" +#include +#include + +#include "DiagramObject.hpp" #include "DiagramStyle.hpp" #include "OrientationKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "DiagramObject.hpp" using namespace CIMPP; -Diagram::Diagram(): DiagramStyle(nullptr) {}; - +Diagram::Diagram() : DiagramStyle(nullptr) {}; Diagram::~Diagram() {}; -bool assign_DiagramStyle_Diagram(BaseClass*, BaseClass*); -bool assign_Diagram_DiagramStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramStyle = dynamic_cast(BaseClass_ptr2); - if(element->DiagramStyle != nullptr) - return assign_DiagramStyle_Diagram(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_Diagram_orientation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->orientation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Diagram_x1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x1InitialView; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Diagram_x2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2InitialView; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Diagram_DiagramElements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiagramElements.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Diagram_y1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y1InitialView; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_Diagram_y2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Diagram* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y2InitialView; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Diagram_orientation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->orientation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObject_Diagram(BaseClass*, BaseClass*); +bool assign_Diagram_DiagramElements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Diagram* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramElements.begin(), element->DiagramElements.end(), element2) == element->DiagramElements.end()) + { + element->DiagramElements.push_back(element2); + return assign_DiagramObject_Diagram(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Diagram_x1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x1InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramStyle_Diagram(BaseClass*, BaseClass*); +bool assign_Diagram_DiagramStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Diagram* element = dynamic_cast(BaseClass_ptr1); + DiagramStyle* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramStyle != element2) + { + element->DiagramStyle = element2; + return assign_DiagramStyle_Diagram(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Diagram_x2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Diagram_y1InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y1InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Diagram_y2InitialView(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Diagram* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y2InitialView; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Diagram_factory() { - return new Diagram; - } + +const char Diagram::debugName[] = "Diagram"; +const char* Diagram::debugString() const +{ + return Diagram::debugName; } -void Diagram::addConstructToMap(std::unordered_map& factory_map) { +void Diagram::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Diagram"), &Diagram_factory)); } -void Diagram::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Diagram.orientation"), &assign_Diagram_orientation)); +void Diagram::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Diagram.orientation"), &assign_Diagram_orientation)); assign_map.insert(std::make_pair(std::string("cim:Diagram.x1InitialView"), &assign_Diagram_x1InitialView)); assign_map.insert(std::make_pair(std::string("cim:Diagram.x2InitialView"), &assign_Diagram_x2InitialView)); assign_map.insert(std::make_pair(std::string("cim:Diagram.y1InitialView"), &assign_Diagram_y1InitialView)); assign_map.insert(std::make_pair(std::string("cim:Diagram.y2InitialView"), &assign_Diagram_y2InitialView)); - } - -void Diagram::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramStyle"), &assign_Diagram_DiagramStyle)); - assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramElements"), &assign_Diagram_DiagramElements)); } -const char Diagram::debugName[] = "Diagram"; -const char* Diagram::debugString() +void Diagram::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Diagram::debugName; + assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramElements"), &assign_Diagram_DiagramElements)); + assign_map.insert(std::make_pair(std::string("cim:Diagram.DiagramStyle"), &assign_Diagram_DiagramStyle)); } const BaseClassDefiner Diagram::declare() @@ -139,4 +158,10 @@ const BaseClassDefiner Diagram::declare() return BaseClassDefiner(Diagram::addConstructToMap, Diagram::addPrimitiveAssignFnsToMap, Diagram::addClassAssignFnsToMap, Diagram::debugName); } - +namespace CIMPP +{ + BaseClass* Diagram_factory() + { + return new Diagram; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Diagram.hpp b/CGMES_2.4.15_27JAN2020/Diagram.hpp index 163978d01..571c85e7c 100644 --- a/CGMES_2.4.15_27JAN2020/Diagram.hpp +++ b/CGMES_2.4.15_27JAN2020/Diagram.hpp @@ -1,47 +1,48 @@ #ifndef Diagram_H #define Diagram_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "OrientationKind.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; + class DiagramStyle; - -class DiagramStyle; -class DiagramObject; /* The diagram being exchanged. The coordinate system is a standard Cartesian coordinate system and the orientation attribute defines the orientation. */ - class Diagram: public IdentifiedObject + class Diagram : public IdentifiedObject { - public: - CIMPP::DiagramStyle* DiagramStyle; /* A Diagram may have a DiagramStyle. Default: 0 */ - CIMPP::OrientationKind orientation; /* Coordinate system orientation of the diagram. Default: 0 */ - CIMPP::Simple_Float x1InitialView; /* X coordinate of the first corner of the initial view. Default: nullptr */ - CIMPP::Simple_Float x2InitialView; /* X coordinate of the second corner of the initial view. Default: nullptr */ - CIMPP::Simple_Float y1InitialView; /* Y coordinate of the first corner of the initial view. Default: nullptr */ - CIMPP::Simple_Float y2InitialView; /* Y coordinate of the second corner of the initial view. Default: nullptr */ - std::list DiagramElements; /* A diagram is made up of multiple diagram objects. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Diagram(); - virtual ~Diagram(); - + ~Diagram() override; + + std::list DiagramElements; /* A diagram is made up of multiple diagram objects. Default: 0 */ + CIMPP::DiagramStyle* DiagramStyle; /* A Diagram may have a DiagramStyle. Default: 0 */ + CIMPP::OrientationKind orientation; /* Coordinate system orientation of the diagram. Default: 0 */ + CIMPP::Simple_Float x1InitialView; /* X coordinate of the first corner of the initial view. Default: nullptr */ + CIMPP::Simple_Float x2InitialView; /* X coordinate of the second corner of the initial view. Default: nullptr */ + CIMPP::Simple_Float y1InitialView; /* Y coordinate of the first corner of the initial view. Default: nullptr */ + CIMPP::Simple_Float y2InitialView; /* Y coordinate of the second corner of the initial view. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Diagram_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.cpp b/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.cpp index a63a57174..24968c480 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramLayoutVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -DiagramLayoutVersion::DiagramLayoutVersion(): date(nullptr) {}; - +DiagramLayoutVersion::DiagramLayoutVersion() {}; DiagramLayoutVersion::~DiagramLayoutVersion() {}; - - -bool assign_DiagramLayoutVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_DiagramLayoutVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_DiagramLayoutVersion_baseUML(std::stringstream &buffer, BaseClass* B return false; } -bool assign_DiagramLayoutVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_DiagramLayoutVersion_baseURI(std::stringstream &buffer, BaseClass* B return false; } +bool assign_DiagramLayoutVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiagramLayoutVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_DiagramLayoutVersion_differenceModelURI(std::stringstream &buffer, B return false; } -bool assign_DiagramLayoutVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_DiagramLayoutVersion_entsoeUML(std::stringstream &buffer, BaseClass* return false; } -bool assign_DiagramLayoutVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_DiagramLayoutVersion_entsoeURI(std::stringstream &buffer, BaseClass* return false; } -bool assign_DiagramLayoutVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_DiagramLayoutVersion_modelDescriptionURI(std::stringstream &buffer, return false; } -bool assign_DiagramLayoutVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_DiagramLayoutVersion_namespaceRDF(std::stringstream &buffer, BaseCla return false; } -bool assign_DiagramLayoutVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_DiagramLayoutVersion_namespaceUML(std::stringstream &buffer, BaseCla return false; } -bool assign_DiagramLayoutVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DiagramLayoutVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramLayoutVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_DiagramLayoutVersion_shortName(std::stringstream &buffer, BaseClass* return false; } -namespace CIMPP { - BaseClass* DiagramLayoutVersion_factory() { - return new DiagramLayoutVersion; - } + + + + + + + + + + + +const char DiagramLayoutVersion::debugName[] = "DiagramLayoutVersion"; +const char* DiagramLayoutVersion::debugString() const +{ + return DiagramLayoutVersion::debugName; } -void DiagramLayoutVersion::addConstructToMap(std::unordered_map& factory_map) { +void DiagramLayoutVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion"), &DiagramLayoutVersion_factory)); } -void DiagramLayoutVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DiagramLayoutVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.baseUML"), &assign_DiagramLayoutVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.baseURI"), &assign_DiagramLayoutVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.differenceModelURI"), &assign_DiagramLayoutVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.date"), &assign_DiagramLayoutVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.differenceModelURI"), &assign_DiagramLayoutVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.entsoeUML"), &assign_DiagramLayoutVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.entsoeURI"), &assign_DiagramLayoutVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.modelDescriptionURI"), &assign_DiagramLayoutVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void DiagramLayoutVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramLayoutVersion.date"), &assign_DiagramLayoutVersion_date)); - } - -const char DiagramLayoutVersion::debugName[] = "DiagramLayoutVersion"; -const char* DiagramLayoutVersion::debugString() +void DiagramLayoutVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramLayoutVersion::debugName; } const BaseClassDefiner DiagramLayoutVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner DiagramLayoutVersion::declare() return BaseClassDefiner(DiagramLayoutVersion::addConstructToMap, DiagramLayoutVersion::addPrimitiveAssignFnsToMap, DiagramLayoutVersion::addClassAssignFnsToMap, DiagramLayoutVersion::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramLayoutVersion_factory() + { + return new DiagramLayoutVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.hpp b/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.hpp index 3c777f1e5..4cef20371 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/DiagramLayoutVersion.hpp @@ -1,48 +1,49 @@ #ifndef DiagramLayoutVersion_H #define DiagramLayoutVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class DiagramLayoutVersion: public BaseClass + class DiagramLayoutVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/DiagramLayout/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramLayoutVersion(); - virtual ~DiagramLayoutVersion(); - + ~DiagramLayoutVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/DiagramLayout/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramLayoutVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiagramObject.cpp b/CGMES_2.4.15_27JAN2020/DiagramObject.cpp index cc2e3475e..686fdca1f 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObject.cpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObject.cpp @@ -1,176 +1,216 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObject.hpp" +#include +#include + #include "Diagram.hpp" +#include "DiagramObjectPoint.hpp" +#include "DiagramObjectStyle.hpp" +#include "IdentifiedObject.hpp" +#include "VisibilityLayer.hpp" #include "Integer.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "AngleDegrees.hpp" -#include "IdentifiedObject.hpp" -#include "DiagramObjectPoint.hpp" -#include "VisibilityLayer.hpp" -#include "DiagramObjectStyle.hpp" using namespace CIMPP; -DiagramObject::DiagramObject(): Diagram(nullptr), IdentifiedObject(nullptr), DiagramObjectStyle(nullptr) {}; - +DiagramObject::DiagramObject() : Diagram(nullptr), DiagramObjectStyle(nullptr), IdentifiedObject(nullptr) {}; DiagramObject::~DiagramObject() {}; -bool assign_Diagram_DiagramElements(BaseClass*, BaseClass*); -bool assign_DiagramObject_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - element->Diagram = dynamic_cast(BaseClass_ptr2); - if(element->Diagram != nullptr) - return assign_Diagram_DiagramElements(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_DiagramObject_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->drawingOrder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_IdentifiedObject_DiagramObjects(BaseClass*, BaseClass*); -bool assign_DiagramObject_IdentifiedObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - element->IdentifiedObject = dynamic_cast(BaseClass_ptr2); - if(element->IdentifiedObject != nullptr) - return assign_IdentifiedObject_DiagramObjects(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_DiagramObject_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiagramObjectPoints.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_DiagramObject_isPolygon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isPolygon; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_DiagramObject_VisibilityLayers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VisibilityLayers.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_DiagramObject_offsetX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->offsetX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_DiagramObject_offsetY(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->offsetY; + if (buffer.fail()) + return false; + else return true; + } + return false; +} + +bool assign_DiagramObject_rotation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rotation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + + +bool assign_Diagram_DiagramElements(BaseClass*, BaseClass*); +bool assign_DiagramObject_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + Diagram* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Diagram != element2) + { + element->Diagram = element2; + return assign_Diagram_DiagramElements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_DiagramObjectPoint_DiagramObject(BaseClass*, BaseClass*); +bool assign_DiagramObject_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramObjectPoints.begin(), element->DiagramObjectPoints.end(), element2) == element->DiagramObjectPoints.end()) + { + element->DiagramObjectPoints.push_back(element2); + return assign_DiagramObjectPoint_DiagramObject(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_DiagramObjectStyle_StyledObjects(BaseClass*, BaseClass*); -bool assign_DiagramObject_DiagramObjectStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObjectStyle = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObjectStyle != nullptr) - return assign_DiagramObjectStyle_StyledObjects(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - -bool assign_DiagramObject_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->drawingOrder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_isPolygon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isPolygon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_offsetX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->offsetX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_offsetY(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->offsetY; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_DiagramObject_rotation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObject* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rotation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - - - -namespace CIMPP { - BaseClass* DiagramObject_factory() { - return new DiagramObject; +bool assign_DiagramObject_DiagramObjectStyle(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectStyle* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramObjectStyle != element2) + { + element->DiagramObjectStyle = element2; + return assign_DiagramObjectStyle_StyledObjects(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + +bool assign_IdentifiedObject_DiagramObjects(BaseClass*, BaseClass*); +bool assign_DiagramObject_IdentifiedObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + IdentifiedObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->IdentifiedObject != element2) + { + element->IdentifiedObject = element2; + return assign_IdentifiedObject_DiagramObjects(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_VisibilityLayer_VisibleObjects(BaseClass*, BaseClass*); +bool assign_DiagramObject_VisibilityLayers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObject* element = dynamic_cast(BaseClass_ptr1); + VisibilityLayer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VisibilityLayers.begin(), element->VisibilityLayers.end(), element2) == element->VisibilityLayers.end()) + { + element->VisibilityLayers.push_back(element2); + return assign_VisibilityLayer_VisibleObjects(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + +const char DiagramObject::debugName[] = "DiagramObject"; +const char* DiagramObject::debugString() const +{ + return DiagramObject::debugName; } -void DiagramObject::addConstructToMap(std::unordered_map& factory_map) { +void DiagramObject::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramObject"), &DiagramObject_factory)); } -void DiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObject.drawingOrder"), &assign_DiagramObject_drawingOrder)); +void DiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:DiagramObject.drawingOrder"), &assign_DiagramObject_drawingOrder)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.isPolygon"), &assign_DiagramObject_isPolygon)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.offsetX"), &assign_DiagramObject_offsetX)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.offsetY"), &assign_DiagramObject_offsetY)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.rotation"), &assign_DiagramObject_rotation)); - } +} -void DiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiagramObject.Diagram"), &assign_DiagramObject_Diagram)); - assign_map.insert(std::make_pair(std::string("cim:DiagramObject.IdentifiedObject"), &assign_DiagramObject_IdentifiedObject)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.DiagramObjectPoints"), &assign_DiagramObject_DiagramObjectPoints)); - assign_map.insert(std::make_pair(std::string("cim:DiagramObject.VisibilityLayers"), &assign_DiagramObject_VisibilityLayers)); assign_map.insert(std::make_pair(std::string("cim:DiagramObject.DiagramObjectStyle"), &assign_DiagramObject_DiagramObjectStyle)); -} - -const char DiagramObject::debugName[] = "DiagramObject"; -const char* DiagramObject::debugString() -{ - return DiagramObject::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramObject.IdentifiedObject"), &assign_DiagramObject_IdentifiedObject)); + assign_map.insert(std::make_pair(std::string("cim:DiagramObject.VisibilityLayers"), &assign_DiagramObject_VisibilityLayers)); } const BaseClassDefiner DiagramObject::declare() @@ -178,4 +218,10 @@ const BaseClassDefiner DiagramObject::declare() return BaseClassDefiner(DiagramObject::addConstructToMap, DiagramObject::addPrimitiveAssignFnsToMap, DiagramObject::addClassAssignFnsToMap, DiagramObject::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObject_factory() + { + return new DiagramObject; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiagramObject.hpp b/CGMES_2.4.15_27JAN2020/DiagramObject.hpp index 7fc11266b..63b5c821b 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObject.hpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObject.hpp @@ -1,55 +1,56 @@ #ifndef DiagramObject_H #define DiagramObject_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "Boolean.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" -#include "AngleDegrees.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Diagram; + class DiagramObjectPoint; + class DiagramObjectStyle; + class IdentifiedObject; + class VisibilityLayer; - -class Diagram; -class IdentifiedObject; -class DiagramObjectPoint; -class VisibilityLayer; -class DiagramObjectStyle; /* An object that defines one or more points in a given space. This object can be associated with anything that specializes IdentifiedObject. For single line diagrams such objects typically include such items as analog values, breakers, disconnectors, power transformers, and transmission lines. */ - class DiagramObject: public IdentifiedObject + class DiagramObject : public IdentifiedObject { - public: - CIMPP::Diagram* Diagram; /* A diagram object is part of a diagram. Default: 0 */ - CIMPP::Integer drawingOrder; /* The drawing order of this element. The higher the number, the later the element is drawn in sequence. This is used to ensure that elements that overlap are rendered in the correct order. Default: 0 */ - CIMPP::Boolean isPolygon; /* Defines whether or not the diagram objects points define the boundaries of a polygon or the routing of a polyline. If this value is true then a receiving application should consider the first and last points to be connected. Default: false */ - CIMPP::Simple_Float offsetX; /* The offset in the X direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the horizontal centre of the icon. -0.5 indicates it is offset by 50% to the left and 0.5 indicates an offset of 50% to the right. Default: nullptr */ - CIMPP::Simple_Float offsetY; /* The offset in the Y direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the vertical centre of the icon. The offset direction is dependent on the orientation of the diagram, with -0.5 and 0.5 indicating an offset of +/- 50% on the vertical axis. Default: nullptr */ - CIMPP::AngleDegrees rotation; /* Sets the angle of rotation of the diagram object. Zero degrees is pointing to the top of the diagram. Rotation is clockwise. Default: nullptr */ - CIMPP::IdentifiedObject* IdentifiedObject; /* The diagram objects that are associated with the domain object. Default: 0 */ - std::list DiagramObjectPoints; /* A diagram object can have 0 or more points to reflect its layout position, routing (for polylines) or boundary (for polygons). Default: 0 */ - std::list VisibilityLayers; /* A diagram object can be part of multiple visibility layers. Default: 0 */ - CIMPP::DiagramObjectStyle* DiagramObjectStyle; /* A diagram object has a style associated that provides a reference for the style used in the originating system. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObject(); - virtual ~DiagramObject(); - + ~DiagramObject() override; + + CIMPP::Diagram* Diagram; /* A diagram object is part of a diagram. Default: 0 */ + std::list DiagramObjectPoints; /* A diagram object can have 0 or more points to reflect its layout position, routing (for polylines) or boundary (for polygons). Default: 0 */ + CIMPP::DiagramObjectStyle* DiagramObjectStyle; /* A diagram object has a style associated that provides a reference for the style used in the originating system. Default: 0 */ + CIMPP::IdentifiedObject* IdentifiedObject; /* The diagram objects that are associated with the domain object. Default: 0 */ + std::list VisibilityLayers; /* A diagram object can be part of multiple visibility layers. Default: 0 */ + CIMPP::Integer drawingOrder; /* The drawing order of this element. The higher the number, the later the element is drawn in sequence. This is used to ensure that elements that overlap are rendered in the correct order. Default: 0 */ + CIMPP::Boolean isPolygon; /* Defines whether or not the diagram objects points define the boundaries of a polygon or the routing of a polyline. If this value is true then a receiving application should consider the first and last points to be connected. Default: false */ + CIMPP::Simple_Float offsetX; /* The offset in the X direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the horizontal centre of the icon. -0.5 indicates it is offset by 50% to the left and 0.5 indicates an offset of 50% to the right. Default: nullptr */ + CIMPP::Simple_Float offsetY; /* The offset in the Y direction. This is used for defining the offset from centre for rendering an icon (the default is that a single point specifies the centre of the icon). The offset is in per-unit with 0 indicating there is no offset from the vertical centre of the icon. The offset direction is dependent on the orientation of the diagram, with -0.5 and 0.5 indicating an offset of +/- 50% on the vertical axis. Default: nullptr */ + CIMPP::AngleDegrees rotation; /* Sets the angle of rotation of the diagram object. Zero degrees is pointing to the top of the diagram. Rotation is clockwise. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObject_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.cpp b/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.cpp index 201d1aee0..9efe6a370 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.cpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.cpp @@ -1,48 +1,56 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObjectGluePoint.hpp" +#include +#include + #include "DiagramObjectPoint.hpp" using namespace CIMPP; -DiagramObjectGluePoint::DiagramObjectGluePoint(): DiagramObjectPoints(nullptr) {}; - +DiagramObjectGluePoint::DiagramObjectGluePoint() {}; DiagramObjectGluePoint::~DiagramObjectGluePoint() {}; -bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectGluePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObjectPoints = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObjectPoints != nullptr) - return true; - } - return false; -} - -namespace CIMPP { - BaseClass* DiagramObjectGluePoint_factory() { - return new DiagramObjectGluePoint; +bool assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass*, BaseClass*); +bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectGluePoint* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramObjectPoints.begin(), element->DiagramObjectPoints.end(), element2) == element->DiagramObjectPoints.end()) + { + element->DiagramObjectPoints.push_back(element2); + return assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DiagramObjectGluePoint::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint"), &DiagramObjectGluePoint_factory)); +const char DiagramObjectGluePoint::debugName[] = "DiagramObjectGluePoint"; +const char* DiagramObjectGluePoint::debugString() const +{ + return DiagramObjectGluePoint::debugName; } -void DiagramObjectGluePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DiagramObjectGluePoint::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint"), &DiagramObjectGluePoint_factory)); +} -void DiagramObjectGluePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint.DiagramObjectPoints"), &assign_DiagramObjectGluePoint_DiagramObjectPoints)); +void DiagramObjectGluePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiagramObjectGluePoint::debugName[] = "DiagramObjectGluePoint"; -const char* DiagramObjectGluePoint::debugString() +void DiagramObjectGluePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramObjectGluePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramObjectGluePoint.DiagramObjectPoints"), &assign_DiagramObjectGluePoint_DiagramObjectPoints)); } const BaseClassDefiner DiagramObjectGluePoint::declare() @@ -50,4 +58,10 @@ const BaseClassDefiner DiagramObjectGluePoint::declare() return BaseClassDefiner(DiagramObjectGluePoint::addConstructToMap, DiagramObjectGluePoint::addPrimitiveAssignFnsToMap, DiagramObjectGluePoint::addClassAssignFnsToMap, DiagramObjectGluePoint::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObjectGluePoint_factory() + { + return new DiagramObjectGluePoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.hpp b/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.hpp index d963bdb3c..09f9a7fe8 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.hpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObjectGluePoint.hpp @@ -1,38 +1,39 @@ #ifndef DiagramObjectGluePoint_H #define DiagramObjectGluePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DiagramObjectPoint; -class DiagramObjectPoint; /* This is used for grouping diagram object points from different diagram objects that are considered to be glued together in a diagram even if they are not at the exact same coordinates. */ - class DiagramObjectGluePoint: public BaseClass + class DiagramObjectGluePoint : public BaseClass { - public: - CIMPP::DiagramObjectPoint* DiagramObjectPoints; /* The `glue` point to which this point is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObjectGluePoint(); - virtual ~DiagramObjectGluePoint(); - + ~DiagramObjectGluePoint() override; + + std::list DiagramObjectPoints; /* The `glue` point to which this point is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObjectGluePoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.cpp b/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.cpp index 61136318d..488a291cc 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.cpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObjectPoint.hpp" +#include +#include + #include "DiagramObject.hpp" #include "DiagramObjectGluePoint.hpp" #include "Integer.hpp" @@ -11,112 +15,126 @@ using namespace CIMPP; -DiagramObjectPoint::DiagramObjectPoint(): DiagramObject(nullptr), DiagramObjectGluePoint(nullptr) {}; - +DiagramObjectPoint::DiagramObjectPoint() : DiagramObject(nullptr), DiagramObjectGluePoint(nullptr) {}; DiagramObjectPoint::~DiagramObjectPoint() {}; -bool assign_DiagramObject_DiagramObjectPoints(BaseClass*, BaseClass*); -bool assign_DiagramObjectPoint_DiagramObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObject = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObject != nullptr) - return assign_DiagramObject_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass*, BaseClass*); -bool assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->DiagramObjectGluePoint = dynamic_cast(BaseClass_ptr2); - if(element->DiagramObjectGluePoint != nullptr) - return assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_DiagramObjectPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiagramObjectPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xPosition; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiagramObjectPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yPosition; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiagramObjectPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zPosition; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiagramObjectPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObject_DiagramObjectPoints(BaseClass*, BaseClass*); +bool assign_DiagramObjectPoint_DiagramObject(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramObject != element2) + { + element->DiagramObject = element2; + return assign_DiagramObject_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DiagramObjectPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xPosition; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass*, BaseClass*); +bool assign_DiagramObjectPoint_DiagramObjectGluePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1); + DiagramObjectGluePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiagramObjectGluePoint != element2) + { + element->DiagramObjectGluePoint = element2; + return assign_DiagramObjectGluePoint_DiagramObjectPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DiagramObjectPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yPosition; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiagramObjectPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiagramObjectPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zPosition; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiagramObjectPoint_factory() { - return new DiagramObjectPoint; - } + + +const char DiagramObjectPoint::debugName[] = "DiagramObjectPoint"; +const char* DiagramObjectPoint::debugString() const +{ + return DiagramObjectPoint::debugName; } -void DiagramObjectPoint::addConstructToMap(std::unordered_map& factory_map) { +void DiagramObjectPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint"), &DiagramObjectPoint_factory)); } -void DiagramObjectPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.sequenceNumber"), &assign_DiagramObjectPoint_sequenceNumber)); +void DiagramObjectPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.sequenceNumber"), &assign_DiagramObjectPoint_sequenceNumber)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.xPosition"), &assign_DiagramObjectPoint_xPosition)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.yPosition"), &assign_DiagramObjectPoint_yPosition)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.zPosition"), &assign_DiagramObjectPoint_zPosition)); } -void DiagramObjectPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DiagramObjectPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.DiagramObject"), &assign_DiagramObjectPoint_DiagramObject)); assign_map.insert(std::make_pair(std::string("cim:DiagramObjectPoint.DiagramObjectGluePoint"), &assign_DiagramObjectPoint_DiagramObjectGluePoint)); - } - -const char DiagramObjectPoint::debugName[] = "DiagramObjectPoint"; -const char* DiagramObjectPoint::debugString() -{ - return DiagramObjectPoint::debugName; } const BaseClassDefiner DiagramObjectPoint::declare() @@ -124,4 +142,10 @@ const BaseClassDefiner DiagramObjectPoint::declare() return BaseClassDefiner(DiagramObjectPoint::addConstructToMap, DiagramObjectPoint::addPrimitiveAssignFnsToMap, DiagramObjectPoint::addClassAssignFnsToMap, DiagramObjectPoint::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObjectPoint_factory() + { + return new DiagramObjectPoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.hpp b/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.hpp index 860de0392..d433fab0e 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.hpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObjectPoint.hpp @@ -1,46 +1,47 @@ #ifndef DiagramObjectPoint_H #define DiagramObjectPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; + class DiagramObjectGluePoint; - -class DiagramObject; -class DiagramObjectGluePoint; /* A point in a given space defined by 3 coordinates and associated to a diagram object. The coordinates may be positive or negative as the origin does not have to be in the corner of a diagram. */ - class DiagramObjectPoint: public BaseClass + class DiagramObjectPoint : public BaseClass { - public: - CIMPP::DiagramObject* DiagramObject; /* The diagram object with which the points are associated. Default: 0 */ - CIMPP::DiagramObjectGluePoint* DiagramObjectGluePoint; /* A diagram object glue point is associated with 2 or more object points that are considered to be `glued` together. Default: 0 */ - CIMPP::Integer sequenceNumber; /* The sequence position of the point, used for defining the order of points for diagram objects acting as a polyline or polygon with more than one point. Default: 0 */ - CIMPP::Simple_Float xPosition; /* The X coordinate of this point. Default: nullptr */ - CIMPP::Simple_Float yPosition; /* The Y coordinate of this point. Default: nullptr */ - CIMPP::Simple_Float zPosition; /* The Z coordinate of this point. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObjectPoint(); - virtual ~DiagramObjectPoint(); - + ~DiagramObjectPoint() override; + + CIMPP::DiagramObject* DiagramObject; /* The diagram object with which the points are associated. Default: 0 */ + CIMPP::DiagramObjectGluePoint* DiagramObjectGluePoint; /* A diagram object glue point is associated with 2 or more object points that are considered to be `glued` together. Default: 0 */ + CIMPP::Integer sequenceNumber; /* The sequence position of the point, used for defining the order of points for diagram objects acting as a polyline or polygon with more than one point. Default: 0 */ + CIMPP::Simple_Float xPosition; /* The X coordinate of this point. Default: nullptr */ + CIMPP::Simple_Float yPosition; /* The Y coordinate of this point. Default: nullptr */ + CIMPP::Simple_Float zPosition; /* The Z coordinate of this point. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObjectPoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.cpp b/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.cpp index 2f75f914d..8bf2e688d 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.cpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramObjectStyle.hpp" +#include +#include + #include "DiagramObject.hpp" using namespace CIMPP; DiagramObjectStyle::DiagramObjectStyle() {}; - DiagramObjectStyle::~DiagramObjectStyle() {}; -bool assign_DiagramObjectStyle_StyledObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramObjectStyle* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->StyledObjects.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_DiagramObject_DiagramObjectStyle(BaseClass*, BaseClass*); +bool assign_DiagramObjectStyle_StyledObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramObjectStyle* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->StyledObjects.begin(), element->StyledObjects.end(), element2) == element->StyledObjects.end()) + { + element->StyledObjects.push_back(element2); + return assign_DiagramObject_DiagramObjectStyle(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DiagramObjectStyle_factory() { - return new DiagramObjectStyle; - } +const char DiagramObjectStyle::debugName[] = "DiagramObjectStyle"; +const char* DiagramObjectStyle::debugString() const +{ + return DiagramObjectStyle::debugName; } -void DiagramObjectStyle::addConstructToMap(std::unordered_map& factory_map) { +void DiagramObjectStyle::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramObjectStyle"), &DiagramObjectStyle_factory)); } -void DiagramObjectStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DiagramObjectStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramObjectStyle.StyledObjects"), &assign_DiagramObjectStyle_StyledObjects)); +void DiagramObjectStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiagramObjectStyle::debugName[] = "DiagramObjectStyle"; -const char* DiagramObjectStyle::debugString() +void DiagramObjectStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramObjectStyle::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramObjectStyle.StyledObjects"), &assign_DiagramObjectStyle_StyledObjects)); } const BaseClassDefiner DiagramObjectStyle::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DiagramObjectStyle::declare() return BaseClassDefiner(DiagramObjectStyle::addConstructToMap, DiagramObjectStyle::addPrimitiveAssignFnsToMap, DiagramObjectStyle::addClassAssignFnsToMap, DiagramObjectStyle::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramObjectStyle_factory() + { + return new DiagramObjectStyle; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.hpp b/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.hpp index a35d2d489..ff6524077 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.hpp +++ b/CGMES_2.4.15_27JAN2020/DiagramObjectStyle.hpp @@ -1,38 +1,39 @@ #ifndef DiagramObjectStyle_H #define DiagramObjectStyle_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DiagramObject; -class DiagramObject; /* A reference to a style used by the originating system for a diagram object. A diagram object style describes information such as line thickness, shape such as circle or rectangle etc, and color. */ - class DiagramObjectStyle: public IdentifiedObject + class DiagramObjectStyle : public IdentifiedObject { - public: - std::list StyledObjects; /* A style can be assigned to multiple diagram objects. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramObjectStyle(); - virtual ~DiagramObjectStyle(); - + ~DiagramObjectStyle() override; + + std::list StyledObjects; /* A style can be assigned to multiple diagram objects. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramObjectStyle_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiagramStyle.cpp b/CGMES_2.4.15_27JAN2020/DiagramStyle.cpp index 064099e82..eae09c4d7 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramStyle.cpp +++ b/CGMES_2.4.15_27JAN2020/DiagramStyle.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiagramStyle.hpp" +#include +#include + #include "Diagram.hpp" using namespace CIMPP; DiagramStyle::DiagramStyle() {}; - DiagramStyle::~DiagramStyle() {}; -bool assign_DiagramStyle_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiagramStyle* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Diagram.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_Diagram_DiagramStyle(BaseClass*, BaseClass*); +bool assign_DiagramStyle_Diagram(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiagramStyle* element = dynamic_cast(BaseClass_ptr1); + Diagram* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Diagram.begin(), element->Diagram.end(), element2) == element->Diagram.end()) + { + element->Diagram.push_back(element2); + return assign_Diagram_DiagramStyle(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* DiagramStyle_factory() { - return new DiagramStyle; - } +const char DiagramStyle::debugName[] = "DiagramStyle"; +const char* DiagramStyle::debugString() const +{ + return DiagramStyle::debugName; } -void DiagramStyle::addConstructToMap(std::unordered_map& factory_map) { +void DiagramStyle::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiagramStyle"), &DiagramStyle_factory)); } -void DiagramStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void DiagramStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiagramStyle.Diagram"), &assign_DiagramStyle_Diagram)); +void DiagramStyle::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiagramStyle::debugName[] = "DiagramStyle"; -const char* DiagramStyle::debugString() +void DiagramStyle::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiagramStyle::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiagramStyle.Diagram"), &assign_DiagramStyle_Diagram)); } const BaseClassDefiner DiagramStyle::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner DiagramStyle::declare() return BaseClassDefiner(DiagramStyle::addConstructToMap, DiagramStyle::addPrimitiveAssignFnsToMap, DiagramStyle::addClassAssignFnsToMap, DiagramStyle::debugName); } - +namespace CIMPP +{ + BaseClass* DiagramStyle_factory() + { + return new DiagramStyle; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiagramStyle.hpp b/CGMES_2.4.15_27JAN2020/DiagramStyle.hpp index 615d86117..43960b981 100644 --- a/CGMES_2.4.15_27JAN2020/DiagramStyle.hpp +++ b/CGMES_2.4.15_27JAN2020/DiagramStyle.hpp @@ -1,38 +1,39 @@ #ifndef DiagramStyle_H #define DiagramStyle_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Diagram; -class Diagram; /* The diagram style refer to a style used by the originating system for a diagram. A diagram style describes information such as schematic, geographic, bus-branch etc. */ - class DiagramStyle: public IdentifiedObject + class DiagramStyle : public IdentifiedObject { - public: - std::list Diagram; /* A DiagramStyle can be used by many Diagrams. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiagramStyle(); - virtual ~DiagramStyle(); - + ~DiagramStyle() override; + + std::list Diagram; /* A DiagramStyle can be used by many Diagrams. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiagramStyle_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.cpp b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.cpp index 8886f8f76..fecfe649c 100644 --- a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.cpp +++ b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.cpp @@ -1,22 +1,26 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscExcContIEEEDEC1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -24,283 +28,297 @@ using namespace CIMPP; DiscExcContIEEEDEC1A::DiscExcContIEEEDEC1A() {}; - DiscExcContIEEEDEC1A::~DiscExcContIEEEDEC1A() {}; +bool assign_DiscExcContIEEEDEC1A_esc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->esc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_kan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kan; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_ketl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ketl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tan; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_tw5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_val(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->val; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vanmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vanmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vomax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vomax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vomin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vomin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtlmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtlmt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC1A_vtn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscExcContIEEEDEC1A_vtlmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtlmt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vomax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vomax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vomin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vomin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_ketl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ketl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_val(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->val; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_esc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->esc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_kan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kan; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tan(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tan; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tw5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vtm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vtn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC1A_vanmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vanmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiscExcContIEEEDEC1A_factory() { - return new DiscExcContIEEEDEC1A; - } +const char DiscExcContIEEEDEC1A::debugName[] = "DiscExcContIEEEDEC1A"; +const char* DiscExcContIEEEDEC1A::debugString() const +{ + return DiscExcContIEEEDEC1A::debugName; } -void DiscExcContIEEEDEC1A::addConstructToMap(std::unordered_map& factory_map) { +void DiscExcContIEEEDEC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A"), &DiscExcContIEEEDEC1A_factory)); } -void DiscExcContIEEEDEC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtlmt"), &assign_DiscExcContIEEEDEC1A_vtlmt)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomax"), &assign_DiscExcContIEEEDEC1A_vomax)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomin"), &assign_DiscExcContIEEEDEC1A_vomin)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.ketl"), &assign_DiscExcContIEEEDEC1A_ketl)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtc"), &assign_DiscExcContIEEEDEC1A_vtc)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.val"), &assign_DiscExcContIEEEDEC1A_val)); +void DiscExcContIEEEDEC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.esc"), &assign_DiscExcContIEEEDEC1A_esc)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.kan"), &assign_DiscExcContIEEEDEC1A_kan)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.ketl"), &assign_DiscExcContIEEEDEC1A_ketl)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tan"), &assign_DiscExcContIEEEDEC1A_tan)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tw5"), &assign_DiscExcContIEEEDEC1A_tw5)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmax"), &assign_DiscExcContIEEEDEC1A_vsmax)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmin"), &assign_DiscExcContIEEEDEC1A_vsmin)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.td"), &assign_DiscExcContIEEEDEC1A_td)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tl1"), &assign_DiscExcContIEEEDEC1A_tl1)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tl2"), &assign_DiscExcContIEEEDEC1A_tl2)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.tw5"), &assign_DiscExcContIEEEDEC1A_tw5)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.val"), &assign_DiscExcContIEEEDEC1A_val)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vanmax"), &assign_DiscExcContIEEEDEC1A_vanmax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomax"), &assign_DiscExcContIEEEDEC1A_vomax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vomin"), &assign_DiscExcContIEEEDEC1A_vomin)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmax"), &assign_DiscExcContIEEEDEC1A_vsmax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vsmin"), &assign_DiscExcContIEEEDEC1A_vsmin)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtc"), &assign_DiscExcContIEEEDEC1A_vtc)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtlmt"), &assign_DiscExcContIEEEDEC1A_vtlmt)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtm"), &assign_DiscExcContIEEEDEC1A_vtm)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vtn"), &assign_DiscExcContIEEEDEC1A_vtn)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC1A.vanmax"), &assign_DiscExcContIEEEDEC1A_vanmax)); } -void DiscExcContIEEEDEC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DiscExcContIEEEDEC1A::debugName[] = "DiscExcContIEEEDEC1A"; -const char* DiscExcContIEEEDEC1A::debugString() +void DiscExcContIEEEDEC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscExcContIEEEDEC1A::debugName; } const BaseClassDefiner DiscExcContIEEEDEC1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner DiscExcContIEEEDEC1A::declare() return BaseClassDefiner(DiscExcContIEEEDEC1A::addConstructToMap, DiscExcContIEEEDEC1A::addPrimitiveAssignFnsToMap, DiscExcContIEEEDEC1A::addClassAssignFnsToMap, DiscExcContIEEEDEC1A::debugName); } - +namespace CIMPP +{ + BaseClass* DiscExcContIEEEDEC1A_factory() + { + return new DiscExcContIEEEDEC1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.hpp b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.hpp index 5eba2d38a..e7c14b65d 100644 --- a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.hpp +++ b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC1A.hpp @@ -1,56 +1,57 @@ #ifndef DiscExcContIEEEDEC1A_H #define DiscExcContIEEEDEC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Type DEC1A discontinuous excitation control model that boosts generator excitation to a level higher than that demanded by the voltage regulator and stabilizer immediately following a system fault. Reference: IEEE Standard 421.5-2005 Section 12.2. */ - class DiscExcContIEEEDEC1A: public DiscontinuousExcitationControlDynamics + class DiscExcContIEEEDEC1A : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::PU vtlmt; /* Voltage reference (). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vomax; /* Limiter (). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU vomin; /* Limiter (). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ketl; /* Terminal voltage limiter gain (). Typical Value = 47. Default: nullptr */ - CIMPP::PU vtc; /* Terminal voltage level reference (). Typical Value = 0.95. Default: nullptr */ - CIMPP::PU val; /* Regulator voltage reference (). Typical Value = 5.5. Default: nullptr */ - CIMPP::PU esc; /* Speed change reference (). Typical Value = 0.0015. Default: nullptr */ - CIMPP::PU kan; /* Discontinuous controller gain (). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds tan; /* Discontinuous controller time constant (). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tw5; /* DEC washout time constant (). Typical Value = 5. Default: nullptr */ - CIMPP::PU vsmax; /* Limiter (). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU vsmin; /* Limiter (). Typical Value = -0.066. Default: nullptr */ - CIMPP::Seconds td; /* Time constant (). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tl1; /* Time constant (). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds tl2; /* Time constant (). Typical Value = 1.25. Default: nullptr */ - CIMPP::PU vtm; /* Voltage limits (). Typical Value = 1.13. Default: nullptr */ - CIMPP::PU vtn; /* Voltage limits (). Typical Value = 1.12. Default: nullptr */ - CIMPP::PU vanmax; /* Limiter for Van (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscExcContIEEEDEC1A(); - virtual ~DiscExcContIEEEDEC1A(); - + ~DiscExcContIEEEDEC1A() override; + + CIMPP::PU esc; /* Speed change reference (). Typical Value = 0.0015. Default: nullptr */ + CIMPP::PU kan; /* Discontinuous controller gain (). Typical Value = 400. Default: nullptr */ + CIMPP::PU ketl; /* Terminal voltage limiter gain (). Typical Value = 47. Default: nullptr */ + CIMPP::Seconds tan; /* Discontinuous controller time constant (). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds td; /* Time constant (). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tl1; /* Time constant (). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds tl2; /* Time constant (). Typical Value = 1.25. Default: nullptr */ + CIMPP::Seconds tw5; /* DEC washout time constant (). Typical Value = 5. Default: nullptr */ + CIMPP::PU val; /* Regulator voltage reference (). Typical Value = 5.5. Default: nullptr */ + CIMPP::PU vanmax; /* Limiter for Van (). Default: nullptr */ + CIMPP::PU vomax; /* Limiter (). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU vomin; /* Limiter (). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vsmax; /* Limiter (). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU vsmin; /* Limiter (). Typical Value = -0.066. Default: nullptr */ + CIMPP::PU vtc; /* Terminal voltage level reference (). Typical Value = 0.95. Default: nullptr */ + CIMPP::PU vtlmt; /* Voltage reference (). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vtm; /* Voltage limits (). Typical Value = 1.13. Default: nullptr */ + CIMPP::PU vtn; /* Voltage limits (). Typical Value = 1.12. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscExcContIEEEDEC1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.cpp b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.cpp index 3c1dbf01b..0b0a7a11a 100644 --- a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.cpp +++ b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.cpp @@ -1,111 +1,116 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscExcContIEEEDEC2A.hpp" -#include "PU.hpp" +#include +#include + #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; DiscExcContIEEEDEC2A::DiscExcContIEEEDEC2A() {}; - DiscExcContIEEEDEC2A::~DiscExcContIEEEDEC2A() {}; +bool assign_DiscExcContIEEEDEC2A_td1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_td2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_vdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_vdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC2A_vk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscExcContIEEEDEC2A_vk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_td1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_td2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_vdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC2A_vdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiscExcContIEEEDEC2A_factory() { - return new DiscExcContIEEEDEC2A; - } +const char DiscExcContIEEEDEC2A::debugName[] = "DiscExcContIEEEDEC2A"; +const char* DiscExcContIEEEDEC2A::debugString() const +{ + return DiscExcContIEEEDEC2A::debugName; } -void DiscExcContIEEEDEC2A::addConstructToMap(std::unordered_map& factory_map) { +void DiscExcContIEEEDEC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A"), &DiscExcContIEEEDEC2A_factory)); } -void DiscExcContIEEEDEC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vk"), &assign_DiscExcContIEEEDEC2A_vk)); +void DiscExcContIEEEDEC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.td1"), &assign_DiscExcContIEEEDEC2A_td1)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.td2"), &assign_DiscExcContIEEEDEC2A_td2)); - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vdmin"), &assign_DiscExcContIEEEDEC2A_vdmin)); assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vdmax"), &assign_DiscExcContIEEEDEC2A_vdmax)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vdmin"), &assign_DiscExcContIEEEDEC2A_vdmin)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC2A.vk"), &assign_DiscExcContIEEEDEC2A_vk)); } -void DiscExcContIEEEDEC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DiscExcContIEEEDEC2A::debugName[] = "DiscExcContIEEEDEC2A"; -const char* DiscExcContIEEEDEC2A::debugString() +void DiscExcContIEEEDEC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscExcContIEEEDEC2A::debugName; } const BaseClassDefiner DiscExcContIEEEDEC2A::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner DiscExcContIEEEDEC2A::declare() return BaseClassDefiner(DiscExcContIEEEDEC2A::addConstructToMap, DiscExcContIEEEDEC2A::addPrimitiveAssignFnsToMap, DiscExcContIEEEDEC2A::addClassAssignFnsToMap, DiscExcContIEEEDEC2A::debugName); } - +namespace CIMPP +{ + BaseClass* DiscExcContIEEEDEC2A_factory() + { + return new DiscExcContIEEEDEC2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.hpp b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.hpp index 3160b03ac..35bb8c70a 100644 --- a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.hpp +++ b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC2A.hpp @@ -1,43 +1,44 @@ #ifndef DiscExcContIEEEDEC2A_H #define DiscExcContIEEEDEC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Type DEC2A model for the discontinuous excitation control. This system provides transient excitation boosting via an open-loop control as initiated by a trigger signal generated remotely. Reference: IEEE Standard 421.5-2005 Section 12.3. */ - class DiscExcContIEEEDEC2A: public DiscontinuousExcitationControlDynamics + class DiscExcContIEEEDEC2A : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::PU vk; /* Discontinuous controller input reference (). Default: nullptr */ - CIMPP::Seconds td1; /* Discontinuous controller time constant (). Default: nullptr */ - CIMPP::Seconds td2; /* Discontinuous controller washout time constant (). Default: nullptr */ - CIMPP::PU vdmin; /* Limiter (). Default: nullptr */ - CIMPP::PU vdmax; /* Limiter (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscExcContIEEEDEC2A(); - virtual ~DiscExcContIEEEDEC2A(); - + ~DiscExcContIEEEDEC2A() override; + + CIMPP::Seconds td1; /* Discontinuous controller time constant (). Default: nullptr */ + CIMPP::Seconds td2; /* Discontinuous controller washout time constant (). Default: nullptr */ + CIMPP::PU vdmax; /* Limiter (). Default: nullptr */ + CIMPP::PU vdmin; /* Limiter (). Default: nullptr */ + CIMPP::PU vk; /* Discontinuous controller input reference (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscExcContIEEEDEC2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.cpp b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.cpp index 5dd6209ae..af7d8f9ad 100644 --- a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.cpp +++ b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.cpp @@ -1,66 +1,68 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscExcContIEEEDEC3A.hpp" -#include "PU.hpp" +#include +#include + #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; DiscExcContIEEEDEC3A::DiscExcContIEEEDEC3A() {}; - DiscExcContIEEEDEC3A::~DiscExcContIEEEDEC3A() {}; +bool assign_DiscExcContIEEEDEC3A_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_DiscExcContIEEEDEC3A_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscExcContIEEEDEC3A_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_DiscExcContIEEEDEC3A_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscExcContIEEEDEC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DiscExcContIEEEDEC3A_factory() { - return new DiscExcContIEEEDEC3A; - } +const char DiscExcContIEEEDEC3A::debugName[] = "DiscExcContIEEEDEC3A"; +const char* DiscExcContIEEEDEC3A::debugString() const +{ + return DiscExcContIEEEDEC3A::debugName; } -void DiscExcContIEEEDEC3A::addConstructToMap(std::unordered_map& factory_map) { +void DiscExcContIEEEDEC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A"), &DiscExcContIEEEDEC3A_factory)); } -void DiscExcContIEEEDEC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A.vtmin"), &assign_DiscExcContIEEEDEC3A_vtmin)); +void DiscExcContIEEEDEC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A.tdr"), &assign_DiscExcContIEEEDEC3A_tdr)); + assign_map.insert(std::make_pair(std::string("cim:DiscExcContIEEEDEC3A.vtmin"), &assign_DiscExcContIEEEDEC3A_vtmin)); } -void DiscExcContIEEEDEC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DiscExcContIEEEDEC3A::debugName[] = "DiscExcContIEEEDEC3A"; -const char* DiscExcContIEEEDEC3A::debugString() +void DiscExcContIEEEDEC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscExcContIEEEDEC3A::debugName; } const BaseClassDefiner DiscExcContIEEEDEC3A::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner DiscExcContIEEEDEC3A::declare() return BaseClassDefiner(DiscExcContIEEEDEC3A::addConstructToMap, DiscExcContIEEEDEC3A::addPrimitiveAssignFnsToMap, DiscExcContIEEEDEC3A::addClassAssignFnsToMap, DiscExcContIEEEDEC3A::debugName); } - +namespace CIMPP +{ + BaseClass* DiscExcContIEEEDEC3A_factory() + { + return new DiscExcContIEEEDEC3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.hpp b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.hpp index a03be5948..b6c4728f7 100644 --- a/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.hpp +++ b/CGMES_2.4.15_27JAN2020/DiscExcContIEEEDEC3A.hpp @@ -1,40 +1,41 @@ #ifndef DiscExcContIEEEDEC3A_H #define DiscExcContIEEEDEC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Type DEC3A model. In some systems, the stabilizer output is disconnected from the regulator immediately following a severe fault to prevent the stabilizer from competing with action of voltage regulator during the first swing. Reference: IEEE Standard 421.5-2005 Section 12.4. */ - class DiscExcContIEEEDEC3A: public DiscontinuousExcitationControlDynamics + class DiscExcContIEEEDEC3A : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::PU vtmin; /* Terminal undervoltage comparison level (). Default: nullptr */ - CIMPP::Seconds tdr; /* Reset time delay (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscExcContIEEEDEC3A(); - virtual ~DiscExcContIEEEDEC3A(); - + ~DiscExcContIEEEDEC3A() override; + + CIMPP::Seconds tdr; /* Reset time delay (). Default: nullptr */ + CIMPP::PU vtmin; /* Terminal undervoltage comparison level (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscExcContIEEEDEC3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Disconnector.cpp b/CGMES_2.4.15_27JAN2020/Disconnector.cpp index b4478d691..4c56bdfb9 100644 --- a/CGMES_2.4.15_27JAN2020/Disconnector.cpp +++ b/CGMES_2.4.15_27JAN2020/Disconnector.cpp @@ -1,36 +1,36 @@ -#include -#include "Switch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Disconnector.hpp" +#include +#include + using namespace CIMPP; Disconnector::Disconnector() {}; - Disconnector::~Disconnector() {}; -namespace CIMPP { - BaseClass* Disconnector_factory() { - return new Disconnector; - } +const char Disconnector::debugName[] = "Disconnector"; +const char* Disconnector::debugString() const +{ + return Disconnector::debugName; } -void Disconnector::addConstructToMap(std::unordered_map& factory_map) { +void Disconnector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Disconnector"), &Disconnector_factory)); } -void Disconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Disconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Disconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Disconnector::debugName[] = "Disconnector"; -const char* Disconnector::debugString() +void Disconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Disconnector::debugName; } const BaseClassDefiner Disconnector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Disconnector::declare() return BaseClassDefiner(Disconnector::addConstructToMap, Disconnector::addPrimitiveAssignFnsToMap, Disconnector::addClassAssignFnsToMap, Disconnector::debugName); } - +namespace CIMPP +{ + BaseClass* Disconnector_factory() + { + return new Disconnector; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Disconnector.hpp b/CGMES_2.4.15_27JAN2020/Disconnector.hpp index 54570cd9f..a818915ac 100644 --- a/CGMES_2.4.15_27JAN2020/Disconnector.hpp +++ b/CGMES_2.4.15_27JAN2020/Disconnector.hpp @@ -1,36 +1,37 @@ #ifndef Disconnector_H #define Disconnector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Switch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Switch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A manually operated or motor operated mechanical switching device used for changing the connections in a circuit, or for isolating a circuit or equipment from a source of power. It is required to open or close circuits when negligible current is broken or made. */ - class Disconnector: public Switch + class Disconnector : public Switch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Disconnector(); - virtual ~Disconnector(); - + ~Disconnector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Disconnector_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.cpp b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.cpp index 297f1c13d..edf98a3ae 100644 --- a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.cpp @@ -1,61 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscontinuousExcitationControlDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -DiscontinuousExcitationControlDynamics::DiscontinuousExcitationControlDynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr) {}; - +DiscontinuousExcitationControlDynamics::DiscontinuousExcitationControlDynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr) {}; DiscontinuousExcitationControlDynamics::~DiscontinuousExcitationControlDynamics() {}; -bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass*, BaseClass*); -bool assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass*, BaseClass*); +bool assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* DiscontinuousExcitationControlDynamics_factory() { - return new DiscontinuousExcitationControlDynamics; +bool assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass*, BaseClass*); +bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscontinuousExcitationControlDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void DiscontinuousExcitationControlDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics"), &DiscontinuousExcitationControlDynamics_factory)); +const char DiscontinuousExcitationControlDynamics::debugName[] = "DiscontinuousExcitationControlDynamics"; +const char* DiscontinuousExcitationControlDynamics::debugString() const +{ + return DiscontinuousExcitationControlDynamics::debugName; } -void DiscontinuousExcitationControlDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void DiscontinuousExcitationControlDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics"), &DiscontinuousExcitationControlDynamics_factory)); +} -void DiscontinuousExcitationControlDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.RemoteInputSignal"), &assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.ExcitationSystemDynamics"), &assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics)); +void DiscontinuousExcitationControlDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char DiscontinuousExcitationControlDynamics::debugName[] = "DiscontinuousExcitationControlDynamics"; -const char* DiscontinuousExcitationControlDynamics::debugString() +void DiscontinuousExcitationControlDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscontinuousExcitationControlDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.ExcitationSystemDynamics"), &assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlDynamics.RemoteInputSignal"), &assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal)); } const BaseClassDefiner DiscontinuousExcitationControlDynamics::declare() @@ -63,4 +78,10 @@ const BaseClassDefiner DiscontinuousExcitationControlDynamics::declare() return BaseClassDefiner(DiscontinuousExcitationControlDynamics::addConstructToMap, DiscontinuousExcitationControlDynamics::addPrimitiveAssignFnsToMap, DiscontinuousExcitationControlDynamics::addClassAssignFnsToMap, DiscontinuousExcitationControlDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* DiscontinuousExcitationControlDynamics_factory() + { + return new DiscontinuousExcitationControlDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.hpp b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.hpp index 7bcd52a3b..110a96824 100644 --- a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlDynamics.hpp @@ -1,40 +1,41 @@ #ifndef DiscontinuousExcitationControlDynamics_H #define DiscontinuousExcitationControlDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Discontinuous excitation control function block whose behaviour is described by reference to a standard model . */ - class DiscontinuousExcitationControlDynamics: public DynamicsFunctionBlock + class DiscontinuousExcitationControlDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this discontinuous excitation control system model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this discontinuous excitation control model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscontinuousExcitationControlDynamics(); - virtual ~DiscontinuousExcitationControlDynamics(); - + ~DiscontinuousExcitationControlDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this discontinuous excitation control model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this discontinuous excitation control system model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscontinuousExcitationControlDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.cpp b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.cpp index a2ee92ba8..f0cdf252e 100644 --- a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "DiscontinuousExcitationControlDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscontinuousExcitationControlUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; DiscontinuousExcitationControlUserDefined::DiscontinuousExcitationControlUserDefined() {}; - DiscontinuousExcitationControlUserDefined::~DiscontinuousExcitationControlUserDefined() {}; -bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_DiscontinuousExcitationControlUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_DiscontinuousExcitationControlUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass*, BaseClass*); +bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscontinuousExcitationControlUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* DiscontinuousExcitationControlUserDefined_factory() { - return new DiscontinuousExcitationControlUserDefined; - } +const char DiscontinuousExcitationControlUserDefined::debugName[] = "DiscontinuousExcitationControlUserDefined"; +const char* DiscontinuousExcitationControlUserDefined::debugString() const +{ + return DiscontinuousExcitationControlUserDefined::debugName; } -void DiscontinuousExcitationControlUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void DiscontinuousExcitationControlUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined"), &DiscontinuousExcitationControlUserDefined_factory)); } -void DiscontinuousExcitationControlUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DiscontinuousExcitationControlUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined.proprietary"), &assign_DiscontinuousExcitationControlUserDefined_proprietary)); - } - -void DiscontinuousExcitationControlUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined.ProprietaryParameterDynamics"), &assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics)); } -const char DiscontinuousExcitationControlUserDefined::debugName[] = "DiscontinuousExcitationControlUserDefined"; -const char* DiscontinuousExcitationControlUserDefined::debugString() +void DiscontinuousExcitationControlUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DiscontinuousExcitationControlUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:DiscontinuousExcitationControlUserDefined.ProprietaryParameterDynamics"), &assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner DiscontinuousExcitationControlUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner DiscontinuousExcitationControlUserDefined::declare() return BaseClassDefiner(DiscontinuousExcitationControlUserDefined::addConstructToMap, DiscontinuousExcitationControlUserDefined::addPrimitiveAssignFnsToMap, DiscontinuousExcitationControlUserDefined::addClassAssignFnsToMap, DiscontinuousExcitationControlUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* DiscontinuousExcitationControlUserDefined_factory() + { + return new DiscontinuousExcitationControlUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.hpp b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.hpp index d4ab36d67..6b48fa523 100644 --- a/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/DiscontinuousExcitationControlUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef DiscontinuousExcitationControlUserDefined_H #define DiscontinuousExcitationControlUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiscontinuousExcitationControlDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiscontinuousExcitationControlDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Discontinuous excitation control function block whose dynamic behaviour is described by */ - class DiscontinuousExcitationControlUserDefined: public DiscontinuousExcitationControlDynamics + class DiscontinuousExcitationControlUserDefined : public DiscontinuousExcitationControlDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscontinuousExcitationControlUserDefined(); - virtual ~DiscontinuousExcitationControlUserDefined(); - + ~DiscontinuousExcitationControlUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscontinuousExcitationControlUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Discrete.cpp b/CGMES_2.4.15_27JAN2020/Discrete.cpp index 1346f5043..d6d1f006f 100644 --- a/CGMES_2.4.15_27JAN2020/Discrete.cpp +++ b/CGMES_2.4.15_27JAN2020/Discrete.cpp @@ -1,62 +1,76 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Discrete.hpp" +#include +#include + #include "DiscreteValue.hpp" #include "ValueAliasSet.hpp" using namespace CIMPP; -Discrete::Discrete(): ValueAliasSet(nullptr) {}; - +Discrete::Discrete() : ValueAliasSet(nullptr) {}; Discrete::~Discrete() {}; -bool assign_Discrete_DiscreteValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Discrete* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiscreteValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_DiscreteValue_Discrete(BaseClass*, BaseClass*); +bool assign_Discrete_DiscreteValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Discrete* element = dynamic_cast(BaseClass_ptr1); + DiscreteValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiscreteValues.begin(), element->DiscreteValues.end(), element2) == element->DiscreteValues.end()) + { + element->DiscreteValues.push_back(element2); + return assign_DiscreteValue_Discrete(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_ValueAliasSet_Discretes(BaseClass*, BaseClass*); -bool assign_Discrete_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Discrete* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_Discretes(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Discrete_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Discrete* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_Discretes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* Discrete_factory() { - return new Discrete; - } +const char Discrete::debugName[] = "Discrete"; +const char* Discrete::debugString() const +{ + return Discrete::debugName; } -void Discrete::addConstructToMap(std::unordered_map& factory_map) { +void Discrete::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Discrete"), &Discrete_factory)); } -void Discrete::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Discrete::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Discrete.DiscreteValues"), &assign_Discrete_DiscreteValues)); - assign_map.insert(std::make_pair(std::string("cim:Discrete.ValueAliasSet"), &assign_Discrete_ValueAliasSet)); +void Discrete::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Discrete::debugName[] = "Discrete"; -const char* Discrete::debugString() +void Discrete::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Discrete::debugName; + assign_map.insert(std::make_pair(std::string("cim:Discrete.DiscreteValues"), &assign_Discrete_DiscreteValues)); + assign_map.insert(std::make_pair(std::string("cim:Discrete.ValueAliasSet"), &assign_Discrete_ValueAliasSet)); } const BaseClassDefiner Discrete::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner Discrete::declare() return BaseClassDefiner(Discrete::addConstructToMap, Discrete::addPrimitiveAssignFnsToMap, Discrete::addClassAssignFnsToMap, Discrete::debugName); } - +namespace CIMPP +{ + BaseClass* Discrete_factory() + { + return new Discrete; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Discrete.hpp b/CGMES_2.4.15_27JAN2020/Discrete.hpp index 68de8657a..3a3e2b07c 100644 --- a/CGMES_2.4.15_27JAN2020/Discrete.hpp +++ b/CGMES_2.4.15_27JAN2020/Discrete.hpp @@ -1,40 +1,41 @@ #ifndef Discrete_H #define Discrete_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DiscreteValue; + class ValueAliasSet; -class DiscreteValue; -class ValueAliasSet; /* Discrete represents a discrete Measurement, i.e. a Measurement representing discrete values, e.g. a Breaker position. */ - class Discrete: public Measurement + class Discrete : public Measurement { - public: - std::list DiscreteValues; /* Measurement to which this value is connected. Default: 0 */ - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a MeasurementValue.value to a name. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Discrete(); - virtual ~Discrete(); - + ~Discrete() override; + + std::list DiscreteValues; /* Measurement to which this value is connected. Default: 0 */ + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a MeasurementValue.value to a name. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Discrete_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DiscreteValue.cpp b/CGMES_2.4.15_27JAN2020/DiscreteValue.cpp index 56227f7be..52264d6bd 100644 --- a/CGMES_2.4.15_27JAN2020/DiscreteValue.cpp +++ b/CGMES_2.4.15_27JAN2020/DiscreteValue.cpp @@ -1,76 +1,92 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DiscreteValue.hpp" +#include +#include + #include "Command.hpp" #include "Discrete.hpp" #include "Integer.hpp" using namespace CIMPP; -DiscreteValue::DiscreteValue(): Command(nullptr), Discrete(nullptr) {}; - +DiscreteValue::DiscreteValue() : Command(nullptr), Discrete(nullptr) {}; DiscreteValue::~DiscreteValue() {}; -bool assign_DiscreteValue_Command(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Command = dynamic_cast(BaseClass_ptr2); - if(element->Command != nullptr) - return true; - } - return false; -} - -bool assign_Discrete_DiscreteValues(BaseClass*, BaseClass*); -bool assign_DiscreteValue_Discrete(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) { - element->Discrete = dynamic_cast(BaseClass_ptr2); - if(element->Discrete != nullptr) - return assign_Discrete_DiscreteValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_DiscreteValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DiscreteValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DiscreteValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Command_DiscreteValue(BaseClass*, BaseClass*); +bool assign_DiscreteValue_Command(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscreteValue* element = dynamic_cast(BaseClass_ptr1); + Command* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Command != element2) + { + element->Command = element2; + return assign_Command_DiscreteValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* DiscreteValue_factory() { - return new DiscreteValue; +bool assign_Discrete_DiscreteValues(BaseClass*, BaseClass*); +bool assign_DiscreteValue_Discrete(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + DiscreteValue* element = dynamic_cast(BaseClass_ptr1); + Discrete* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Discrete != element2) + { + element->Discrete = element2; + return assign_Discrete_DiscreteValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + +const char DiscreteValue::debugName[] = "DiscreteValue"; +const char* DiscreteValue::debugString() const +{ + return DiscreteValue::debugName; } -void DiscreteValue::addConstructToMap(std::unordered_map& factory_map) { +void DiscreteValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DiscreteValue"), &DiscreteValue_factory)); } -void DiscreteValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.value"), &assign_DiscreteValue_value)); +void DiscreteValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.value"), &assign_DiscreteValue_value)); } -void DiscreteValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void DiscreteValue::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.Command"), &assign_DiscreteValue_Command)); assign_map.insert(std::make_pair(std::string("cim:DiscreteValue.Discrete"), &assign_DiscreteValue_Discrete)); - } - -const char DiscreteValue::debugName[] = "DiscreteValue"; -const char* DiscreteValue::debugString() -{ - return DiscreteValue::debugName; } const BaseClassDefiner DiscreteValue::declare() @@ -78,4 +94,10 @@ const BaseClassDefiner DiscreteValue::declare() return BaseClassDefiner(DiscreteValue::addConstructToMap, DiscreteValue::addPrimitiveAssignFnsToMap, DiscreteValue::addClassAssignFnsToMap, DiscreteValue::debugName); } - +namespace CIMPP +{ + BaseClass* DiscreteValue_factory() + { + return new DiscreteValue; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DiscreteValue.hpp b/CGMES_2.4.15_27JAN2020/DiscreteValue.hpp index 1f612822d..9345c3775 100644 --- a/CGMES_2.4.15_27JAN2020/DiscreteValue.hpp +++ b/CGMES_2.4.15_27JAN2020/DiscreteValue.hpp @@ -1,42 +1,43 @@ #ifndef DiscreteValue_H #define DiscreteValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Command; + class Discrete; - -class Command; -class Discrete; /* DiscreteValue represents a discrete MeasurementValue. */ - class DiscreteValue: public MeasurementValue + class DiscreteValue : public MeasurementValue { - public: - CIMPP::Command* Command; /* The MeasurementValue that is controlled. Default: 0 */ - CIMPP::Discrete* Discrete; /* The values connected to this measurement. Default: 0 */ - CIMPP::Integer value; /* The value to supervise. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DiscreteValue(); - virtual ~DiscreteValue(); - + ~DiscreteValue() override; + + CIMPP::Command* Command; /* The MeasurementValue that is controlled. Default: 0 */ + CIMPP::Discrete* Discrete; /* The values connected to this measurement. Default: 0 */ + CIMPP::Integer value; /* The value to supervise. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DiscreteValue_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.cpp b/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.cpp index 63914b160..ca339f115 100644 --- a/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.cpp +++ b/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DroopSignalFeedbackKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::DroopSignalFeedbackKind& rop) +DroopSignalFeedbackKind& DroopSignalFeedbackKind::operator=(DroopSignalFeedbackKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +DroopSignalFeedbackKind::operator DroopSignalFeedbackKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char DroopSignalFeedbackKind::debugName[] = "DroopSignalFeedbackKind"; +const char* DroopSignalFeedbackKind::debugString() const +{ + return DroopSignalFeedbackKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, DroopSignalFeedbackKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const DroopSignalFeedbackKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == DroopSignalFeedbackKind::electricalPower) + { + EnumSymbol = "electricalPower"; + } + if (obj.value == DroopSignalFeedbackKind::none) + { + EnumSymbol = "none"; + } + if (obj.value == DroopSignalFeedbackKind::fuelValveStroke) + { + EnumSymbol = "fuelValveStroke"; + } + if (obj.value == DroopSignalFeedbackKind::governorOutput) + { + EnumSymbol = "governorOutput"; + } + + if (!EnumSymbol.empty()) + { + os << "DroopSignalFeedbackKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.hpp b/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.hpp index 01984347c..de948a1bc 100644 --- a/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.hpp +++ b/CGMES_2.4.15_27JAN2020/DroopSignalFeedbackKind.hpp @@ -1,29 +1,54 @@ #ifndef DroopSignalFeedbackKind_H #define DroopSignalFeedbackKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Governor droop signal feedback source. */ - enum class DroopSignalFeedbackKind + class DroopSignalFeedbackKind { - /** - * Electrical power feedback (connection indicated as 1 in the block diagrams of models, e.g. GovCT1, GovCT2). - */ - electricalPower, - /** - * No droop signal feedback, is isochronous governor. - */ - none, - /** - * Fuel valve stroke feedback (true stroke) (connection indicated as 2 in the block diagrams of model, e.g. GovCT1, GovCT2). - */ - fuelValveStroke, - /** - * Governor output feedback (requested stroke) (connection indicated as 3 in the block diagrams of models, e.g. GovCT1, GovCT2). - */ - governorOutput, + public: + enum DroopSignalFeedbackKind_ENUM + { + /** + * Electrical power feedback (connection indicated as 1 in the block diagrams of models, e.g. GovCT1, GovCT2). + */ + electricalPower, + /** + * No droop signal feedback, is isochronous governor. + */ + none, + /** + * Fuel valve stroke feedback (true stroke) (connection indicated as 2 in the block diagrams of model, e.g. GovCT1, GovCT2). + */ + fuelValveStroke, + /** + * Governor output feedback (requested stroke) (connection indicated as 3 in the block diagrams of models, e.g. GovCT1, GovCT2). + */ + governorOutput, + }; + + DroopSignalFeedbackKind() : value(), initialized(false) {} + DroopSignalFeedbackKind(DroopSignalFeedbackKind_ENUM value) : value(value), initialized(true) {} + + DroopSignalFeedbackKind& operator=(DroopSignalFeedbackKind_ENUM rop); + operator DroopSignalFeedbackKind_ENUM() const; + + DroopSignalFeedbackKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, DroopSignalFeedbackKind& rop); + friend std::ostream& operator<<(std::ostream& os, const DroopSignalFeedbackKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::DroopSignalFeedbackKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.cpp b/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.cpp index 01d8bdb3c..d45cc9fc5 100644 --- a/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.cpp +++ b/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.cpp @@ -1,51 +1,52 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DynamicsFunctionBlock.hpp" +#include +#include + #include "Boolean.hpp" using namespace CIMPP; DynamicsFunctionBlock::DynamicsFunctionBlock() {}; - DynamicsFunctionBlock::~DynamicsFunctionBlock() {}; +bool assign_DynamicsFunctionBlock_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsFunctionBlock* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->enabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DynamicsFunctionBlock_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsFunctionBlock* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->enabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* DynamicsFunctionBlock_factory() { - return new DynamicsFunctionBlock; - } +const char DynamicsFunctionBlock::debugName[] = "DynamicsFunctionBlock"; +const char* DynamicsFunctionBlock::debugString() const +{ + return DynamicsFunctionBlock::debugName; } -void DynamicsFunctionBlock::addConstructToMap(std::unordered_map& factory_map) { +void DynamicsFunctionBlock::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DynamicsFunctionBlock"), &DynamicsFunctionBlock_factory)); } -void DynamicsFunctionBlock::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DynamicsFunctionBlock::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DynamicsFunctionBlock.enabled"), &assign_DynamicsFunctionBlock_enabled)); } -void DynamicsFunctionBlock::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char DynamicsFunctionBlock::debugName[] = "DynamicsFunctionBlock"; -const char* DynamicsFunctionBlock::debugString() +void DynamicsFunctionBlock::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DynamicsFunctionBlock::debugName; } const BaseClassDefiner DynamicsFunctionBlock::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner DynamicsFunctionBlock::declare() return BaseClassDefiner(DynamicsFunctionBlock::addConstructToMap, DynamicsFunctionBlock::addPrimitiveAssignFnsToMap, DynamicsFunctionBlock::addClassAssignFnsToMap, DynamicsFunctionBlock::debugName); } - +namespace CIMPP +{ + BaseClass* DynamicsFunctionBlock_factory() + { + return new DynamicsFunctionBlock; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.hpp b/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.hpp index d2be285ab..75c86d07d 100644 --- a/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.hpp +++ b/CGMES_2.4.15_27JAN2020/DynamicsFunctionBlock.hpp @@ -1,38 +1,39 @@ #ifndef DynamicsFunctionBlock_H #define DynamicsFunctionBlock_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Abstract parent class for all Dynamics function blocks. */ - class DynamicsFunctionBlock: public IdentifiedObject + class DynamicsFunctionBlock : public IdentifiedObject { - public: - CIMPP::Boolean enabled; /* Function block used indicator. true = use of function block is enabled false = use of function block is disabled. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DynamicsFunctionBlock(); - virtual ~DynamicsFunctionBlock(); - + ~DynamicsFunctionBlock() override; + + CIMPP::Boolean enabled; /* Function block used indicator. true = use of function block is enabled false = use of function block is disabled. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DynamicsFunctionBlock_factory(); diff --git a/CGMES_2.4.15_27JAN2020/DynamicsVersion.cpp b/CGMES_2.4.15_27JAN2020/DynamicsVersion.cpp index 6cdce7312..959b46475 100644 --- a/CGMES_2.4.15_27JAN2020/DynamicsVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/DynamicsVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "DynamicsVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -DynamicsVersion::DynamicsVersion(): date(nullptr) {}; - +DynamicsVersion::DynamicsVersion() {}; DynamicsVersion::~DynamicsVersion() {}; - - -bool assign_DynamicsVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_DynamicsVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_DynamicsVersion_baseUML(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_DynamicsVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_DynamicsVersion_baseURI(std::stringstream &buffer, BaseClass* BaseCl return false; } +bool assign_DynamicsVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_DynamicsVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_DynamicsVersion_differenceModelURI(std::stringstream &buffer, BaseCl return false; } -bool assign_DynamicsVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_DynamicsVersion_entsoeUML(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_DynamicsVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_DynamicsVersion_entsoeURI(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_DynamicsVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_DynamicsVersion_modelDescriptionURI(std::stringstream &buffer, BaseC return false; } -bool assign_DynamicsVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_DynamicsVersion_namespaceRDF(std::stringstream &buffer, BaseClass* B return false; } -bool assign_DynamicsVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_DynamicsVersion_namespaceUML(std::stringstream &buffer, BaseClass* B return false; } -bool assign_DynamicsVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_DynamicsVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (DynamicsVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_DynamicsVersion_shortName(std::stringstream &buffer, BaseClass* Base return false; } -namespace CIMPP { - BaseClass* DynamicsVersion_factory() { - return new DynamicsVersion; - } + + + + + + + + + + + +const char DynamicsVersion::debugName[] = "DynamicsVersion"; +const char* DynamicsVersion::debugString() const +{ + return DynamicsVersion::debugName; } -void DynamicsVersion::addConstructToMap(std::unordered_map& factory_map) { +void DynamicsVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:DynamicsVersion"), &DynamicsVersion_factory)); } -void DynamicsVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void DynamicsVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.baseUML"), &assign_DynamicsVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.baseURI"), &assign_DynamicsVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.differenceModelURI"), &assign_DynamicsVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.date"), &assign_DynamicsVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.differenceModelURI"), &assign_DynamicsVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.entsoeUML"), &assign_DynamicsVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.entsoeURI"), &assign_DynamicsVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.modelDescriptionURI"), &assign_DynamicsVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void DynamicsVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:DynamicsVersion.date"), &assign_DynamicsVersion_date)); - } - -const char DynamicsVersion::debugName[] = "DynamicsVersion"; -const char* DynamicsVersion::debugString() +void DynamicsVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return DynamicsVersion::debugName; } const BaseClassDefiner DynamicsVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner DynamicsVersion::declare() return BaseClassDefiner(DynamicsVersion::addConstructToMap, DynamicsVersion::addPrimitiveAssignFnsToMap, DynamicsVersion::addClassAssignFnsToMap, DynamicsVersion::debugName); } - +namespace CIMPP +{ + BaseClass* DynamicsVersion_factory() + { + return new DynamicsVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/DynamicsVersion.hpp b/CGMES_2.4.15_27JAN2020/DynamicsVersion.hpp index 4894926e0..4f0dde70f 100644 --- a/CGMES_2.4.15_27JAN2020/DynamicsVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/DynamicsVersion.hpp @@ -1,48 +1,49 @@ #ifndef DynamicsVersion_H #define DynamicsVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class DynamicsVersion: public BaseClass + class DynamicsVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Dynamics/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ DynamicsVersion(); - virtual ~DynamicsVersion(); - + ~DynamicsVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Dynamics/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* DynamicsVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.cpp b/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.cpp index becdc044c..3d4c826d4 100644 --- a/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.cpp +++ b/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.cpp @@ -1,51 +1,52 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EarthFaultCompensator.hpp" +#include +#include + #include "Resistance.hpp" using namespace CIMPP; EarthFaultCompensator::EarthFaultCompensator() {}; - EarthFaultCompensator::~EarthFaultCompensator() {}; +bool assign_EarthFaultCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EarthFaultCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EarthFaultCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EarthFaultCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EarthFaultCompensator_factory() { - return new EarthFaultCompensator; - } +const char EarthFaultCompensator::debugName[] = "EarthFaultCompensator"; +const char* EarthFaultCompensator::debugString() const +{ + return EarthFaultCompensator::debugName; } -void EarthFaultCompensator::addConstructToMap(std::unordered_map& factory_map) { +void EarthFaultCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EarthFaultCompensator"), &EarthFaultCompensator_factory)); } -void EarthFaultCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EarthFaultCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EarthFaultCompensator.r"), &assign_EarthFaultCompensator_r)); } -void EarthFaultCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char EarthFaultCompensator::debugName[] = "EarthFaultCompensator"; -const char* EarthFaultCompensator::debugString() +void EarthFaultCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EarthFaultCompensator::debugName; } const BaseClassDefiner EarthFaultCompensator::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner EarthFaultCompensator::declare() return BaseClassDefiner(EarthFaultCompensator::addConstructToMap, EarthFaultCompensator::addPrimitiveAssignFnsToMap, EarthFaultCompensator::addClassAssignFnsToMap, EarthFaultCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* EarthFaultCompensator_factory() + { + return new EarthFaultCompensator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.hpp b/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.hpp index 84fa2a201..9d323d750 100644 --- a/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.hpp +++ b/CGMES_2.4.15_27JAN2020/EarthFaultCompensator.hpp @@ -1,38 +1,39 @@ #ifndef EarthFaultCompensator_H #define EarthFaultCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A conducting equipment used to represent a connection to ground which is typically used to compensate earth faults.. An earth fault compensator device modeled with a single terminal implies a second terminal solidly connected to ground. If two terminals are modeled, the ground is not assumed and normal connection rules apply. */ - class EarthFaultCompensator: public ConductingEquipment + class EarthFaultCompensator : public ConductingEquipment { - public: - CIMPP::Resistance r; /* Nominal resistance of device. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EarthFaultCompensator(); - virtual ~EarthFaultCompensator(); - + ~EarthFaultCompensator() override; + + CIMPP::Resistance r; /* Nominal resistance of device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EarthFaultCompensator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EnergyArea.cpp b/CGMES_2.4.15_27JAN2020/EnergyArea.cpp index b9e2eeca6..e32dc8db6 100644 --- a/CGMES_2.4.15_27JAN2020/EnergyArea.cpp +++ b/CGMES_2.4.15_27JAN2020/EnergyArea.cpp @@ -1,48 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergyArea.hpp" +#include +#include + #include "ControlArea.hpp" using namespace CIMPP; -EnergyArea::EnergyArea(): ControlArea(nullptr) {}; - +EnergyArea::EnergyArea() : ControlArea(nullptr) {}; EnergyArea::~EnergyArea() {}; -bool assign_EnergyArea_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergyArea* element = dynamic_cast(BaseClass_ptr1)) { - element->ControlArea = dynamic_cast(BaseClass_ptr2); - if(element->ControlArea != nullptr) - return true; - } - return false; -} - -namespace CIMPP { - BaseClass* EnergyArea_factory() { - return new EnergyArea; +bool assign_ControlArea_EnergyArea(BaseClass*, BaseClass*); +bool assign_EnergyArea_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergyArea* element = dynamic_cast(BaseClass_ptr1); + ControlArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ControlArea != element2) + { + element->ControlArea = element2; + return assign_ControlArea_EnergyArea(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void EnergyArea::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:EnergyArea"), &EnergyArea_factory)); +const char EnergyArea::debugName[] = "EnergyArea"; +const char* EnergyArea::debugString() const +{ + return EnergyArea::debugName; } -void EnergyArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void EnergyArea::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:EnergyArea"), &EnergyArea_factory)); +} -void EnergyArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergyArea.ControlArea"), &assign_EnergyArea_ControlArea)); +void EnergyArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EnergyArea::debugName[] = "EnergyArea"; -const char* EnergyArea::debugString() +void EnergyArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergyArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergyArea.ControlArea"), &assign_EnergyArea_ControlArea)); } const BaseClassDefiner EnergyArea::declare() @@ -50,4 +58,10 @@ const BaseClassDefiner EnergyArea::declare() return BaseClassDefiner(EnergyArea::addConstructToMap, EnergyArea::addPrimitiveAssignFnsToMap, EnergyArea::addClassAssignFnsToMap, EnergyArea::debugName); } - +namespace CIMPP +{ + BaseClass* EnergyArea_factory() + { + return new EnergyArea; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EnergyArea.hpp b/CGMES_2.4.15_27JAN2020/EnergyArea.hpp index 1ea400bdb..6974a9a94 100644 --- a/CGMES_2.4.15_27JAN2020/EnergyArea.hpp +++ b/CGMES_2.4.15_27JAN2020/EnergyArea.hpp @@ -1,38 +1,39 @@ #ifndef EnergyArea_H #define EnergyArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ControlArea; -class ControlArea; /* Describes an area having energy production or consumption. Specializations are intended to support the load allocation function as typically required in energy management systems or planning studies to allocate hypothesized load levels to individual load points for power flow analysis. Often the energy area can be linked to both measured and forecast load levels. */ - class EnergyArea: public IdentifiedObject + class EnergyArea : public IdentifiedObject { - public: - CIMPP::ControlArea* ControlArea; /* The control area specification that is used for the load forecast. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergyArea(); - virtual ~EnergyArea(); - + ~EnergyArea() override; + + CIMPP::ControlArea* ControlArea; /* The control area specification that is used for the load forecast. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergyArea_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EnergyConsumer.cpp b/CGMES_2.4.15_27JAN2020/EnergyConsumer.cpp index 207d00303..8aa4ba5f9 100644 --- a/CGMES_2.4.15_27JAN2020/EnergyConsumer.cpp +++ b/CGMES_2.4.15_27JAN2020/EnergyConsumer.cpp @@ -1,152 +1,172 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergyConsumer.hpp" +#include +#include + +#include "LoadDynamics.hpp" #include "LoadResponseCharacteristic.hpp" #include "ActivePower.hpp" +#include "ActivePower.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" -#include "PerCent.hpp" -#include "ActivePower.hpp" #include "ReactivePower.hpp" -#include "LoadDynamics.hpp" +#include "PerCent.hpp" using namespace CIMPP; -EnergyConsumer::EnergyConsumer(): LoadResponse(nullptr), LoadDynamics(nullptr) {}; - +EnergyConsumer::EnergyConsumer() : LoadDynamics(nullptr), LoadResponse(nullptr) {}; EnergyConsumer::~EnergyConsumer() {}; -bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass*, BaseClass*); -bool assign_EnergyConsumer_LoadResponse(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadResponse = dynamic_cast(BaseClass_ptr2); - if(element->LoadResponse != nullptr) - return assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_EnergyConsumer_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_pfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfixed; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_pfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfixedPct; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadDynamics_EnergyConsumer(BaseClass*, BaseClass*); -bool assign_EnergyConsumer_LoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadDynamics = dynamic_cast(BaseClass_ptr2); - if(element->LoadDynamics != nullptr) - return assign_LoadDynamics_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_EnergyConsumer_qfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qfixed; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_EnergyConsumer_qfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qfixedPct; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EnergyConsumer_pfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfixed; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_LoadDynamics_EnergyConsumer(BaseClass*, BaseClass*); +bool assign_EnergyConsumer_LoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergyConsumer* element = dynamic_cast(BaseClass_ptr1); + LoadDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadDynamics != element2) + { + element->LoadDynamics = element2; + return assign_LoadDynamics_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EnergyConsumer_pfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfixedPct; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass*, BaseClass*); +bool assign_EnergyConsumer_LoadResponse(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergyConsumer* element = dynamic_cast(BaseClass_ptr1); + LoadResponseCharacteristic* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadResponse != element2) + { + element->LoadResponse = element2; + return assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EnergyConsumer_qfixed(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qfixed; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EnergyConsumer_qfixedPct(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qfixedPct; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EnergyConsumer_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EnergyConsumer_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergyConsumer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EnergyConsumer_factory() { - return new EnergyConsumer; - } + +const char EnergyConsumer::debugName[] = "EnergyConsumer"; +const char* EnergyConsumer::debugString() const +{ + return EnergyConsumer::debugName; } -void EnergyConsumer::addConstructToMap(std::unordered_map& factory_map) { +void EnergyConsumer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EnergyConsumer"), &EnergyConsumer_factory)); } -void EnergyConsumer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.pfixed"), &assign_EnergyConsumer_pfixed)); +void EnergyConsumer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.p"), &assign_EnergyConsumer_p)); + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.pfixed"), &assign_EnergyConsumer_pfixed)); assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.pfixedPct"), &assign_EnergyConsumer_pfixedPct)); + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.q"), &assign_EnergyConsumer_q)); assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.qfixed"), &assign_EnergyConsumer_qfixed)); assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.qfixedPct"), &assign_EnergyConsumer_qfixedPct)); - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.p"), &assign_EnergyConsumer_p)); - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.q"), &assign_EnergyConsumer_q)); - } - -void EnergyConsumer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadResponse"), &assign_EnergyConsumer_LoadResponse)); - assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadDynamics"), &assign_EnergyConsumer_LoadDynamics)); } -const char EnergyConsumer::debugName[] = "EnergyConsumer"; -const char* EnergyConsumer::debugString() +void EnergyConsumer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergyConsumer::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadDynamics"), &assign_EnergyConsumer_LoadDynamics)); + assign_map.insert(std::make_pair(std::string("cim:EnergyConsumer.LoadResponse"), &assign_EnergyConsumer_LoadResponse)); } const BaseClassDefiner EnergyConsumer::declare() @@ -154,4 +174,10 @@ const BaseClassDefiner EnergyConsumer::declare() return BaseClassDefiner(EnergyConsumer::addConstructToMap, EnergyConsumer::addPrimitiveAssignFnsToMap, EnergyConsumer::addClassAssignFnsToMap, EnergyConsumer::debugName); } - +namespace CIMPP +{ + BaseClass* EnergyConsumer_factory() + { + return new EnergyConsumer; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EnergyConsumer.hpp b/CGMES_2.4.15_27JAN2020/EnergyConsumer.hpp index ed3df5731..7d04fdbfc 100644 --- a/CGMES_2.4.15_27JAN2020/EnergyConsumer.hpp +++ b/CGMES_2.4.15_27JAN2020/EnergyConsumer.hpp @@ -1,49 +1,50 @@ #ifndef EnergyConsumer_H #define EnergyConsumer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class LoadDynamics; + class LoadResponseCharacteristic; - -class LoadResponseCharacteristic; -class LoadDynamics; /* Generic user of energy - a point of consumption on the power system model. */ - class EnergyConsumer: public ConductingEquipment + class EnergyConsumer : public ConductingEquipment { - public: - CIMPP::LoadResponseCharacteristic* LoadResponse; /* The load response characteristic of this load. If missing, this load is assumed to be constant power. Default: 0 */ - CIMPP::ActivePower pfixed; /* Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::PerCent pfixedPct; /* Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::ReactivePower qfixed; /* Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::PerCent qfixedPct; /* Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ - CIMPP::ActivePower p; /* Active power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ - CIMPP::LoadDynamics* LoadDynamics; /* Load dynamics model used to describe dynamic behavior of this energy consumer. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergyConsumer(); - virtual ~EnergyConsumer(); - + ~EnergyConsumer() override; + + CIMPP::LoadDynamics* LoadDynamics; /* Load dynamics model used to describe dynamic behavior of this energy consumer. Default: 0 */ + CIMPP::LoadResponseCharacteristic* LoadResponse; /* The load response characteristic of this load. If missing, this load is assumed to be constant power. Default: 0 */ + CIMPP::ActivePower p; /* Active power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ + CIMPP::ActivePower pfixed; /* Active power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + CIMPP::PerCent pfixedPct; /* Fixed active power as per cent of load group fixed active power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power of the load. Load sign convention is used, i.e. positive sign means flow out from a node. For voltage dependent loads the value is at rated voltage. Starting value for a steady state solution. Default: nullptr */ + CIMPP::ReactivePower qfixed; /* Reactive power of the load that is a fixed quantity. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + CIMPP::PerCent qfixedPct; /* Fixed reactive power as per cent of load group fixed reactive power. Load sign convention is used, i.e. positive sign means flow out from a node. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergyConsumer_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EnergySchedulingType.cpp b/CGMES_2.4.15_27JAN2020/EnergySchedulingType.cpp index 0e4e4a649..aba3d7573 100644 --- a/CGMES_2.4.15_27JAN2020/EnergySchedulingType.cpp +++ b/CGMES_2.4.15_27JAN2020/EnergySchedulingType.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergySchedulingType.hpp" +#include +#include + #include "EnergySource.hpp" using namespace CIMPP; EnergySchedulingType::EnergySchedulingType() {}; - EnergySchedulingType::~EnergySchedulingType() {}; -bool assign_EnergySchedulingType_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergySchedulingType* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergySource.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_EnergySource_EnergySchedulingType(BaseClass*, BaseClass*); +bool assign_EnergySchedulingType_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergySchedulingType* element = dynamic_cast(BaseClass_ptr1); + EnergySource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergySource.begin(), element->EnergySource.end(), element2) == element->EnergySource.end()) + { + element->EnergySource.push_back(element2); + return assign_EnergySource_EnergySchedulingType(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* EnergySchedulingType_factory() { - return new EnergySchedulingType; - } +const char EnergySchedulingType::debugName[] = "EnergySchedulingType"; +const char* EnergySchedulingType::debugString() const +{ + return EnergySchedulingType::debugName; } -void EnergySchedulingType::addConstructToMap(std::unordered_map& factory_map) { +void EnergySchedulingType::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EnergySchedulingType"), &EnergySchedulingType_factory)); } -void EnergySchedulingType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void EnergySchedulingType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergySchedulingType.EnergySource"), &assign_EnergySchedulingType_EnergySource)); +void EnergySchedulingType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EnergySchedulingType::debugName[] = "EnergySchedulingType"; -const char* EnergySchedulingType::debugString() +void EnergySchedulingType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergySchedulingType::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergySchedulingType.EnergySource"), &assign_EnergySchedulingType_EnergySource)); } const BaseClassDefiner EnergySchedulingType::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EnergySchedulingType::declare() return BaseClassDefiner(EnergySchedulingType::addConstructToMap, EnergySchedulingType::addPrimitiveAssignFnsToMap, EnergySchedulingType::addClassAssignFnsToMap, EnergySchedulingType::debugName); } - +namespace CIMPP +{ + BaseClass* EnergySchedulingType_factory() + { + return new EnergySchedulingType; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EnergySchedulingType.hpp b/CGMES_2.4.15_27JAN2020/EnergySchedulingType.hpp index 7ce7f9c1b..738e505bb 100644 --- a/CGMES_2.4.15_27JAN2020/EnergySchedulingType.hpp +++ b/CGMES_2.4.15_27JAN2020/EnergySchedulingType.hpp @@ -1,38 +1,39 @@ #ifndef EnergySchedulingType_H #define EnergySchedulingType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EnergySource; -class EnergySource; /* Used to define the type of generation for scheduling purposes. */ - class EnergySchedulingType: public IdentifiedObject + class EnergySchedulingType : public IdentifiedObject { - public: - std::list EnergySource; /* Energy Scheduling Type of an Energy Source Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergySchedulingType(); - virtual ~EnergySchedulingType(); - + ~EnergySchedulingType() override; + + std::list EnergySource; /* Energy Source of a particular Energy Scheduling Type Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergySchedulingType_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EnergySource.cpp b/CGMES_2.4.15_27JAN2020/EnergySource.cpp index b26896a57..2b02d4b7d 100644 --- a/CGMES_2.4.15_27JAN2020/EnergySource.cpp +++ b/CGMES_2.4.15_27JAN2020/EnergySource.cpp @@ -1,226 +1,252 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EnergySource.hpp" +#include +#include + #include "EnergySchedulingType.hpp" +#include "WindTurbineType3or4Dynamics.hpp" +#include "ActivePower.hpp" #include "Voltage.hpp" #include "Resistance.hpp" #include "Resistance.hpp" +#include "ReactivePower.hpp" #include "Resistance.hpp" #include "AngleRadians.hpp" #include "Voltage.hpp" #include "Reactance.hpp" #include "Reactance.hpp" #include "Reactance.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" -#include "WindTurbineType3or4Dynamics.hpp" using namespace CIMPP; -EnergySource::EnergySource(): EnergySchedulingType(nullptr), WindTurbineType3or4Dynamics(nullptr) {}; - +EnergySource::EnergySource() : EnergySchedulingType(nullptr), WindTurbineType3or4Dynamics(nullptr) {}; EnergySource::~EnergySource() {}; -bool assign_EnergySchedulingType_EnergySource(BaseClass*, BaseClass*); -bool assign_EnergySource_EnergySchedulingType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - element->EnergySchedulingType = dynamic_cast(BaseClass_ptr2); - if(element->EnergySchedulingType != nullptr) - return assign_EnergySchedulingType_EnergySource(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_EnergySource_activePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->activePower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalVoltage; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_reactivePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->reactivePower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_rn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_voltageAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageAngle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_voltageMagnitude(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageMagnitude; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergySource_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4Dynamics != nullptr) - return true; - } - return false; +bool assign_EnergySource_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_EnergySource_xn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EnergySource* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EnergySource_nominalVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalVoltage; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_EnergySchedulingType_EnergySource(BaseClass*, BaseClass*); +bool assign_EnergySource_EnergySchedulingType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergySource* element = dynamic_cast(BaseClass_ptr1); + EnergySchedulingType* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EnergySchedulingType != element2) + { + element->EnergySchedulingType = element2; + return assign_EnergySchedulingType_EnergySource(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EnergySource_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_rn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_voltageAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageAngle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_voltageMagnitude(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageMagnitude; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_xn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_activePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->activePower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_EnergySource_reactivePower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EnergySource* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->reactivePower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* EnergySource_factory() { - return new EnergySource; +bool assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass*, BaseClass*); +bool assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EnergySource* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4Dynamics != element2) + { + element->WindTurbineType3or4Dynamics = element2; + return assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void EnergySource::addConstructToMap(std::unordered_map& factory_map) { + + + + + + + + + + + +const char EnergySource::debugName[] = "EnergySource"; +const char* EnergySource::debugString() const +{ + return EnergySource::debugName; +} + +void EnergySource::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EnergySource"), &EnergySource_factory)); } -void EnergySource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergySource.nominalVoltage"), &assign_EnergySource_nominalVoltage)); +void EnergySource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:EnergySource.activePower"), &assign_EnergySource_activePower)); + assign_map.insert(std::make_pair(std::string("cim:EnergySource.nominalVoltage"), &assign_EnergySource_nominalVoltage)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.r"), &assign_EnergySource_r)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.r0"), &assign_EnergySource_r0)); + assign_map.insert(std::make_pair(std::string("cim:EnergySource.reactivePower"), &assign_EnergySource_reactivePower)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.rn"), &assign_EnergySource_rn)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.voltageAngle"), &assign_EnergySource_voltageAngle)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.voltageMagnitude"), &assign_EnergySource_voltageMagnitude)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.x"), &assign_EnergySource_x)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.x0"), &assign_EnergySource_x0)); assign_map.insert(std::make_pair(std::string("cim:EnergySource.xn"), &assign_EnergySource_xn)); - assign_map.insert(std::make_pair(std::string("cim:EnergySource.activePower"), &assign_EnergySource_activePower)); - assign_map.insert(std::make_pair(std::string("cim:EnergySource.reactivePower"), &assign_EnergySource_reactivePower)); - } - -void EnergySource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EnergySource.EnergySchedulingType"), &assign_EnergySource_EnergySchedulingType)); - assign_map.insert(std::make_pair(std::string("cim:EnergySource.WindTurbineType3or4Dynamics"), &assign_EnergySource_WindTurbineType3or4Dynamics)); } -const char EnergySource::debugName[] = "EnergySource"; -const char* EnergySource::debugString() +void EnergySource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EnergySource::debugName; + assign_map.insert(std::make_pair(std::string("cim:EnergySource.EnergySchedulingType"), &assign_EnergySource_EnergySchedulingType)); + assign_map.insert(std::make_pair(std::string("cim:EnergySource.WindTurbineType3or4Dynamics"), &assign_EnergySource_WindTurbineType3or4Dynamics)); } const BaseClassDefiner EnergySource::declare() @@ -228,4 +254,10 @@ const BaseClassDefiner EnergySource::declare() return BaseClassDefiner(EnergySource::addConstructToMap, EnergySource::addPrimitiveAssignFnsToMap, EnergySource::addClassAssignFnsToMap, EnergySource::debugName); } - +namespace CIMPP +{ + BaseClass* EnergySource_factory() + { + return new EnergySource; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EnergySource.hpp b/CGMES_2.4.15_27JAN2020/EnergySource.hpp index 001fc22ac..009e0eac2 100644 --- a/CGMES_2.4.15_27JAN2020/EnergySource.hpp +++ b/CGMES_2.4.15_27JAN2020/EnergySource.hpp @@ -1,57 +1,58 @@ #ifndef EnergySource_H #define EnergySource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Voltage.hpp" -#include "Resistance.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +#include "ActivePower.hpp" #include "AngleRadians.hpp" #include "Reactance.hpp" -#include "ActivePower.hpp" #include "ReactivePower.hpp" +#include "Resistance.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class EnergySchedulingType; + class WindTurbineType3or4Dynamics; -class EnergySchedulingType; -class WindTurbineType3or4Dynamics; /* A generic equivalent for an energy supplier on a transmission or distribution voltage level. */ - class EnergySource: public ConductingEquipment + class EnergySource : public ConductingEquipment { - public: - CIMPP::EnergySchedulingType* EnergySchedulingType; /* Energy Source of a particular Energy Scheduling Type Default: 0 */ - CIMPP::Voltage nominalVoltage; /* Phase-to-phase nominal voltage. Default: nullptr */ - CIMPP::Resistance r; /* Positive sequence Thevenin resistance. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence Thevenin resistance. Default: nullptr */ - CIMPP::Resistance rn; /* Negative sequence Thevenin resistance. Default: nullptr */ - CIMPP::AngleRadians voltageAngle; /* Phase angle of a-phase open circuit. Default: nullptr */ - CIMPP::Voltage voltageMagnitude; /* Phase-to-phase open circuit voltage magnitude. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence Thevenin reactance. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence Thevenin reactance. Default: nullptr */ - CIMPP::Reactance xn; /* Negative sequence Thevenin reactance. Default: nullptr */ - CIMPP::ActivePower activePower; /* High voltage source active injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::ReactivePower reactivePower; /* High voltage source reactive injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Wind generator Type 3 or 4 dynamics model associated with this energy source. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EnergySource(); - virtual ~EnergySource(); - + ~EnergySource() override; + + CIMPP::EnergySchedulingType* EnergySchedulingType; /* Energy Scheduling Type of an Energy Source Default: 0 */ + CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Wind generator Type 3 or 4 dynamics model associated with this energy source. Default: 0 */ + CIMPP::ActivePower activePower; /* High voltage source active injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Voltage nominalVoltage; /* Phase-to-phase nominal voltage. Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence Thevenin resistance. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence Thevenin resistance. Default: nullptr */ + CIMPP::ReactivePower reactivePower; /* High voltage source reactive injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Resistance rn; /* Negative sequence Thevenin resistance. Default: nullptr */ + CIMPP::AngleRadians voltageAngle; /* Phase angle of a-phase open circuit. Default: nullptr */ + CIMPP::Voltage voltageMagnitude; /* Phase-to-phase open circuit voltage magnitude. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence Thevenin reactance. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence Thevenin reactance. Default: nullptr */ + CIMPP::Reactance xn; /* Negative sequence Thevenin reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EnergySource_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Equipment.cpp b/CGMES_2.4.15_27JAN2020/Equipment.cpp index bb5c62106..a3f0d0b62 100644 --- a/CGMES_2.4.15_27JAN2020/Equipment.cpp +++ b/CGMES_2.4.15_27JAN2020/Equipment.cpp @@ -1,77 +1,92 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Equipment.hpp" -#include "Boolean.hpp" +#include +#include + #include "EquipmentContainer.hpp" #include "OperationalLimitSet.hpp" +#include "Boolean.hpp" using namespace CIMPP; -Equipment::Equipment(): EquipmentContainer(nullptr) {}; - +Equipment::Equipment() : EquipmentContainer(nullptr) {}; Equipment::~Equipment() {}; -bool assign_EquipmentContainer_Equipments(BaseClass*, BaseClass*); -bool assign_Equipment_EquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Equipment* element = dynamic_cast(BaseClass_ptr1)) { - element->EquipmentContainer = dynamic_cast(BaseClass_ptr2); - if(element->EquipmentContainer != nullptr) - return assign_EquipmentContainer_Equipments(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_Equipment_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Equipment* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimitSet.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Equipment_aggregate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Equipment* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aggregate; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_Equipment_aggregate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Equipment* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aggregate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_EquipmentContainer_Equipments(BaseClass*, BaseClass*); +bool assign_Equipment_EquipmentContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Equipment* element = dynamic_cast(BaseClass_ptr1); + EquipmentContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EquipmentContainer != element2) + { + element->EquipmentContainer = element2; + return assign_EquipmentContainer_Equipments(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_OperationalLimitSet_Equipment(BaseClass*, BaseClass*); +bool assign_Equipment_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Equipment* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimitSet.begin(), element->OperationalLimitSet.end(), element2) == element->OperationalLimitSet.end()) + { + element->OperationalLimitSet.push_back(element2); + return assign_OperationalLimitSet_Equipment(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* Equipment_factory() { - return new Equipment; - } +const char Equipment::debugName[] = "Equipment"; +const char* Equipment::debugString() const +{ + return Equipment::debugName; } -void Equipment::addConstructToMap(std::unordered_map& factory_map) { +void Equipment::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Equipment"), &Equipment_factory)); } -void Equipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Equipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Equipment.aggregate"), &assign_Equipment_aggregate)); - } - -void Equipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Equipment.EquipmentContainer"), &assign_Equipment_EquipmentContainer)); - assign_map.insert(std::make_pair(std::string("cim:Equipment.OperationalLimitSet"), &assign_Equipment_OperationalLimitSet)); } -const char Equipment::debugName[] = "Equipment"; -const char* Equipment::debugString() +void Equipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Equipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:Equipment.EquipmentContainer"), &assign_Equipment_EquipmentContainer)); + assign_map.insert(std::make_pair(std::string("cim:Equipment.OperationalLimitSet"), &assign_Equipment_OperationalLimitSet)); } const BaseClassDefiner Equipment::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner Equipment::declare() return BaseClassDefiner(Equipment::addConstructToMap, Equipment::addPrimitiveAssignFnsToMap, Equipment::addClassAssignFnsToMap, Equipment::debugName); } - +namespace CIMPP +{ + BaseClass* Equipment_factory() + { + return new Equipment; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Equipment.hpp b/CGMES_2.4.15_27JAN2020/Equipment.hpp index be97d9c9b..731df8bcc 100644 --- a/CGMES_2.4.15_27JAN2020/Equipment.hpp +++ b/CGMES_2.4.15_27JAN2020/Equipment.hpp @@ -1,42 +1,43 @@ #ifndef Equipment_H #define Equipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class EquipmentContainer; + class OperationalLimitSet; -class EquipmentContainer; -class OperationalLimitSet; /* The parts of a power system that are physical devices, electronic or mechanical. */ - class Equipment: public PowerSystemResource + class Equipment : public PowerSystemResource { - public: - CIMPP::Boolean aggregate; /* The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be power transformers or synchronous machines operating in parallel modeled as a single aggregate power transformer or aggregate synchronous machine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. Default: false */ - CIMPP::EquipmentContainer* EquipmentContainer; /* Container of this equipment. Default: 0 */ - std::list OperationalLimitSet; /* The operational limit sets associated with this equipment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Equipment(); - virtual ~Equipment(); - + ~Equipment() override; + + CIMPP::EquipmentContainer* EquipmentContainer; /* Container of this equipment. Default: 0 */ + std::list OperationalLimitSet; /* The operational limit sets associated with this equipment. Default: 0 */ + CIMPP::Boolean aggregate; /* The single instance of equipment represents multiple pieces of equipment that have been modeled together as an aggregate. Examples would be power transformers or synchronous machines operating in parallel modeled as a single aggregate power transformer or aggregate synchronous machine. This is not to be used to indicate equipment that is part of a group of interdependent equipment produced by a network production program. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Equipment_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.cpp b/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.cpp index c8d95b34e..a9d39fa2e 100644 --- a/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquipmentBoundaryVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -16,35 +20,16 @@ using namespace CIMPP; -EquipmentBoundaryVersion::EquipmentBoundaryVersion(): date(nullptr) {}; - +EquipmentBoundaryVersion::EquipmentBoundaryVersion() {}; EquipmentBoundaryVersion::~EquipmentBoundaryVersion() {}; - - -bool assign_EquipmentBoundaryVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - - -bool assign_EquipmentBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -52,10 +37,12 @@ bool assign_EquipmentBoundaryVersion_baseUML(std::stringstream &buffer, BaseClas return false; } -bool assign_EquipmentBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -63,11 +50,25 @@ bool assign_EquipmentBoundaryVersion_baseURI(std::stringstream &buffer, BaseClas return false; } +bool assign_EquipmentBoundaryVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquipmentBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -75,10 +76,12 @@ bool assign_EquipmentBoundaryVersion_differenceModelURI(std::stringstream &buffe return false; } -bool assign_EquipmentBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -86,10 +89,12 @@ bool assign_EquipmentBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseCl return false; } -bool assign_EquipmentBoundaryVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIcore = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -97,10 +102,12 @@ bool assign_EquipmentBoundaryVersion_entsoeURIcore(std::stringstream &buffer, Ba return false; } -bool assign_EquipmentBoundaryVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIoperation = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -108,10 +115,12 @@ bool assign_EquipmentBoundaryVersion_entsoeURIoperation(std::stringstream &buffe return false; } -bool assign_EquipmentBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -119,10 +128,12 @@ bool assign_EquipmentBoundaryVersion_modelDescriptionURI(std::stringstream &buff return false; } -bool assign_EquipmentBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -130,10 +141,12 @@ bool assign_EquipmentBoundaryVersion_namespaceRDF(std::stringstream &buffer, Bas return false; } -bool assign_EquipmentBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -141,10 +154,12 @@ bool assign_EquipmentBoundaryVersion_namespaceUML(std::stringstream &buffer, Bas return false; } -bool assign_EquipmentBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -152,20 +167,35 @@ bool assign_EquipmentBoundaryVersion_shortName(std::stringstream &buffer, BaseCl return false; } -namespace CIMPP { - BaseClass* EquipmentBoundaryVersion_factory() { - return new EquipmentBoundaryVersion; - } + + + + + + + + + + + + +const char EquipmentBoundaryVersion::debugName[] = "EquipmentBoundaryVersion"; +const char* EquipmentBoundaryVersion::debugString() const +{ + return EquipmentBoundaryVersion::debugName; } -void EquipmentBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) { +void EquipmentBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion"), &EquipmentBoundaryVersion_factory)); } -void EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.baseUML"), &assign_EquipmentBoundaryVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.baseURI"), &assign_EquipmentBoundaryVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.differenceModelURI"), &assign_EquipmentBoundaryVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.date"), &assign_EquipmentBoundaryVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.differenceModelURI"), &assign_EquipmentBoundaryVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.entsoeUML"), &assign_EquipmentBoundaryVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.entsoeURIcore"), &assign_EquipmentBoundaryVersion_entsoeURIcore)); assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.entsoeURIoperation"), &assign_EquipmentBoundaryVersion_entsoeURIoperation)); @@ -175,14 +205,8 @@ void EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquipmentBoundaryVersion.date"), &assign_EquipmentBoundaryVersion_date)); - } - -const char EquipmentBoundaryVersion::debugName[] = "EquipmentBoundaryVersion"; -const char* EquipmentBoundaryVersion::debugString() +void EquipmentBoundaryVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquipmentBoundaryVersion::debugName; } const BaseClassDefiner EquipmentBoundaryVersion::declare() @@ -190,4 +214,10 @@ const BaseClassDefiner EquipmentBoundaryVersion::declare() return BaseClassDefiner(EquipmentBoundaryVersion::addConstructToMap, EquipmentBoundaryVersion::addPrimitiveAssignFnsToMap, EquipmentBoundaryVersion::addClassAssignFnsToMap, EquipmentBoundaryVersion::debugName); } - +namespace CIMPP +{ + BaseClass* EquipmentBoundaryVersion_factory() + { + return new EquipmentBoundaryVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.hpp b/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.hpp index 9fada91bf..0f14a07f6 100644 --- a/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/EquipmentBoundaryVersion.hpp @@ -1,49 +1,50 @@ #ifndef EquipmentBoundaryVersion_H #define EquipmentBoundaryVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Profile version details. */ - class EquipmentBoundaryVersion: public BaseClass + class EquipmentBoundaryVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundaryOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquipmentBoundaryVersion(); - virtual ~EquipmentBoundaryVersion(); - + ~EquipmentBoundaryVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentBoundaryOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquipmentBoundaryVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquipmentContainer.cpp b/CGMES_2.4.15_27JAN2020/EquipmentContainer.cpp index 7b60e6a9f..c2a2d9b74 100644 --- a/CGMES_2.4.15_27JAN2020/EquipmentContainer.cpp +++ b/CGMES_2.4.15_27JAN2020/EquipmentContainer.cpp @@ -1,49 +1,56 @@ -#include -#include "ConnectivityNodeContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquipmentContainer.hpp" +#include +#include + #include "Equipment.hpp" using namespace CIMPP; EquipmentContainer::EquipmentContainer() {}; - EquipmentContainer::~EquipmentContainer() {}; -bool assign_EquipmentContainer_Equipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquipmentContainer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Equipments.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_Equipment_EquipmentContainer(BaseClass*, BaseClass*); +bool assign_EquipmentContainer_Equipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquipmentContainer* element = dynamic_cast(BaseClass_ptr1); + Equipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Equipments.begin(), element->Equipments.end(), element2) == element->Equipments.end()) + { + element->Equipments.push_back(element2); + return assign_Equipment_EquipmentContainer(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* EquipmentContainer_factory() { - return new EquipmentContainer; - } +const char EquipmentContainer::debugName[] = "EquipmentContainer"; +const char* EquipmentContainer::debugString() const +{ + return EquipmentContainer::debugName; } -void EquipmentContainer::addConstructToMap(std::unordered_map& factory_map) { +void EquipmentContainer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquipmentContainer"), &EquipmentContainer_factory)); } -void EquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void EquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquipmentContainer.Equipments"), &assign_EquipmentContainer_Equipments)); +void EquipmentContainer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EquipmentContainer::debugName[] = "EquipmentContainer"; -const char* EquipmentContainer::debugString() +void EquipmentContainer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquipmentContainer::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquipmentContainer.Equipments"), &assign_EquipmentContainer_Equipments)); } const BaseClassDefiner EquipmentContainer::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EquipmentContainer::declare() return BaseClassDefiner(EquipmentContainer::addConstructToMap, EquipmentContainer::addPrimitiveAssignFnsToMap, EquipmentContainer::addClassAssignFnsToMap, EquipmentContainer::debugName); } - +namespace CIMPP +{ + BaseClass* EquipmentContainer_factory() + { + return new EquipmentContainer; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquipmentContainer.hpp b/CGMES_2.4.15_27JAN2020/EquipmentContainer.hpp index 5407d798f..7b4688598 100644 --- a/CGMES_2.4.15_27JAN2020/EquipmentContainer.hpp +++ b/CGMES_2.4.15_27JAN2020/EquipmentContainer.hpp @@ -1,38 +1,39 @@ #ifndef EquipmentContainer_H #define EquipmentContainer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConnectivityNodeContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConnectivityNodeContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Equipment; -class Equipment; /* A modeling construct to provide a root class for containing equipment. */ - class EquipmentContainer: public ConnectivityNodeContainer + class EquipmentContainer : public ConnectivityNodeContainer { - public: - std::list Equipments; /* Contained equipment. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquipmentContainer(); - virtual ~EquipmentContainer(); - + ~EquipmentContainer() override; + + std::list Equipments; /* Contained equipment. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquipmentContainer_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquipmentVersion.cpp b/CGMES_2.4.15_27JAN2020/EquipmentVersion.cpp index 0c387fc5b..09b0153e0 100644 --- a/CGMES_2.4.15_27JAN2020/EquipmentVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/EquipmentVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquipmentVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "String.hpp" @@ -19,38 +23,16 @@ using namespace CIMPP; -EquipmentVersion::EquipmentVersion(): date(nullptr) {}; - +EquipmentVersion::EquipmentVersion() {}; EquipmentVersion::~EquipmentVersion() {}; - - - - -bool assign_EquipmentVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - - - -bool assign_EquipmentVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -58,10 +40,12 @@ bool assign_EquipmentVersion_baseUML(std::stringstream &buffer, BaseClass* BaseC return false; } -bool assign_EquipmentVersion_baseURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURIcore = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -69,10 +53,12 @@ bool assign_EquipmentVersion_baseURIcore(std::stringstream &buffer, BaseClass* B return false; } -bool assign_EquipmentVersion_baseURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURIoperation = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -80,10 +66,12 @@ bool assign_EquipmentVersion_baseURIoperation(std::stringstream &buffer, BaseCla return false; } -bool assign_EquipmentVersion_baseURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_baseURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURIshortCircuit = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -91,11 +79,25 @@ bool assign_EquipmentVersion_baseURIshortCircuit(std::stringstream &buffer, Base return false; } +bool assign_EquipmentVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquipmentVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -103,10 +105,12 @@ bool assign_EquipmentVersion_differenceModelURI(std::stringstream &buffer, BaseC return false; } -bool assign_EquipmentVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -114,10 +118,12 @@ bool assign_EquipmentVersion_entsoeUML(std::stringstream &buffer, BaseClass* Bas return false; } -bool assign_EquipmentVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIcore = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -125,10 +131,12 @@ bool assign_EquipmentVersion_entsoeURIcore(std::stringstream &buffer, BaseClass* return false; } -bool assign_EquipmentVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeURIoperation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIoperation = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -136,10 +144,12 @@ bool assign_EquipmentVersion_entsoeURIoperation(std::stringstream &buffer, BaseC return false; } -bool assign_EquipmentVersion_entsoeURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_entsoeURIshortCircuit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURIshortCircuit = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -147,10 +157,12 @@ bool assign_EquipmentVersion_entsoeURIshortCircuit(std::stringstream &buffer, Ba return false; } -bool assign_EquipmentVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -158,10 +170,12 @@ bool assign_EquipmentVersion_modelDescriptionURI(std::stringstream &buffer, Base return false; } -bool assign_EquipmentVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -169,10 +183,12 @@ bool assign_EquipmentVersion_namespaceRDF(std::stringstream &buffer, BaseClass* return false; } -bool assign_EquipmentVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -180,10 +196,12 @@ bool assign_EquipmentVersion_namespaceUML(std::stringstream &buffer, BaseClass* return false; } -bool assign_EquipmentVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_EquipmentVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquipmentVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -191,22 +209,40 @@ bool assign_EquipmentVersion_shortName(std::stringstream &buffer, BaseClass* Bas return false; } -namespace CIMPP { - BaseClass* EquipmentVersion_factory() { - return new EquipmentVersion; - } + + + + + + + + + + + + + + + +const char EquipmentVersion::debugName[] = "EquipmentVersion"; +const char* EquipmentVersion::debugString() const +{ + return EquipmentVersion::debugName; } -void EquipmentVersion::addConstructToMap(std::unordered_map& factory_map) { +void EquipmentVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquipmentVersion"), &EquipmentVersion_factory)); } -void EquipmentVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquipmentVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseUML"), &assign_EquipmentVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseURIcore"), &assign_EquipmentVersion_baseURIcore)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseURIoperation"), &assign_EquipmentVersion_baseURIoperation)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.baseURIshortCircuit"), &assign_EquipmentVersion_baseURIshortCircuit)); - assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.differenceModelURI"), &assign_EquipmentVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.date"), &assign_EquipmentVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.differenceModelURI"), &assign_EquipmentVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.entsoeUML"), &assign_EquipmentVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.entsoeURIcore"), &assign_EquipmentVersion_entsoeURIcore)); assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.entsoeURIoperation"), &assign_EquipmentVersion_entsoeURIoperation)); @@ -217,14 +253,8 @@ void EquipmentVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquipmentVersion.date"), &assign_EquipmentVersion_date)); - } - -const char EquipmentVersion::debugName[] = "EquipmentVersion"; -const char* EquipmentVersion::debugString() +void EquipmentVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquipmentVersion::debugName; } const BaseClassDefiner EquipmentVersion::declare() @@ -232,4 +262,10 @@ const BaseClassDefiner EquipmentVersion::declare() return BaseClassDefiner(EquipmentVersion::addConstructToMap, EquipmentVersion::addPrimitiveAssignFnsToMap, EquipmentVersion::addClassAssignFnsToMap, EquipmentVersion::debugName); } - +namespace CIMPP +{ + BaseClass* EquipmentVersion_factory() + { + return new EquipmentVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquipmentVersion.hpp b/CGMES_2.4.15_27JAN2020/EquipmentVersion.hpp index 16fb8c119..a6ff60989 100644 --- a/CGMES_2.4.15_27JAN2020/EquipmentVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/EquipmentVersion.hpp @@ -1,52 +1,53 @@ #ifndef EquipmentVersion_H #define EquipmentVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class EquipmentVersion: public BaseClass + class EquipmentVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURIcore; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::String baseURIoperation; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::String baseURIshortCircuit; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentCore/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String entsoeURIshortCircuit; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentShortCircuit/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquipmentVersion(); - virtual ~EquipmentVersion(); - + ~EquipmentVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURIcore; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::String baseURIoperation; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::String baseURIshortCircuit; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURIcore; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentCore/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String entsoeURIoperation; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentOperation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String entsoeURIshortCircuit; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/EquipmentShortCircuit/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquipmentVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquivalentBranch.cpp b/CGMES_2.4.15_27JAN2020/EquivalentBranch.cpp index a8a8550ab..306a28be7 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentBranch.cpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentBranch.cpp @@ -1,7 +1,11 @@ -#include -#include "EquivalentEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentBranch.hpp" +#include +#include + #include "Resistance.hpp" #include "Resistance.hpp" #include "Reactance.hpp" @@ -22,234 +26,247 @@ using namespace CIMPP; EquivalentBranch::EquivalentBranch() {}; - EquivalentBranch::~EquivalentBranch() {}; +bool assign_EquivalentBranch_negativeR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeR12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_negativeR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeR21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_negativeX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeX12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_negativeX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->negativeX21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveR12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveR21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveX12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_positiveX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveX21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_r21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_x21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroR12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroR21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroX12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentBranch_zeroX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeroX21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquivalentBranch_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_r21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_x21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeR12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeR21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeX12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_negativeX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->negativeX21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveR12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveR21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveX12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_positiveX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveX21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroR12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroR12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroR21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroR21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroX12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroX12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentBranch_zeroX21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentBranch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeroX21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EquivalentBranch_factory() { - return new EquivalentBranch; - } +const char EquivalentBranch::debugName[] = "EquivalentBranch"; +const char* EquivalentBranch::debugString() const +{ + return EquivalentBranch::debugName; } -void EquivalentBranch::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentBranch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentBranch"), &EquivalentBranch_factory)); } -void EquivalentBranch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.r"), &assign_EquivalentBranch_r)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.r21"), &assign_EquivalentBranch_r21)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.x"), &assign_EquivalentBranch_x)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.x21"), &assign_EquivalentBranch_x21)); +void EquivalentBranch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.negativeR12"), &assign_EquivalentBranch_negativeR12)); assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.negativeR21"), &assign_EquivalentBranch_negativeR21)); assign_map.insert(std::make_pair(std::string("cim:EquivalentBranch.negativeX12"), &assign_EquivalentBranch_negativeX12)); @@ -258,19 +275,18 @@ void EquivalentBranch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char EquivalentBranch::debugName[] = "EquivalentBranch"; -const char* EquivalentBranch::debugString() +void EquivalentBranch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentBranch::debugName; } const BaseClassDefiner EquivalentBranch::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner EquivalentBranch::declare() return BaseClassDefiner(EquivalentBranch::addConstructToMap, EquivalentBranch::addPrimitiveAssignFnsToMap, EquivalentBranch::addClassAssignFnsToMap, EquivalentBranch::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentBranch_factory() + { + return new EquivalentBranch; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquivalentBranch.hpp b/CGMES_2.4.15_27JAN2020/EquivalentBranch.hpp index 6ea22b2c9..72cff31a3 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentBranch.hpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentBranch.hpp @@ -1,54 +1,55 @@ #ifndef EquivalentBranch_H #define EquivalentBranch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquivalentEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Resistance.hpp" +#include "EquivalentEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents equivalent branches. */ - class EquivalentBranch: public EquivalentEquipment + class EquivalentBranch : public EquivalentEquipment { - public: - CIMPP::Resistance r; /* Positive sequence series resistance of the reduced branch. Default: nullptr */ - CIMPP::Resistance r21; /* Resistance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.r is given, then EquivalentBranch.r21 is assumed equal to EquivalentBranch.r. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence series reactance of the reduced branch. Default: nullptr */ - CIMPP::Reactance x21; /* Reactance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.x is given, then EquivalentBranch.x21 is assumed equal to EquivalentBranch.x. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance negativeR12; /* Negative sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance negativeR21; /* Negative sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance negativeX12; /* Negative sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance negativeX21; /* Negative sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909. Usage: EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance positiveR12; /* Positive sequence series resistance from terminal sequence 1 to terminal sequence 2 . Used for short circuit data exchange according to IEC 60909. EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance positiveR21; /* Positive sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance positiveX12; /* Positive sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance positiveX21; /* Positive sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance zeroR12; /* Zero sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Resistance zeroR21; /* Zero sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance zeroX12; /* Zero sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - CIMPP::Reactance zeroX21; /* Zero sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentBranch(); - virtual ~EquivalentBranch(); - + ~EquivalentBranch() override; + + CIMPP::Resistance negativeR12; /* Negative sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance negativeR21; /* Negative sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance negativeX12; /* Negative sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance negativeX21; /* Negative sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909. Usage: EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance positiveR12; /* Positive sequence series resistance from terminal sequence 1 to terminal sequence 2 . Used for short circuit data exchange according to IEC 60909. EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance positiveR21; /* Positive sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance positiveX12; /* Positive sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance positiveX21; /* Positive sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence series resistance of the reduced branch. Default: nullptr */ + CIMPP::Resistance r21; /* Resistance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.r is given, then EquivalentBranch.r21 is assumed equal to EquivalentBranch.r. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence series reactance of the reduced branch. Default: nullptr */ + CIMPP::Reactance x21; /* Reactance from terminal sequence 2 to terminal sequence 1 .Used for steady state power flow. This attribute is optional and represent unbalanced network such as off-nominal phase shifter. If only EquivalentBranch.x is given, then EquivalentBranch.x21 is assumed equal to EquivalentBranch.x. Usage rule : EquivalentBranch is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance zeroR12; /* Zero sequence series resistance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Resistance zeroR21; /* Zero sequence series resistance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance zeroX12; /* Zero sequence series reactance from terminal sequence 1 to terminal sequence 2. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + CIMPP::Reactance zeroX21; /* Zero sequence series reactance from terminal sequence 2 to terminal sequence 1. Used for short circuit data exchange according to IEC 60909 Usage : EquivalentBranch is a result of network reduction prior to the data exchange Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentBranch_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquivalentEquipment.cpp b/CGMES_2.4.15_27JAN2020/EquivalentEquipment.cpp index bc2c92288..4591a9d2c 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentEquipment.cpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentEquipment.cpp @@ -1,49 +1,56 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentEquipment.hpp" +#include +#include + #include "EquivalentNetwork.hpp" using namespace CIMPP; -EquivalentEquipment::EquivalentEquipment(): EquivalentNetwork(nullptr) {}; - +EquivalentEquipment::EquivalentEquipment() : EquivalentNetwork(nullptr) {}; EquivalentEquipment::~EquivalentEquipment() {}; -bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass*, BaseClass*); -bool assign_EquivalentEquipment_EquivalentNetwork(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquivalentEquipment* element = dynamic_cast(BaseClass_ptr1)) { - element->EquivalentNetwork = dynamic_cast(BaseClass_ptr2); - if(element->EquivalentNetwork != nullptr) - return assign_EquivalentNetwork_EquivalentEquipments(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* EquivalentEquipment_factory() { - return new EquivalentEquipment; +bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass*, BaseClass*); +bool assign_EquivalentEquipment_EquivalentNetwork(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquivalentEquipment* element = dynamic_cast(BaseClass_ptr1); + EquivalentNetwork* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EquivalentNetwork != element2) + { + element->EquivalentNetwork = element2; + return assign_EquivalentNetwork_EquivalentEquipments(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void EquivalentEquipment::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:EquivalentEquipment"), &EquivalentEquipment_factory)); +const char EquivalentEquipment::debugName[] = "EquivalentEquipment"; +const char* EquivalentEquipment::debugString() const +{ + return EquivalentEquipment::debugName; } -void EquivalentEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void EquivalentEquipment::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:EquivalentEquipment"), &EquivalentEquipment_factory)); +} -void EquivalentEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentEquipment.EquivalentNetwork"), &assign_EquivalentEquipment_EquivalentNetwork)); +void EquivalentEquipment::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EquivalentEquipment::debugName[] = "EquivalentEquipment"; -const char* EquivalentEquipment::debugString() +void EquivalentEquipment::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentEquipment::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquivalentEquipment.EquivalentNetwork"), &assign_EquivalentEquipment_EquivalentNetwork)); } const BaseClassDefiner EquivalentEquipment::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EquivalentEquipment::declare() return BaseClassDefiner(EquivalentEquipment::addConstructToMap, EquivalentEquipment::addPrimitiveAssignFnsToMap, EquivalentEquipment::addClassAssignFnsToMap, EquivalentEquipment::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentEquipment_factory() + { + return new EquivalentEquipment; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquivalentEquipment.hpp b/CGMES_2.4.15_27JAN2020/EquivalentEquipment.hpp index 3fc6d9f94..9cab80178 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentEquipment.hpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentEquipment.hpp @@ -1,38 +1,39 @@ #ifndef EquivalentEquipment_H #define EquivalentEquipment_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EquivalentNetwork; -class EquivalentNetwork; /* The class represents equivalent objects that are the result of a network reduction. The class is the base for equivalent objects of different types. */ - class EquivalentEquipment: public ConductingEquipment + class EquivalentEquipment : public ConductingEquipment { - public: - CIMPP::EquivalentNetwork* EquivalentNetwork; /* The associated reduced equivalents. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentEquipment(); - virtual ~EquivalentEquipment(); - + ~EquivalentEquipment() override; + + CIMPP::EquivalentNetwork* EquivalentNetwork; /* The associated reduced equivalents. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentEquipment_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquivalentInjection.cpp b/CGMES_2.4.15_27JAN2020/EquivalentInjection.cpp index e2d8eb895..c2be44fd4 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentInjection.cpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentInjection.cpp @@ -1,274 +1,296 @@ -#include -#include "EquivalentEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentInjection.hpp" +#include +#include + #include "ReactiveCapabilityCurve.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -#include "Boolean.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Resistance.hpp" #include "Resistance.hpp" #include "Resistance.hpp" +#include "Boolean.hpp" +#include "Boolean.hpp" +#include "Voltage.hpp" #include "Reactance.hpp" #include "Reactance.hpp" #include "Reactance.hpp" -#include "Boolean.hpp" -#include "Voltage.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" using namespace CIMPP; -EquivalentInjection::EquivalentInjection(): ReactiveCapabilityCurve(nullptr) {}; - +EquivalentInjection::EquivalentInjection() : ReactiveCapabilityCurve(nullptr) {}; EquivalentInjection::~EquivalentInjection() {}; -bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass*, BaseClass*); -bool assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - element->ReactiveCapabilityCurve = dynamic_cast(BaseClass_ptr2); - if(element->ReactiveCapabilityCurve != nullptr) - return assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_EquivalentInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_regulationCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->regulationCapability; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_regulationStatus(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->regulationStatus; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_regulationTarget(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->regulationTarget; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentInjection_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquivalentInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass*, BaseClass*); +bool assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquivalentInjection* element = dynamic_cast(BaseClass_ptr1); + ReactiveCapabilityCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ReactiveCapabilityCurve != element2) + { + element->ReactiveCapabilityCurve = element2; + return assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_EquivalentInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_regulationCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->regulationCapability; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_regulationStatus(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->regulationStatus; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_regulationTarget(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->regulationTarget; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EquivalentInjection_factory() { - return new EquivalentInjection; - } + +const char EquivalentInjection::debugName[] = "EquivalentInjection"; +const char* EquivalentInjection::debugString() const +{ + return EquivalentInjection::debugName; } -void EquivalentInjection::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentInjection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentInjection"), &EquivalentInjection_factory)); } -void EquivalentInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.maxP"), &assign_EquivalentInjection_maxP)); +void EquivalentInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.maxP"), &assign_EquivalentInjection_maxP)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.maxQ"), &assign_EquivalentInjection_maxQ)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.minP"), &assign_EquivalentInjection_minP)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.minQ"), &assign_EquivalentInjection_minQ)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationCapability"), &assign_EquivalentInjection_regulationCapability)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.p"), &assign_EquivalentInjection_p)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.q"), &assign_EquivalentInjection_q)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r"), &assign_EquivalentInjection_r)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r0"), &assign_EquivalentInjection_r0)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.r2"), &assign_EquivalentInjection_r2)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationCapability"), &assign_EquivalentInjection_regulationCapability)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationStatus"), &assign_EquivalentInjection_regulationStatus)); + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationTarget"), &assign_EquivalentInjection_regulationTarget)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.x"), &assign_EquivalentInjection_x)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.x0"), &assign_EquivalentInjection_x0)); assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.x2"), &assign_EquivalentInjection_x2)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationStatus"), &assign_EquivalentInjection_regulationStatus)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.regulationTarget"), &assign_EquivalentInjection_regulationTarget)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.p"), &assign_EquivalentInjection_p)); - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.q"), &assign_EquivalentInjection_q)); } -void EquivalentInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.ReactiveCapabilityCurve"), &assign_EquivalentInjection_ReactiveCapabilityCurve)); - } - -const char EquivalentInjection::debugName[] = "EquivalentInjection"; -const char* EquivalentInjection::debugString() +void EquivalentInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentInjection::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquivalentInjection.ReactiveCapabilityCurve"), &assign_EquivalentInjection_ReactiveCapabilityCurve)); } const BaseClassDefiner EquivalentInjection::declare() @@ -276,4 +298,10 @@ const BaseClassDefiner EquivalentInjection::declare() return BaseClassDefiner(EquivalentInjection::addConstructToMap, EquivalentInjection::addPrimitiveAssignFnsToMap, EquivalentInjection::addClassAssignFnsToMap, EquivalentInjection::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentInjection_factory() + { + return new EquivalentInjection; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquivalentInjection.hpp b/CGMES_2.4.15_27JAN2020/EquivalentInjection.hpp index a9ff52471..6cc6a8342 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentInjection.hpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentInjection.hpp @@ -1,59 +1,60 @@ #ifndef EquivalentInjection_H #define EquivalentInjection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquivalentEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "EquivalentEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "ReactivePower.hpp" #include "Boolean.hpp" -#include "Resistance.hpp" #include "Reactance.hpp" +#include "ReactivePower.hpp" +#include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ReactiveCapabilityCurve; - -class ReactiveCapabilityCurve; /* This class represents equivalent injections (generation or load). Voltage regulation is allowed only at the point of connection. */ - class EquivalentInjection: public EquivalentEquipment + class EquivalentInjection : public EquivalentEquipment { - public: - CIMPP::ReactiveCapabilityCurve* ReactiveCapabilityCurve; /* The equivalent injection using this reactive capability curve. Default: 0 */ - CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower maxQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ - CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower minQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ - CIMPP::Boolean regulationCapability; /* Specifies whether or not the EquivalentInjection has the capability to regulate the local voltage. Default: false */ - CIMPP::Resistance r; /* Positive sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Resistance r2; /* Negative sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Reactance x2; /* Negative sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ - CIMPP::Boolean regulationStatus; /* Specifies the default regulation status of the EquivalentInjection. True is regulating. False is not regulating. Default: false */ - CIMPP::Voltage regulationTarget; /* The target voltage for voltage regulation. Default: nullptr */ - CIMPP::ActivePower p; /* Equivalent active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::ReactivePower q; /* Equivalent reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentInjection(); - virtual ~EquivalentInjection(); - + ~EquivalentInjection() override; + + CIMPP::ReactiveCapabilityCurve* ReactiveCapabilityCurve; /* The equivalent injection using this reactive capability curve. Default: 0 */ + CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower maxQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ + CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower minQ; /* Used for modeling of infeed for load flow exchange. Not used for short circuit modeling. If maxQ and minQ are not used ReactiveCapabilityCurve can be used. Default: nullptr */ + CIMPP::ActivePower p; /* Equivalent active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::ReactivePower q; /* Equivalent reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Resistance r; /* Positive sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Resistance r2; /* Negative sequence resistance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Boolean regulationCapability; /* Specifies whether or not the EquivalentInjection has the capability to regulate the local voltage. Default: false */ + CIMPP::Boolean regulationStatus; /* Specifies the default regulation status of the EquivalentInjection. True is regulating. False is not regulating. Default: false */ + CIMPP::Voltage regulationTarget; /* The target voltage for voltage regulation. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + CIMPP::Reactance x2; /* Negative sequence reactance. Used to represent Extended-Ward (IEC 60909). Usage : Extended-Ward is a result of network reduction prior to the data exchange. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentInjection_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquivalentNetwork.cpp b/CGMES_2.4.15_27JAN2020/EquivalentNetwork.cpp index 46d146976..f8ed0f8da 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentNetwork.cpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentNetwork.cpp @@ -1,49 +1,56 @@ -#include -#include "ConnectivityNodeContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentNetwork.hpp" +#include +#include + #include "EquivalentEquipment.hpp" using namespace CIMPP; EquivalentNetwork::EquivalentNetwork() {}; - EquivalentNetwork::~EquivalentNetwork() {}; -bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(EquivalentNetwork* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EquivalentEquipments.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_EquivalentEquipment_EquivalentNetwork(BaseClass*, BaseClass*); +bool assign_EquivalentNetwork_EquivalentEquipments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + EquivalentNetwork* element = dynamic_cast(BaseClass_ptr1); + EquivalentEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EquivalentEquipments.begin(), element->EquivalentEquipments.end(), element2) == element->EquivalentEquipments.end()) + { + element->EquivalentEquipments.push_back(element2); + return assign_EquivalentEquipment_EquivalentNetwork(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* EquivalentNetwork_factory() { - return new EquivalentNetwork; - } +const char EquivalentNetwork::debugName[] = "EquivalentNetwork"; +const char* EquivalentNetwork::debugString() const +{ + return EquivalentNetwork::debugName; } -void EquivalentNetwork::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentNetwork::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentNetwork"), &EquivalentNetwork_factory)); } -void EquivalentNetwork::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void EquivalentNetwork::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:EquivalentNetwork.EquivalentEquipments"), &assign_EquivalentNetwork_EquivalentEquipments)); +void EquivalentNetwork::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char EquivalentNetwork::debugName[] = "EquivalentNetwork"; -const char* EquivalentNetwork::debugString() +void EquivalentNetwork::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentNetwork::debugName; + assign_map.insert(std::make_pair(std::string("cim:EquivalentNetwork.EquivalentEquipments"), &assign_EquivalentNetwork_EquivalentEquipments)); } const BaseClassDefiner EquivalentNetwork::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner EquivalentNetwork::declare() return BaseClassDefiner(EquivalentNetwork::addConstructToMap, EquivalentNetwork::addPrimitiveAssignFnsToMap, EquivalentNetwork::addClassAssignFnsToMap, EquivalentNetwork::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentNetwork_factory() + { + return new EquivalentNetwork; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquivalentNetwork.hpp b/CGMES_2.4.15_27JAN2020/EquivalentNetwork.hpp index febd34b67..39b7c3b62 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentNetwork.hpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentNetwork.hpp @@ -1,38 +1,39 @@ #ifndef EquivalentNetwork_H #define EquivalentNetwork_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConnectivityNodeContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConnectivityNodeContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EquivalentEquipment; -class EquivalentEquipment; /* A class that represents an external meshed network that has been reduced to an electrically equivalent model. The ConnectivityNodes contained in the equivalent are intended to reflect internal nodes of the equivalent. The boundary Connectivity nodes where the equivalent connects outside itself are NOT contained by the equivalent. */ - class EquivalentNetwork: public ConnectivityNodeContainer + class EquivalentNetwork : public ConnectivityNodeContainer { - public: - std::list EquivalentEquipments; /* The equivalent where the reduced model belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentNetwork(); - virtual ~EquivalentNetwork(); - + ~EquivalentNetwork() override; + + std::list EquivalentEquipments; /* The equivalent where the reduced model belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentNetwork_factory(); diff --git a/CGMES_2.4.15_27JAN2020/EquivalentShunt.cpp b/CGMES_2.4.15_27JAN2020/EquivalentShunt.cpp index 1a652d829..b62bb06bd 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentShunt.cpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentShunt.cpp @@ -1,66 +1,68 @@ -#include -#include "EquivalentEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "EquivalentShunt.hpp" +#include +#include + #include "Susceptance.hpp" #include "Conductance.hpp" using namespace CIMPP; EquivalentShunt::EquivalentShunt() {}; - EquivalentShunt::~EquivalentShunt() {}; +bool assign_EquivalentShunt_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EquivalentShunt_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_EquivalentShunt_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_EquivalentShunt_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(EquivalentShunt* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* EquivalentShunt_factory() { - return new EquivalentShunt; - } +const char EquivalentShunt::debugName[] = "EquivalentShunt"; +const char* EquivalentShunt::debugString() const +{ + return EquivalentShunt::debugName; } -void EquivalentShunt::addConstructToMap(std::unordered_map& factory_map) { +void EquivalentShunt::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:EquivalentShunt"), &EquivalentShunt_factory)); } -void EquivalentShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void EquivalentShunt::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:EquivalentShunt.b"), &assign_EquivalentShunt_b)); assign_map.insert(std::make_pair(std::string("cim:EquivalentShunt.g"), &assign_EquivalentShunt_g)); } -void EquivalentShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char EquivalentShunt::debugName[] = "EquivalentShunt"; -const char* EquivalentShunt::debugString() +void EquivalentShunt::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return EquivalentShunt::debugName; } const BaseClassDefiner EquivalentShunt::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner EquivalentShunt::declare() return BaseClassDefiner(EquivalentShunt::addConstructToMap, EquivalentShunt::addPrimitiveAssignFnsToMap, EquivalentShunt::addClassAssignFnsToMap, EquivalentShunt::debugName); } - +namespace CIMPP +{ + BaseClass* EquivalentShunt_factory() + { + return new EquivalentShunt; + } +} diff --git a/CGMES_2.4.15_27JAN2020/EquivalentShunt.hpp b/CGMES_2.4.15_27JAN2020/EquivalentShunt.hpp index 80e5b7b6e..f6edab3a2 100644 --- a/CGMES_2.4.15_27JAN2020/EquivalentShunt.hpp +++ b/CGMES_2.4.15_27JAN2020/EquivalentShunt.hpp @@ -1,40 +1,41 @@ #ifndef EquivalentShunt_H #define EquivalentShunt_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquivalentEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "EquivalentEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents equivalent shunts. */ - class EquivalentShunt: public EquivalentEquipment + class EquivalentShunt : public EquivalentEquipment { - public: - CIMPP::Susceptance b; /* Positive sequence shunt susceptance. Default: nullptr */ - CIMPP::Conductance g; /* Positive sequence shunt conductance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ EquivalentShunt(); - virtual ~EquivalentShunt(); - + ~EquivalentShunt() override; + + CIMPP::Susceptance b; /* Positive sequence shunt susceptance. Default: nullptr */ + CIMPP::Conductance g; /* Positive sequence shunt conductance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* EquivalentShunt_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC1A.cpp b/CGMES_2.4.15_27JAN2020/ExcAC1A.cpp index d518305a3..e1183202a 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC1A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC1A.cpp @@ -1,366 +1,388 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC1A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcAC1A::ExcAC1A() {}; - ExcAC1A::~ExcAC1A() {}; +bool assign_ExcAC1A_hvlvgates(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hvlvgates; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC1A_hvlvgates(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hvlvgates; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC1A_factory() { - return new ExcAC1A; - } +const char ExcAC1A::debugName[] = "ExcAC1A"; +const char* ExcAC1A::debugString() const +{ + return ExcAC1A::debugName; } -void ExcAC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC1A"), &ExcAC1A_factory)); } -void ExcAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tb"), &assign_ExcAC1A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tc"), &assign_ExcAC1A_tc)); +void ExcAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.hvlvgates"), &assign_ExcAC1A_hvlvgates)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ka"), &assign_ExcAC1A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ta"), &assign_ExcAC1A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamax"), &assign_ExcAC1A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamin"), &assign_ExcAC1A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.te"), &assign_ExcAC1A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kc"), &assign_ExcAC1A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kd"), &assign_ExcAC1A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ke"), &assign_ExcAC1A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kf"), &assign_ExcAC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kf1"), &assign_ExcAC1A_kf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kf2"), &assign_ExcAC1A_kf2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ks"), &assign_ExcAC1A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve1"), &assign_ExcAC1A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve2"), &assign_ExcAC1A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ta"), &assign_ExcAC1A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tb"), &assign_ExcAC1A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tc"), &assign_ExcAC1A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.te"), &assign_ExcAC1A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.tf"), &assign_ExcAC1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kc"), &assign_ExcAC1A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.kd"), &assign_ExcAC1A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ke"), &assign_ExcAC1A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamax"), &assign_ExcAC1A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vamin"), &assign_ExcAC1A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ve1"), &assign_ExcAC1A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve1"), &assign_ExcAC1A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.ve2"), &assign_ExcAC1A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.seve2"), &assign_ExcAC1A_seve2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vrmax"), &assign_ExcAC1A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.vrmin"), &assign_ExcAC1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC1A.hvlvgates"), &assign_ExcAC1A_hvlvgates)); } -void ExcAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC1A::debugName[] = "ExcAC1A"; -const char* ExcAC1A::debugString() +void ExcAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC1A::debugName; } const BaseClassDefiner ExcAC1A::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner ExcAC1A::declare() return BaseClassDefiner(ExcAC1A::addConstructToMap, ExcAC1A::addPrimitiveAssignFnsToMap, ExcAC1A::addClassAssignFnsToMap, ExcAC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC1A_factory() + { + return new ExcAC1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC1A.hpp b/CGMES_2.4.15_27JAN2020/ExcAC1A.hpp index 5ca0eb61f..8880dc0e4 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC1A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC1A.hpp @@ -1,62 +1,63 @@ #ifndef ExcAC1A_H #define ExcAC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE AC1A alternator-supplied rectifier excitation system with different rate feedback source. */ - class ExcAC1A: public ExcitationSystemDynamics + class ExcAC1A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 0. Default: nullptr */ - CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.38. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 6.03. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Rrmin). Typical Value = -5.43. Default: nullptr */ - CIMPP::Boolean hvlvgates; /* Indicates if both HV gate and LV gate are active (HVLVgates). true = gates are used false = gates are not used. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC1A(); - virtual ~ExcAC1A(); - + ~ExcAC1A() override; + + CIMPP::Boolean hvlvgates; /* Indicates if both HV gate and LV gate are active (HVLVgates). true = gates are used false = gates are not used. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.38. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 3.14. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 6.03. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Rrmin). Typical Value = -5.43. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC2A.cpp b/CGMES_2.4.15_27JAN2020/ExcAC2A.cpp index daacc9483..6f3c74e6d 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC2A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC2A.cpp @@ -1,456 +1,484 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC2A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcAC2A::ExcAC2A() {}; - ExcAC2A::~ExcAC2A() {}; +bool assign_ExcAC2A_hvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hvgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lvgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vlr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_vlr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_hvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hvgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC2A_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lvgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAC2A_factory() { - return new ExcAC2A; - } + + + + + + + + + + + + + + + + + + + + + + +const char ExcAC2A::debugName[] = "ExcAC2A"; +const char* ExcAC2A::debugString() const +{ + return ExcAC2A::debugName; } -void ExcAC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC2A"), &ExcAC2A_factory)); } -void ExcAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tb"), &assign_ExcAC2A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tc"), &assign_ExcAC2A_tc)); +void ExcAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.hvgate"), &assign_ExcAC2A_hvgate)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ka"), &assign_ExcAC2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ta"), &assign_ExcAC2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamax"), &assign_ExcAC2A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamin"), &assign_ExcAC2A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kb"), &assign_ExcAC2A_kb)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kb1"), &assign_ExcAC2A_kb1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmax"), &assign_ExcAC2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmin"), &assign_ExcAC2A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.te"), &assign_ExcAC2A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vfemax"), &assign_ExcAC2A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kh"), &assign_ExcAC2A_kh)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kc"), &assign_ExcAC2A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kd"), &assign_ExcAC2A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ke"), &assign_ExcAC2A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kf"), &assign_ExcAC2A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kh"), &assign_ExcAC2A_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kl"), &assign_ExcAC2A_kl)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vlr"), &assign_ExcAC2A_vlr)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kl1"), &assign_ExcAC2A_kl1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ks"), &assign_ExcAC2A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.lvgate"), &assign_ExcAC2A_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve1"), &assign_ExcAC2A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve2"), &assign_ExcAC2A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ta"), &assign_ExcAC2A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tb"), &assign_ExcAC2A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tc"), &assign_ExcAC2A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.te"), &assign_ExcAC2A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.tf"), &assign_ExcAC2A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kc"), &assign_ExcAC2A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.kd"), &assign_ExcAC2A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ke"), &assign_ExcAC2A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamax"), &assign_ExcAC2A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vamin"), &assign_ExcAC2A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ve1"), &assign_ExcAC2A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve1"), &assign_ExcAC2A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.ve2"), &assign_ExcAC2A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.seve2"), &assign_ExcAC2A_seve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.hvgate"), &assign_ExcAC2A_hvgate)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.lvgate"), &assign_ExcAC2A_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vfemax"), &assign_ExcAC2A_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vlr"), &assign_ExcAC2A_vlr)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmax"), &assign_ExcAC2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC2A.vrmin"), &assign_ExcAC2A_vrmin)); } -void ExcAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC2A::debugName[] = "ExcAC2A"; -const char* ExcAC2A::debugString() +void ExcAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC2A::debugName; } const BaseClassDefiner ExcAC2A::declare() @@ -458,4 +486,10 @@ const BaseClassDefiner ExcAC2A::declare() return BaseClassDefiner(ExcAC2A::addConstructToMap, ExcAC2A::addPrimitiveAssignFnsToMap, ExcAC2A::addClassAssignFnsToMap, ExcAC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC2A_factory() + { + return new ExcAC2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC2A.hpp b/CGMES_2.4.15_27JAN2020/ExcAC2A.hpp index 33453b599..17de55256 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC2A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC2A.hpp @@ -1,68 +1,69 @@ #ifndef ExcAC2A_H #define ExcAC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE AC2A alternator-supplied rectifier excitation system with different field current limit. */ - class ExcAC2A: public ExcitationSystemDynamics + class ExcAC2A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ - CIMPP::PU kb; /* Second stage regulator gain (Kb) (>0). Exciter field current controller gain. Typical Value = 25. Default: nullptr */ - CIMPP::PU kb1; /* Second stage regulator gain (Kb1). It is exciter field current controller gain used as alternative to Kb to represent a variant of the ExcAC2A model. Typical Value = 25. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 105. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 4.4. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current feedback gain (Kh). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU kl; /* Exciter field current limiter gain (Kl). Typical Value = 10. Default: nullptr */ - CIMPP::PU vlr; /* Maximum exciter field current (Vlr). Typical Value = 4.4. Default: nullptr */ - CIMPP::PU kl1; /* Coefficient to allow different usage of the model (Kl1). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.28. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.35. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.037. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 3.3. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.012. Default: nullptr */ - CIMPP::Boolean hvgate; /* Indicates if HV gate is active (HVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ - CIMPP::Boolean lvgate; /* Indicates if LV gate is active (LVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC2A(); - virtual ~ExcAC2A(); - + ~ExcAC2A() override; + + CIMPP::Boolean hvgate; /* Indicates if HV gate is active (HVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ + CIMPP::PU kb; /* Second stage regulator gain (Kb) (>0). Exciter field current controller gain. Typical Value = 25. Default: nullptr */ + CIMPP::PU kb1; /* Second stage regulator gain (Kb1). It is exciter field current controller gain used as alternative to Kb to represent a variant of the ExcAC2A model. Typical Value = 25. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.28. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.35. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current feedback gain (Kh). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl; /* Exciter field current limiter gain (Kl). Typical Value = 10. Default: nullptr */ + CIMPP::PU kl1; /* Coefficient to allow different usage of the model (Kl1). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean lvgate; /* Indicates if LV gate is active (LVgate). true = gate is used false = gate is not used. Typical Value = true. Default: false */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.037. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.6. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 3.3. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU vlr; /* Maximum exciter field current (Vlr). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 105. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -95. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC3A.cpp b/CGMES_2.4.15_27JAN2020/ExcAC3A.cpp index c9b9a205c..87e00405c 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC3A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC3A.cpp @@ -1,426 +1,452 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC3A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" using namespace CIMPP; ExcAC3A::ExcAC3A() {}; - ExcAC3A::~ExcAC3A() {}; +bool assign_ExcAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_klv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC3A_vlv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_klv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC3A_vlv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAC3A_factory() { - return new ExcAC3A; - } + + + + + + + + + + + + + + + + + + + + +const char ExcAC3A::debugName[] = "ExcAC3A"; +const char* ExcAC3A::debugString() const +{ + return ExcAC3A::debugName; } -void ExcAC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC3A"), &ExcAC3A_factory)); } -void ExcAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tb"), &assign_ExcAC3A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tc"), &assign_ExcAC3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ka"), &assign_ExcAC3A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ta"), &assign_ExcAC3A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamax"), &assign_ExcAC3A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamin"), &assign_ExcAC3A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.te"), &assign_ExcAC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vemin"), &assign_ExcAC3A_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kr"), &assign_ExcAC3A_kr)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf"), &assign_ExcAC3A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tf"), &assign_ExcAC3A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kn"), &assign_ExcAC3A_kn)); +void ExcAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.efdn"), &assign_ExcAC3A_efdn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ka"), &assign_ExcAC3A_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kc"), &assign_ExcAC3A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kd"), &assign_ExcAC3A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ke"), &assign_ExcAC3A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.klv"), &assign_ExcAC3A_klv)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf"), &assign_ExcAC3A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf1"), &assign_ExcAC3A_kf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kf2"), &assign_ExcAC3A_kf2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.klv"), &assign_ExcAC3A_klv)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kn"), &assign_ExcAC3A_kn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.kr"), &assign_ExcAC3A_kr)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ks"), &assign_ExcAC3A_ks)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vfemax"), &assign_ExcAC3A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve1"), &assign_ExcAC3A_ve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.seve1"), &assign_ExcAC3A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve2"), &assign_ExcAC3A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.seve2"), &assign_ExcAC3A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ta"), &assign_ExcAC3A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tb"), &assign_ExcAC3A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tc"), &assign_ExcAC3A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.te"), &assign_ExcAC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.tf"), &assign_ExcAC3A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamax"), &assign_ExcAC3A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vamin"), &assign_ExcAC3A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve1"), &assign_ExcAC3A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.ve2"), &assign_ExcAC3A_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vemin"), &assign_ExcAC3A_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vfemax"), &assign_ExcAC3A_vfemax)); assign_map.insert(std::make_pair(std::string("cim:ExcAC3A.vlv"), &assign_ExcAC3A_vlv)); } -void ExcAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC3A::debugName[] = "ExcAC3A"; -const char* ExcAC3A::debugString() +void ExcAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC3A::debugName; } const BaseClassDefiner ExcAC3A::declare() @@ -428,4 +454,10 @@ const BaseClassDefiner ExcAC3A::declare() return BaseClassDefiner(ExcAC3A::addConstructToMap, ExcAC3A::addPrimitiveAssignFnsToMap, ExcAC3A::addClassAssignFnsToMap, ExcAC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC3A_factory() + { + return new ExcAC3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC3A.hpp b/CGMES_2.4.15_27JAN2020/ExcAC3A.hpp index 70e872bed..db3685cc7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC3A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC3A.hpp @@ -1,65 +1,66 @@ #ifndef ExcAC3A_H #define ExcAC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC3A alternator-supplied rectifier excitation system with different field current limit. */ - class ExcAC3A: public ExcitationSystemDynamics + class ExcAC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ka; /* Voltage regulator gain (Ka). Typical Value = 45.62. Default: nullptr */ - CIMPP::PU ta; /* Voltage regulator time constant (Ta). Typical Value = 0.013. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.17. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (Kr). Typical Value =3.77. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.143. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU kn; /* Excitation control system stabilizer gain (Kn). Typical Value =0.05. Default: nullptr */ - CIMPP::PU efdn; /* Value of at which feedback gain changes (Efdn). Typical Value = 2.36. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.104. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.499. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU klv; /* Gain used in the minimum field voltage limiter loop (Klv). Typical Value = 0.194. Default: nullptr */ - CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 16. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1) equals Vemax (Ve1). Typical Value = 6.24. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 1.143. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.68. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vlv; /* Field voltage used in the minimum field voltage limiter loop (Vlv). Typical Value = 0.79. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC3A(); - virtual ~ExcAC3A(); - + ~ExcAC3A() override; + + CIMPP::PU efdn; /* Value of at which feedback gain changes (Efdn). Typical Value = 2.36. Default: nullptr */ + CIMPP::Seconds ka; /* Voltage regulator gain (Ka). Typical Value = 45.62. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.104. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 0.499. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.143. Default: nullptr */ + CIMPP::PU kf1; /* Coefficient to allow different usage of the model (Kf1). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf2; /* Coefficient to allow different usage of the model (Kf2). Typical Value = 0. Default: nullptr */ + CIMPP::PU klv; /* Gain used in the minimum field voltage limiter loop (Klv). Typical Value = 0.194. Default: nullptr */ + CIMPP::PU kn; /* Excitation control system stabilizer gain (Kn). Typical Value =0.05. Default: nullptr */ + CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (Kr). Typical Value =3.77. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 1.143. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve]). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ta; /* Voltage regulator time constant (Ta). Typical Value = 0.013. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.17. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1) equals Vemax (Ve1). Typical Value = 6.24. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 4.68. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 16. Default: nullptr */ + CIMPP::PU vlv; /* Field voltage used in the minimum field voltage limiter loop (Vlv). Typical Value = 0.79. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC4A.cpp b/CGMES_2.4.15_27JAN2020/ExcAC4A.cpp index cc5f6f7fd..42910c5bc 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC4A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC4A.cpp @@ -1,171 +1,180 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC4A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAC4A::ExcAC4A() {}; - ExcAC4A::~ExcAC4A() {}; +bool assign_ExcAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC4A_factory() { - return new ExcAC4A; - } +const char ExcAC4A::debugName[] = "ExcAC4A"; +const char* ExcAC4A::debugString() const +{ + return ExcAC4A::debugName; } -void ExcAC4A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC4A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC4A"), &ExcAC4A_factory)); } -void ExcAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimax"), &assign_ExcAC4A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimin"), &assign_ExcAC4A_vimin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tc"), &assign_ExcAC4A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tb"), &assign_ExcAC4A_tb)); +void ExcAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.ka"), &assign_ExcAC4A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.kc"), &assign_ExcAC4A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.ta"), &assign_ExcAC4A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tb"), &assign_ExcAC4A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.tc"), &assign_ExcAC4A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimax"), &assign_ExcAC4A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vimin"), &assign_ExcAC4A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vrmax"), &assign_ExcAC4A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.vrmin"), &assign_ExcAC4A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC4A.kc"), &assign_ExcAC4A_kc)); } -void ExcAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC4A::debugName[] = "ExcAC4A"; -const char* ExcAC4A::debugString() +void ExcAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC4A::debugName; } const BaseClassDefiner ExcAC4A::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner ExcAC4A::declare() return BaseClassDefiner(ExcAC4A::addConstructToMap, ExcAC4A::addPrimitiveAssignFnsToMap, ExcAC4A::addClassAssignFnsToMap, ExcAC4A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC4A_factory() + { + return new ExcAC4A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC4A.hpp b/CGMES_2.4.15_27JAN2020/ExcAC4A.hpp index b436fb11a..3351ab9be 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC4A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC4A.hpp @@ -1,47 +1,48 @@ #ifndef ExcAC4A_H #define ExcAC4A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC4A alternator-supplied rectifier excitation system with different minimum controller output. */ - class ExcAC4A: public ExcitationSystemDynamics + class ExcAC4A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.015. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5.64. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.53. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC4A(); - virtual ~ExcAC4A(); - + ~ExcAC4A() override; + + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 200. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.015. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5.64. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.53. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC4A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC5A.cpp b/CGMES_2.4.15_27JAN2020/ExcAC5A.cpp index 22eef41fd..405cbcaba 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC5A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC5A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC5A.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcAC5A::ExcAC5A() {}; - ExcAC5A::~ExcAC5A() {}; +bool assign_ExcAC5A_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC5A_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC5A_factory() { - return new ExcAC5A; - } +const char ExcAC5A::debugName[] = "ExcAC5A"; +const char* ExcAC5A::debugString() const +{ + return ExcAC5A::debugName; } -void ExcAC5A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC5A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC5A"), &ExcAC5A_factory)); } -void ExcAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.a"), &assign_ExcAC5A_a)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd1"), &assign_ExcAC5A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd2"), &assign_ExcAC5A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ka"), &assign_ExcAC5A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ke"), &assign_ExcAC5A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.kf"), &assign_ExcAC5A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ks"), &assign_ExcAC5A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd1"), &assign_ExcAC5A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd2"), &assign_ExcAC5A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ta"), &assign_ExcAC5A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tb"), &assign_ExcAC5A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tc"), &assign_ExcAC5A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ta"), &assign_ExcAC5A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmax"), &assign_ExcAC5A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmin"), &assign_ExcAC5A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.ke"), &assign_ExcAC5A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.te"), &assign_ExcAC5A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.kf"), &assign_ExcAC5A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tf1"), &assign_ExcAC5A_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tf2"), &assign_ExcAC5A_tf2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.tf3"), &assign_ExcAC5A_tf3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd1"), &assign_ExcAC5A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd1"), &assign_ExcAC5A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.efd2"), &assign_ExcAC5A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.seefd2"), &assign_ExcAC5A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.a"), &assign_ExcAC5A_a)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmax"), &assign_ExcAC5A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC5A.vrmin"), &assign_ExcAC5A_vrmin)); } -void ExcAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC5A::debugName[] = "ExcAC5A"; -const char* ExcAC5A::debugString() +void ExcAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC5A::debugName; } const BaseClassDefiner ExcAC5A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcAC5A::declare() return BaseClassDefiner(ExcAC5A::addConstructToMap, ExcAC5A::addPrimitiveAssignFnsToMap, ExcAC5A::addClassAssignFnsToMap, ExcAC5A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC5A_factory() + { + return new ExcAC5A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC5A.hpp b/CGMES_2.4.15_27JAN2020/ExcAC5A.hpp index 621c3067b..8e36cf0c6 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC5A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC5A.hpp @@ -1,57 +1,58 @@ #ifndef ExcAC5A_H #define ExcAC5A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC5A alternator-supplied rectifier excitation system with different minimum controller output. */ - class ExcAC5A: public ExcitationSystemDynamics + class ExcAC5A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 7.3. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value =-7.3. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (Tf2). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (Tf3). Typical Value = 0. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 5.6. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (S[Efd1]). Typical Value = 0.86. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 4.2. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (S[Efd2]). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float a; /* Coefficient to allow different usage of the model (a). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC5A(); - virtual ~ExcAC5A(); - + ~ExcAC5A() override; + + CIMPP::Simple_Float a; /* Coefficient to allow different usage of the model (a). Typical Value = 1. Default: nullptr */ + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 5.6. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 4.2. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 400. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (S[Efd1]). Typical Value = 0.86. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (S[Efd2]). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (Tf2). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (Tf3). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 7.3. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value =-7.3. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC5A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC6A.cpp b/CGMES_2.4.15_27JAN2020/ExcAC6A.cpp index c8afc58ab..f19cc0233 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC6A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC6A.cpp @@ -1,19 +1,24 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC6A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -22,360 +27,378 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAC6A::ExcAC6A() {}; - ExcAC6A::~ExcAC6A() {}; +bool assign_ExcAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tj; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfelim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tj; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfelim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAC6A_factory() { - return new ExcAC6A; - } +const char ExcAC6A::debugName[] = "ExcAC6A"; +const char* ExcAC6A::debugString() const +{ + return ExcAC6A::debugName; } -void ExcAC6A::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC6A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC6A"), &ExcAC6A_factory)); } -void ExcAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ka"), &assign_ExcAC6A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kc"), &assign_ExcAC6A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kd"), &assign_ExcAC6A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ke"), &assign_ExcAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kh"), &assign_ExcAC6A_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ks"), &assign_ExcAC6A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve1"), &assign_ExcAC6A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve2"), &assign_ExcAC6A_seve2)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ta"), &assign_ExcAC6A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tk"), &assign_ExcAC6A_tk)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tb"), &assign_ExcAC6A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tc"), &assign_ExcAC6A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamax"), &assign_ExcAC6A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamin"), &assign_ExcAC6A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmax"), &assign_ExcAC6A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmin"), &assign_ExcAC6A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.te"), &assign_ExcAC6A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kh"), &assign_ExcAC6A_kh)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tj"), &assign_ExcAC6A_tj)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.th"), &assign_ExcAC6A_th)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vfelim"), &assign_ExcAC6A_vfelim)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vhmax"), &assign_ExcAC6A_vhmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kc"), &assign_ExcAC6A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.kd"), &assign_ExcAC6A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ke"), &assign_ExcAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tj"), &assign_ExcAC6A_tj)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.tk"), &assign_ExcAC6A_tk)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamax"), &assign_ExcAC6A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vamin"), &assign_ExcAC6A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ve1"), &assign_ExcAC6A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve1"), &assign_ExcAC6A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.ve2"), &assign_ExcAC6A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.seve2"), &assign_ExcAC6A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vfelim"), &assign_ExcAC6A_vfelim)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vhmax"), &assign_ExcAC6A_vhmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmax"), &assign_ExcAC6A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcAC6A.vrmin"), &assign_ExcAC6A_vrmin)); } -void ExcAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC6A::debugName[] = "ExcAC6A"; -const char* ExcAC6A::debugString() +void ExcAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC6A::debugName; } const BaseClassDefiner ExcAC6A::declare() @@ -383,4 +406,10 @@ const BaseClassDefiner ExcAC6A::declare() return BaseClassDefiner(ExcAC6A::addConstructToMap, ExcAC6A::addPrimitiveAssignFnsToMap, ExcAC6A::addClassAssignFnsToMap, ExcAC6A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC6A_factory() + { + return new ExcAC6A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC6A.hpp b/CGMES_2.4.15_27JAN2020/ExcAC6A.hpp index e2b21d058..479374d09 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC6A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC6A.hpp @@ -1,62 +1,63 @@ #ifndef ExcAC6A_H #define ExcAC6A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC6A alternator-supplied rectifier excitation system with speed input. */ - class ExcAC6A: public ExcitationSystemDynamics + class ExcAC6A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 536. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.086. Default: nullptr */ - CIMPP::Seconds tk; /* Voltage regulator time constant (Tk). Typical Value = 0.18. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 3. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 75. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -75. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 44. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -36. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current limiter gain (Kh). Typical Value = 92. Default: nullptr */ - CIMPP::Seconds tj; /* Exciter field current limiter time constant (Tj). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds th; /* Exciter field current limiter time constant (Th). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU vfelim; /* Exciter field current limit reference (Vfelim). Typical Value = 19. Default: nullptr */ - CIMPP::PU vhmax; /* Maximum field current limiter signal reference (Vhmax). Typical Value = 75. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.173. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.91. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1.6. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 7.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.214. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 5.55. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.044. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC6A(); - virtual ~ExcAC6A(); - + ~ExcAC6A() override; + + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 536. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.173. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.91. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1.6. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current limiter gain (Kh). Typical Value = 92. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0.214. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 0.044. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.086. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 9. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds th; /* Exciter field current limiter time constant (Th). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tj; /* Exciter field current limiter time constant (Tj). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tk; /* Voltage regulator time constant (Tk). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 75. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -75. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 7.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 5.55. Default: nullptr */ + CIMPP::PU vfelim; /* Exciter field current limit reference (Vfelim). Typical Value = 19. Default: nullptr */ + CIMPP::PU vhmax; /* Maximum field current limiter signal reference (Vhmax). Typical Value = 75. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 44. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -36. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC6A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAC8B.cpp b/CGMES_2.4.15_27JAN2020/ExcAC8B.cpp index 7b16aa3ff..d926b91ad 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC8B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC8B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAC8B.hpp" +#include +#include + #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" @@ -33,373 +37,401 @@ using namespace CIMPP; ExcAC8B::ExcAC8B() {}; - ExcAC8B::~ExcAC8B() {}; +bool assign_ExcAC8B_inlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_pidlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pidlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_telim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->telim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAC8B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAC8B_vpidmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpidmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAC8B_vpidmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpidmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAC8B_vtmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmult; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAC8B_inlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_pidlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pidlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_telim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->telim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vpidmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpidmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vpidmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpidmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAC8B_vtmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmult; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAC8B_factory() { - return new ExcAC8B; - } + + + + + + + + + + + + + + + + + + +const char ExcAC8B::debugName[] = "ExcAC8B"; +const char* ExcAC8B::debugString() const +{ + return ExcAC8B::debugName; } -void ExcAC8B::addConstructToMap(std::unordered_map& factory_map) { +void ExcAC8B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAC8B"), &ExcAC8B_factory)); } -void ExcAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAC8B.inlim"), &assign_ExcAC8B_inlim)); assign_map.insert(std::make_pair(std::string("cim:ExcAC8B.ka"), &assign_ExcAC8B_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcAC8B.kc"), &assign_ExcAC8B_kc)); @@ -429,13 +461,8 @@ void ExcAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAC8B::debugName[] = "ExcAC8B"; -const char* ExcAC8B::debugString() +void ExcAC8B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAC8B::debugName; } const BaseClassDefiner ExcAC8B::declare() @@ -443,4 +470,10 @@ const BaseClassDefiner ExcAC8B::declare() return BaseClassDefiner(ExcAC8B::addConstructToMap, ExcAC8B::addPrimitiveAssignFnsToMap, ExcAC8B::addClassAssignFnsToMap, ExcAC8B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAC8B_factory() + { + return new ExcAC8B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAC8B.hpp b/CGMES_2.4.15_27JAN2020/ExcAC8B.hpp index f6b50df1a..83af54d73 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAC8B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAC8B.hpp @@ -1,67 +1,68 @@ #ifndef ExcAC8B_H #define ExcAC8B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE AC8B alternator-supplied rectifier excitation system with speed input and input limiter. */ - class ExcAC8B: public ExcitationSystemDynamics + class ExcAC8B : public ExcitationSystemDynamics { - public: - CIMPP::Boolean inlim; /* Input limiter indicator. true = input limiter Vimax and Vimin is considered false = input limiter Vimax and Vimin is not considered. Typical Value = true. Default: false */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.55. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU kdr; /* Voltage regulator derivative gain (Kdr). Typical Value = 10. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 5. Default: nullptr */ - CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 80. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean pidlim; /* PID limiter indicator. true = input limiter Vpidmax and Vpidmin is considered false = input limiter Vpidmax and Vpidmin is not considered. Typical Value = true. Default: false */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve1]). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve2]). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdr; /* Lag time constant (Tdr). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.2. Default: nullptr */ - CIMPP::Boolean telim; /* Selector for the limiter on the block [1/sTe]. See diagram for meaning of true and false. Typical Value = false. Default: false */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve) equals V (Ve1). Typical Value = 6.5. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 9. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 6. Default: nullptr */ - CIMPP::PU vimax; /* Input signal maximum (Vimax). Typical Value = 35. Default: nullptr */ - CIMPP::PU vimin; /* Input signal minimum (Vimin). Typical Value = -10. Default: nullptr */ - CIMPP::PU vpidmax; /* PID maximum controller output (Vpidmax). Typical Value = 35. Default: nullptr */ - CIMPP::PU vpidmin; /* PID minimum controller output (Vpidmin). Typical Value = -10. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 35. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean vtmult; /* Multiply by generator`s terminal voltage indicator. true =the limits Vrmax and Vrmin are multiplied by the generator`s terminal voltage to represent a thyristor power stage fed from the generator terminals false = limits are not multiplied by generator`s terminal voltage. Typical Value = false. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAC8B(); - virtual ~ExcAC8B(); - + ~ExcAC8B() override; + + CIMPP::Boolean inlim; /* Input limiter indicator. true = input limiter Vimax and Vimin is considered false = input limiter Vimax and Vimin is not considered. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 1. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.55. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (Kd). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU kdr; /* Voltage regulator derivative gain (Kdr). Typical Value = 10. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 5. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 80. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean pidlim; /* PID limiter indicator. true = input limiter Vpidmax and Vpidmin is considered false = input limiter Vpidmax and Vpidmin is not considered. Typical Value = true. Default: false */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve1]). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve, back of commutating reactance (Se[Ve2]). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdr; /* Lag time constant (Tdr). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.2. Default: nullptr */ + CIMPP::Boolean telim; /* Selector for the limiter on the block [1/sTe]. See diagram for meaning of true and false. Typical Value = false. Default: false */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve) equals V (Ve1). Typical Value = 6.5. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve). Typical Value = 9. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (Vemin). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (Vfemax). Typical Value = 6. Default: nullptr */ + CIMPP::PU vimax; /* Input signal maximum (Vimax). Typical Value = 35. Default: nullptr */ + CIMPP::PU vimin; /* Input signal minimum (Vimin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vpidmax; /* PID maximum controller output (Vpidmax). Typical Value = 35. Default: nullptr */ + CIMPP::PU vpidmin; /* PID minimum controller output (Vpidmin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 35. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean vtmult; /* Multiply by generator`s terminal voltage indicator. true =the limits Vrmax and Vrmin are multiplied by the generator`s terminal voltage to represent a thyristor power stage fed from the generator terminals false = limits are not multiplied by generator`s terminal voltage. Typical Value = false. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAC8B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcANS.cpp b/CGMES_2.4.15_27JAN2020/ExcANS.cpp index a3aba3f57..5faf227b7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcANS.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcANS.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcANS.hpp" +#include +#include + +#include "Integer.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "Integer.hpp" +#include "Integer.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Integer.hpp" -#include "Integer.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Integer.hpp" -#include "Seconds.hpp" using namespace CIMPP; ExcANS::ExcANS() {}; - ExcANS::~ExcANS() {}; +bool assign_ExcANS_blint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->blint; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_ifmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_ifmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_krvecc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->krvecc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_kvfif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvfif; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcANS_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcANS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcANS_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcANS_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_blint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->blint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_kvfif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvfif; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_ifmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_ifmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_krvecc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->krvecc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcANS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcANS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcANS_factory() { - return new ExcANS; - } + + + + + + + + + + +const char ExcANS::debugName[] = "ExcANS"; +const char* ExcANS::debugString() const +{ + return ExcANS::debugName; } -void ExcANS::addConstructToMap(std::unordered_map& factory_map) { +void ExcANS::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcANS"), &ExcANS_factory)); } -void ExcANS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcANS.k3"), &assign_ExcANS_k3)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.k2"), &assign_ExcANS_k2)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.kce"), &assign_ExcANS_kce)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.t3"), &assign_ExcANS_t3)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.t2"), &assign_ExcANS_t2)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.t1"), &assign_ExcANS_t1)); +void ExcANS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcANS.blint"), &assign_ExcANS_blint)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.kvfif"), &assign_ExcANS_kvfif)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.ifmn"), &assign_ExcANS_ifmn)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.ifmx"), &assign_ExcANS_ifmx)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmn"), &assign_ExcANS_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmx"), &assign_ExcANS_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.k2"), &assign_ExcANS_k2)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.k3"), &assign_ExcANS_k3)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.kce"), &assign_ExcANS_kce)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.krvecc"), &assign_ExcANS_krvecc)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.kvfif"), &assign_ExcANS_kvfif)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.t1"), &assign_ExcANS_t1)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.t2"), &assign_ExcANS_t2)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.t3"), &assign_ExcANS_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcANS.tb"), &assign_ExcANS_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmn"), &assign_ExcANS_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcANS.vrmx"), &assign_ExcANS_vrmx)); } -void ExcANS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcANS::debugName[] = "ExcANS"; -const char* ExcANS::debugString() +void ExcANS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcANS::debugName; } const BaseClassDefiner ExcANS::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcANS::declare() return BaseClassDefiner(ExcANS::addConstructToMap, ExcANS::addPrimitiveAssignFnsToMap, ExcANS::addClassAssignFnsToMap, ExcANS::debugName); } - +namespace CIMPP +{ + BaseClass* ExcANS_factory() + { + return new ExcANS; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcANS.hpp b/CGMES_2.4.15_27JAN2020/ExcANS.hpp index ebf932391..3ab370692 100644 --- a/CGMES_2.4.15_27JAN2020/ExcANS.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcANS.hpp @@ -1,54 +1,55 @@ #ifndef ExcANS_H #define ExcANS_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system. It represents static field voltage or excitation current feedback excitation system. */ - class ExcANS: public ExcitationSystemDynamics + class ExcANS : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float k3; /* AVR gain (K). Typical Value = 1000. Default: nullptr */ - CIMPP::Simple_Float k2; /* Exciter gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::Simple_Float kce; /* Ceiling factor (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T). Typical Value = 1.6. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T). Typical Value = 20. Default: nullptr */ - CIMPP::Integer blint; /* Governor Control Flag (BLINT). 0 = lead-lag regulator 1 = proportional integral regulator. Typical Value = 0. Default: 0 */ - CIMPP::Integer kvfif; /* Rate feedback signal flag (K). 0 = output voltage of the exciter 1 = exciter field current. Typical Value = 0. Default: 0 */ - CIMPP::PU ifmn; /* Minimum exciter current (I). Typical Value = -5.2. Default: nullptr */ - CIMPP::PU ifmx; /* Maximum exciter current (I). Typical Value = 6.5. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -5.2. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 6.5. Default: nullptr */ - CIMPP::Integer krvecc; /* Feedback enabling (K). 0 = Open loop control 1 = Closed loop control. Typical Value = 1. Default: 0 */ - CIMPP::Seconds tb; /* Exciter time constant (T). Typical Value = 0.04. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcANS(); - virtual ~ExcANS(); - + ~ExcANS() override; + + CIMPP::Integer blint; /* Governor Control Flag (BLINT). 0 = lead-lag regulator 1 = proportional integral regulator. Typical Value = 0. Default: 0 */ + CIMPP::PU ifmn; /* Minimum exciter current (I). Typical Value = -5.2. Default: nullptr */ + CIMPP::PU ifmx; /* Maximum exciter current (I). Typical Value = 6.5. Default: nullptr */ + CIMPP::Simple_Float k2; /* Exciter gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::Simple_Float k3; /* AVR gain (K). Typical Value = 1000. Default: nullptr */ + CIMPP::Simple_Float kce; /* Ceiling factor (K). Typical Value = 1. Default: nullptr */ + CIMPP::Integer krvecc; /* Feedback enabling (K). 0 = Open loop control 1 = Closed loop control. Typical Value = 1. Default: 0 */ + CIMPP::Integer kvfif; /* Rate feedback signal flag (K). 0 = output voltage of the exciter 1 = exciter field current. Typical Value = 0. Default: 0 */ + CIMPP::Seconds t1; /* Time constant (T). Typical Value = 20. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T). Typical Value = 1.6. Default: nullptr */ + CIMPP::Seconds tb; /* Exciter time constant (T). Typical Value = 0.04. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -5.2. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 6.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcANS_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR1.cpp b/CGMES_2.4.15_27JAN2020/ExcAVR1.cpp index 3064751c8..e94acd57f 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR1.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR1.cpp @@ -1,216 +1,228 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR1.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" using namespace CIMPP; ExcAVR1::ExcAVR1() {}; - ExcAVR1::~ExcAVR1() {}; +bool assign_ExcAVR1_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR1_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR1_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR1_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR1_factory() { - return new ExcAVR1; - } + + + + + + + + + +const char ExcAVR1::debugName[] = "ExcAVR1"; +const char* ExcAVR1::debugString() const +{ + return ExcAVR1::debugName; } -void ExcAVR1::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR1"), &ExcAVR1_factory)); } -void ExcAVR1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e1"), &assign_ExcAVR1_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e2"), &assign_ExcAVR1_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.ka"), &assign_ExcAVR1_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmn"), &assign_ExcAVR1_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmx"), &assign_ExcAVR1_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.kf"), &assign_ExcAVR1_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se1"), &assign_ExcAVR1_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se2"), &assign_ExcAVR1_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.ta"), &assign_ExcAVR1_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.tb"), &assign_ExcAVR1_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.te"), &assign_ExcAVR1_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e1"), &assign_ExcAVR1_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se1"), &assign_ExcAVR1_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.e2"), &assign_ExcAVR1_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.se2"), &assign_ExcAVR1_se2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.kf"), &assign_ExcAVR1_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.tf"), &assign_ExcAVR1_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmn"), &assign_ExcAVR1_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR1.vrmx"), &assign_ExcAVR1_vrmx)); } -void ExcAVR1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR1::debugName[] = "ExcAVR1"; -const char* ExcAVR1::debugString() +void ExcAVR1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR1::debugName; } const BaseClassDefiner ExcAVR1::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner ExcAVR1::declare() return BaseClassDefiner(ExcAVR1::addConstructToMap, ExcAVR1::addPrimitiveAssignFnsToMap, ExcAVR1::addClassAssignFnsToMap, ExcAVR1::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR1_factory() + { + return new ExcAVR1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR1.hpp b/CGMES_2.4.15_27JAN2020/ExcAVR1.hpp index 41fed73ef..ae8f6209d 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR1.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR1.hpp @@ -1,51 +1,52 @@ #ifndef ExcAVR1_H #define ExcAVR1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system corresponding to IEEE (1968) Type 1 Model. It represents exciter dynamo and electromechanical regulator. */ - class ExcAVR1: public ExcitationSystemDynamics + class ExcAVR1 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ - CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds tf; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR1(); - virtual ~ExcAVR1(); - + ~ExcAVR1() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ + CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ + CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR2.cpp b/CGMES_2.4.15_27JAN2020/ExcAVR2.cpp index f5f25823a..30734b84e 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR2.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR2.cpp @@ -1,31 +1,199 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR2.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAVR2::ExcAVR2() {}; - ExcAVR2::~ExcAVR2() {}; +bool assign_ExcAVR2_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcAVR2_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR2_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR2_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +205,40 @@ ExcAVR2::~ExcAVR2() {}; -bool assign_ExcAVR2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR2_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR2_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR2_factory() { - return new ExcAVR2; - } + +const char ExcAVR2::debugName[] = "ExcAVR2"; +const char* ExcAVR2::debugString() const +{ + return ExcAVR2::debugName; } -void ExcAVR2::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR2"), &ExcAVR2_factory)); } -void ExcAVR2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e1"), &assign_ExcAVR2_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e2"), &assign_ExcAVR2_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.ka"), &assign_ExcAVR2_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmn"), &assign_ExcAVR2_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmx"), &assign_ExcAVR2_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.kf"), &assign_ExcAVR2_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se1"), &assign_ExcAVR2_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se2"), &assign_ExcAVR2_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.ta"), &assign_ExcAVR2_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.tb"), &assign_ExcAVR2_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.te"), &assign_ExcAVR2_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e1"), &assign_ExcAVR2_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se1"), &assign_ExcAVR2_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.e2"), &assign_ExcAVR2_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.se2"), &assign_ExcAVR2_se2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.kf"), &assign_ExcAVR2_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.tf1"), &assign_ExcAVR2_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.tf2"), &assign_ExcAVR2_tf2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmn"), &assign_ExcAVR2_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR2.vrmx"), &assign_ExcAVR2_vrmx)); } -void ExcAVR2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR2::debugName[] = "ExcAVR2"; -const char* ExcAVR2::debugString() +void ExcAVR2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR2::debugName; } const BaseClassDefiner ExcAVR2::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner ExcAVR2::declare() return BaseClassDefiner(ExcAVR2::addConstructToMap, ExcAVR2::addPrimitiveAssignFnsToMap, ExcAVR2::addClassAssignFnsToMap, ExcAVR2::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR2_factory() + { + return new ExcAVR2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR2.hpp b/CGMES_2.4.15_27JAN2020/ExcAVR2.hpp index cd4668ea7..56bcf98fc 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR2.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR2.hpp @@ -1,52 +1,53 @@ #ifndef ExcAVR2_H #define ExcAVR2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system corresponding to IEEE (1968) Type 2 Model. It represents alternator and rotating diodes and electromechanic voltage regulators. */ - class ExcAVR2: public ExcitationSystemDynamics + class ExcAVR2 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ - CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds tf1; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf2; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR2(); - virtual ~ExcAVR2(); - + ~ExcAVR2() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 500. Default: nullptr */ + CIMPP::Simple_Float kf; /* Rate feedback gain (K). Typical Value = 0.02. Default: nullptr */ + CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* AVR time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf1; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf2; /* Rate feedback time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -6. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR3.cpp b/CGMES_2.4.15_27JAN2020/ExcAVR3.cpp index c055a262b..bec98de59 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR3.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR3.cpp @@ -1,216 +1,228 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR3.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcAVR3::ExcAVR3() {}; - ExcAVR3::~ExcAVR3() {}; +bool assign_ExcAVR3_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR3_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR3_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR3_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR3_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR3_factory() { - return new ExcAVR3; - } + + + + + + + + + +const char ExcAVR3::debugName[] = "ExcAVR3"; +const char* ExcAVR3::debugString() const +{ + return ExcAVR3::debugName; } -void ExcAVR3::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR3"), &ExcAVR3_factory)); } -void ExcAVR3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e1"), &assign_ExcAVR3_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e2"), &assign_ExcAVR3_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.ka"), &assign_ExcAVR3_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmn"), &assign_ExcAVR3_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmx"), &assign_ExcAVR3_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se1"), &assign_ExcAVR3_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se2"), &assign_ExcAVR3_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t1"), &assign_ExcAVR3_t1)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t2"), &assign_ExcAVR3_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t3"), &assign_ExcAVR3_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.t4"), &assign_ExcAVR3_t4)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.te"), &assign_ExcAVR3_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e1"), &assign_ExcAVR3_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se1"), &assign_ExcAVR3_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.e2"), &assign_ExcAVR3_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.se2"), &assign_ExcAVR3_se2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmn"), &assign_ExcAVR3_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR3.vrmx"), &assign_ExcAVR3_vrmx)); } -void ExcAVR3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR3::debugName[] = "ExcAVR3"; -const char* ExcAVR3::debugString() +void ExcAVR3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR3::debugName; } const BaseClassDefiner ExcAVR3::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner ExcAVR3::declare() return BaseClassDefiner(ExcAVR3::addConstructToMap, ExcAVR3::addPrimitiveAssignFnsToMap, ExcAVR3::addClassAssignFnsToMap, ExcAVR3::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR3_factory() + { + return new ExcAVR3; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR3.hpp b/CGMES_2.4.15_27JAN2020/ExcAVR3.hpp index b5f7cf86f..a3238d239 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR3.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR3.hpp @@ -1,51 +1,52 @@ #ifndef ExcAVR3_H #define ExcAVR3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian excitation system. It represents exciter dynamo and electric regulator. */ - class ExcAVR3: public ExcitationSystemDynamics + class ExcAVR3 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 3000. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -7.5. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7.5. Default: nullptr */ - CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 220. Default: nullptr */ - CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.6. Default: nullptr */ - CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0.66. Default: nullptr */ - CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0.07. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR3(); - virtual ~ExcAVR3(); - + ~ExcAVR3() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 3.14. Default: nullptr */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 3000. Default: nullptr */ + CIMPP::Simple_Float se1; /* Saturation factor at E1 (S(E1)). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float se2; /* Saturation factor at E2 (S(E2)). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 220. Default: nullptr */ + CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.6. Default: nullptr */ + CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0.66. Default: nullptr */ + CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0.07. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = -7.5. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 7.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR3_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR4.cpp b/CGMES_2.4.15_27JAN2020/ExcAVR4.cpp index f68040704..1c70c9f5a 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR4.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR4.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR4.hpp" +#include +#include + +#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcAVR4::ExcAVR4() {}; - ExcAVR4::~ExcAVR4() {}; +bool assign_ExcAVR4_imul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_kif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kif; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t1if(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1if; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_tif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tif; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vfmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vfmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR4_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR4_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_vrmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_vrmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR4_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_vfmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_vfmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_kif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kif; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_tif(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tif; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_t1if(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1if; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcAVR4_imul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcAVR4_factory() { - return new ExcAVR4; - } + + + + + + + + + + +const char ExcAVR4::debugName[] = "ExcAVR4"; +const char* ExcAVR4::debugString() const +{ + return ExcAVR4::debugName; } -void ExcAVR4::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR4"), &ExcAVR4_factory)); } -void ExcAVR4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.imul"), &assign_ExcAVR4_imul)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.ka"), &assign_ExcAVR4_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmn"), &assign_ExcAVR4_vrmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmx"), &assign_ExcAVR4_vrmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.ke"), &assign_ExcAVR4_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.kif"), &assign_ExcAVR4_kif)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t1"), &assign_ExcAVR4_t1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t1if"), &assign_ExcAVR4_t1if)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t2"), &assign_ExcAVR4_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t3"), &assign_ExcAVR4_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t4"), &assign_ExcAVR4_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.ke"), &assign_ExcAVR4_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmx"), &assign_ExcAVR4_vfmx)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmn"), &assign_ExcAVR4_vfmn)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.kif"), &assign_ExcAVR4_kif)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.tif"), &assign_ExcAVR4_tif)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.t1if"), &assign_ExcAVR4_t1if)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.imul"), &assign_ExcAVR4_imul)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmn"), &assign_ExcAVR4_vfmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vfmx"), &assign_ExcAVR4_vfmx)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmn"), &assign_ExcAVR4_vrmn)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR4.vrmx"), &assign_ExcAVR4_vrmx)); } -void ExcAVR4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR4::debugName[] = "ExcAVR4"; -const char* ExcAVR4::debugString() +void ExcAVR4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR4::debugName; } const BaseClassDefiner ExcAVR4::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcAVR4::declare() return BaseClassDefiner(ExcAVR4::addConstructToMap, ExcAVR4::addPrimitiveAssignFnsToMap, ExcAVR4::addClassAssignFnsToMap, ExcAVR4::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR4_factory() + { + return new ExcAVR4; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR4.hpp b/CGMES_2.4.15_27JAN2020/ExcAVR4.hpp index ec3bb11da..adb83a2fe 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR4.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR4.hpp @@ -1,54 +1,55 @@ #ifndef ExcAVR4_H #define ExcAVR4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "Simple_Float.hpp" +namespace CIMPP +{ /* Italian excitation system. It represents static exciter and electric voltage regulator. */ - class ExcAVR4: public ExcitationSystemDynamics + class ExcAVR4 : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 300. Default: nullptr */ - CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 4.8. Default: nullptr */ - CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ke; /* Exciter gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU vfmx; /* Maximum exciter output (V). Typical Value = 5. Default: nullptr */ - CIMPP::PU vfmn; /* Minimum exciter output (V). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float kif; /* Exciter internal reactance (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tif; /* Exciter current feedback time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1if; /* Exciter current feedback time constant (T). Typical Value = 60. Default: nullptr */ - CIMPP::Boolean imul; /* AVR output voltage dependency selector (Imul). true = selector is connected false = selector is not connected. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR4(); - virtual ~ExcAVR4(); - + ~ExcAVR4() override; + + CIMPP::Boolean imul; /* AVR output voltage dependency selector (Imul). true = selector is connected false = selector is not connected. Typical Value = true. Default: false */ + CIMPP::Simple_Float ka; /* AVR gain (K). Typical Value = 300. Default: nullptr */ + CIMPP::Simple_Float ke; /* Exciter gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float kif; /* Exciter internal reactance (K). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t1; /* AVR time constant (T). Typical Value = 4.8. Default: nullptr */ + CIMPP::Seconds t1if; /* Exciter current feedback time constant (T). Typical Value = 60. Default: nullptr */ + CIMPP::Seconds t2; /* AVR time constant (T). Typical Value = 1.5. Default: nullptr */ + CIMPP::Seconds t3; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t4; /* AVR time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tif; /* Exciter current feedback time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfmn; /* Minimum exciter output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfmx; /* Maximum exciter output (V). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmn; /* Maximum AVR output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmx; /* Minimum AVR output (V). Typical Value = 5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR4_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR5.cpp b/CGMES_2.4.15_27JAN2020/ExcAVR5.cpp index 1036f58fa..0232b8142 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR5.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR5.cpp @@ -1,81 +1,84 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR5.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcAVR5::ExcAVR5() {}; - ExcAVR5::~ExcAVR5() {}; +bool assign_ExcAVR5_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR5_rex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rex; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR5_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR5_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR5_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR5_rex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rex; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAVR5_factory() { - return new ExcAVR5; - } +const char ExcAVR5::debugName[] = "ExcAVR5"; +const char* ExcAVR5::debugString() const +{ + return ExcAVR5::debugName; } -void ExcAVR5::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR5::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR5"), &ExcAVR5_factory)); } -void ExcAVR5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcAVR5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.ka"), &assign_ExcAVR5_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.ta"), &assign_ExcAVR5_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.rex"), &assign_ExcAVR5_rex)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR5.ta"), &assign_ExcAVR5_ta)); } -void ExcAVR5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR5::debugName[] = "ExcAVR5"; -const char* ExcAVR5::debugString() +void ExcAVR5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR5::debugName; } const BaseClassDefiner ExcAVR5::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner ExcAVR5::declare() return BaseClassDefiner(ExcAVR5::addConstructToMap, ExcAVR5::addPrimitiveAssignFnsToMap, ExcAVR5::addClassAssignFnsToMap, ExcAVR5::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR5_factory() + { + return new ExcAVR5; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR5.hpp b/CGMES_2.4.15_27JAN2020/ExcAVR5.hpp index 26d4e1b1f..53cfd5ee7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR5.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR5.hpp @@ -1,41 +1,42 @@ #ifndef ExcAVR5_H #define ExcAVR5_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Manual excitation control with field circuit resistance. This model can be used as a very simple representation of manual voltage control. */ - class ExcAVR5: public ExcitationSystemDynamics + class ExcAVR5 : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Gain (Ka). Default: nullptr */ - CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ - CIMPP::PU rex; /* Effective Output Resistance (Rex). Rex represents the effective output resistance seen by the excitation system. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR5(); - virtual ~ExcAVR5(); - + ~ExcAVR5() override; + + CIMPP::PU ka; /* Gain (Ka). Default: nullptr */ + CIMPP::PU rex; /* Effective Output Resistance (Rex). Rex represents the effective output resistance seen by the excitation system. Default: nullptr */ + CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR5_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR7.cpp b/CGMES_2.4.15_27JAN2020/ExcAVR7.cpp index 7c6ee5455..0933e6aa5 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR7.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR7.cpp @@ -1,12 +1,15 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcAVR7.hpp" +#include +#include + +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -14,338 +17,356 @@ #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcAVR7::ExcAVR7() {}; - ExcAVR7::~ExcAVR7() {}; +bool assign_ExcAVR7_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmax3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmax5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmin1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmin3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcAVR7_vmin5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcAVR7_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmin1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmax3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmin3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmax5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcAVR7_vmin5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcAVR7* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcAVR7_factory() { - return new ExcAVR7; - } +const char ExcAVR7::debugName[] = "ExcAVR7"; +const char* ExcAVR7::debugString() const +{ + return ExcAVR7::debugName; } -void ExcAVR7::addConstructToMap(std::unordered_map& factory_map) { +void ExcAVR7::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcAVR7"), &ExcAVR7_factory)); } -void ExcAVR7::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k1"), &assign_ExcAVR7_k1)); +void ExcAVR7::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a1"), &assign_ExcAVR7_a1)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a2"), &assign_ExcAVR7_a2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t1"), &assign_ExcAVR7_t1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t2"), &assign_ExcAVR7_t2)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax1"), &assign_ExcAVR7_vmax1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin1"), &assign_ExcAVR7_vmin1)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k3"), &assign_ExcAVR7_k3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a3"), &assign_ExcAVR7_a3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a4"), &assign_ExcAVR7_a4)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t3"), &assign_ExcAVR7_t3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t4"), &assign_ExcAVR7_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax3"), &assign_ExcAVR7_vmax3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin3"), &assign_ExcAVR7_vmin3)); - assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k5"), &assign_ExcAVR7_k5)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a5"), &assign_ExcAVR7_a5)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.a6"), &assign_ExcAVR7_a6)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k1"), &assign_ExcAVR7_k1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k3"), &assign_ExcAVR7_k3)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.k5"), &assign_ExcAVR7_k5)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t1"), &assign_ExcAVR7_t1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t2"), &assign_ExcAVR7_t2)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t3"), &assign_ExcAVR7_t3)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t4"), &assign_ExcAVR7_t4)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t5"), &assign_ExcAVR7_t5)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.t6"), &assign_ExcAVR7_t6)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax1"), &assign_ExcAVR7_vmax1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax3"), &assign_ExcAVR7_vmax3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmax5"), &assign_ExcAVR7_vmax5)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin1"), &assign_ExcAVR7_vmin1)); + assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin3"), &assign_ExcAVR7_vmin3)); assign_map.insert(std::make_pair(std::string("cim:ExcAVR7.vmin5"), &assign_ExcAVR7_vmin5)); } -void ExcAVR7::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcAVR7::debugName[] = "ExcAVR7"; -const char* ExcAVR7::debugString() +void ExcAVR7::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcAVR7::debugName; } const BaseClassDefiner ExcAVR7::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner ExcAVR7::declare() return BaseClassDefiner(ExcAVR7::addConstructToMap, ExcAVR7::addPrimitiveAssignFnsToMap, ExcAVR7::addClassAssignFnsToMap, ExcAVR7::debugName); } - +namespace CIMPP +{ + BaseClass* ExcAVR7_factory() + { + return new ExcAVR7; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcAVR7.hpp b/CGMES_2.4.15_27JAN2020/ExcAVR7.hpp index 0edf51f18..998268aa7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcAVR7.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcAVR7.hpp @@ -1,59 +1,60 @@ #ifndef ExcAVR7_H #define ExcAVR7_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IVO excitation system. */ - class ExcAVR7: public ExcitationSystemDynamics + class ExcAVR7 : public ExcitationSystemDynamics { - public: - CIMPP::PU k1; /* Gain (K1). Typical Value = 1. Default: nullptr */ - CIMPP::PU a1; /* Lead coefficient (A1). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU a2; /* Lag coefficient (A2). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t1; /* Lead time constant (T1). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t2; /* Lag time constant (T2). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vmax1; /* Lead-lag max. limit (Vmax1). Typical Value = 5. Default: nullptr */ - CIMPP::PU vmin1; /* Lead-lag min. limit (Vmin1). Typical Value = -5. Default: nullptr */ - CIMPP::PU k3; /* Gain (K3). Typical Value = 3. Default: nullptr */ - CIMPP::PU a3; /* Lead coefficient (A3). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU a4; /* Lag coefficient (A4). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t3; /* Lead time constant (T3). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4; /* Lag time constant (T4). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vmax3; /* Lead-lag max. limit (Vmax3). Typical Value = 5. Default: nullptr */ - CIMPP::PU vmin3; /* Lead-lag min. limit (Vmin3). Typical Value = -5. Default: nullptr */ - CIMPP::PU k5; /* Gain (K5). Typical Value = 1. Default: nullptr */ - CIMPP::PU a5; /* Lead coefficient (A5). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU a6; /* Lag coefficient (A6). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t5; /* Lead time constant (T5). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t6; /* Lag time constant (T6). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vmax5; /* Lead-lag max. limit (Vmax5). Typical Value = 5. Default: nullptr */ - CIMPP::PU vmin5; /* Lead-lag min. limit (Vmin5). Typical Value = -2. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcAVR7(); - virtual ~ExcAVR7(); - + ~ExcAVR7() override; + + CIMPP::PU a1; /* Lead coefficient (A1). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a2; /* Lag coefficient (A2). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a3; /* Lead coefficient (A3). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a4; /* Lag coefficient (A4). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a5; /* Lead coefficient (A5). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU a6; /* Lag coefficient (A6). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU k1; /* Gain (K1). Typical Value = 1. Default: nullptr */ + CIMPP::PU k3; /* Gain (K3). Typical Value = 3. Default: nullptr */ + CIMPP::PU k5; /* Gain (K5). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t1; /* Lead time constant (T1). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t2; /* Lag time constant (T2). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3; /* Lead time constant (T3). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Lag time constant (T4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t5; /* Lead time constant (T5). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t6; /* Lag time constant (T6). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vmax1; /* Lead-lag max. limit (Vmax1). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmax3; /* Lead-lag max. limit (Vmax3). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmax5; /* Lead-lag max. limit (Vmax5). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmin1; /* Lead-lag min. limit (Vmin1). Typical Value = -5. Default: nullptr */ + CIMPP::PU vmin3; /* Lead-lag min. limit (Vmin3). Typical Value = -5. Default: nullptr */ + CIMPP::PU vmin5; /* Lead-lag min. limit (Vmin5). Typical Value = -2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcAVR7_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcBBC.cpp b/CGMES_2.4.15_27JAN2020/ExcBBC.cpp index 8763915c3..e78e0f2d7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcBBC.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcBBC.cpp @@ -1,7 +1,15 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcBBC.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "Boolean.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -9,193 +17,196 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcBBC::ExcBBC() {}; - ExcBBC::~ExcBBC() {}; +bool assign_ExcBBC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_switch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->_switch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcBBC_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcBBC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcBBC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcBBC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcBBC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcBBC_switch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcBBC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->_switch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcBBC_factory() { - return new ExcBBC; - } + + + + + + + + + +const char ExcBBC::debugName[] = "ExcBBC"; +const char* ExcBBC::debugString() const +{ + return ExcBBC::debugName; } -void ExcBBC::addConstructToMap(std::unordered_map& factory_map) { +void ExcBBC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcBBC"), &ExcBBC_factory)); } -void ExcBBC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcBBC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmax"), &assign_ExcBBC_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmin"), &assign_ExcBBC_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.k"), &assign_ExcBBC_k)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.switch"), &assign_ExcBBC_switch)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t1"), &assign_ExcBBC_t1)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t2"), &assign_ExcBBC_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t3"), &assign_ExcBBC_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.t4"), &assign_ExcBBC_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.k"), &assign_ExcBBC_k)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.vrmin"), &assign_ExcBBC_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.vrmax"), &assign_ExcBBC_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmin"), &assign_ExcBBC_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.efdmax"), &assign_ExcBBC_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcBBC.vrmin"), &assign_ExcBBC_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcBBC.xe"), &assign_ExcBBC_xe)); - assign_map.insert(std::make_pair(std::string("cim:ExcBBC.switch"), &assign_ExcBBC_switch)); } -void ExcBBC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcBBC::debugName[] = "ExcBBC"; -const char* ExcBBC::debugString() +void ExcBBC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcBBC::debugName; } const BaseClassDefiner ExcBBC::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner ExcBBC::declare() return BaseClassDefiner(ExcBBC::addConstructToMap, ExcBBC::addPrimitiveAssignFnsToMap, ExcBBC::addClassAssignFnsToMap, ExcBBC::debugName); } - +namespace CIMPP +{ + BaseClass* ExcBBC_factory() + { + return new ExcBBC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcBBC.hpp b/CGMES_2.4.15_27JAN2020/ExcBBC.hpp index 379cec722..2878ad4ff 100644 --- a/CGMES_2.4.15_27JAN2020/ExcBBC.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcBBC.hpp @@ -1,50 +1,51 @@ #ifndef ExcBBC_H #define ExcBBC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Transformer fed static excitation system (static with ABB regulator). This model represents a static excitation system in which a gated thyristor bridge fed by a transformer at the main generator terminals feeds the main generator directly. */ - class ExcBBC: public ExcitationSystemDynamics + class ExcBBC : public ExcitationSystemDynamics { - public: - CIMPP::Seconds t1; /* Controller time constant (T1). Typical Value = 6. Default: nullptr */ - CIMPP::Seconds t2; /* Controller time constant (T2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU k; /* Steady state gain (K). Typical Value = 300. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum control element output (Vrmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum control element output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU efdmin; /* Minimum open circuit exciter voltage (Efdmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum open circuit exciter voltage (Efdmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU xe; /* Effective excitation transformer reactance (Xe). Typical Value = 0.05. Default: nullptr */ - CIMPP::Boolean _switch; /* Supplementary signal routing selector (switch). true = Vs connected to 3rd summing point false = Vs connected to 1st summing point (see diagram). Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcBBC(); - virtual ~ExcBBC(); - + ~ExcBBC() override; + + CIMPP::PU efdmax; /* Maximum open circuit exciter voltage (Efdmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU efdmin; /* Minimum open circuit exciter voltage (Efdmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU k; /* Steady state gain (K). Typical Value = 300. Default: nullptr */ + CIMPP::Boolean _switch; /* Supplementary signal routing selector (switch). true = Vs connected to 3rd summing point false = Vs connected to 1st summing point (see diagram). Typical Value = true. Default: false */ + CIMPP::Seconds t1; /* Controller time constant (T1). Typical Value = 6. Default: nullptr */ + CIMPP::Seconds t2; /* Controller time constant (T2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum control element output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum control element output (Vrmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU xe; /* Effective excitation transformer reactance (Xe). Typical Value = 0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcBBC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcCZ.cpp b/CGMES_2.4.15_27JAN2020/ExcCZ.cpp index 6bf344d51..672a78e76 100644 --- a/CGMES_2.4.15_27JAN2020/ExcCZ.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcCZ.cpp @@ -1,186 +1,196 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcCZ.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcCZ::ExcCZ() {}; - ExcCZ::~ExcCZ() {}; +bool assign_ExcCZ_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcCZ_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcCZ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcCZ_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcCZ_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcCZ_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcCZ_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcCZ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcCZ_factory() { - return new ExcCZ; - } + + + +const char ExcCZ::debugName[] = "ExcCZ"; +const char* ExcCZ::debugString() const +{ + return ExcCZ::debugName; } -void ExcCZ::addConstructToMap(std::unordered_map& factory_map) { +void ExcCZ::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcCZ"), &ExcCZ_factory)); } -void ExcCZ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcCZ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmax"), &assign_ExcCZ_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmin"), &assign_ExcCZ_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ka"), &assign_ExcCZ_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ke"), &assign_ExcCZ_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.kp"), &assign_ExcCZ_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ta"), &assign_ExcCZ_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.tc"), &assign_ExcCZ_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcCZ.te"), &assign_ExcCZ_te)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.vrmax"), &assign_ExcCZ_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcCZ.vrmin"), &assign_ExcCZ_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ka"), &assign_ExcCZ_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ta"), &assign_ExcCZ_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.ke"), &assign_ExcCZ_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.te"), &assign_ExcCZ_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmax"), &assign_ExcCZ_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcCZ.efdmin"), &assign_ExcCZ_efdmin)); } -void ExcCZ::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcCZ::debugName[] = "ExcCZ"; -const char* ExcCZ::debugString() +void ExcCZ::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcCZ::debugName; } const BaseClassDefiner ExcCZ::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner ExcCZ::declare() return BaseClassDefiner(ExcCZ::addConstructToMap, ExcCZ::addPrimitiveAssignFnsToMap, ExcCZ::addClassAssignFnsToMap, ExcCZ::debugName); } - +namespace CIMPP +{ + BaseClass* ExcCZ_factory() + { + return new ExcCZ; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcCZ.hpp b/CGMES_2.4.15_27JAN2020/ExcCZ.hpp index 145ad1bdd..31978efcc 100644 --- a/CGMES_2.4.15_27JAN2020/ExcCZ.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcCZ.hpp @@ -1,48 +1,49 @@ #ifndef ExcCZ_H #define ExcCZ_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Czech Proportion/Integral Exciter. */ - class ExcCZ: public ExcitationSystemDynamics + class ExcCZ : public ExcitationSystemDynamics { - public: - CIMPP::PU kp; /* Regulator proportional gain (Kp). Default: nullptr */ - CIMPP::Seconds tc; /* Regulator integral time constant (Tc). Default: nullptr */ - CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Default: nullptr */ - CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Default: nullptr */ - CIMPP::PU ka; /* Regulator gain (Ka). Default: nullptr */ - CIMPP::Seconds ta; /* Regulator time constant (Ta). Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Default: nullptr */ - CIMPP::PU efdmax; /* Exciter output maximum limit (Efdmax). Default: nullptr */ - CIMPP::PU efdmin; /* Exciter output minimum limit (Efdmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcCZ(); - virtual ~ExcCZ(); - + ~ExcCZ() override; + + CIMPP::PU efdmax; /* Exciter output maximum limit (Efdmax). Default: nullptr */ + CIMPP::PU efdmin; /* Exciter output minimum limit (Efdmin). Default: nullptr */ + CIMPP::PU ka; /* Regulator gain (Ka). Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Default: nullptr */ + CIMPP::PU kp; /* Regulator proportional gain (Kp). Default: nullptr */ + CIMPP::Seconds ta; /* Regulator time constant (Ta). Default: nullptr */ + CIMPP::Seconds tc; /* Regulator integral time constant (Tc). Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Default: nullptr */ + CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Default: nullptr */ + CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcCZ_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcDC1A.cpp b/CGMES_2.4.15_27JAN2020/ExcDC1A.cpp index 522a9016d..f8cf51244 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC1A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC1A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcDC1A::ExcDC1A() {}; - ExcDC1A::~ExcDC1A() {}; +bool assign_ExcDC1A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->edfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC1A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->edfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcDC1A_factory() { - return new ExcDC1A; - } +const char ExcDC1A::debugName[] = "ExcDC1A"; +const char* ExcDC1A::debugString() const +{ + return ExcDC1A::debugName; } -void ExcDC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC1A"), &ExcDC1A_factory)); } -void ExcDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.edfmax"), &assign_ExcDC1A_edfmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd1"), &assign_ExcDC1A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd2"), &assign_ExcDC1A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efdmin"), &assign_ExcDC1A_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.exclim"), &assign_ExcDC1A_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ka"), &assign_ExcDC1A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ke"), &assign_ExcDC1A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.kf"), &assign_ExcDC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ks"), &assign_ExcDC1A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd1"), &assign_ExcDC1A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd2"), &assign_ExcDC1A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ta"), &assign_ExcDC1A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.tb"), &assign_ExcDC1A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.tc"), &assign_ExcDC1A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmax"), &assign_ExcDC1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmin"), &assign_ExcDC1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.ke"), &assign_ExcDC1A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.te"), &assign_ExcDC1A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.kf"), &assign_ExcDC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.tf"), &assign_ExcDC1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd1"), &assign_ExcDC1A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd1"), &assign_ExcDC1A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efd2"), &assign_ExcDC1A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.seefd2"), &assign_ExcDC1A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.exclim"), &assign_ExcDC1A_exclim)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.efdmin"), &assign_ExcDC1A_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.edfmax"), &assign_ExcDC1A_edfmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmax"), &assign_ExcDC1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC1A.vrmin"), &assign_ExcDC1A_vrmin)); } -void ExcDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC1A::debugName[] = "ExcDC1A"; -const char* ExcDC1A::debugString() +void ExcDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC1A::debugName; } const BaseClassDefiner ExcDC1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcDC1A::declare() return BaseClassDefiner(ExcDC1A::addConstructToMap, ExcDC1A::addPrimitiveAssignFnsToMap, ExcDC1A::addClassAssignFnsToMap, ExcDC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC1A_factory() + { + return new ExcDC1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcDC1A.hpp b/CGMES_2.4.15_27JAN2020/ExcDC1A.hpp index e6e48e170..d18025cc9 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC1A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC1A.hpp @@ -1,58 +1,59 @@ #ifndef ExcDC1A_H #define ExcDC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE DC1A direct current commutator exciter with speed input and without underexcitation limiters (UEL) inputs. */ - class ExcDC1A: public ExcitationSystemDynamics + class ExcDC1A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 46. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.06. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.46. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.1. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.3. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ - CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC1A(); - virtual ~ExcDC1A(); - + ~ExcDC1A() override; + + CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.1. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.3. Default: nullptr */ + CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 46. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.33. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.06. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.46. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcDC2A.cpp b/CGMES_2.4.15_27JAN2020/ExcDC2A.cpp index 900c9922f..0dc85256f 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC2A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC2A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC2A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Boolean.hpp" #include "Boolean.hpp" using namespace CIMPP; ExcDC2A::ExcDC2A() {}; - ExcDC2A::~ExcDC2A() {}; +bool assign_ExcDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC2A_vtlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC2A_vtlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcDC2A_factory() { - return new ExcDC2A; - } +const char ExcDC2A::debugName[] = "ExcDC2A"; +const char* ExcDC2A::debugString() const +{ + return ExcDC2A::debugName; } -void ExcDC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC2A"), &ExcDC2A_factory)); } -void ExcDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd1"), &assign_ExcDC2A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd2"), &assign_ExcDC2A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.exclim"), &assign_ExcDC2A_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ka"), &assign_ExcDC2A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ke"), &assign_ExcDC2A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.kf"), &assign_ExcDC2A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ks"), &assign_ExcDC2A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd1"), &assign_ExcDC2A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd2"), &assign_ExcDC2A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ta"), &assign_ExcDC2A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tb"), &assign_ExcDC2A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tc"), &assign_ExcDC2A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmax"), &assign_ExcDC2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmin"), &assign_ExcDC2A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.ke"), &assign_ExcDC2A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.te"), &assign_ExcDC2A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.kf"), &assign_ExcDC2A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tf"), &assign_ExcDC2A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.tf1"), &assign_ExcDC2A_tf1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd1"), &assign_ExcDC2A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd1"), &assign_ExcDC2A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.efd2"), &assign_ExcDC2A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.seefd2"), &assign_ExcDC2A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.exclim"), &assign_ExcDC2A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmax"), &assign_ExcDC2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vrmin"), &assign_ExcDC2A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcDC2A.vtlim"), &assign_ExcDC2A_vtlim)); } -void ExcDC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC2A::debugName[] = "ExcDC2A"; -const char* ExcDC2A::debugString() +void ExcDC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC2A::debugName; } const BaseClassDefiner ExcDC2A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcDC2A::declare() return BaseClassDefiner(ExcDC2A::addConstructToMap, ExcDC2A::addPrimitiveAssignFnsToMap, ExcDC2A::addClassAssignFnsToMap, ExcDC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC2A_factory() + { + return new ExcDC2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcDC2A.hpp b/CGMES_2.4.15_27JAN2020/ExcDC2A.hpp index c9b7870fe..143921a50 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC2A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC2A.hpp @@ -1,58 +1,59 @@ #ifndef ExcDC2A_H #define ExcDC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE DC2A direct current commutator exciters with speed input, one more leg block in feedback loop and without underexcitation limiters (UEL) inputs. DC type 2 excitation system model with added speed multiplier, added lead-lag, and voltage-dependent limits. */ - class ExcDC2A: public ExcitationSystemDynamics + class ExcDC2A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.95. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). If Ke is entered as zero, the model calculates an effective value of Ke such that the initial condition value of Vr is zero. The zero value of Ke is not changed. If Ke is entered as non-zero, its value is used directly, without change. Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.33. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ - CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 0. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.05. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.279. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.29. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.117. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::Boolean vtlim; /* (Vtlim). true = limiter at the block [Ka/(1+sTa)] is dependent on Vt false = limiter at the block is not dependent on Vt. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC2A(); - virtual ~ExcDC2A(); - + ~ExcDC2A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 3.05. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 2.29. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). If Ke is entered as zero, the model calculates an effective value of Ke such that the initial condition value of Vr is zero. The zero value of Ke is not changed. If Ke is entered as non-zero, its value is used directly, without change. Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.279. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.117. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.33. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ + CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (Tf1). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.95. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.9. Default: nullptr */ + CIMPP::Boolean vtlim; /* (Vtlim). true = limiter at the block [Ka/(1+sTa)] is dependent on Vt false = limiter at the block is not dependent on Vt. Typical Value = true. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcDC3A.cpp b/CGMES_2.4.15_27JAN2020/ExcDC3A.cpp index f70b0dd69..77fa53c3e 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC3A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC3A.cpp @@ -1,276 +1,292 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC3A.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcDC3A::ExcDC3A() {}; - ExcDC3A::~ExcDC3A() {}; +bool assign_ExcDC3A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->edfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_edfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->edfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A_efdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcDC3A_factory() { - return new ExcDC3A; - } +const char ExcDC3A::debugName[] = "ExcDC3A"; +const char* ExcDC3A::debugString() const +{ + return ExcDC3A::debugName; } -void ExcDC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC3A"), &ExcDC3A_factory)); } -void ExcDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.trh"), &assign_ExcDC3A_trh)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ks"), &assign_ExcDC3A_ks)); +void ExcDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.edfmax"), &assign_ExcDC3A_edfmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd1"), &assign_ExcDC3A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd2"), &assign_ExcDC3A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdlim"), &assign_ExcDC3A_efdlim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdmin"), &assign_ExcDC3A_efdmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.exclim"), &assign_ExcDC3A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ke"), &assign_ExcDC3A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.kr"), &assign_ExcDC3A_kr)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ks"), &assign_ExcDC3A_ks)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.kv"), &assign_ExcDC3A_kv)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmax"), &assign_ExcDC3A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmin"), &assign_ExcDC3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.te"), &assign_ExcDC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.ke"), &assign_ExcDC3A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd1"), &assign_ExcDC3A_efd1)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.seefd1"), &assign_ExcDC3A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efd2"), &assign_ExcDC3A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.seefd2"), &assign_ExcDC3A_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.exclim"), &assign_ExcDC3A_exclim)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.edfmax"), &assign_ExcDC3A_edfmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdmin"), &assign_ExcDC3A_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.efdlim"), &assign_ExcDC3A_efdlim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.te"), &assign_ExcDC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.trh"), &assign_ExcDC3A_trh)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmax"), &assign_ExcDC3A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A.vrmin"), &assign_ExcDC3A_vrmin)); } -void ExcDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC3A::debugName[] = "ExcDC3A"; -const char* ExcDC3A::debugString() +void ExcDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC3A::debugName; } const BaseClassDefiner ExcDC3A::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcDC3A::declare() return BaseClassDefiner(ExcDC3A::addConstructToMap, ExcDC3A::addPrimitiveAssignFnsToMap, ExcDC3A::addClassAssignFnsToMap, ExcDC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC3A_factory() + { + return new ExcDC3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcDC3A.hpp b/CGMES_2.4.15_27JAN2020/ExcDC3A.hpp index a3aea0247..f28f29984 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC3A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC3A.hpp @@ -1,56 +1,57 @@ #ifndef ExcDC3A_H #define ExcDC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* This is modified IEEE DC3A direct current commutator exciters with speed input, and death band. DC old type 4. */ - class ExcDC3A: public ExcitationSystemDynamics + class ExcDC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds trh; /* Rheostat travel time (Trh). Typical Value = 20. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU kr; /* Death band (Kr). If Kr is not zero, the voltage regulator input changes at a constant rate if Verr > Kr or Verr < -Kr as per the IEEE (1968) Type 4 model. If Kr is zero, the error signal drives the voltage regulator continuously as per the IEEE (1980) DC3 and IEEE (1992, 2005) DC3A models. Typical Value = 0. Default: nullptr */ - CIMPP::PU kv; /* Fast raise/lower contact setting (Kv). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 2.6. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 3.45. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.35. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ - CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ - CIMPP::Boolean efdlim; /* (Efdlim). true = exciter output limiter is active false = exciter output limiter not active. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC3A(); - virtual ~ExcDC3A(); - + ~ExcDC3A() override; + + CIMPP::PU edfmax; /* Maximum voltage exciter output limiter (Efdmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (Efd1). Typical Value = 2.6. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (Efd2). Typical Value = 3.45. Default: nullptr */ + CIMPP::Boolean efdlim; /* (Efdlim). true = exciter output limiter is active false = exciter output limiter not active. Typical Value = true. Default: false */ + CIMPP::PU efdmin; /* Minimum voltage exciter output limiter (Efdmin). Typical Value = -99. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kr; /* Death band (Kr). If Kr is not zero, the voltage regulator input changes at a constant rate if Verr > Kr or Verr < -Kr as per the IEEE (1968) Type 4 model. If Kr is zero, the error signal drives the voltage regulator continuously as per the IEEE (1980) DC3 and IEEE (1992, 2005) DC3A models. Typical Value = 0. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::PU kv; /* Fast raise/lower contact setting (Kv). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, Efd1 (Se[Eefd1]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, Efd2 (Se[Efd2]). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ + CIMPP::Seconds trh; /* Rheostat travel time (Trh). Typical Value = 20. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcDC3A1.cpp b/CGMES_2.4.15_27JAN2020/ExcDC3A1.cpp index dedb8aa31..1723a0039 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC3A1.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC3A1.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcDC3A1.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" +#include "PU.hpp" using namespace CIMPP; ExcDC3A1::ExcDC3A1() {}; - ExcDC3A1::~ExcDC3A1() {}; +bool assign_ExcDC3A1_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vb1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vb1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vblim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vblim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcDC3A1_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcDC3A1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcDC3A1_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_vb1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vb1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcDC3A1_vblim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcDC3A1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vblim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcDC3A1_factory() { - return new ExcDC3A1; - } + + + + + + + + + + +const char ExcDC3A1::debugName[] = "ExcDC3A1"; +const char* ExcDC3A1::debugString() const +{ + return ExcDC3A1::debugName; } -void ExcDC3A1::addConstructToMap(std::unordered_map& factory_map) { +void ExcDC3A1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcDC3A1"), &ExcDC3A1_factory)); } -void ExcDC3A1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcDC3A1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.exclim"), &assign_ExcDC3A1_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ka"), &assign_ExcDC3A1_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ke"), &assign_ExcDC3A1_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kf"), &assign_ExcDC3A1_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ki"), &assign_ExcDC3A1_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kp"), &assign_ExcDC3A1_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ta"), &assign_ExcDC3A1_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmax"), &assign_ExcDC3A1_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmin"), &assign_ExcDC3A1_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.te"), &assign_ExcDC3A1_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kf"), &assign_ExcDC3A1_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.tf"), &assign_ExcDC3A1_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.kp"), &assign_ExcDC3A1_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ki"), &assign_ExcDC3A1_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vbmax"), &assign_ExcDC3A1_vbmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.exclim"), &assign_ExcDC3A1_exclim)); - assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.ke"), &assign_ExcDC3A1_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vb1max"), &assign_ExcDC3A1_vb1max)); assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vblim"), &assign_ExcDC3A1_vblim)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vbmax"), &assign_ExcDC3A1_vbmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmax"), &assign_ExcDC3A1_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcDC3A1.vrmin"), &assign_ExcDC3A1_vrmin)); } -void ExcDC3A1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcDC3A1::debugName[] = "ExcDC3A1"; -const char* ExcDC3A1::debugString() +void ExcDC3A1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcDC3A1::debugName; } const BaseClassDefiner ExcDC3A1::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcDC3A1::declare() return BaseClassDefiner(ExcDC3A1::addConstructToMap, ExcDC3A1::addPrimitiveAssignFnsToMap, ExcDC3A1::addClassAssignFnsToMap, ExcDC3A1::debugName); } - +namespace CIMPP +{ + BaseClass* ExcDC3A1_factory() + { + return new ExcDC3A1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcDC3A1.hpp b/CGMES_2.4.15_27JAN2020/ExcDC3A1.hpp index e369d70c1..1ff34b005 100644 --- a/CGMES_2.4.15_27JAN2020/ExcDC3A1.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcDC3A1.hpp @@ -1,53 +1,54 @@ #ifndef ExcDC3A1_H #define ExcDC3A1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* This is modified old IEEE type 3 excitation system. */ - class ExcDC3A1: public ExcitationSystemDynamics + class ExcDC3A1 : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.37. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ - CIMPP::PU vbmax; /* Available exciter voltage limiter (Vbmax). Typical Value = 11.63. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). true = lower limit of zero is applied to integrator output false = lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU vb1max; /* Available exciter voltage limiter (Vb1max). Typical Value = 11.63. Default: nullptr */ - CIMPP::Boolean vblim; /* Vb limiter indicator. true = exciter Vbmax limiter is active false = Vb1max is active. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcDC3A1(); - virtual ~ExcDC3A1(); - + ~ExcDC3A1() override; + + CIMPP::Boolean exclim; /* (exclim). true = lower limit of zero is applied to integrator output false = lower limit of zero not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 300. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (Kf). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.37. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 1.83. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.675. Default: nullptr */ + CIMPP::PU vb1max; /* Available exciter voltage limiter (Vb1max). Typical Value = 11.63. Default: nullptr */ + CIMPP::Boolean vblim; /* Vb limiter indicator. true = exciter Vbmax limiter is active false = Vb1max is active. Typical Value = true. Default: false */ + CIMPP::PU vbmax; /* Available exciter voltage limiter (Vbmax). Typical Value = 11.63. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcDC3A1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcELIN1.cpp b/CGMES_2.4.15_27JAN2020/ExcELIN1.cpp index 27c474b7a..5137c3751 100644 --- a/CGMES_2.4.15_27JAN2020/ExcELIN1.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcELIN1.cpp @@ -1,261 +1,276 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcELIN1.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" using namespace CIMPP; ExcELIN1::ExcELIN1() {}; - ExcELIN1::~ExcELIN1() {}; +bool assign_ExcELIN1_dpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpnf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_efmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_efmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_smax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->smax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_tfi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_tnu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tnu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_tsw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_vpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_vpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpnf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_vpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN1_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcELIN1_tfi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_tnu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tnu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_vpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_vpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_vpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpnf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_dpnf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpnf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_tsw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_efmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_efmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN1_smax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->smax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcELIN1_factory() { - return new ExcELIN1; - } +const char ExcELIN1::debugName[] = "ExcELIN1"; +const char* ExcELIN1::debugString() const +{ + return ExcELIN1::debugName; } -void ExcELIN1::addConstructToMap(std::unordered_map& factory_map) { +void ExcELIN1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcELIN1"), &ExcELIN1_factory)); } -void ExcELIN1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tfi"), &assign_ExcELIN1_tfi)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tnu"), &assign_ExcELIN1_tnu)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpu"), &assign_ExcELIN1_vpu)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpi"), &assign_ExcELIN1_vpi)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpnf"), &assign_ExcELIN1_vpnf)); +void ExcELIN1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.dpnf"), &assign_ExcELIN1_dpnf)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tsw"), &assign_ExcELIN1_tsw)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.efmin"), &assign_ExcELIN1_efmin)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.efmax"), &assign_ExcELIN1_efmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.xe"), &assign_ExcELIN1_xe)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.efmin"), &assign_ExcELIN1_efmin)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ks1"), &assign_ExcELIN1_ks1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ks2"), &assign_ExcELIN1_ks2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.smax"), &assign_ExcELIN1_smax)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tfi"), &assign_ExcELIN1_tfi)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tnu"), &assign_ExcELIN1_tnu)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ts1"), &assign_ExcELIN1_ts1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.ts2"), &assign_ExcELIN1_ts2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.smax"), &assign_ExcELIN1_smax)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.tsw"), &assign_ExcELIN1_tsw)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpi"), &assign_ExcELIN1_vpi)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpnf"), &assign_ExcELIN1_vpnf)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.vpu"), &assign_ExcELIN1_vpu)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN1.xe"), &assign_ExcELIN1_xe)); } -void ExcELIN1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcELIN1::debugName[] = "ExcELIN1"; -const char* ExcELIN1::debugString() +void ExcELIN1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcELIN1::debugName; } const BaseClassDefiner ExcELIN1::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner ExcELIN1::declare() return BaseClassDefiner(ExcELIN1::addConstructToMap, ExcELIN1::addPrimitiveAssignFnsToMap, ExcELIN1::addClassAssignFnsToMap, ExcELIN1::debugName); } - +namespace CIMPP +{ + BaseClass* ExcELIN1_factory() + { + return new ExcELIN1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcELIN1.hpp b/CGMES_2.4.15_27JAN2020/ExcELIN1.hpp index 71fdfbc8d..938588450 100644 --- a/CGMES_2.4.15_27JAN2020/ExcELIN1.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcELIN1.hpp @@ -1,53 +1,54 @@ #ifndef ExcELIN1_H #define ExcELIN1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Static PI transformer fed excitation system: ELIN (VATECH) - simplified model. This model represents an all-static excitation system. A PI voltage controller establishes a desired field current set point for a proportional current controller. The integrator of the PI controller has a follow-up input to match its signal to the present field current. A power system stabilizer with power input is included in the model. */ - class ExcELIN1: public ExcitationSystemDynamics + class ExcELIN1 : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tfi; /* Current transducer time constant (Tfi). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tnu; /* Controller reset time constant (Tnu). Typical Value = 2. Default: nullptr */ - CIMPP::PU vpu; /* Voltage controller proportional gain (Vpu). Typical Value = 34.5. Default: nullptr */ - CIMPP::PU vpi; /* Current controller gain (Vpi). Typical Value = 12.45. Default: nullptr */ - CIMPP::PU vpnf; /* Controller follow up gain (Vpnf). Typical Value = 2. Default: nullptr */ - CIMPP::PU dpnf; /* Controller follow up dead band (Dpnf). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsw; /* Stabilizer parameters (Tsw). Typical Value = 3. Default: nullptr */ - CIMPP::PU efmin; /* Minimum open circuit excitation voltage (Efmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU efmax; /* Maximum open circuit excitation voltage (Efmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU xe; /* Excitation transformer effective reactance (Xe) (>=0). Xe represents the regulation of the transformer/rectifier unit. Typical Value = 0.06. Default: nullptr */ - CIMPP::PU ks1; /* Stabilizer Gain 1 (Ks1). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks2; /* Stabilizer Gain 2 (Ks2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ts1; /* Stabilizer Phase Lag Time Constant (Ts1). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ts2; /* Stabilizer Filter Time Constant (Ts2). Typical Value = 1. Default: nullptr */ - CIMPP::PU smax; /* Stabilizer Limit Output (smax). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcELIN1(); - virtual ~ExcELIN1(); - + ~ExcELIN1() override; + + CIMPP::PU dpnf; /* Controller follow up dead band (Dpnf). Typical Value = 0. Default: nullptr */ + CIMPP::PU efmax; /* Maximum open circuit excitation voltage (Efmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU efmin; /* Minimum open circuit excitation voltage (Efmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU ks1; /* Stabilizer Gain 1 (Ks1). Typical Value = 0. Default: nullptr */ + CIMPP::PU ks2; /* Stabilizer Gain 2 (Ks2). Typical Value = 0. Default: nullptr */ + CIMPP::PU smax; /* Stabilizer Limit Output (smax). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tfi; /* Current transducer time constant (Tfi). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tnu; /* Controller reset time constant (Tnu). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds ts1; /* Stabilizer Phase Lag Time Constant (Ts1). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ts2; /* Stabilizer Filter Time Constant (Ts2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tsw; /* Stabilizer parameters (Tsw). Typical Value = 3. Default: nullptr */ + CIMPP::PU vpi; /* Current controller gain (Vpi). Typical Value = 12.45. Default: nullptr */ + CIMPP::PU vpnf; /* Controller follow up gain (Vpnf). Typical Value = 2. Default: nullptr */ + CIMPP::PU vpu; /* Voltage controller proportional gain (Vpu). Typical Value = 34.5. Default: nullptr */ + CIMPP::PU xe; /* Excitation transformer effective reactance (Xe) (>=0). Xe represents the regulation of the transformer/rectifier unit. Typical Value = 0.06. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcELIN1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcELIN2.cpp b/CGMES_2.4.15_27JAN2020/ExcELIN2.cpp index fe3f20f63..c75dd79b5 100644 --- a/CGMES_2.4.15_27JAN2020/ExcELIN2.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcELIN2.cpp @@ -1,11 +1,14 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcELIN2.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -13,19 +16,20 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -33,409 +37,432 @@ using namespace CIMPP; ExcELIN2::ExcELIN2() {}; - ExcELIN2::~ExcELIN2() {}; +bool assign_ExcELIN2_efdbas(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdbas; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_iefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iefmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_iefmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iefmax2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_iefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k1ec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1ec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_kd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ke2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ketb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ketb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_pid1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pid1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_te2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_tr4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_upmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->upmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_upmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->upmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcELIN2_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcELIN2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_k1ec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1ec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_kd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_pid1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pid1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcELIN2_iefmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iefmax2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ketb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ketb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_upmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->upmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_upmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->upmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_xp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_te2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ke2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_tr4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_iefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_iefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcELIN2_efdbas(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdbas; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcELIN2_factory() { - return new ExcELIN2; - } + + + + + + + + + + + + + + + + + + + + + +const char ExcELIN2::debugName[] = "ExcELIN2"; +const char* ExcELIN2::debugString() const +{ + return ExcELIN2::debugName; } -void ExcELIN2::addConstructToMap(std::unordered_map& factory_map) { +void ExcELIN2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcELIN2"), &ExcELIN2_factory)); } -void ExcELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.efdbas"), &assign_ExcELIN2_efdbas)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax"), &assign_ExcELIN2_iefmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax2"), &assign_ExcELIN2_iefmax2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmin"), &assign_ExcELIN2_iefmin)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k1"), &assign_ExcELIN2_k1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k1ec"), &assign_ExcELIN2_k1ec)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k2"), &assign_ExcELIN2_k2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k3"), &assign_ExcELIN2_k3)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k4"), &assign_ExcELIN2_k4)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.kd1"), &assign_ExcELIN2_kd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tb1"), &assign_ExcELIN2_tb1)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ke2"), &assign_ExcELIN2_ke2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ketb"), &assign_ExcELIN2_ketb)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.pid1max"), &assign_ExcELIN2_pid1max)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve1"), &assign_ExcELIN2_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve2"), &assign_ExcELIN2_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tb1"), &assign_ExcELIN2_tb1)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te"), &assign_ExcELIN2_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te2"), &assign_ExcELIN2_te2)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti1"), &assign_ExcELIN2_ti1)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax2"), &assign_ExcELIN2_iefmax2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k2"), &assign_ExcELIN2_k2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ketb"), &assign_ExcELIN2_ketb)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti3"), &assign_ExcELIN2_ti3)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti4"), &assign_ExcELIN2_ti4)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tr4"), &assign_ExcELIN2_tr4)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.upmax"), &assign_ExcELIN2_upmax)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.upmin"), &assign_ExcELIN2_upmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te"), &assign_ExcELIN2_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.xp"), &assign_ExcELIN2_xp)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.te2"), &assign_ExcELIN2_te2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ke2"), &assign_ExcELIN2_ke2)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ve1"), &assign_ExcELIN2_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve1"), &assign_ExcELIN2_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ve2"), &assign_ExcELIN2_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.seve2"), &assign_ExcELIN2_seve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.tr4"), &assign_ExcELIN2_tr4)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k3"), &assign_ExcELIN2_k3)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti3"), &assign_ExcELIN2_ti3)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.k4"), &assign_ExcELIN2_k4)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.ti4"), &assign_ExcELIN2_ti4)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmax"), &assign_ExcELIN2_iefmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.iefmin"), &assign_ExcELIN2_iefmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.efdbas"), &assign_ExcELIN2_efdbas)); + assign_map.insert(std::make_pair(std::string("cim:ExcELIN2.xp"), &assign_ExcELIN2_xp)); } -void ExcELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcELIN2::debugName[] = "ExcELIN2"; -const char* ExcELIN2::debugString() +void ExcELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcELIN2::debugName; } const BaseClassDefiner ExcELIN2::declare() @@ -443,4 +470,10 @@ const BaseClassDefiner ExcELIN2::declare() return BaseClassDefiner(ExcELIN2::addConstructToMap, ExcELIN2::addPrimitiveAssignFnsToMap, ExcELIN2::addClassAssignFnsToMap, ExcELIN2::debugName); } - +namespace CIMPP +{ + BaseClass* ExcELIN2_factory() + { + return new ExcELIN2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcELIN2.hpp b/CGMES_2.4.15_27JAN2020/ExcELIN2.hpp index 263089f20..d9f1bfd71 100644 --- a/CGMES_2.4.15_27JAN2020/ExcELIN2.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcELIN2.hpp @@ -1,65 +1,66 @@ #ifndef ExcELIN2_H #define ExcELIN2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Detailed Excitation System Model - ELIN (VATECH). This model represents an all-static excitation system. A PI voltage controller establishes a desired field current set point for a proportional current controller. The integrator of the PI controller has a follow-up input to match its signal to the present field current. Power system stabilizer models used in conjunction with this excitation system model: PssELIN2, PssIEEE2B, Pss2B. */ - class ExcELIN2: public ExcitationSystemDynamics + class ExcELIN2 : public ExcitationSystemDynamics { - public: - CIMPP::PU k1; /* Voltage regulator input gain (K1). Typical Value = 0. Default: nullptr */ - CIMPP::PU k1ec; /* Voltage regulator input limit (K1ec). Typical Value = 2. Default: nullptr */ - CIMPP::PU kd1; /* Voltage controller derivative gain (Kd1). Typical Value = 34.5. Default: nullptr */ - CIMPP::Seconds tb1; /* Voltage controller derivative washout time constant (Tb1). Typical Value = 12.45. Default: nullptr */ - CIMPP::PU pid1max; /* Controller follow up gain (PID1max). Typical Value = 2. Default: nullptr */ - CIMPP::PU ti1; /* Controller follow up dead band (Ti1). Typical Value = 0. Default: nullptr */ - CIMPP::PU iefmax2; /* Minimum open circuit excitation voltage (Iefmax2). Typical Value = -5. Default: nullptr */ - CIMPP::PU k2; /* Gain (K2). Typical Value = 5. Default: nullptr */ - CIMPP::PU ketb; /* Gain (Ketb). Typical Value = 0.06. Default: nullptr */ - CIMPP::PU upmax; /* Limiter (Upmax). Typical Value = 3. Default: nullptr */ - CIMPP::PU upmin; /* Limiter (Upmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Time constant (Te). Typical Value = 0. Default: nullptr */ - CIMPP::PU xp; /* Excitation transformer effective reactance (Xp). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te2; /* Time Constant (Te2). Typical Value = 1. Default: nullptr */ - CIMPP::PU ke2; /* Gain (Ke2). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 3. Default: nullptr */ - CIMPP::PU seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 0. Default: nullptr */ - CIMPP::PU seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tr4; /* Time constant (Tr4). Typical Value = 1. Default: nullptr */ - CIMPP::PU k3; /* Gain (K3). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ti3; /* Time constant (Ti3). Typical Value = 3. Default: nullptr */ - CIMPP::PU k4; /* Gain (K4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti4; /* Time constant (Ti4). Typical Value = 0. Default: nullptr */ - CIMPP::PU iefmax; /* Limiter (Iefmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU iefmin; /* Limiter (Iefmin). Typical Value = 1. Default: nullptr */ - CIMPP::PU efdbas; /* Gain (Efdbas). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcELIN2(); - virtual ~ExcELIN2(); - + ~ExcELIN2() override; + + CIMPP::PU efdbas; /* Gain (Efdbas). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU iefmax; /* Limiter (Iefmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU iefmax2; /* Minimum open circuit excitation voltage (Iefmax2). Typical Value = -5. Default: nullptr */ + CIMPP::PU iefmin; /* Limiter (Iefmin). Typical Value = 1. Default: nullptr */ + CIMPP::PU k1; /* Voltage regulator input gain (K1). Typical Value = 0. Default: nullptr */ + CIMPP::PU k1ec; /* Voltage regulator input limit (K1ec). Typical Value = 2. Default: nullptr */ + CIMPP::PU k2; /* Gain (K2). Typical Value = 5. Default: nullptr */ + CIMPP::PU k3; /* Gain (K3). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU k4; /* Gain (K4). Typical Value = 0. Default: nullptr */ + CIMPP::PU kd1; /* Voltage controller derivative gain (Kd1). Typical Value = 34.5. Default: nullptr */ + CIMPP::PU ke2; /* Gain (Ke2). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ketb; /* Gain (Ketb). Typical Value = 0.06. Default: nullptr */ + CIMPP::PU pid1max; /* Controller follow up gain (PID1max). Typical Value = 2. Default: nullptr */ + CIMPP::PU seve1; /* Exciter saturation function value at the corresponding exciter voltage, Ve1, back of commutating reactance (Se[Ve1]). Typical Value = 0. Default: nullptr */ + CIMPP::PU seve2; /* Exciter saturation function value at the corresponding exciter voltage, Ve2, back of commutating reactance (Se[Ve2]). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tb1; /* Voltage controller derivative washout time constant (Tb1). Typical Value = 12.45. Default: nullptr */ + CIMPP::Seconds te; /* Time constant (Te). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te2; /* Time Constant (Te2). Typical Value = 1. Default: nullptr */ + CIMPP::PU ti1; /* Controller follow up dead band (Ti1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti3; /* Time constant (Ti3). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ti4; /* Time constant (Ti4). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tr4; /* Time constant (Tr4). Typical Value = 1. Default: nullptr */ + CIMPP::PU upmax; /* Limiter (Upmax). Typical Value = 3. Default: nullptr */ + CIMPP::PU upmin; /* Limiter (Upmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve1). Typical Value = 3. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (Ve2). Typical Value = 0. Default: nullptr */ + CIMPP::PU xp; /* Excitation transformer effective reactance (Xp). Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcELIN2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcHU.cpp b/CGMES_2.4.15_27JAN2020/ExcHU.cpp index c85043c06..0414a2cd4 100644 --- a/CGMES_2.4.15_27JAN2020/ExcHU.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcHU.cpp @@ -1,216 +1,228 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcHU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcHU::ExcHU() {}; - ExcHU::~ExcHU() {}; +bool assign_ExcHU_ae(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ae; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ai(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ai; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_atr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->atr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_imin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcHU_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcHU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcHU_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcHU_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcHU_imin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcHU_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ae(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ae; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ai(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ai; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_atr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->atr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcHU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcHU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcHU_factory() { - return new ExcHU; - } + + + + + + + + + +const char ExcHU::debugName[] = "ExcHU"; +const char* ExcHU::debugString() const +{ + return ExcHU::debugName; } -void ExcHU::addConstructToMap(std::unordered_map& factory_map) { +void ExcHU::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcHU"), &ExcHU_factory)); } -void ExcHU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcHU.tr"), &assign_ExcHU_tr)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.te"), &assign_ExcHU_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.imin"), &assign_ExcHU_imin)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.imax"), &assign_ExcHU_imax)); +void ExcHU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcHU.ae"), &assign_ExcHU_ae)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.emin"), &assign_ExcHU_emin)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.emax"), &assign_ExcHU_emax)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.ki"), &assign_ExcHU_ki)); assign_map.insert(std::make_pair(std::string("cim:ExcHU.ai"), &assign_ExcHU_ai)); - assign_map.insert(std::make_pair(std::string("cim:ExcHU.ti"), &assign_ExcHU_ti)); assign_map.insert(std::make_pair(std::string("cim:ExcHU.atr"), &assign_ExcHU_atr)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.emax"), &assign_ExcHU_emax)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.emin"), &assign_ExcHU_emin)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.imax"), &assign_ExcHU_imax)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.imin"), &assign_ExcHU_imin)); assign_map.insert(std::make_pair(std::string("cim:ExcHU.ke"), &assign_ExcHU_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.ki"), &assign_ExcHU_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.te"), &assign_ExcHU_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.ti"), &assign_ExcHU_ti)); + assign_map.insert(std::make_pair(std::string("cim:ExcHU.tr"), &assign_ExcHU_tr)); } -void ExcHU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcHU::debugName[] = "ExcHU"; -const char* ExcHU::debugString() +void ExcHU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcHU::debugName; } const BaseClassDefiner ExcHU::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner ExcHU::declare() return BaseClassDefiner(ExcHU::addConstructToMap, ExcHU::addPrimitiveAssignFnsToMap, ExcHU::addClassAssignFnsToMap, ExcHU::debugName); } - +namespace CIMPP +{ + BaseClass* ExcHU_factory() + { + return new ExcHU; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcHU.hpp b/CGMES_2.4.15_27JAN2020/ExcHU.hpp index 748474e64..ae718ffa4 100644 --- a/CGMES_2.4.15_27JAN2020/ExcHU.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcHU.hpp @@ -1,51 +1,52 @@ #ifndef ExcHU_H #define ExcHU_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Hungarian Excitation System Model, with built-in voltage transducer. */ - class ExcHU: public ExcitationSystemDynamics + class ExcHU : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tr; /* Filter time constant (Tr). If a voltage compensator is used in conjunction with this excitation system model, Tr should be set to 0. Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds te; /* Major loop PI tag integration time constant (Te). Typical Value = 0.154. Default: nullptr */ - CIMPP::PU imin; /* Major loop PI tag output signal lower limit (Imin). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU imax; /* Major loop PI tag output signal upper limit (Imax). Typical Value = 2.19. Default: nullptr */ - CIMPP::PU ae; /* Major loop PI tag gain factor (Ae). Typical Value = 3. Default: nullptr */ - CIMPP::PU emin; /* Field voltage control signal lower limit on AVR base (Emin). Typical Value = -0.866. Default: nullptr */ - CIMPP::PU emax; /* Field voltage control signal upper limit on AVR base (Emax). Typical Value = 0.996. Default: nullptr */ - CIMPP::Simple_Float ki; /* Current base conversion constant (Ki). Typical Value = 0.21428. Default: nullptr */ - CIMPP::PU ai; /* Minor loop PI tag gain factor (Ai). Typical Value = 22. Default: nullptr */ - CIMPP::Seconds ti; /* Minor loop PI control tag integration time constant (Ti). Typical Value = 0.01333. Default: nullptr */ - CIMPP::PU atr; /* AVR constant (Atr). Typical Value = 2.19. Default: nullptr */ - CIMPP::Simple_Float ke; /* Voltage base conversion constant (Ke). Typical Value = 4.666. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcHU(); - virtual ~ExcHU(); - + ~ExcHU() override; + + CIMPP::PU ae; /* Major loop PI tag gain factor (Ae). Typical Value = 3. Default: nullptr */ + CIMPP::PU ai; /* Minor loop PI tag gain factor (Ai). Typical Value = 22. Default: nullptr */ + CIMPP::PU atr; /* AVR constant (Atr). Typical Value = 2.19. Default: nullptr */ + CIMPP::PU emax; /* Field voltage control signal upper limit on AVR base (Emax). Typical Value = 0.996. Default: nullptr */ + CIMPP::PU emin; /* Field voltage control signal lower limit on AVR base (Emin). Typical Value = -0.866. Default: nullptr */ + CIMPP::PU imax; /* Major loop PI tag output signal upper limit (Imax). Typical Value = 2.19. Default: nullptr */ + CIMPP::PU imin; /* Major loop PI tag output signal lower limit (Imin). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float ke; /* Voltage base conversion constant (Ke). Typical Value = 4.666. Default: nullptr */ + CIMPP::Simple_Float ki; /* Current base conversion constant (Ki). Typical Value = 0.21428. Default: nullptr */ + CIMPP::Seconds te; /* Major loop PI tag integration time constant (Te). Typical Value = 0.154. Default: nullptr */ + CIMPP::Seconds ti; /* Minor loop PI control tag integration time constant (Ti). Typical Value = 0.01333. Default: nullptr */ + CIMPP::Seconds tr; /* Filter time constant (Tr). If a voltage compensator is used in conjunction with this excitation system model, Tr should be set to 0. Typical Value = 0.01. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcHU_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.cpp index f6a581bb0..c1eb35e8d 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.cpp @@ -1,306 +1,324 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC1A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcIEEEAC1A::ExcIEEEAC1A() {}; - ExcIEEEAC1A::~ExcIEEEAC1A() {}; +bool assign_ExcIEEEAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC1A_factory() { - return new ExcIEEEAC1A; - } +const char ExcIEEEAC1A::debugName[] = "ExcIEEEAC1A"; +const char* ExcIEEEAC1A::debugString() const +{ + return ExcIEEEAC1A::debugName; } -void ExcIEEEAC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A"), &ExcIEEEAC1A_factory)); } -void ExcIEEEAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tb"), &assign_ExcIEEEAC1A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tc"), &assign_ExcIEEEAC1A_tc)); +void ExcIEEEAC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ka"), &assign_ExcIEEEAC1A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ta"), &assign_ExcIEEEAC1A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamax"), &assign_ExcIEEEAC1A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamin"), &assign_ExcIEEEAC1A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.te"), &assign_ExcIEEEAC1A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kf"), &assign_ExcIEEEAC1A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tf"), &assign_ExcIEEEAC1A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kc"), &assign_ExcIEEEAC1A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kd"), &assign_ExcIEEEAC1A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ke"), &assign_ExcIEEEAC1A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve1"), &assign_ExcIEEEAC1A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.kf"), &assign_ExcIEEEAC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.seve1"), &assign_ExcIEEEAC1A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve2"), &assign_ExcIEEEAC1A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.seve2"), &assign_ExcIEEEAC1A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ta"), &assign_ExcIEEEAC1A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tb"), &assign_ExcIEEEAC1A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tc"), &assign_ExcIEEEAC1A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.te"), &assign_ExcIEEEAC1A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.tf"), &assign_ExcIEEEAC1A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamax"), &assign_ExcIEEEAC1A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vamin"), &assign_ExcIEEEAC1A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve1"), &assign_ExcIEEEAC1A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.ve2"), &assign_ExcIEEEAC1A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vrmax"), &assign_ExcIEEEAC1A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC1A.vrmin"), &assign_ExcIEEEAC1A_vrmin)); } -void ExcIEEEAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC1A::debugName[] = "ExcIEEEAC1A"; -const char* ExcIEEEAC1A::debugString() +void ExcIEEEAC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC1A::debugName; } const BaseClassDefiner ExcIEEEAC1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcIEEEAC1A::declare() return BaseClassDefiner(ExcIEEEAC1A::addConstructToMap, ExcIEEEAC1A::addPrimitiveAssignFnsToMap, ExcIEEEAC1A::addClassAssignFnsToMap, ExcIEEEAC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC1A_factory() + { + return new ExcIEEEAC1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.hpp index b2f9a991d..b00761df6 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC1A.hpp @@ -1,57 +1,58 @@ #ifndef ExcIEEEAC1A_H #define ExcIEEEAC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC1A model. The model represents the field-controlled alternator-rectifier excitation systems designated Type AC1A. These excitation systems consist of an alternator main exciter with non-controlled rectifiers. Reference: IEEE Standard 421.5-2005 Section 6.1. */ - class ExcIEEEAC1A: public ExcitationSystemDynamics + class ExcIEEEAC1A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.38. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.18. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.14. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 6.03. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -5.43. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC1A(); - virtual ~ExcIEEEAC1A(); - + ~ExcIEEEAC1A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.38. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.18. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.14. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 6.03. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -5.43. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.cpp index 787826963..e544a1fe1 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.cpp @@ -1,351 +1,372 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC2A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC2A::ExcIEEEAC2A() {}; - ExcIEEEAC2A::~ExcIEEEAC2A() {}; +bool assign_ExcIEEEAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC2A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC2A_factory() { - return new ExcIEEEAC2A; - } +const char ExcIEEEAC2A::debugName[] = "ExcIEEEAC2A"; +const char* ExcIEEEAC2A::debugString() const +{ + return ExcIEEEAC2A::debugName; } -void ExcIEEEAC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A"), &ExcIEEEAC2A_factory)); } -void ExcIEEEAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tb"), &assign_ExcIEEEAC2A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tc"), &assign_ExcIEEEAC2A_tc)); +void ExcIEEEAC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ka"), &assign_ExcIEEEAC2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ta"), &assign_ExcIEEEAC2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamax"), &assign_ExcIEEEAC2A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamin"), &assign_ExcIEEEAC2A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kb"), &assign_ExcIEEEAC2A_kb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmax"), &assign_ExcIEEEAC2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmin"), &assign_ExcIEEEAC2A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.te"), &assign_ExcIEEEAC2A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vfemax"), &assign_ExcIEEEAC2A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kh"), &assign_ExcIEEEAC2A_kh)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kf"), &assign_ExcIEEEAC2A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tf"), &assign_ExcIEEEAC2A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kc"), &assign_ExcIEEEAC2A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kd"), &assign_ExcIEEEAC2A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ke"), &assign_ExcIEEEAC2A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve1"), &assign_ExcIEEEAC2A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kf"), &assign_ExcIEEEAC2A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.kh"), &assign_ExcIEEEAC2A_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.seve1"), &assign_ExcIEEEAC2A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve2"), &assign_ExcIEEEAC2A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.seve2"), &assign_ExcIEEEAC2A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ta"), &assign_ExcIEEEAC2A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tb"), &assign_ExcIEEEAC2A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tc"), &assign_ExcIEEEAC2A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.te"), &assign_ExcIEEEAC2A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.tf"), &assign_ExcIEEEAC2A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamax"), &assign_ExcIEEEAC2A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vamin"), &assign_ExcIEEEAC2A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve1"), &assign_ExcIEEEAC2A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.ve2"), &assign_ExcIEEEAC2A_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vfemax"), &assign_ExcIEEEAC2A_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmax"), &assign_ExcIEEEAC2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC2A.vrmin"), &assign_ExcIEEEAC2A_vrmin)); } -void ExcIEEEAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC2A::debugName[] = "ExcIEEEAC2A"; -const char* ExcIEEEAC2A::debugString() +void ExcIEEEAC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC2A::debugName; } const BaseClassDefiner ExcIEEEAC2A::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner ExcIEEEAC2A::declare() return BaseClassDefiner(ExcIEEEAC2A::addConstructToMap, ExcIEEEAC2A::addPrimitiveAssignFnsToMap, ExcIEEEAC2A::addClassAssignFnsToMap, ExcIEEEAC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC2A_factory() + { + return new ExcIEEEAC2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.hpp index f6d137939..d2217767f 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC2A.hpp @@ -1,60 +1,61 @@ #ifndef ExcIEEEAC2A_H #define ExcIEEEAC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC2A model. The model represents a high initial response field-controlled alternator-rectifier excitation system. The alternator main exciter is used with non-controlled rectifiers. The Type AC2A model is similar to that of Type AC1A except for the inclusion of exciter time constant compensation and exciter field current limiting elements. Reference: IEEE Standard 421.5-2005 Section 6.2. */ - class ExcIEEEAC2A: public ExcitationSystemDynamics + class ExcIEEEAC2A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ - CIMPP::PU kb; /* Second stage regulator gain (K). Typical Value = 25. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 105. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 4.4. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current feedback gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.28. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.35. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.037. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.3. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.012. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC2A(); - virtual ~ExcIEEEAC2A(); - + ~ExcIEEEAC2A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ + CIMPP::PU kb; /* Second stage regulator gain (K). Typical Value = 25. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.28. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.35. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current feedback gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.037. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.6. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 8. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -8. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.3. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 4.4. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 105. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -95. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.cpp index 6d4c2cc44..e70a624f8 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.cpp @@ -1,351 +1,372 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC3A.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC3A::ExcIEEEAC3A() {}; - ExcIEEEAC3A::~ExcIEEEAC3A() {}; +bool assign_ExcIEEEAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_efdn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC3A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC3A_factory() { - return new ExcIEEEAC3A; - } +const char ExcIEEEAC3A::debugName[] = "ExcIEEEAC3A"; +const char* ExcIEEEAC3A::debugString() const +{ + return ExcIEEEAC3A::debugName; } -void ExcIEEEAC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A"), &ExcIEEEAC3A_factory)); } -void ExcIEEEAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tb"), &assign_ExcIEEEAC3A_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tc"), &assign_ExcIEEEAC3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ka"), &assign_ExcIEEEAC3A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ta"), &assign_ExcIEEEAC3A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamax"), &assign_ExcIEEEAC3A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamin"), &assign_ExcIEEEAC3A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.te"), &assign_ExcIEEEAC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vemin"), &assign_ExcIEEEAC3A_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kr"), &assign_ExcIEEEAC3A_kr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kf"), &assign_ExcIEEEAC3A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tf"), &assign_ExcIEEEAC3A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kn"), &assign_ExcIEEEAC3A_kn)); +void ExcIEEEAC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.efdn"), &assign_ExcIEEEAC3A_efdn)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ka"), &assign_ExcIEEEAC3A_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kc"), &assign_ExcIEEEAC3A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kd"), &assign_ExcIEEEAC3A_kd)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ke"), &assign_ExcIEEEAC3A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vfemax"), &assign_ExcIEEEAC3A_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve1"), &assign_ExcIEEEAC3A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kf"), &assign_ExcIEEEAC3A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kn"), &assign_ExcIEEEAC3A_kn)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.kr"), &assign_ExcIEEEAC3A_kr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.seve1"), &assign_ExcIEEEAC3A_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve2"), &assign_ExcIEEEAC3A_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.seve2"), &assign_ExcIEEEAC3A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ta"), &assign_ExcIEEEAC3A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tb"), &assign_ExcIEEEAC3A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tc"), &assign_ExcIEEEAC3A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.te"), &assign_ExcIEEEAC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.tf"), &assign_ExcIEEEAC3A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamax"), &assign_ExcIEEEAC3A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vamin"), &assign_ExcIEEEAC3A_vamin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve1"), &assign_ExcIEEEAC3A_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.ve2"), &assign_ExcIEEEAC3A_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vemin"), &assign_ExcIEEEAC3A_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC3A.vfemax"), &assign_ExcIEEEAC3A_vfemax)); } -void ExcIEEEAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC3A::debugName[] = "ExcIEEEAC3A"; -const char* ExcIEEEAC3A::debugString() +void ExcIEEEAC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC3A::debugName; } const BaseClassDefiner ExcIEEEAC3A::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner ExcIEEEAC3A::declare() return BaseClassDefiner(ExcIEEEAC3A::addConstructToMap, ExcIEEEAC3A::addPrimitiveAssignFnsToMap, ExcIEEEAC3A::addClassAssignFnsToMap, ExcIEEEAC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC3A_factory() + { + return new ExcIEEEAC3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.hpp index 617e39760..0508e8329 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC3A.hpp @@ -1,60 +1,61 @@ #ifndef ExcIEEEAC3A_H #define ExcIEEEAC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC3A model. The model represents the field-controlled alternator-rectifier excitation systems designated Type AC3A. These excitation systems include an alternator main exciter with non-controlled rectifiers. The exciter employs self-excitation, and the voltage regulator power is derived from the exciter output voltage. Therefore, this system has an additional nonlinearity, simulated by the use of a multiplier whose inputs are the voltage regulator command signal, , and the exciter output voltage, , times . This model is applicable to excitation systems employing static voltage regulators. Reference: IEEE Standard 421.5-2005 Section 6.3. */ - class ExcIEEEAC3A: public ExcitationSystemDynamics + class ExcIEEEAC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 45.62. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.013. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.17. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (K). Typical Value = 3.77. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.143. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kn; /* Excitation control system stabilizer gain (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU efdn; /* Value of at which feedback gain changes (E). Typical Value = 2.36. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.104. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.499. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 16. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 6.24. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 1.143. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.68. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC3A(); - virtual ~ExcIEEEAC3A(); - + ~ExcIEEEAC3A() override; + + CIMPP::PU efdn; /* Value of at which feedback gain changes (E). Typical Value = 2.36. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 45.62. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.104. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.499. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.143. Default: nullptr */ + CIMPP::PU kn; /* Excitation control system stabilizer gain (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kr; /* Constant associated with regulator and alternator field power supply (K). Typical Value = 3.77. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 1.143. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.013. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.17. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 6.24. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 4.68. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 16. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.cpp index 79c73f1f1..54c509ac0 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.cpp @@ -1,171 +1,180 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC4A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEAC4A::ExcIEEEAC4A() {}; - ExcIEEEAC4A::~ExcIEEEAC4A() {}; +bool assign_ExcIEEEAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC4A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC4A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC4A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC4A_factory() { - return new ExcIEEEAC4A; - } +const char ExcIEEEAC4A::debugName[] = "ExcIEEEAC4A"; +const char* ExcIEEEAC4A::debugString() const +{ + return ExcIEEEAC4A::debugName; } -void ExcIEEEAC4A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC4A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A"), &ExcIEEEAC4A_factory)); } -void ExcIEEEAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimax"), &assign_ExcIEEEAC4A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimin"), &assign_ExcIEEEAC4A_vimin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tc"), &assign_ExcIEEEAC4A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tb"), &assign_ExcIEEEAC4A_tb)); +void ExcIEEEAC4A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.ka"), &assign_ExcIEEEAC4A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.kc"), &assign_ExcIEEEAC4A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.ta"), &assign_ExcIEEEAC4A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tb"), &assign_ExcIEEEAC4A_tb)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.tc"), &assign_ExcIEEEAC4A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimax"), &assign_ExcIEEEAC4A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vimin"), &assign_ExcIEEEAC4A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vrmax"), &assign_ExcIEEEAC4A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.vrmin"), &assign_ExcIEEEAC4A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC4A.kc"), &assign_ExcIEEEAC4A_kc)); } -void ExcIEEEAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC4A::debugName[] = "ExcIEEEAC4A"; -const char* ExcIEEEAC4A::debugString() +void ExcIEEEAC4A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC4A::debugName; } const BaseClassDefiner ExcIEEEAC4A::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner ExcIEEEAC4A::declare() return BaseClassDefiner(ExcIEEEAC4A::addConstructToMap, ExcIEEEAC4A::addPrimitiveAssignFnsToMap, ExcIEEEAC4A::addClassAssignFnsToMap, ExcIEEEAC4A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC4A_factory() + { + return new ExcIEEEAC4A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.hpp index 9cbfe93b6..884938057 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC4A.hpp @@ -1,47 +1,48 @@ #ifndef ExcIEEEAC4A_H #define ExcIEEEAC4A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC4A model. The model represents type AC4A alternator-supplied controlled-rectifier excitation system which is quite different from the other type ac systems. This high initial response excitation system utilizes a full thyristor bridge in the exciter output circuit. The voltage regulator controls the firing of the thyristor bridges. The exciter alternator uses an independent voltage regulator to control its output voltage to a constant value. These effects are not modeled; however, transient loading effects on the exciter alternator are included. Reference: IEEE Standard 421.5-2005 Section 6.4. */ - class ExcIEEEAC4A: public ExcitationSystemDynamics + class ExcIEEEAC4A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 10. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -10. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.015. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.64. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.53. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC4A(); - virtual ~ExcIEEEAC4A(); - + ~ExcIEEEAC4A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 200. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.015. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 10. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -10. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.64. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.53. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC4A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.cpp index 107bf8bf8..691cba77a 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.cpp @@ -1,246 +1,260 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC5A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC5A::ExcIEEEAC5A() {}; - ExcIEEEAC5A::~ExcIEEEAC5A() {}; +bool assign_ExcIEEEAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC5A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC5A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_tf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC5A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC5A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEAC5A_factory() { - return new ExcIEEEAC5A; - } + + + + + + + + + + +const char ExcIEEEAC5A::debugName[] = "ExcIEEEAC5A"; +const char* ExcIEEEAC5A::debugString() const +{ + return ExcIEEEAC5A::debugName; } -void ExcIEEEAC5A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC5A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A"), &ExcIEEEAC5A_factory)); } -void ExcIEEEAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEAC5A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd1"), &assign_ExcIEEEAC5A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd2"), &assign_ExcIEEEAC5A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ka"), &assign_ExcIEEEAC5A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ta"), &assign_ExcIEEEAC5A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmax"), &assign_ExcIEEEAC5A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmin"), &assign_ExcIEEEAC5A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ke"), &assign_ExcIEEEAC5A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.te"), &assign_ExcIEEEAC5A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.kf"), &assign_ExcIEEEAC5A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd1"), &assign_ExcIEEEAC5A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd2"), &assign_ExcIEEEAC5A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.ta"), &assign_ExcIEEEAC5A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.te"), &assign_ExcIEEEAC5A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.tf1"), &assign_ExcIEEEAC5A_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.tf2"), &assign_ExcIEEEAC5A_tf2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.tf3"), &assign_ExcIEEEAC5A_tf3)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd1"), &assign_ExcIEEEAC5A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd1"), &assign_ExcIEEEAC5A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.efd2"), &assign_ExcIEEEAC5A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.seefd2"), &assign_ExcIEEEAC5A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmax"), &assign_ExcIEEEAC5A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC5A.vrmin"), &assign_ExcIEEEAC5A_vrmin)); } -void ExcIEEEAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC5A::debugName[] = "ExcIEEEAC5A"; -const char* ExcIEEEAC5A::debugString() +void ExcIEEEAC5A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC5A::debugName; } const BaseClassDefiner ExcIEEEAC5A::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcIEEEAC5A::declare() return BaseClassDefiner(ExcIEEEAC5A::addConstructToMap, ExcIEEEAC5A::addPrimitiveAssignFnsToMap, ExcIEEEAC5A::addClassAssignFnsToMap, ExcIEEEAC5A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC5A_factory() + { + return new ExcIEEEAC5A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.hpp index c3e1bc531..dfe6bad93 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC5A.hpp @@ -1,53 +1,54 @@ #ifndef ExcIEEEAC5A_H #define ExcIEEEAC5A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC5A model. The model represents a simplified model for brushless excitation systems. The regulator is supplied from a source, such as a permanent magnet generator, which is not affected by system disturbances. Unlike other ac models, this model uses loaded rather than open circuit exciter saturation data in the same way as it is used for the dc models. Because the model has been widely implemented by the industry, it is sometimes used to represent other types of systems when either detailed data for them are not available or simplified models are required. Reference: IEEE Standard 421.5-2005 Section 6.5. */ - class ExcIEEEAC5A: public ExcitationSystemDynamics + class ExcIEEEAC5A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 7.3. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -7.3. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 5.6. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.86. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 4.2. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC5A(); - virtual ~ExcIEEEAC5A(); - + ~ExcIEEEAC5A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 5.6. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 4.2. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 400. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.03. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.86. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf1; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf2; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf3; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 7.3. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -7.3. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC5A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.cpp index 59e7e7af0..241e30969 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.cpp @@ -1,18 +1,23 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC6A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -21,346 +26,363 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEAC6A::ExcIEEEAC6A() {}; - ExcIEEEAC6A::~ExcIEEEAC6A() {}; +bool assign_ExcIEEEAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tj; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfelim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC6A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_tj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tj; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_th(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vfelim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfelim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC6A_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC6A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC6A_factory() { - return new ExcIEEEAC6A; - } +const char ExcIEEEAC6A::debugName[] = "ExcIEEEAC6A"; +const char* ExcIEEEAC6A::debugString() const +{ + return ExcIEEEAC6A::debugName; } -void ExcIEEEAC6A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC6A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A"), &ExcIEEEAC6A_factory)); } -void ExcIEEEAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEAC6A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ka"), &assign_ExcIEEEAC6A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kc"), &assign_ExcIEEEAC6A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kd"), &assign_ExcIEEEAC6A_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ke"), &assign_ExcIEEEAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kh"), &assign_ExcIEEEAC6A_kh)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve1"), &assign_ExcIEEEAC6A_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve2"), &assign_ExcIEEEAC6A_seve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ta"), &assign_ExcIEEEAC6A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tk"), &assign_ExcIEEEAC6A_tk)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tb"), &assign_ExcIEEEAC6A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tc"), &assign_ExcIEEEAC6A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamax"), &assign_ExcIEEEAC6A_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamin"), &assign_ExcIEEEAC6A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmax"), &assign_ExcIEEEAC6A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmin"), &assign_ExcIEEEAC6A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.te"), &assign_ExcIEEEAC6A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kh"), &assign_ExcIEEEAC6A_kh)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tj"), &assign_ExcIEEEAC6A_tj)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.th"), &assign_ExcIEEEAC6A_th)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vfelim"), &assign_ExcIEEEAC6A_vfelim)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vhmax"), &assign_ExcIEEEAC6A_vhmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kc"), &assign_ExcIEEEAC6A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.kd"), &assign_ExcIEEEAC6A_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ke"), &assign_ExcIEEEAC6A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tj"), &assign_ExcIEEEAC6A_tj)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.tk"), &assign_ExcIEEEAC6A_tk)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamax"), &assign_ExcIEEEAC6A_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vamin"), &assign_ExcIEEEAC6A_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ve1"), &assign_ExcIEEEAC6A_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve1"), &assign_ExcIEEEAC6A_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.ve2"), &assign_ExcIEEEAC6A_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.seve2"), &assign_ExcIEEEAC6A_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vfelim"), &assign_ExcIEEEAC6A_vfelim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vhmax"), &assign_ExcIEEEAC6A_vhmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmax"), &assign_ExcIEEEAC6A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC6A.vrmin"), &assign_ExcIEEEAC6A_vrmin)); } -void ExcIEEEAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC6A::debugName[] = "ExcIEEEAC6A"; -const char* ExcIEEEAC6A::debugString() +void ExcIEEEAC6A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC6A::debugName; } const BaseClassDefiner ExcIEEEAC6A::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner ExcIEEEAC6A::declare() return BaseClassDefiner(ExcIEEEAC6A::addConstructToMap, ExcIEEEAC6A::addPrimitiveAssignFnsToMap, ExcIEEEAC6A::addClassAssignFnsToMap, ExcIEEEAC6A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC6A_factory() + { + return new ExcIEEEAC6A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.hpp index 8b6c46dcc..d41b29933 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC6A.hpp @@ -1,61 +1,62 @@ #ifndef ExcIEEEAC6A_H #define ExcIEEEAC6A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC6A model. The model represents field-controlled alternator-rectifier excitation systems with system-supplied electronic voltage regulators. The maximum output of the regulator, , is a function of terminal voltage, . The field current limiter included in the original model AC6A remains in the 2005 update. Reference: IEEE Standard 421.5-2005 Section 6.6. */ - class ExcIEEEAC6A: public ExcitationSystemDynamics + class ExcIEEEAC6A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 536. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.086. Default: nullptr */ - CIMPP::Seconds tk; /* Voltage regulator time constant (T). Typical Value = 0.18. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 3. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 75. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -75. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 44. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -36. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh; /* Exciter field current limiter gain (K). Typical Value = 92. Default: nullptr */ - CIMPP::Seconds tj; /* Exciter field current limiter time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds th; /* Exciter field current limiter time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU vfelim; /* Exciter field current limit reference (V). Typical Value = 19. Default: nullptr */ - CIMPP::PU vhmax; /* Maximum field current limiter signal reference (V). Typical Value = 75. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.173. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.91. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1.6. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 7.4. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.214. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 5.55. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.044. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC6A(); - virtual ~ExcIEEEAC6A(); - + ~ExcIEEEAC6A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 536. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.173. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.91. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1.6. Default: nullptr */ + CIMPP::PU kh; /* Exciter field current limiter gain (K). Typical Value = 92. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.214. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.044. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.086. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 9. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds th; /* Exciter field current limiter time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tj; /* Exciter field current limiter time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tk; /* Voltage regulator time constant (T). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 75. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -75. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V(V). Typical Value = 7.4. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 5.55. Default: nullptr */ + CIMPP::PU vfelim; /* Exciter field current limit reference (V). Typical Value = 19. Default: nullptr */ + CIMPP::PU vhmax; /* Maximum field current limiter signal reference (V). Typical Value = 75. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 44. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -36. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC6A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.cpp index 51bda42ba..f4c5ba1bb 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.cpp @@ -1,11 +1,14 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC7B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -14,413 +17,436 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC7B::ExcIEEEAC7B() {}; - ExcIEEEAC7B::~ExcIEEEAC7B() {}; +bool assign_ExcIEEEAC7B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC7B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEAC7B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEAC7B_factory() { - return new ExcIEEEAC7B; - } + + + + + + + + + + + + + + + + + + + + +const char ExcIEEEAC7B::debugName[] = "ExcIEEEAC7B"; +const char* ExcIEEEAC7B::debugString() const +{ + return ExcIEEEAC7B::debugName; } -void ExcIEEEAC7B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC7B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B"), &ExcIEEEAC7B_factory)); } -void ExcIEEEAC7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpr"), &assign_ExcIEEEAC7B_kpr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kir"), &assign_ExcIEEEAC7B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kdr"), &assign_ExcIEEEAC7B_kdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.tdr"), &assign_ExcIEEEAC7B_tdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmax"), &assign_ExcIEEEAC7B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmin"), &assign_ExcIEEEAC7B_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpa"), &assign_ExcIEEEAC7B_kpa)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kia"), &assign_ExcIEEEAC7B_kia)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamax"), &assign_ExcIEEEAC7B_vamax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamin"), &assign_ExcIEEEAC7B_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kp"), &assign_ExcIEEEAC7B_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kl"), &assign_ExcIEEEAC7B_kl)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.te"), &assign_ExcIEEEAC7B_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vfemax"), &assign_ExcIEEEAC7B_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vemin"), &assign_ExcIEEEAC7B_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ke"), &assign_ExcIEEEAC7B_ke)); +void ExcIEEEAC7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kc"), &assign_ExcIEEEAC7B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kd"), &assign_ExcIEEEAC7B_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kdr"), &assign_ExcIEEEAC7B_kdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ke"), &assign_ExcIEEEAC7B_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kf1"), &assign_ExcIEEEAC7B_kf1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kf2"), &assign_ExcIEEEAC7B_kf2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kf3"), &assign_ExcIEEEAC7B_kf3)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kia"), &assign_ExcIEEEAC7B_kia)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kir"), &assign_ExcIEEEAC7B_kir)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kl"), &assign_ExcIEEEAC7B_kl)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kp"), &assign_ExcIEEEAC7B_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpa"), &assign_ExcIEEEAC7B_kpa)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.kpr"), &assign_ExcIEEEAC7B_kpr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve1"), &assign_ExcIEEEAC7B_seve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve2"), &assign_ExcIEEEAC7B_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.tdr"), &assign_ExcIEEEAC7B_tdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.te"), &assign_ExcIEEEAC7B_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.tf"), &assign_ExcIEEEAC7B_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamax"), &assign_ExcIEEEAC7B_vamax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vamin"), &assign_ExcIEEEAC7B_vamin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ve1"), &assign_ExcIEEEAC7B_ve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve1"), &assign_ExcIEEEAC7B_seve1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.ve2"), &assign_ExcIEEEAC7B_ve2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.seve2"), &assign_ExcIEEEAC7B_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vemin"), &assign_ExcIEEEAC7B_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vfemax"), &assign_ExcIEEEAC7B_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmax"), &assign_ExcIEEEAC7B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC7B.vrmin"), &assign_ExcIEEEAC7B_vrmin)); } -void ExcIEEEAC7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC7B::debugName[] = "ExcIEEEAC7B"; -const char* ExcIEEEAC7B::debugString() +void ExcIEEEAC7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC7B::debugName; } const BaseClassDefiner ExcIEEEAC7B::declare() @@ -428,4 +454,10 @@ const BaseClassDefiner ExcIEEEAC7B::declare() return BaseClassDefiner(ExcIEEEAC7B::addConstructToMap, ExcIEEEAC7B::addPrimitiveAssignFnsToMap, ExcIEEEAC7B::addClassAssignFnsToMap, ExcIEEEAC7B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC7B_factory() + { + return new ExcIEEEAC7B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.hpp index a91fbc510..3eda15144 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC7B.hpp @@ -1,65 +1,66 @@ #ifndef ExcIEEEAC7B_H #define ExcIEEEAC7B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC7B model. The model represents excitation systems which consist of an ac alternator with either stationary or rotating rectifiers to produce the dc field requirements. It is an upgrade to earlier ac excitation systems, which replace only the controls but retain the ac alternator and diode rectifier bridge. Reference: IEEE Standard 421.5-2005 Section 6.7. In the IEEE Standard 421.5 - 2005, the [1 / sT] block is shown as [1 / (1 + sT)], which is incorrect. */ - class ExcIEEEAC7B: public ExcitationSystemDynamics + class ExcIEEEAC7B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 4.24. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 4.24. Default: nullptr */ - CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.79. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -5.79. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 65.36. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 59.69. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.96. Default: nullptr */ - CIMPP::PU kl; /* Exciter field voltage lower limit parameter (K). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6.9. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.18. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU kf1; /* Excitation control system stabilizer gain (K). Typical Value = 0.212. Default: nullptr */ - CIMPP::PU kf2; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kf3; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.3. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.44. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.02. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.075. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC7B(); - virtual ~ExcIEEEAC7B(); - + ~ExcIEEEAC7B() override; + + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf1; /* Excitation control system stabilizer gain (K). Typical Value = 0.212. Default: nullptr */ + CIMPP::PU kf2; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf3; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 59.69. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 4.24. Default: nullptr */ + CIMPP::PU kl; /* Exciter field voltage lower limit parameter (K). Typical Value = 10. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.96. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 65.36. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 4.24. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.44. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.075. Default: nullptr */ + CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.1. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -0.95. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.3. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 3.02. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6.9. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5.79. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -5.79. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC7B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.cpp index 46e1f1861..ec5301141 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.cpp @@ -1,14 +1,21 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEAC8B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -17,290 +24,301 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; ExcIEEEAC8B::ExcIEEEAC8B() {}; - ExcIEEEAC8B::~ExcIEEEAC8B() {}; +bool assign_ExcIEEEAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ve2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfemax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEAC8B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_tdr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vfemax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfemax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_seve1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_ve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEAC8B_seve2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEAC8B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seve2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEAC8B_factory() { - return new ExcIEEEAC8B; - } +const char ExcIEEEAC8B::debugName[] = "ExcIEEEAC8B"; +const char* ExcIEEEAC8B::debugString() const +{ + return ExcIEEEAC8B::debugName; } -void ExcIEEEAC8B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEAC8B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B"), &ExcIEEEAC8B_factory)); } -void ExcIEEEAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kpr"), &assign_ExcIEEEAC8B_kpr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kir"), &assign_ExcIEEEAC8B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kdr"), &assign_ExcIEEEAC8B_kdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.tdr"), &assign_ExcIEEEAC8B_tdr)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmax"), &assign_ExcIEEEAC8B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmin"), &assign_ExcIEEEAC8B_vrmin)); +void ExcIEEEAC8B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ka"), &assign_ExcIEEEAC8B_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ta"), &assign_ExcIEEEAC8B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.te"), &assign_ExcIEEEAC8B_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vfemax"), &assign_ExcIEEEAC8B_vfemax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vemin"), &assign_ExcIEEEAC8B_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ke"), &assign_ExcIEEEAC8B_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kc"), &assign_ExcIEEEAC8B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kd"), &assign_ExcIEEEAC8B_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve1"), &assign_ExcIEEEAC8B_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kdr"), &assign_ExcIEEEAC8B_kdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ke"), &assign_ExcIEEEAC8B_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kir"), &assign_ExcIEEEAC8B_kir)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.kpr"), &assign_ExcIEEEAC8B_kpr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.seve1"), &assign_ExcIEEEAC8B_seve1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve2"), &assign_ExcIEEEAC8B_ve2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.seve2"), &assign_ExcIEEEAC8B_seve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ta"), &assign_ExcIEEEAC8B_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.tdr"), &assign_ExcIEEEAC8B_tdr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.te"), &assign_ExcIEEEAC8B_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve1"), &assign_ExcIEEEAC8B_ve1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.ve2"), &assign_ExcIEEEAC8B_ve2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vemin"), &assign_ExcIEEEAC8B_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vfemax"), &assign_ExcIEEEAC8B_vfemax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmax"), &assign_ExcIEEEAC8B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEAC8B.vrmin"), &assign_ExcIEEEAC8B_vrmin)); } -void ExcIEEEAC8B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEAC8B::debugName[] = "ExcIEEEAC8B"; -const char* ExcIEEEAC8B::debugString() +void ExcIEEEAC8B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEAC8B::debugName; } const BaseClassDefiner ExcIEEEAC8B::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcIEEEAC8B::declare() return BaseClassDefiner(ExcIEEEAC8B::addConstructToMap, ExcIEEEAC8B::addPrimitiveAssignFnsToMap, ExcIEEEAC8B::addClassAssignFnsToMap, ExcIEEEAC8B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEAC8B_factory() + { + return new ExcIEEEAC8B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.hpp index 52fdd9dda..e3597ea8e 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEAC8B.hpp @@ -1,57 +1,58 @@ #ifndef ExcIEEEAC8B_H #define ExcIEEEAC8B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type AC8B model. This model represents a PID voltage regulator with either a brushless exciter or dc exciter. The AVR in this model consists of PID control, with separate constants for the proportional (), integral (), and derivative () gains. The representation of the brushless exciter (, , , , ) is similar to the model Type AC2A. The Type AC8B model can be used to represent static voltage regulators applied to brushless excitation systems. Digitally based voltage regulators feeding dc rotating main exciters can be represented with the AC Type AC8B model with the parameters and set to 0. For thyristor power stages fed from the generator terminals, the limits and should be a function of terminal voltage: * and * . Reference: IEEE Standard 421.5-2005 Section 6.8. */ - class ExcIEEEAC8B: public ExcitationSystemDynamics + class ExcIEEEAC8B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 80. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 5. Default: nullptr */ - CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 35. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.55. Default: nullptr */ - CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.5. Default: nullptr */ - CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 9. Default: nullptr */ - CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 3. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEAC8B(); - virtual ~ExcIEEEAC8B(); - + ~ExcIEEEAC8B() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.55. Default: nullptr */ + CIMPP::PU kd; /* Demagnetizing factor, a function of exciter alternator reactances (K). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU kdr; /* Voltage regulator derivative gain (K). Typical Value = 10. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 5. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 80. Default: nullptr */ + CIMPP::Simple_Float seve1; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float seve2; /* Exciter saturation function value at the corresponding exciter voltage, V, back of commutating reactance (S[V]). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdr; /* Lag time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU ve1; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V) equals V (V). Typical Value = 6.5. Default: nullptr */ + CIMPP::PU ve2; /* Exciter alternator output voltages back of commutating reactance at which saturation is defined (V). Typical Value = 9. Default: nullptr */ + CIMPP::PU vemin; /* Minimum exciter voltage output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfemax; /* Exciter field current limit reference (V). Typical Value = 6. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 35. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEAC8B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.cpp index 1e4c6a4e9..a48495089 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.cpp @@ -1,276 +1,292 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC1A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Boolean.hpp" -#include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEDC1A::ExcIEEEDC1A() {}; - ExcIEEEDC1A::~ExcIEEEDC1A() {}; +bool assign_ExcIEEEDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC1A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEDC1A_factory() { - return new ExcIEEEDC1A; - } +const char ExcIEEEDC1A::debugName[] = "ExcIEEEDC1A"; +const char* ExcIEEEDC1A::debugString() const +{ + return ExcIEEEDC1A::debugName; } -void ExcIEEEDC1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A"), &ExcIEEEDC1A_factory)); } -void ExcIEEEDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEDC1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd1"), &assign_ExcIEEEDC1A_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd2"), &assign_ExcIEEEDC1A_efd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.exclim"), &assign_ExcIEEEDC1A_exclim)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ka"), &assign_ExcIEEEDC1A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ke"), &assign_ExcIEEEDC1A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.kf"), &assign_ExcIEEEDC1A_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd1"), &assign_ExcIEEEDC1A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd2"), &assign_ExcIEEEDC1A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ta"), &assign_ExcIEEEDC1A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.tb"), &assign_ExcIEEEDC1A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.tc"), &assign_ExcIEEEDC1A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmax"), &assign_ExcIEEEDC1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmin"), &assign_ExcIEEEDC1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.ke"), &assign_ExcIEEEDC1A_ke)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.te"), &assign_ExcIEEEDC1A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.kf"), &assign_ExcIEEEDC1A_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.tf"), &assign_ExcIEEEDC1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd1"), &assign_ExcIEEEDC1A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd1"), &assign_ExcIEEEDC1A_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.efd2"), &assign_ExcIEEEDC1A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.seefd2"), &assign_ExcIEEEDC1A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.uelin"), &assign_ExcIEEEDC1A_uelin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.exclim"), &assign_ExcIEEEDC1A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmax"), &assign_ExcIEEEDC1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC1A.vrmin"), &assign_ExcIEEEDC1A_vrmin)); } -void ExcIEEEDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC1A::debugName[] = "ExcIEEEDC1A"; -const char* ExcIEEEDC1A::debugString() +void ExcIEEEDC1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC1A::debugName; } const BaseClassDefiner ExcIEEEDC1A::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcIEEEDC1A::declare() return BaseClassDefiner(ExcIEEEDC1A::addConstructToMap, ExcIEEEDC1A::addPrimitiveAssignFnsToMap, ExcIEEEDC1A::addClassAssignFnsToMap, ExcIEEEDC1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC1A_factory() + { + return new ExcIEEEDC1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.hpp index 02b382b84..bc0f8df03 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC1A.hpp @@ -1,56 +1,57 @@ #ifndef ExcIEEEDC1A_H #define ExcIEEEDC1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC1A model. This model represents field-controlled dc commutator exciters with continuously acting voltage regulators (especially the direct-acting rheostatic, rotating amplifier, and magnetic amplifier types). Because this model has been widely implemented by the industry, it is sometimes used to represent other types of systems when detailed data for them are not available or when a simplified model is required. Reference: IEEE Standard 421.5-2005 Section 5.1. */ - class ExcIEEEDC1A: public ExcitationSystemDynamics + class ExcIEEEDC1A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 46. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.06. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.46. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.1. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.33. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.3. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.1. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC1A(); - virtual ~ExcIEEEDC1A(); - + ~ExcIEEEDC1A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.1. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.3. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 46. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.33. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.06. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.46. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.cpp index 022c95124..49e329c32 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC2A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -22,230 +26,247 @@ using namespace CIMPP; ExcIEEEDC2A::ExcIEEEDC2A() {}; - ExcIEEEDC2A::~ExcIEEEDC2A() {}; +bool assign_ExcIEEEDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC2A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEDC2A_factory() { - return new ExcIEEEDC2A; - } +const char ExcIEEEDC2A::debugName[] = "ExcIEEEDC2A"; +const char* ExcIEEEDC2A::debugString() const +{ + return ExcIEEEDC2A::debugName; } -void ExcIEEEDC2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A"), &ExcIEEEDC2A_factory)); } -void ExcIEEEDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A.efd1"), &assign_ExcIEEEDC2A_efd1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A.efd2"), &assign_ExcIEEEDC2A_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC2A.exclim"), &assign_ExcIEEEDC2A_exclim)); @@ -264,13 +285,8 @@ void ExcIEEEDC2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC2A::debugName[] = "ExcIEEEDC2A"; -const char* ExcIEEEDC2A::debugString() +void ExcIEEEDC2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC2A::debugName; } const BaseClassDefiner ExcIEEEDC2A::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcIEEEDC2A::declare() return BaseClassDefiner(ExcIEEEDC2A::addConstructToMap, ExcIEEEDC2A::addPrimitiveAssignFnsToMap, ExcIEEEDC2A::addClassAssignFnsToMap, ExcIEEEDC2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC2A_factory() + { + return new ExcIEEEDC2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.hpp index 554a6ba47..2656d284d 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC2A.hpp @@ -1,56 +1,57 @@ #ifndef ExcIEEEDC2A_H #define ExcIEEEDC2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "Simple_Float.hpp" +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC2A model. This model represents represent field-controlled dc commutator exciters with continuously acting voltage regulators having supplies obtained from the generator or auxiliary bus. It differs from the Type DC1A model only in the voltage regulator output limits, which are now proportional to terminal voltage . It is representative of solid-state replacements for various forms of older mechanical and rotating amplifier regulating equipment connected to dc commutator exciters. Reference: IEEE Standard 421.5-2005 Section 5.2. */ - class ExcIEEEDC2A: public ExcitationSystemDynamics + class ExcIEEEDC2A : public ExcitationSystemDynamics { - public: - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.05. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.29. Default: nullptr */ - CIMPP::PU exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. Typical Value = - 999 which means that there is no limit applied. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 300. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.279. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.117. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.33. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 0.675. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.95. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.9. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC2A(); - virtual ~ExcIEEEDC2A(); - + ~ExcIEEEDC2A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.05. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.29. Default: nullptr */ + CIMPP::PU exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. Typical Value = - 999 which means that there is no limit applied. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 300. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.279. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.117. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 1.33. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 0.675. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (uelin). true = input is connected to the HV gate false = input connects to the error signal. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.95. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.cpp index 3069c7e30..116d404a9 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.cpp @@ -1,201 +1,212 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC3A.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEDC3A::ExcIEEEDC3A() {}; - ExcIEEEDC3A::~ExcIEEEDC3A() {}; +bool assign_ExcIEEEDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exclim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC3A_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC3A_kv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEDC3A_exclim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exclim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEDC3A_factory() { - return new ExcIEEEDC3A; - } + + + + + + + + + +const char ExcIEEEDC3A::debugName[] = "ExcIEEEDC3A"; +const char* ExcIEEEDC3A::debugString() const +{ + return ExcIEEEDC3A::debugName; } -void ExcIEEEDC3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A"), &ExcIEEEDC3A_factory)); } -void ExcIEEEDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.trh"), &assign_ExcIEEEDC3A_trh)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.kv"), &assign_ExcIEEEDC3A_kv)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmax"), &assign_ExcIEEEDC3A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmin"), &assign_ExcIEEEDC3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.te"), &assign_ExcIEEEDC3A_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.ke"), &assign_ExcIEEEDC3A_ke)); +void ExcIEEEDC3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.efd1"), &assign_ExcIEEEDC3A_efd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd1"), &assign_ExcIEEEDC3A_seefd1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.efd2"), &assign_ExcIEEEDC3A_efd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd2"), &assign_ExcIEEEDC3A_seefd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.exclim"), &assign_ExcIEEEDC3A_exclim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.ke"), &assign_ExcIEEEDC3A_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.kv"), &assign_ExcIEEEDC3A_kv)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd1"), &assign_ExcIEEEDC3A_seefd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.seefd2"), &assign_ExcIEEEDC3A_seefd2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.te"), &assign_ExcIEEEDC3A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.trh"), &assign_ExcIEEEDC3A_trh)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmax"), &assign_ExcIEEEDC3A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC3A.vrmin"), &assign_ExcIEEEDC3A_vrmin)); } -void ExcIEEEDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC3A::debugName[] = "ExcIEEEDC3A"; -const char* ExcIEEEDC3A::debugString() +void ExcIEEEDC3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC3A::debugName; } const BaseClassDefiner ExcIEEEDC3A::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner ExcIEEEDC3A::declare() return BaseClassDefiner(ExcIEEEDC3A::addConstructToMap, ExcIEEEDC3A::addPrimitiveAssignFnsToMap, ExcIEEEDC3A::addClassAssignFnsToMap, ExcIEEEDC3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC3A_factory() + { + return new ExcIEEEDC3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.hpp index 41575683a..49c988e59 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC3A.hpp @@ -1,51 +1,52 @@ #ifndef ExcIEEEDC3A_H #define ExcIEEEDC3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC3A model. This model represents represent older systems, in particular those dc commutator exciters with non-continuously acting regulators that were commonly used before the development of the continuously acting varieties. These systems respond at basically two different rates, depending upon the magnitude of voltage error. For small errors, adjustment is made periodically with a signal to a motor-operated rheostat. Larger errors cause resistors to be quickly shorted or inserted and a strong forcing signal applied to the exciter. Continuous motion of the motor-operated rheostat occurs for these larger error signals, even though it is bypassed by contactor action. Reference: IEEE Standard 421.5-2005 Section 5.3. */ - class ExcIEEEDC3A: public ExcitationSystemDynamics + class ExcIEEEDC3A : public ExcitationSystemDynamics { - public: - CIMPP::Seconds trh; /* Rheostat travel time (T). Typical Value = 20. Default: nullptr */ - CIMPP::PU kv; /* Fast raise/lower contact setting (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.375. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.267. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.15. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.068. Default: nullptr */ - CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC3A(); - virtual ~ExcIEEEDC3A(); - + ~ExcIEEEDC3A() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.375. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 3.15. Default: nullptr */ + CIMPP::Boolean exclim; /* (exclim). IEEE standard is ambiguous about lower limit on exciter output. true = a lower limit of zero is applied to integrator output false = a lower limit of zero is not applied to integrator output. Typical Value = true. Default: false */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kv; /* Fast raise/lower contact setting (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.267. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.068. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds trh; /* Rheostat travel time (T). Typical Value = 20. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.cpp index d9da2e70d..9c83746f6 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.cpp @@ -1,321 +1,340 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEDC4B.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcIEEEDC4B::ExcIEEEDC4B() {}; - ExcIEEEDC4B::~ExcIEEEDC4B() {}; +bool assign_ExcIEEEDC4B_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->seefd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vemin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEDC4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEDC4B_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_seefd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_seefd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->seefd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_vemin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vemin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEDC4B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEDC4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEDC4B_factory() { - return new ExcIEEEDC4B; - } +const char ExcIEEEDC4B::debugName[] = "ExcIEEEDC4B"; +const char* ExcIEEEDC4B::debugString() const +{ + return ExcIEEEDC4B::debugName; } -void ExcIEEEDC4B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEDC4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B"), &ExcIEEEDC4B_factory)); } -void ExcIEEEDC4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEDC4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd1"), &assign_ExcIEEEDC4B_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd2"), &assign_ExcIEEEDC4B_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ka"), &assign_ExcIEEEDC4B_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ta"), &assign_ExcIEEEDC4B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kp"), &assign_ExcIEEEDC4B_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ki"), &assign_ExcIEEEDC4B_ki)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kd"), &assign_ExcIEEEDC4B_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.td"), &assign_ExcIEEEDC4B_td)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmax"), &assign_ExcIEEEDC4B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmin"), &assign_ExcIEEEDC4B_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ke"), &assign_ExcIEEEDC4B_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.te"), &assign_ExcIEEEDC4B_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kf"), &assign_ExcIEEEDC4B_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.tf"), &assign_ExcIEEEDC4B_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd1"), &assign_ExcIEEEDC4B_efd1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ki"), &assign_ExcIEEEDC4B_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.kp"), &assign_ExcIEEEDC4B_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.oelin"), &assign_ExcIEEEDC4B_oelin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.seefd1"), &assign_ExcIEEEDC4B_seefd1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.efd2"), &assign_ExcIEEEDC4B_efd2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.seefd2"), &assign_ExcIEEEDC4B_seefd2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vemin"), &assign_ExcIEEEDC4B_vemin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.oelin"), &assign_ExcIEEEDC4B_oelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.ta"), &assign_ExcIEEEDC4B_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.td"), &assign_ExcIEEEDC4B_td)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.te"), &assign_ExcIEEEDC4B_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.tf"), &assign_ExcIEEEDC4B_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.uelin"), &assign_ExcIEEEDC4B_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vemin"), &assign_ExcIEEEDC4B_vemin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmax"), &assign_ExcIEEEDC4B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEDC4B.vrmin"), &assign_ExcIEEEDC4B_vrmin)); } -void ExcIEEEDC4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEDC4B::debugName[] = "ExcIEEEDC4B"; -const char* ExcIEEEDC4B::debugString() +void ExcIEEEDC4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEDC4B::debugName; } const BaseClassDefiner ExcIEEEDC4B::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcIEEEDC4B::declare() return BaseClassDefiner(ExcIEEEDC4B::addConstructToMap, ExcIEEEDC4B::addPrimitiveAssignFnsToMap, ExcIEEEDC4B::addClassAssignFnsToMap, ExcIEEEDC4B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEDC4B_factory() + { + return new ExcIEEEDC4B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.hpp index cbb1cf6a8..f5ea5c20a 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEDC4B.hpp @@ -1,59 +1,60 @@ #ifndef ExcIEEEDC4B_H #define ExcIEEEDC4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type DC4B model. These excitation systems utilize a field-controlled dc commutator exciter with a continuously acting voltage regulator having supplies obtained from the generator or auxiliary bus. Reference: IEEE Standard 421.5-2005 Section 5.4. */ - class ExcIEEEDC4B: public ExcitationSystemDynamics + class ExcIEEEDC4B : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU kp; /* Regulator proportional gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::PU ki; /* Regulator integral gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::PU kd; /* Regulator derivative gain (K). Typical Value = 20. Default: nullptr */ - CIMPP::Seconds td; /* Regulator derivative filter time constant(T). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 2.7. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 1.75. Default: nullptr */ - CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.33. Default: nullptr */ - CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.27. Default: nullptr */ - CIMPP::PU vemin; /* Minimum exciter voltage output(V). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean oelin; /* OEL input (OELin). true = LV gate false = subtract from error signal. Typical Value = true. Default: false */ - CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEDC4B(); - virtual ~ExcIEEEDC4B(); - + ~ExcIEEEDC4B() override; + + CIMPP::PU efd1; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 1.75. Default: nullptr */ + CIMPP::PU efd2; /* Exciter voltage at which exciter saturation is defined (E). Typical Value = 2.33. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kd; /* Regulator derivative gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Regulator integral gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU kp; /* Regulator proportional gain (K). Typical Value = 20. Default: nullptr */ + CIMPP::Boolean oelin; /* OEL input (OELin). true = LV gate false = subtract from error signal. Typical Value = true. Default: false */ + CIMPP::Simple_Float seefd1; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.08. Default: nullptr */ + CIMPP::Simple_Float seefd2; /* Exciter saturation function value at the corresponding exciter voltage, E (S[E]). Typical Value = 0.27. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds td; /* Regulator derivative filter time constant(T). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ + CIMPP::PU vemin; /* Minimum exciter voltage output(V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 2.7. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEDC4B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.cpp index 137e3cc50..48a92f05e 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -25,269 +29,289 @@ using namespace CIMPP; ExcIEEEST1A::ExcIEEEST1A() {}; - ExcIEEEST1A::~ExcIEEEST1A() {}; +bool assign_ExcIEEEST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_pssin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pssin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_pssin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pssin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST1A_factory() { - return new ExcIEEEST1A; - } +const char ExcIEEEST1A::debugName[] = "ExcIEEEST1A"; +const char* ExcIEEEST1A::debugString() const +{ + return ExcIEEEST1A::debugName; } -void ExcIEEEST1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A"), &ExcIEEEST1A_factory)); } -void ExcIEEEST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A.ilr"), &assign_ExcIEEEST1A_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A.ka"), &assign_ExcIEEEST1A_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST1A.kc"), &assign_ExcIEEEST1A_kc)); @@ -309,13 +333,8 @@ void ExcIEEEST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST1A::debugName[] = "ExcIEEEST1A"; -const char* ExcIEEEST1A::debugString() +void ExcIEEEST1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST1A::debugName; } const BaseClassDefiner ExcIEEEST1A::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcIEEEST1A::declare() return BaseClassDefiner(ExcIEEEST1A::addConstructToMap, ExcIEEEST1A::addPrimitiveAssignFnsToMap, ExcIEEEST1A::addClassAssignFnsToMap, ExcIEEEST1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST1A_factory() + { + return new ExcIEEEST1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.hpp index c45173769..c59603d1c 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST1A.hpp @@ -1,59 +1,60 @@ #ifndef ExcIEEEST1A_H #define ExcIEEEST1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Seconds.hpp" #include "ExcIEEEST1AUELselectorKind.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST1A model. This model represents systems in which excitation power is supplied through a transformer from the generator terminals (or the unit's auxiliary bus) and is regulated by a controlled rectifier. The maximum exciter voltage available from such systems is directly related to the generator terminal voltage. Reference: IEEE Standard 421.5-2005 Section 7.1. */ - class ExcIEEEST1A: public ExcitationSystemDynamics + class ExcIEEEST1A : public ExcitationSystemDynamics { - public: - CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 190. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean pssin; /* Selector of the Power System Stabilizer (PSS) input (PSSin). true = PSS input (Vs) added to error signal false = PSS input (Vs) added to voltage regulator output. Typical Value = true. Default: false */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tb1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tc1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::ExcIEEEST1AUELselectorKind uelin; /* Selector of the connection of the UEL input (UELin). Typical Value = ignoreUELsignal. Default: 0 */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ - CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 999. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -999. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 7.8. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -6.7. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST1A(); - virtual ~ExcIEEEST1A(); - + ~ExcIEEEST1A() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 190. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean pssin; /* Selector of the Power System Stabilizer (PSS) input (PSSin). true = PSS input (Vs) added to error signal false = PSS input (Vs) added to voltage regulator output. Typical Value = true. Default: false */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tb1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tc1; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::ExcIEEEST1AUELselectorKind uelin; /* Selector of the connection of the UEL input (UELin). Typical Value = ignoreUELsignal. Default: 0 */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 14.5. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -14.5. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 999. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -999. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 7.8. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = -6.7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.cpp index 6060c0dd5..cac712136 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST1AUELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcIEEEST1AUELselectorKind& rop) +ExcIEEEST1AUELselectorKind& ExcIEEEST1AUELselectorKind::operator=(ExcIEEEST1AUELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcIEEEST1AUELselectorKind::operator ExcIEEEST1AUELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcIEEEST1AUELselectorKind::debugName[] = "ExcIEEEST1AUELselectorKind"; +const char* ExcIEEEST1AUELselectorKind::debugString() const +{ + return ExcIEEEST1AUELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcIEEEST1AUELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcIEEEST1AUELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcIEEEST1AUELselectorKind::ignoreUELsignal) + { + EnumSymbol = "ignoreUELsignal"; + } + if (obj.value == ExcIEEEST1AUELselectorKind::inputHVgateVoltageOutput) + { + EnumSymbol = "inputHVgateVoltageOutput"; + } + if (obj.value == ExcIEEEST1AUELselectorKind::inputHVgateErrorSignal) + { + EnumSymbol = "inputHVgateErrorSignal"; + } + if (obj.value == ExcIEEEST1AUELselectorKind::inputAddedToErrorSignal) + { + EnumSymbol = "inputAddedToErrorSignal"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcIEEEST1AUELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.hpp index 3f420426b..62cd07318 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST1AUELselectorKind.hpp @@ -1,29 +1,54 @@ #ifndef ExcIEEEST1AUELselectorKind_H #define ExcIEEEST1AUELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the UEL input used in ExcIEEEST1A. */ - enum class ExcIEEEST1AUELselectorKind + class ExcIEEEST1AUELselectorKind { - /** - * Ignore UEL signal. - */ - ignoreUELsignal, - /** - * UEL input HV gate with voltage regulator output. - */ - inputHVgateVoltageOutput, - /** - * UEL input HV gate with error signal. - */ - inputHVgateErrorSignal, - /** - * UEL input added to error signal. - */ - inputAddedToErrorSignal, + public: + enum ExcIEEEST1AUELselectorKind_ENUM + { + /** + * Ignore UEL signal. + */ + ignoreUELsignal, + /** + * UEL input HV gate with voltage regulator output. + */ + inputHVgateVoltageOutput, + /** + * UEL input HV gate with error signal. + */ + inputHVgateErrorSignal, + /** + * UEL input added to error signal. + */ + inputAddedToErrorSignal, + }; + + ExcIEEEST1AUELselectorKind() : value(), initialized(false) {} + ExcIEEEST1AUELselectorKind(ExcIEEEST1AUELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcIEEEST1AUELselectorKind& operator=(ExcIEEEST1AUELselectorKind_ENUM rop); + operator ExcIEEEST1AUELselectorKind_ENUM() const; + + ExcIEEEST1AUELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcIEEEST1AUELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcIEEEST1AUELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcIEEEST1AUELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.cpp index 4ac35b2ef..def7e0e1c 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.cpp @@ -1,30 +1,199 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST2A.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcIEEEST2A::ExcIEEEST2A() {}; - ExcIEEEST2A::~ExcIEEEST2A() {}; +bool assign_ExcIEEEST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_ExcIEEEST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +206,39 @@ ExcIEEEST2A::~ExcIEEEST2A() {}; -bool assign_ExcIEEEST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEST2A_factory() { - return new ExcIEEEST2A; - } +const char ExcIEEEST2A::debugName[] = "ExcIEEEST2A"; +const char* ExcIEEEST2A::debugString() const +{ + return ExcIEEEST2A::debugName; } -void ExcIEEEST2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A"), &ExcIEEEST2A_factory)); } -void ExcIEEEST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.efdmax"), &assign_ExcIEEEST2A_efdmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ka"), &assign_ExcIEEEST2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ta"), &assign_ExcIEEEST2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmax"), &assign_ExcIEEEST2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmin"), &assign_ExcIEEEST2A_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kc"), &assign_ExcIEEEST2A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ke"), &assign_ExcIEEEST2A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.te"), &assign_ExcIEEEST2A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kf"), &assign_ExcIEEEST2A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.tf"), &assign_ExcIEEEST2A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kp"), &assign_ExcIEEEST2A_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ki"), &assign_ExcIEEEST2A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kc"), &assign_ExcIEEEST2A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.efdmax"), &assign_ExcIEEEST2A_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.kp"), &assign_ExcIEEEST2A_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.ta"), &assign_ExcIEEEST2A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.te"), &assign_ExcIEEEST2A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.tf"), &assign_ExcIEEEST2A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.uelin"), &assign_ExcIEEEST2A_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmax"), &assign_ExcIEEEST2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST2A.vrmin"), &assign_ExcIEEEST2A_vrmin)); } -void ExcIEEEST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST2A::debugName[] = "ExcIEEEST2A"; -const char* ExcIEEEST2A::debugString() +void ExcIEEEST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST2A::debugName; } const BaseClassDefiner ExcIEEEST2A::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner ExcIEEEST2A::declare() return BaseClassDefiner(ExcIEEEST2A::addConstructToMap, ExcIEEEST2A::addPrimitiveAssignFnsToMap, ExcIEEEST2A::addClassAssignFnsToMap, ExcIEEEST2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST2A_factory() + { + return new ExcIEEEST2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.hpp index 912aa6548..817ffedb7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST2A.hpp @@ -1,52 +1,53 @@ #ifndef ExcIEEEST2A_H #define ExcIEEEST2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST2A model. Some static systems utilize both current and voltage sources (generator terminal quantities) to comprise the power source. The regulator controls the exciter output through controlled saturation of the power transformer components. These compound-source rectifier excitation systems are designated Type ST2A and are represented by ExcIEEEST2A. Reference: IEEE Standard 421.5-2005 Section 7.2. */ - class ExcIEEEST2A: public ExcitationSystemDynamics + class ExcIEEEST2A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 120. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.88. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 8. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 1.82. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum field voltage (E). Typical Value = 99. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST2A(); - virtual ~ExcIEEEST2A(); - + ~ExcIEEEST2A() override; + + CIMPP::PU efdmax; /* Maximum field voltage (E). Typical Value = 99. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (K). Typical Value = 120. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 1.82. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (K). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 8. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 4.88. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (T). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.cpp index 4c4f03a47..63b81a0cb 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.cpp @@ -1,22 +1,26 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST3A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "AngleDegrees.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -26,311 +30,327 @@ using namespace CIMPP; ExcIEEEST3A::ExcIEEEST3A() {}; - ExcIEEEST3A::~ExcIEEEST3A() {}; +bool assign_ExcIEEEST3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vgmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vgmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST3A_factory() { - return new ExcIEEEST3A; - } +const char ExcIEEEST3A::debugName[] = "ExcIEEEST3A"; +const char* ExcIEEEST3A::debugString() const +{ + return ExcIEEEST3A::debugName; } -void ExcIEEEST3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A"), &ExcIEEEST3A_factory)); } -void ExcIEEEST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimax"), &assign_ExcIEEEST3A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimin"), &assign_ExcIEEEST3A_vimin)); +void ExcIEEEST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ka"), &assign_ExcIEEEST3A_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kc"), &assign_ExcIEEEST3A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kg"), &assign_ExcIEEEST3A_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ki"), &assign_ExcIEEEST3A_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.km"), &assign_ExcIEEEST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kp"), &assign_ExcIEEEST3A_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ta"), &assign_ExcIEEEST3A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.tb"), &assign_ExcIEEEST3A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.tc"), &assign_ExcIEEEST3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmax"), &assign_ExcIEEEST3A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmin"), &assign_ExcIEEEST3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.km"), &assign_ExcIEEEST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.thetap"), &assign_ExcIEEEST3A_thetap)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.tm"), &assign_ExcIEEEST3A_tm)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vbmax"), &assign_ExcIEEEST3A_vbmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vgmax"), &assign_ExcIEEEST3A_vgmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimax"), &assign_ExcIEEEST3A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vimin"), &assign_ExcIEEEST3A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vmmax"), &assign_ExcIEEEST3A_vmmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vmmin"), &assign_ExcIEEEST3A_vmmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kg"), &assign_ExcIEEEST3A_kg)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kp"), &assign_ExcIEEEST3A_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.thetap"), &assign_ExcIEEEST3A_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.ki"), &assign_ExcIEEEST3A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.kc"), &assign_ExcIEEEST3A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmax"), &assign_ExcIEEEST3A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vrmin"), &assign_ExcIEEEST3A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.xl"), &assign_ExcIEEEST3A_xl)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vbmax"), &assign_ExcIEEEST3A_vbmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST3A.vgmax"), &assign_ExcIEEEST3A_vgmax)); } -void ExcIEEEST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST3A::debugName[] = "ExcIEEEST3A"; -const char* ExcIEEEST3A::debugString() +void ExcIEEEST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST3A::debugName; } const BaseClassDefiner ExcIEEEST3A::declare() @@ -338,4 +358,10 @@ const BaseClassDefiner ExcIEEEST3A::declare() return BaseClassDefiner(ExcIEEEST3A::addConstructToMap, ExcIEEEST3A::addPrimitiveAssignFnsToMap, ExcIEEEST3A::addClassAssignFnsToMap, ExcIEEEST3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST3A_factory() + { + return new ExcIEEEST3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.hpp index dc1e98f9f..9497c70c7 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST3A.hpp @@ -1,59 +1,60 @@ #ifndef ExcIEEEST3A_H #define ExcIEEEST3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST3A model. Some static systems utilize a field voltage control loop to linearize the exciter control characteristic. This also makes the output independent of supply source variations until supply limitations are reached. These systems utilize a variety of controlled-rectifier designs: full thyristor complements or hybrid bridges in either series or shunt configurations. The power source may consist of only a potential source, either fed from the machine terminals or from internal windings. Some designs may have compound power sources utilizing both machine potential and current. These power sources are represented as phasor combinations of machine terminal current and voltage and are accommodated by suitable parameters in model Type ST3A which is represented by ExcIEEEST3A. Reference: IEEE Standard 421.5-2005 Section 7.3. */ - class ExcIEEEST3A: public ExcitationSystemDynamics + class ExcIEEEST3A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -0.2. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (K). This is parameter K in the IEEE Std. Typical Value = 200. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 10. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -10. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 7.93. Default: nullptr */ - CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (T). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 6.15. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.081. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 6.9. Default: nullptr */ - CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (V). Typical Value = 5.8. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST3A(); - virtual ~ExcIEEEST3A(); - + ~ExcIEEEST3A() override; + + CIMPP::PU ka; /* Voltage regulator gain (K). This is parameter K in the IEEE Std. Typical Value = 200. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 7.93. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 6.15. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (T). Typical Value = 1. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (T). Typical Value = 0.4. Default: nullptr */ + CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 6.9. Default: nullptr */ + CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (V). Typical Value = 5.8. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (V). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (V). Typical Value = -0.2. Default: nullptr */ + CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 10. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -10. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.081. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.cpp index 738423f7b..7f8bb74f6 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.cpp @@ -1,19 +1,23 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST4B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" -#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -22,255 +26,267 @@ using namespace CIMPP; ExcIEEEST4B::ExcIEEEST4B() {}; - ExcIEEEST4B::~ExcIEEEST4B() {}; +bool assign_ExcIEEEST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST4B_factory() { - return new ExcIEEEST4B; - } +const char ExcIEEEST4B::debugName[] = "ExcIEEEST4B"; +const char* ExcIEEEST4B::debugString() const +{ + return ExcIEEEST4B::debugName; } -void ExcIEEEST4B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B"), &ExcIEEEST4B_factory)); } -void ExcIEEEST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kpr"), &assign_ExcIEEEST4B_kpr)); +void ExcIEEEST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kc"), &assign_ExcIEEEST4B_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kg"), &assign_ExcIEEEST4B_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ki"), &assign_ExcIEEEST4B_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kim"), &assign_ExcIEEEST4B_kim)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kir"), &assign_ExcIEEEST4B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ta"), &assign_ExcIEEEST4B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmax"), &assign_ExcIEEEST4B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmin"), &assign_ExcIEEEST4B_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kp"), &assign_ExcIEEEST4B_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kpm"), &assign_ExcIEEEST4B_kpm)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kim"), &assign_ExcIEEEST4B_kim)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kpr"), &assign_ExcIEEEST4B_kpr)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ta"), &assign_ExcIEEEST4B_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.thetap"), &assign_ExcIEEEST4B_thetap)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vbmax"), &assign_ExcIEEEST4B_vbmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vmmax"), &assign_ExcIEEEST4B_vmmax)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vmmin"), &assign_ExcIEEEST4B_vmmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kg"), &assign_ExcIEEEST4B_kg)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kp"), &assign_ExcIEEEST4B_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.thetap"), &assign_ExcIEEEST4B_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.ki"), &assign_ExcIEEEST4B_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.kc"), &assign_ExcIEEEST4B_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmax"), &assign_ExcIEEEST4B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vrmin"), &assign_ExcIEEEST4B_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.xl"), &assign_ExcIEEEST4B_xl)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST4B.vbmax"), &assign_ExcIEEEST4B_vbmax)); } -void ExcIEEEST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST4B::debugName[] = "ExcIEEEST4B"; -const char* ExcIEEEST4B::debugString() +void ExcIEEEST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST4B::debugName; } const BaseClassDefiner ExcIEEEST4B::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcIEEEST4B::declare() return BaseClassDefiner(ExcIEEEST4B::addConstructToMap, ExcIEEEST4B::addPrimitiveAssignFnsToMap, ExcIEEEST4B::addClassAssignFnsToMap, ExcIEEEST4B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST4B_factory() + { + return new ExcIEEEST4B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.hpp index 9d4f94400..7ddb62e5b 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST4B.hpp @@ -1,55 +1,56 @@ #ifndef ExcIEEEST4B_H #define ExcIEEEST4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST4B model. This model is a variation of the Type ST3A model, with a proportional plus integral (PI) regulator block replacing the lag-lead regulator characteristic that is in the ST3A model. Both potential and compound source rectifier excitation systems are modeled. The PI regulator blocks have non-windup limits that are represented. The voltage regulator of this model is typically implemented digitally. Reference: IEEE Standard 421.5-2005 Section 7.4. */ - class ExcIEEEST4B: public ExcitationSystemDynamics + class ExcIEEEST4B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 10.75. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 10.75. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU kpm; /* Voltage regulator proportional gain output (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kim; /* Voltage regulator integral gain output (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 99. Default: nullptr */ - CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = -99. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 9.3. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.113. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.124. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 11.63. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST4B(); - virtual ~ExcIEEEST4B(); - + ~ExcIEEEST4B() override; + + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (K). Typical Value = 0.113. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kim; /* Voltage regulator integral gain output (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (K). Typical Value = 10.75. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (K). Typical Value = 9.3. Default: nullptr */ + CIMPP::PU kpm; /* Voltage regulator proportional gain output (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (K). Typical Value = 10.75. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ + CIMPP::PU vbmax; /* Maximum excitation voltage (V). Typical Value = 11.63. Default: nullptr */ + CIMPP::PU vmmax; /* Maximum inner loop output (V). Typical Value = 99. Default: nullptr */ + CIMPP::PU vmmin; /* Minimum inner loop output (V). Typical Value = -99. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (X). Typical Value = 0.124. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST4B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.cpp index fa855da43..8a63ef0f1 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.cpp @@ -1,10 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST5B.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" @@ -19,273 +20,289 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcIEEEST5B::ExcIEEEST5B() {}; - ExcIEEEST5B::~ExcIEEEST5B() {}; +bool assign_ExcIEEEST5B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tob1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tob1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tob2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tob2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_toc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->toc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_toc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->toc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tub1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tub1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tub2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tub2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tuc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_tuc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST5B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST5B_kr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_toc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->toc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tob1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tob1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_toc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->toc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tob2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tob2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tuc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tub1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tub1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tuc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST5B_tub2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST5B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tub2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST5B_factory() { - return new ExcIEEEST5B; - } +const char ExcIEEEST5B::debugName[] = "ExcIEEEST5B"; +const char* ExcIEEEST5B::debugString() const +{ + return ExcIEEEST5B::debugName; } -void ExcIEEEST5B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST5B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B"), &ExcIEEEST5B_factory)); } -void ExcIEEEST5B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST5B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.kc"), &assign_ExcIEEEST5B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.kr"), &assign_ExcIEEEST5B_kr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.t1"), &assign_ExcIEEEST5B_t1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.kc"), &assign_ExcIEEEST5B_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmax"), &assign_ExcIEEEST5B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmin"), &assign_ExcIEEEST5B_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc1"), &assign_ExcIEEEST5B_tc1)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tb1"), &assign_ExcIEEEST5B_tb1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc2"), &assign_ExcIEEEST5B_tc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tb2"), &assign_ExcIEEEST5B_tb2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc1"), &assign_ExcIEEEST5B_toc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc1"), &assign_ExcIEEEST5B_tc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tc2"), &assign_ExcIEEEST5B_tc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tob1"), &assign_ExcIEEEST5B_tob1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc2"), &assign_ExcIEEEST5B_toc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tob2"), &assign_ExcIEEEST5B_tob2)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc1"), &assign_ExcIEEEST5B_tuc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc1"), &assign_ExcIEEEST5B_toc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.toc2"), &assign_ExcIEEEST5B_toc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tub1"), &assign_ExcIEEEST5B_tub1)); - assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc2"), &assign_ExcIEEEST5B_tuc2)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tub2"), &assign_ExcIEEEST5B_tub2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc1"), &assign_ExcIEEEST5B_tuc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.tuc2"), &assign_ExcIEEEST5B_tuc2)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmax"), &assign_ExcIEEEST5B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST5B.vrmin"), &assign_ExcIEEEST5B_vrmin)); } -void ExcIEEEST5B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST5B::debugName[] = "ExcIEEEST5B"; -const char* ExcIEEEST5B::debugString() +void ExcIEEEST5B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST5B::debugName; } const BaseClassDefiner ExcIEEEST5B::declare() @@ -293,4 +310,10 @@ const BaseClassDefiner ExcIEEEST5B::declare() return BaseClassDefiner(ExcIEEEST5B::addConstructToMap, ExcIEEEST5B::addPrimitiveAssignFnsToMap, ExcIEEEST5B::addClassAssignFnsToMap, ExcIEEEST5B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST5B_factory() + { + return new ExcIEEEST5B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.hpp index cbabc34f9..20bc909f1 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST5B.hpp @@ -1,55 +1,56 @@ #ifndef ExcIEEEST5B_H #define ExcIEEEST5B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST5B model. The Type ST5B excitation system is a variation of the Type ST1A model, with alternative overexcitation and underexcitation inputs and additional limits. Reference: IEEE Standard 421.5-2005 Section 7.5. Note: the block diagram in the IEEE 421.5 standard has input signal Vc and does not indicate the summation point with Vref. The implementation of the ExcIEEEST5B shall consider summation point with Vref. */ - class ExcIEEEST5B: public ExcitationSystemDynamics + class ExcIEEEST5B : public ExcitationSystemDynamics { - public: - CIMPP::PU kr; /* Regulator gain (K). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds t1; /* Firing circuit time constant (T1). Typical Value = 0.004. Default: nullptr */ - CIMPP::PU kc; /* Rectifier regulation factor (K). Typical Value = 0.004. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4. Default: nullptr */ - CIMPP::Seconds tc1; /* Regulator lead time constant (T). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tb1; /* Regulator lag time constant (T). Typical Value = 6. Default: nullptr */ - CIMPP::Seconds tc2; /* Regulator lead time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tb2; /* Regulator lag time constant (T). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds toc1; /* OEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tob1; /* OEL lag time constant (T). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds toc2; /* OEL lead time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tob2; /* OEL lag time constant (T). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tuc1; /* UEL lead time constant (T). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tub1; /* UEL lag time constant (T). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tuc2; /* UEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tub2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST5B(); - virtual ~ExcIEEEST5B(); - + ~ExcIEEEST5B() override; + + CIMPP::PU kc; /* Rectifier regulation factor (K). Typical Value = 0.004. Default: nullptr */ + CIMPP::PU kr; /* Regulator gain (K). Typical Value = 200. Default: nullptr */ + CIMPP::Seconds t1; /* Firing circuit time constant (T1). Typical Value = 0.004. Default: nullptr */ + CIMPP::Seconds tb1; /* Regulator lag time constant (T). Typical Value = 6. Default: nullptr */ + CIMPP::Seconds tb2; /* Regulator lag time constant (T). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tc1; /* Regulator lead time constant (T). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tc2; /* Regulator lead time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tob1; /* OEL lag time constant (T). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tob2; /* OEL lag time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds toc1; /* OEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds toc2; /* OEL lead time constant (T). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tub1; /* UEL lag time constant (T). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tub2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tuc1; /* UEL lead time constant (T). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tuc2; /* UEL lead time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST5B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.cpp index 19e9d1502..1d19b4998 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST6B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -20,204 +24,219 @@ using namespace CIMPP; ExcIEEEST6B::ExcIEEEST6B() {}; - ExcIEEEST6B::~ExcIEEEST6B() {}; +bool assign_ExcIEEEST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kci(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kci; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kci(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kci; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcIEEEST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcIEEEST6B_factory() { - return new ExcIEEEST6B; - } + + + + + + + + + + +const char ExcIEEEST6B::debugName[] = "ExcIEEEST6B"; +const char* ExcIEEEST6B::debugString() const +{ + return ExcIEEEST6B::debugName; } -void ExcIEEEST6B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST6B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B"), &ExcIEEEST6B_factory)); } -void ExcIEEEST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B.ilr"), &assign_ExcIEEEST6B_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B.kci"), &assign_ExcIEEEST6B_kci)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST6B.kff"), &assign_ExcIEEEST6B_kff)); @@ -234,13 +253,8 @@ void ExcIEEEST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST6B::debugName[] = "ExcIEEEST6B"; -const char* ExcIEEEST6B::debugString() +void ExcIEEEST6B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST6B::debugName; } const BaseClassDefiner ExcIEEEST6B::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner ExcIEEEST6B::declare() return BaseClassDefiner(ExcIEEEST6B::addConstructToMap, ExcIEEEST6B::addPrimitiveAssignFnsToMap, ExcIEEEST6B::addClassAssignFnsToMap, ExcIEEEST6B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST6B_factory() + { + return new ExcIEEEST6B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.hpp index dcf0633c3..1c5b7b3c9 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST6B.hpp @@ -1,53 +1,54 @@ #ifndef ExcIEEEST6B_H #define ExcIEEEST6B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcST6BOELselectorKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST6B model. This model consists of a PI voltage regulator with an inner loop field voltage regulator and pre-control. The field voltage regulator implements a proportional control. The pre-control and the delay in the feedback circuit increase the dynamic response. Reference: IEEE Standard 421.5-2005 Section 7.6. */ - class ExcIEEEST6B: public ExcitationSystemDynamics + class ExcIEEEST6B : public ExcitationSystemDynamics { - public: - CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 4.164. Default: nullptr */ - CIMPP::PU kci; /* Exciter output current limit adjustment (K). Typical Value = 1.0577. Default: nullptr */ - CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 45.094. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 17.33. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 18.038. Default: nullptr */ - CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST6B(); - virtual ~ExcIEEEST6B(); - + ~ExcIEEEST6B() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (I). Typical Value = 4.164. Default: nullptr */ + CIMPP::PU kci; /* Exciter output current limit adjustment (K). Typical Value = 1.0577. Default: nullptr */ + CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 45.094. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limiter gain (K). Typical Value = 17.33. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 18.038. Default: nullptr */ + CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -3.85. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST6B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.cpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.cpp index aa585bfc8..76c7e0260 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcIEEEST7B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -21,217 +25,233 @@ using namespace CIMPP; ExcIEEEST7B::ExcIEEEST7B() {}; - ExcIEEEST7B::~ExcIEEEST7B() {}; +bool assign_ExcIEEEST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcIEEEST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcIEEEST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcIEEEST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcIEEEST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcIEEEST7B_factory() { - return new ExcIEEEST7B; - } +const char ExcIEEEST7B::debugName[] = "ExcIEEEST7B"; +const char* ExcIEEEST7B::debugString() const +{ + return ExcIEEEST7B::debugName; } -void ExcIEEEST7B::addConstructToMap(std::unordered_map& factory_map) { +void ExcIEEEST7B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B"), &ExcIEEEST7B_factory)); } -void ExcIEEEST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcIEEEST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B.kh"), &assign_ExcIEEEST7B_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B.kia"), &assign_ExcIEEEST7B_kia)); assign_map.insert(std::make_pair(std::string("cim:ExcIEEEST7B.kl"), &assign_ExcIEEEST7B_kl)); @@ -249,13 +269,8 @@ void ExcIEEEST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcIEEEST7B::debugName[] = "ExcIEEEST7B"; -const char* ExcIEEEST7B::debugString() +void ExcIEEEST7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcIEEEST7B::debugName; } const BaseClassDefiner ExcIEEEST7B::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner ExcIEEEST7B::declare() return BaseClassDefiner(ExcIEEEST7B::addConstructToMap, ExcIEEEST7B::addPrimitiveAssignFnsToMap, ExcIEEEST7B::addClassAssignFnsToMap, ExcIEEEST7B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcIEEEST7B_factory() + { + return new ExcIEEEST7B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.hpp b/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.hpp index b09663574..68301f797 100644 --- a/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcIEEEST7B.hpp @@ -1,55 +1,56 @@ #ifndef ExcIEEEST7B_H #define ExcIEEEST7B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcST7BOELselectorKind.hpp" -#include "Seconds.hpp" #include "ExcST7BUELselectorKind.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type ST7B model. This model is representative of static potential-source excitation systems. In this system, the AVR consists of a PI voltage regulator. A phase lead-lag filter in series allows introduction of a derivative function, typically used with brushless excitation systems. In that case, the regulator is of the PID type. In addition, the terminal voltage channel includes a phase lead-lag filter. The AVR includes the appropriate inputs on its reference for overexcitation limiter (OEL1), underexcitation limiter (UEL), stator current limiter (SCL), and current compensator (DROOP). All these limitations, when they work at voltage reference level, keep the PSS (VS signal from Type PSS1A, PSS2A, or PSS2B) in operation. However, the UEL limitation can also be transferred to the high value (HV) gate acting on the output signal. In addition, the output signal passes through a low value (LV) gate for a ceiling overexcitation limiter (OEL2). Reference: IEEE Standard 421.5-2005 Section 7.7. */ - class ExcIEEEST7B: public ExcitationSystemDynamics + class ExcIEEEST7B : public ExcitationSystemDynamics { - public: - CIMPP::PU kh; /* High-value gate feedback gain (K). Typical Value 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl; /* Low-value gate feedback gain (K). Typical Value 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 40. Default: nullptr */ - CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tb; /* Regulator lag time constant (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tc; /* Regulator lead time constant (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value 1. Default: nullptr */ - CIMPP::Seconds tia; /* Feedback time constant (T). Typical Value = 3. Default: nullptr */ - CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ - CIMPP::PU vmax; /* Maximum voltage reference signal (V). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum voltage reference signal (V). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcIEEEST7B(); - virtual ~ExcIEEEST7B(); - + ~ExcIEEEST7B() override; + + CIMPP::PU kh; /* High-value gate feedback gain (K). Typical Value 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl; /* Low-value gate feedback gain (K). Typical Value 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (K). Typical Value = 40. Default: nullptr */ + CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tb; /* Regulator lag time constant (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tc; /* Regulator lead time constant (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (T). Typical Value 1. Default: nullptr */ + CIMPP::Seconds tia; /* Feedback time constant (T). Typical Value = 3. Default: nullptr */ + CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ + CIMPP::PU vmax; /* Maximum voltage reference signal (V). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum voltage reference signal (V). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (V). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (V). Typical Value = -4.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcIEEEST7B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcOEX3T.cpp b/CGMES_2.4.15_27JAN2020/ExcOEX3T.cpp index 79bf9658a..6849a4fed 100644 --- a/CGMES_2.4.15_27JAN2020/ExcOEX3T.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcOEX3T.cpp @@ -1,321 +1,340 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcOEX3T.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; ExcOEX3T::ExcOEX3T() {}; - ExcOEX3T::~ExcOEX3T() {}; +bool assign_ExcOEX3T_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_see1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->see1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_see2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->see2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcOEX3T_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcOEX3T_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_see1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->see1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcOEX3T_see2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcOEX3T* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->see2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcOEX3T_factory() { - return new ExcOEX3T; - } +const char ExcOEX3T::debugName[] = "ExcOEX3T"; +const char* ExcOEX3T::debugString() const +{ + return ExcOEX3T::debugName; } -void ExcOEX3T::addConstructToMap(std::unordered_map& factory_map) { +void ExcOEX3T::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcOEX3T"), &ExcOEX3T_factory)); } -void ExcOEX3T::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcOEX3T::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e1"), &assign_ExcOEX3T_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e2"), &assign_ExcOEX3T_e2)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ka"), &assign_ExcOEX3T_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kc"), &assign_ExcOEX3T_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kd"), &assign_ExcOEX3T_kd)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ke"), &assign_ExcOEX3T_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kf"), &assign_ExcOEX3T_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see1"), &assign_ExcOEX3T_see1)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see2"), &assign_ExcOEX3T_see2)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t1"), &assign_ExcOEX3T_t1)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t2"), &assign_ExcOEX3T_t2)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t3"), &assign_ExcOEX3T_t3)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t4"), &assign_ExcOEX3T_t4)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ka"), &assign_ExcOEX3T_ka)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t5"), &assign_ExcOEX3T_t5)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.t6"), &assign_ExcOEX3T_t6)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmax"), &assign_ExcOEX3T_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmin"), &assign_ExcOEX3T_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.te"), &assign_ExcOEX3T_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kf"), &assign_ExcOEX3T_kf)); assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.tf"), &assign_ExcOEX3T_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kc"), &assign_ExcOEX3T_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.kd"), &assign_ExcOEX3T_kd)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.ke"), &assign_ExcOEX3T_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e1"), &assign_ExcOEX3T_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see1"), &assign_ExcOEX3T_see1)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.e2"), &assign_ExcOEX3T_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.see2"), &assign_ExcOEX3T_see2)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmax"), &assign_ExcOEX3T_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcOEX3T.vrmin"), &assign_ExcOEX3T_vrmin)); } -void ExcOEX3T::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcOEX3T::debugName[] = "ExcOEX3T"; -const char* ExcOEX3T::debugString() +void ExcOEX3T::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcOEX3T::debugName; } const BaseClassDefiner ExcOEX3T::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcOEX3T::declare() return BaseClassDefiner(ExcOEX3T::addConstructToMap, ExcOEX3T::addPrimitiveAssignFnsToMap, ExcOEX3T::addClassAssignFnsToMap, ExcOEX3T::debugName); } - +namespace CIMPP +{ + BaseClass* ExcOEX3T_factory() + { + return new ExcOEX3T; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcOEX3T.hpp b/CGMES_2.4.15_27JAN2020/ExcOEX3T.hpp index d89680ab6..8ee520293 100644 --- a/CGMES_2.4.15_27JAN2020/ExcOEX3T.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcOEX3T.hpp @@ -1,57 +1,58 @@ #ifndef ExcOEX3T_H #define ExcOEX3T_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE Type ST1 Excitation System with semi-continuous and acting terminal voltage limiter. */ - class ExcOEX3T: public ExcitationSystemDynamics + class ExcOEX3T : public ExcitationSystemDynamics { - public: - CIMPP::Seconds t1; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T). Default: nullptr */ - CIMPP::PU ka; /* Gain (K). Default: nullptr */ - CIMPP::Seconds t5; /* Time constant (T). Default: nullptr */ - CIMPP::Seconds t6; /* Time constant (T). Default: nullptr */ - CIMPP::PU vrmax; /* Limiter (V). Default: nullptr */ - CIMPP::PU vrmin; /* Limiter (V). Default: nullptr */ - CIMPP::Seconds te; /* Time constant (T). Default: nullptr */ - CIMPP::PU kf; /* Gain (K). Default: nullptr */ - CIMPP::Seconds tf; /* Time constant (T). Default: nullptr */ - CIMPP::PU kc; /* Gain (K). Default: nullptr */ - CIMPP::PU kd; /* Gain (K). Default: nullptr */ - CIMPP::PU ke; /* Gain (K). Default: nullptr */ - CIMPP::PU e1; /* Saturation parameter (E). Default: nullptr */ - CIMPP::PU see1; /* Saturation parameter (S(E)). Default: nullptr */ - CIMPP::PU e2; /* Saturation parameter (E). Default: nullptr */ - CIMPP::PU see2; /* Saturation parameter (S(E)). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcOEX3T(); - virtual ~ExcOEX3T(); - + ~ExcOEX3T() override; + + CIMPP::PU e1; /* Saturation parameter (E). Default: nullptr */ + CIMPP::PU e2; /* Saturation parameter (E). Default: nullptr */ + CIMPP::PU ka; /* Gain (K). Default: nullptr */ + CIMPP::PU kc; /* Gain (K). Default: nullptr */ + CIMPP::PU kd; /* Gain (K). Default: nullptr */ + CIMPP::PU ke; /* Gain (K). Default: nullptr */ + CIMPP::PU kf; /* Gain (K). Default: nullptr */ + CIMPP::PU see1; /* Saturation parameter (S(E)). Default: nullptr */ + CIMPP::PU see2; /* Saturation parameter (S(E)). Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t5; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds t6; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds te; /* Time constant (T). Default: nullptr */ + CIMPP::Seconds tf; /* Time constant (T). Default: nullptr */ + CIMPP::PU vrmax; /* Limiter (V). Default: nullptr */ + CIMPP::PU vrmin; /* Limiter (V). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcOEX3T_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcPIC.cpp b/CGMES_2.4.15_27JAN2020/ExcPIC.cpp index b62a9a96b..4e7434109 100644 --- a/CGMES_2.4.15_27JAN2020/ExcPIC.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcPIC.cpp @@ -1,26 +1,30 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcPIC.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -29,353 +33,372 @@ using namespace CIMPP; ExcPIC::ExcPIC() {}; - ExcPIC::~ExcPIC() {}; +bool assign_ExcPIC_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_ta4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcPIC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcPIC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcPIC_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ta4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcPIC_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcPIC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcPIC_factory() { - return new ExcPIC; - } +const char ExcPIC::debugName[] = "ExcPIC"; +const char* ExcPIC::debugString() const +{ + return ExcPIC::debugName; } -void ExcPIC::addConstructToMap(std::unordered_map& factory_map) { +void ExcPIC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcPIC"), &ExcPIC_factory)); } -void ExcPIC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcPIC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e1"), &assign_ExcPIC_e1)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e2"), &assign_ExcPIC_e2)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmax"), &assign_ExcPIC_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmin"), &assign_ExcPIC_efdmin)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ka"), &assign_ExcPIC_ka)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kc"), &assign_ExcPIC_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ke"), &assign_ExcPIC_ke)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kf"), &assign_ExcPIC_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ki"), &assign_ExcPIC_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kp"), &assign_ExcPIC_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se1"), &assign_ExcPIC_se1)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se2"), &assign_ExcPIC_se2)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta1"), &assign_ExcPIC_ta1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr1"), &assign_ExcPIC_vr1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr2"), &assign_ExcPIC_vr2)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta2"), &assign_ExcPIC_ta2)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta3"), &assign_ExcPIC_ta3)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ta4"), &assign_ExcPIC_ta4)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmax"), &assign_ExcPIC_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmin"), &assign_ExcPIC_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kf"), &assign_ExcPIC_kf)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.te"), &assign_ExcPIC_te)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.tf1"), &assign_ExcPIC_tf1)); assign_map.insert(std::make_pair(std::string("cim:ExcPIC.tf2"), &assign_ExcPIC_tf2)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmax"), &assign_ExcPIC_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.efdmin"), &assign_ExcPIC_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ke"), &assign_ExcPIC_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.te"), &assign_ExcPIC_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e1"), &assign_ExcPIC_e1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se1"), &assign_ExcPIC_se1)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.e2"), &assign_ExcPIC_e2)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.se2"), &assign_ExcPIC_se2)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kp"), &assign_ExcPIC_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.ki"), &assign_ExcPIC_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcPIC.kc"), &assign_ExcPIC_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr1"), &assign_ExcPIC_vr1)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vr2"), &assign_ExcPIC_vr2)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmax"), &assign_ExcPIC_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcPIC.vrmin"), &assign_ExcPIC_vrmin)); } -void ExcPIC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcPIC::debugName[] = "ExcPIC"; -const char* ExcPIC::debugString() +void ExcPIC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcPIC::debugName; } const BaseClassDefiner ExcPIC::declare() @@ -383,4 +406,10 @@ const BaseClassDefiner ExcPIC::declare() return BaseClassDefiner(ExcPIC::addConstructToMap, ExcPIC::addPrimitiveAssignFnsToMap, ExcPIC::addClassAssignFnsToMap, ExcPIC::debugName); } - +namespace CIMPP +{ + BaseClass* ExcPIC_factory() + { + return new ExcPIC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcPIC.hpp b/CGMES_2.4.15_27JAN2020/ExcPIC.hpp index 411e21612..29379a6fa 100644 --- a/CGMES_2.4.15_27JAN2020/ExcPIC.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcPIC.hpp @@ -1,61 +1,62 @@ #ifndef ExcPIC_H #define ExcPIC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Proportional/Integral Regulator Excitation System Model. This model can be used to represent excitation systems with a proportional-integral (PI) voltage regulator controller. */ - class ExcPIC: public ExcitationSystemDynamics + class ExcPIC : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* PI controller gain (Ka). Typical Value = 3.15. Default: nullptr */ - CIMPP::Seconds ta1; /* PI controller time constant (Ta1). Typical Value = 1. Default: nullptr */ - CIMPP::PU vr1; /* PI maximum limit (Vr1). Typical Value = 1. Default: nullptr */ - CIMPP::PU vr2; /* PI minimum limit (Vr2). Typical Value = -0.87. Default: nullptr */ - CIMPP::Seconds ta2; /* Voltage regulator time constant (Ta2). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds ta3; /* Lead time constant (Ta3). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta4; /* Lag time constant (Ta4). Typical Value = 0. Default: nullptr */ - CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU kf; /* Rate feedback gain (Kf). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf1; /* Rate feedback time constant (Tf1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf2; /* Rate feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ - CIMPP::PU efdmax; /* Exciter maximum limit (Efdmax). Typical Value = 8. Default: nullptr */ - CIMPP::PU efdmin; /* Exciter minimum limit (Efdmin). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant (Ke). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant (Te). Typical Value = 0. Default: nullptr */ - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 0. Default: nullptr */ - CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 0. Default: nullptr */ - CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Potential source gain (Kp). Typical Value = 6.5. Default: nullptr */ - CIMPP::PU ki; /* Current source gain (Ki). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Exciter regulation factor (Kc). Typical Value = 0.08. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcPIC(); - virtual ~ExcPIC(); - + ~ExcPIC() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 0. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 0. Default: nullptr */ + CIMPP::PU efdmax; /* Exciter maximum limit (Efdmax). Typical Value = 8. Default: nullptr */ + CIMPP::PU efdmin; /* Exciter minimum limit (Efdmin). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU ka; /* PI controller gain (Ka). Typical Value = 3.15. Default: nullptr */ + CIMPP::PU kc; /* Exciter regulation factor (Kc). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant (Ke). Typical Value = 0. Default: nullptr */ + CIMPP::PU kf; /* Rate feedback gain (Kf). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Current source gain (Ki). Typical Value = 0. Default: nullptr */ + CIMPP::PU kp; /* Potential source gain (Kp). Typical Value = 6.5. Default: nullptr */ + CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0. Default: nullptr */ + CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta1; /* PI controller time constant (Ta1). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ta2; /* Voltage regulator time constant (Ta2). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds ta3; /* Lead time constant (Ta3). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta4; /* Lag time constant (Ta4). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant (Te). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf1; /* Rate feedback time constant (Tf1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf2; /* Rate feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ + CIMPP::PU vr1; /* PI maximum limit (Vr1). Typical Value = 1. Default: nullptr */ + CIMPP::PU vr2; /* PI minimum limit (Vr2). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU vrmax; /* Voltage regulator maximum limit (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Voltage regulator minimum limit (Vrmin). Typical Value = -0.87. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcPIC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcREXS.cpp b/CGMES_2.4.15_27JAN2020/ExcREXS.cpp index 0b586cbc4..29f89ca72 100644 --- a/CGMES_2.4.15_27JAN2020/ExcREXS.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcREXS.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcREXS.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "ExcREXSFeedbackSignalKind.hpp" @@ -42,490 +46,527 @@ using namespace CIMPP; ExcREXS::ExcREXS() {}; - ExcREXS::~ExcREXS() {}; +bool assign_ExcREXS_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_flimf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flimf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kefd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kefd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kii(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kii; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kvi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kvp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_kvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvphz; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_nvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nvphz; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->se2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vcmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vfmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcREXS_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcREXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcREXS_e1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_e2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_flimf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flimf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcREXS_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kefd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kefd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kii(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kii; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kvi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kvp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_kvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvphz; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_nvphz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nvphz; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_se1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_se2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->se2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tc2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vcmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vfmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcREXS_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcREXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcREXS_factory() { - return new ExcREXS; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char ExcREXS::debugName[] = "ExcREXS"; +const char* ExcREXS::debugString() const +{ + return ExcREXS::debugName; } -void ExcREXS::addConstructToMap(std::unordered_map& factory_map) { +void ExcREXS::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcREXS"), &ExcREXS_factory)); } -void ExcREXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcREXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcREXS.e1"), &assign_ExcREXS_e1)); assign_map.insert(std::make_pair(std::string("cim:ExcREXS.e2"), &assign_ExcREXS_e2)); assign_map.insert(std::make_pair(std::string("cim:ExcREXS.fbf"), &assign_ExcREXS_fbf)); @@ -564,13 +605,8 @@ void ExcREXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcREXS::debugName[] = "ExcREXS"; -const char* ExcREXS::debugString() +void ExcREXS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcREXS::debugName; } const BaseClassDefiner ExcREXS::declare() @@ -578,4 +614,10 @@ const BaseClassDefiner ExcREXS::declare() return BaseClassDefiner(ExcREXS::addConstructToMap, ExcREXS::addPrimitiveAssignFnsToMap, ExcREXS::addClassAssignFnsToMap, ExcREXS::debugName); } - +namespace CIMPP +{ + BaseClass* ExcREXS_factory() + { + return new ExcREXS; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcREXS.hpp b/CGMES_2.4.15_27JAN2020/ExcREXS.hpp index 067bce3bf..bb6ea0147 100644 --- a/CGMES_2.4.15_27JAN2020/ExcREXS.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcREXS.hpp @@ -1,75 +1,76 @@ #ifndef ExcREXS_H #define ExcREXS_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcREXSFeedbackSignalKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* General Purpose Rotating Excitation System Model. This model can be used to represent a wide range of excitation systems whose DC power source is an AC or DC generator. It encompasses IEEE type AC1, AC2, DC1, and DC2 excitation system models. */ - class ExcREXS: public ExcitationSystemDynamics + class ExcREXS : public ExcitationSystemDynamics { - public: - CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 3. Default: nullptr */ - CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 4. Default: nullptr */ - CIMPP::ExcREXSFeedbackSignalKind fbf; /* Rate feedback signal flag (Fbf). Typical Value = fieldCurrent. Default: 0 */ - CIMPP::PU flimf; /* Limit type flag (Flimf). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier regulation factor (Kc). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU kd; /* Exciter regulation factor (Kd). Typical Value = 2. Default: nullptr */ - CIMPP::PU ke; /* Exciter field proportional constant (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::PU kefd; /* Field voltage feedback gain (Kefd). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds kf; /* Rate feedback gain (Kf). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU kh; /* Field voltage controller feedback gain (Kh). Typical Value = 0. Default: nullptr */ - CIMPP::PU kii; /* Field Current Regulator Integral Gain (Kii). Typical Value = 0. Default: nullptr */ - CIMPP::PU kip; /* Field Current Regulator Proportional Gain (Kip). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU kvi; /* Voltage Regulator Integral Gain (Kvi). Typical Value = 0. Default: nullptr */ - CIMPP::PU kvp; /* Voltage Regulator Proportional Gain (Kvp). Typical Value = 2800. Default: nullptr */ - CIMPP::PU kvphz; /* V/Hz limiter gain (Kvphz). Typical Value = 0. Default: nullptr */ - CIMPP::PU nvphz; /* Pickup speed of V/Hz limiter (Nvphz). Typical Value = 0. Default: nullptr */ - CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0.0001. Default: nullptr */ - CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0.001. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage Regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ - CIMPP::Seconds tb1; /* Lag time constant (Tb1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb2; /* Lag time constant (Tb2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc1; /* Lead time constant (Tc1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc2; /* Lead time constant (Tc2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds te; /* Exciter field time constant (Te). Typical Value = 1.2. Default: nullptr */ - CIMPP::Seconds tf; /* Rate feedback time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf1; /* Feedback lead time constant (Tf1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf2; /* Feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tp; /* Field current Bridge time constant (Tp). Typical Value = 0. Default: nullptr */ - CIMPP::PU vcmax; /* Maximum compounding voltage (Vcmax). Typical Value = 0. Default: nullptr */ - CIMPP::PU vfmax; /* Maximum Exciter Field Current (Vfmax). Typical Value = 47. Default: nullptr */ - CIMPP::PU vfmin; /* Minimum Exciter Field Current (Vfmin). Typical Value = -20. Default: nullptr */ - CIMPP::PU vimax; /* Voltage Regulator Input Limit (Vimax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum controller output (Vrmax). Typical Value = 47. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum controller output (Vrmin). Typical Value = -20. Default: nullptr */ - CIMPP::PU xc; /* Exciter compounding reactance (Xc). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcREXS(); - virtual ~ExcREXS(); - + ~ExcREXS() override; + + CIMPP::PU e1; /* Field voltage value 1 (E1). Typical Value = 3. Default: nullptr */ + CIMPP::PU e2; /* Field voltage value 2 (E2). Typical Value = 4. Default: nullptr */ + CIMPP::ExcREXSFeedbackSignalKind fbf; /* Rate feedback signal flag (Fbf). Typical Value = fieldCurrent. Default: 0 */ + CIMPP::PU flimf; /* Limit type flag (Flimf). Typical Value = 0. Default: nullptr */ + CIMPP::PU kc; /* Rectifier regulation factor (Kc). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kd; /* Exciter regulation factor (Kd). Typical Value = 2. Default: nullptr */ + CIMPP::PU ke; /* Exciter field proportional constant (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kefd; /* Field voltage feedback gain (Kefd). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds kf; /* Rate feedback gain (Kf). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kh; /* Field voltage controller feedback gain (Kh). Typical Value = 0. Default: nullptr */ + CIMPP::PU kii; /* Field Current Regulator Integral Gain (Kii). Typical Value = 0. Default: nullptr */ + CIMPP::PU kip; /* Field Current Regulator Proportional Gain (Kip). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::PU kvi; /* Voltage Regulator Integral Gain (Kvi). Typical Value = 0. Default: nullptr */ + CIMPP::PU kvp; /* Voltage Regulator Proportional Gain (Kvp). Typical Value = 2800. Default: nullptr */ + CIMPP::PU kvphz; /* V/Hz limiter gain (Kvphz). Typical Value = 0. Default: nullptr */ + CIMPP::PU nvphz; /* Pickup speed of V/Hz limiter (Nvphz). Typical Value = 0. Default: nullptr */ + CIMPP::PU se1; /* Saturation factor at E1 (Se1). Typical Value = 0.0001. Default: nullptr */ + CIMPP::PU se2; /* Saturation factor at E2 (Se2). Typical Value = 0.001. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage Regulator time constant (Ta). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds tb1; /* Lag time constant (Tb1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb2; /* Lag time constant (Tb2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc1; /* Lead time constant (Tc1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc2; /* Lead time constant (Tc2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter field time constant (Te). Typical Value = 1.2. Default: nullptr */ + CIMPP::Seconds tf; /* Rate feedback time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf1; /* Feedback lead time constant (Tf1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf2; /* Feedback lag time constant (Tf2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tp; /* Field current Bridge time constant (Tp). Typical Value = 0. Default: nullptr */ + CIMPP::PU vcmax; /* Maximum compounding voltage (Vcmax). Typical Value = 0. Default: nullptr */ + CIMPP::PU vfmax; /* Maximum Exciter Field Current (Vfmax). Typical Value = 47. Default: nullptr */ + CIMPP::PU vfmin; /* Minimum Exciter Field Current (Vfmin). Typical Value = -20. Default: nullptr */ + CIMPP::PU vimax; /* Voltage Regulator Input Limit (Vimax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum controller output (Vrmax). Typical Value = 47. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum controller output (Vrmin). Typical Value = -20. Default: nullptr */ + CIMPP::PU xc; /* Exciter compounding reactance (Xc). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcREXS_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.cpp b/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.cpp index 9f24a10b7..de55c6691 100644 --- a/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcREXSFeedbackSignalKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcREXSFeedbackSignalKind& rop) +ExcREXSFeedbackSignalKind& ExcREXSFeedbackSignalKind::operator=(ExcREXSFeedbackSignalKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcREXSFeedbackSignalKind::operator ExcREXSFeedbackSignalKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcREXSFeedbackSignalKind::debugName[] = "ExcREXSFeedbackSignalKind"; +const char* ExcREXSFeedbackSignalKind::debugString() const +{ + return ExcREXSFeedbackSignalKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcREXSFeedbackSignalKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcREXSFeedbackSignalKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcREXSFeedbackSignalKind::fieldVoltage) + { + EnumSymbol = "fieldVoltage"; + } + if (obj.value == ExcREXSFeedbackSignalKind::fieldCurrent) + { + EnumSymbol = "fieldCurrent"; + } + if (obj.value == ExcREXSFeedbackSignalKind::outputVoltage) + { + EnumSymbol = "outputVoltage"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcREXSFeedbackSignalKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.hpp b/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.hpp index 40c3b7e29..2ca199680 100644 --- a/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcREXSFeedbackSignalKind.hpp @@ -1,25 +1,50 @@ #ifndef ExcREXSFeedbackSignalKind_H #define ExcREXSFeedbackSignalKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of rate feedback signals. */ - enum class ExcREXSFeedbackSignalKind + class ExcREXSFeedbackSignalKind { - /** - * The voltage regulator output voltage is used. It is the same as exciter field voltage. - */ - fieldVoltage, - /** - * The exciter field current is used. - */ - fieldCurrent, - /** - * The output voltage of the exciter is used. - */ - outputVoltage, + public: + enum ExcREXSFeedbackSignalKind_ENUM + { + /** + * The voltage regulator output voltage is used. It is the same as exciter field voltage. + */ + fieldVoltage, + /** + * The exciter field current is used. + */ + fieldCurrent, + /** + * The output voltage of the exciter is used. + */ + outputVoltage, + }; + + ExcREXSFeedbackSignalKind() : value(), initialized(false) {} + ExcREXSFeedbackSignalKind(ExcREXSFeedbackSignalKind_ENUM value) : value(value), initialized(true) {} + + ExcREXSFeedbackSignalKind& operator=(ExcREXSFeedbackSignalKind_ENUM rop); + operator ExcREXSFeedbackSignalKind_ENUM() const; + + ExcREXSFeedbackSignalKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcREXSFeedbackSignalKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcREXSFeedbackSignalKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcREXSFeedbackSignalKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ExcSCRX.cpp b/CGMES_2.4.15_27JAN2020/ExcSCRX.cpp index 705acd366..7f086d80e 100644 --- a/CGMES_2.4.15_27JAN2020/ExcSCRX.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcSCRX.cpp @@ -1,156 +1,164 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcSCRX.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcSCRX::ExcSCRX() {}; - ExcSCRX::~ExcSCRX() {}; +bool assign_ExcSCRX_cswitch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cswitch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_rcrfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcrfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tatb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSCRX_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcSCRX_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tatb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_cswitch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cswitch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSCRX_rcrfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSCRX* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcrfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcSCRX_factory() { - return new ExcSCRX; - } +const char ExcSCRX::debugName[] = "ExcSCRX"; +const char* ExcSCRX::debugString() const +{ + return ExcSCRX::debugName; } -void ExcSCRX::addConstructToMap(std::unordered_map& factory_map) { +void ExcSCRX::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcSCRX"), &ExcSCRX_factory)); } -void ExcSCRX::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcSCRX::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.cswitch"), &assign_ExcSCRX_cswitch)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emax"), &assign_ExcSCRX_emax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emin"), &assign_ExcSCRX_emin)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.k"), &assign_ExcSCRX_k)); + assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.rcrfd"), &assign_ExcSCRX_rcrfd)); assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.tatb"), &assign_ExcSCRX_tatb)); assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.tb"), &assign_ExcSCRX_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.k"), &assign_ExcSCRX_k)); assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.te"), &assign_ExcSCRX_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emin"), &assign_ExcSCRX_emin)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.emax"), &assign_ExcSCRX_emax)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.cswitch"), &assign_ExcSCRX_cswitch)); - assign_map.insert(std::make_pair(std::string("cim:ExcSCRX.rcrfd"), &assign_ExcSCRX_rcrfd)); } -void ExcSCRX::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcSCRX::debugName[] = "ExcSCRX"; -const char* ExcSCRX::debugString() +void ExcSCRX::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcSCRX::debugName; } const BaseClassDefiner ExcSCRX::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner ExcSCRX::declare() return BaseClassDefiner(ExcSCRX::addConstructToMap, ExcSCRX::addPrimitiveAssignFnsToMap, ExcSCRX::addClassAssignFnsToMap, ExcSCRX::debugName); } - +namespace CIMPP +{ + BaseClass* ExcSCRX_factory() + { + return new ExcSCRX; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcSCRX.hpp b/CGMES_2.4.15_27JAN2020/ExcSCRX.hpp index f3e9799fd..af289a605 100644 --- a/CGMES_2.4.15_27JAN2020/ExcSCRX.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcSCRX.hpp @@ -1,48 +1,49 @@ #ifndef ExcSCRX_H #define ExcSCRX_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simple excitation system model representing generic characteristics of many excitation systems; intended for use where negative field current may be a problem. */ - class ExcSCRX: public ExcitationSystemDynamics + class ExcSCRX : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). The parameter Ta is not defined explicitly. Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU k; /* Gain (K) (>0). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds te; /* Time constant of gain block (Te) (>0). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = 0. Default: nullptr */ - CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ - CIMPP::Boolean cswitch; /* Power source switch (Cswitch). true = fixed voltage of 1.0 PU false = generator terminal voltage. Default: false */ - CIMPP::Simple_Float rcrfd; /* Rc/Rfd - ratio of field discharge resistance to field winding resistance (RcRfd). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcSCRX(); - virtual ~ExcSCRX(); - + ~ExcSCRX() override; + + CIMPP::Boolean cswitch; /* Power source switch (Cswitch). true = fixed voltage of 1.0 PU false = generator terminal voltage. Default: false */ + CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ + CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = 0. Default: nullptr */ + CIMPP::PU k; /* Gain (K) (>0). Typical Value = 200. Default: nullptr */ + CIMPP::Simple_Float rcrfd; /* Rc/Rfd - ratio of field discharge resistance to field winding resistance (RcRfd). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). The parameter Ta is not defined explicitly. Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds te; /* Time constant of gain block (Te) (>0). Typical Value = 0.02. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcSCRX_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcSEXS.cpp b/CGMES_2.4.15_27JAN2020/ExcSEXS.cpp index 61ad50b9e..0877745ba 100644 --- a/CGMES_2.4.15_27JAN2020/ExcSEXS.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcSEXS.cpp @@ -1,186 +1,196 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcSEXS.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; ExcSEXS::ExcSEXS() {}; - ExcSEXS::~ExcSEXS() {}; +bool assign_ExcSEXS_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tatb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSEXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcSEXS_tatb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tatb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSEXS_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSEXS_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSEXS_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSEXS* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcSEXS_factory() { - return new ExcSEXS; - } + + + +const char ExcSEXS::debugName[] = "ExcSEXS"; +const char* ExcSEXS::debugString() const +{ + return ExcSEXS::debugName; } -void ExcSEXS::addConstructToMap(std::unordered_map& factory_map) { +void ExcSEXS::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcSEXS"), &ExcSEXS_factory)); } -void ExcSEXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tatb"), &assign_ExcSEXS_tatb)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tb"), &assign_ExcSEXS_tb)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.k"), &assign_ExcSEXS_k)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.te"), &assign_ExcSEXS_te)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.emin"), &assign_ExcSEXS_emin)); +void ExcSEXS::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmax"), &assign_ExcSEXS_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmin"), &assign_ExcSEXS_efdmin)); assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.emax"), &assign_ExcSEXS_emax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.emin"), &assign_ExcSEXS_emin)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.k"), &assign_ExcSEXS_k)); assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.kc"), &assign_ExcSEXS_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tatb"), &assign_ExcSEXS_tatb)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tb"), &assign_ExcSEXS_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.tc"), &assign_ExcSEXS_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmin"), &assign_ExcSEXS_efdmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.efdmax"), &assign_ExcSEXS_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcSEXS.te"), &assign_ExcSEXS_te)); } -void ExcSEXS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcSEXS::debugName[] = "ExcSEXS"; -const char* ExcSEXS::debugString() +void ExcSEXS::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcSEXS::debugName; } const BaseClassDefiner ExcSEXS::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner ExcSEXS::declare() return BaseClassDefiner(ExcSEXS::addConstructToMap, ExcSEXS::addPrimitiveAssignFnsToMap, ExcSEXS::addClassAssignFnsToMap, ExcSEXS::debugName); } - +namespace CIMPP +{ + BaseClass* ExcSEXS_factory() + { + return new ExcSEXS; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcSEXS.hpp b/CGMES_2.4.15_27JAN2020/ExcSEXS.hpp index 451a2b99a..cda7c72b1 100644 --- a/CGMES_2.4.15_27JAN2020/ExcSEXS.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcSEXS.hpp @@ -1,49 +1,50 @@ #ifndef ExcSEXS_H #define ExcSEXS_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified Excitation System Model. */ - class ExcSEXS: public ExcitationSystemDynamics + class ExcSEXS : public ExcitationSystemDynamics { - public: - CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU k; /* Gain (K) (>0). Typical Value = 100. Default: nullptr */ - CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -5. Default: nullptr */ - CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ - CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 0.08. Default: nullptr */ - CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::PU efdmin; /* Field voltage clipping minimum limit (Efdmin). Typical Value = -5. Default: nullptr */ - CIMPP::PU efdmax; /* Field voltage clipping maximum limit (Efdmax). Typical Value = 5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcSEXS(); - virtual ~ExcSEXS(); - + ~ExcSEXS() override; + + CIMPP::PU efdmax; /* Field voltage clipping maximum limit (Efdmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU efdmin; /* Field voltage clipping minimum limit (Efdmin). Typical Value = -5. Default: nullptr */ + CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 5. Default: nullptr */ + CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -5. Default: nullptr */ + CIMPP::PU k; /* Gain (K) (>0). Typical Value = 100. Default: nullptr */ + CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 0.08. Default: nullptr */ + CIMPP::Simple_Float tatb; /* Ta/Tb - gain reduction ratio of lag-lead element (TaTb). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tb; /* Denominator time constant of lag-lead block (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcSEXS_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcSK.cpp b/CGMES_2.4.15_27JAN2020/ExcSK.cpp index a3a3b9fd3..8c9d63df5 100644 --- a/CGMES_2.4.15_27JAN2020/ExcSK.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcSK.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcSK.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -38,438 +42,471 @@ using namespace CIMPP; ExcSK::ExcSK() {}; - ExcSK::~ExcSK() {}; +bool assign_ExcSK_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kgob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kgob; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kqi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kqob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqob; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_kqp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_nq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_qconoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qconoff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_qz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qz; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_remote(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->remote; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_sbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_uimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_uimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_urmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->urmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_urmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->urmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_vtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcSK_yp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcSK_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_efdmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_emin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kgob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kgob; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kqi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kqob(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqob; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_kqp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_nq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_qconoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qconoff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_qz(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qz; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_remote(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->remote; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_sbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_uimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_uimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_urmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->urmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_urmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->urmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_vtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_vtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ExcSK_yp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* ExcSK_factory() { - return new ExcSK; - } + + + + + + + + + + + + + + + + + + + + + + + + + + +const char ExcSK::debugName[] = "ExcSK"; +const char* ExcSK::debugString() const +{ + return ExcSK::debugName; } -void ExcSK::addConstructToMap(std::unordered_map& factory_map) { +void ExcSK::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcSK"), &ExcSK_factory)); } -void ExcSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcSK.efdmax"), &assign_ExcSK_efdmax)); assign_map.insert(std::make_pair(std::string("cim:ExcSK.efdmin"), &assign_ExcSK_efdmin)); assign_map.insert(std::make_pair(std::string("cim:ExcSK.emax"), &assign_ExcSK_emax)); @@ -504,13 +541,8 @@ void ExcSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcSK::debugName[] = "ExcSK"; -const char* ExcSK::debugString() +void ExcSK::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcSK::debugName; } const BaseClassDefiner ExcSK::declare() @@ -518,4 +550,10 @@ const BaseClassDefiner ExcSK::declare() return BaseClassDefiner(ExcSK::addConstructToMap, ExcSK::addPrimitiveAssignFnsToMap, ExcSK::addClassAssignFnsToMap, ExcSK::debugName); } - +namespace CIMPP +{ + BaseClass* ExcSK_factory() + { + return new ExcSK; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcSK.hpp b/CGMES_2.4.15_27JAN2020/ExcSK.hpp index 6595ff1c7..663fb7330 100644 --- a/CGMES_2.4.15_27JAN2020/ExcSK.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcSK.hpp @@ -1,72 +1,73 @@ #ifndef ExcSK_H #define ExcSK_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" -#include "Boolean.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ApparentPower.hpp" +#include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Slovakian Excitation System Model. UEL and secondary voltage control are included in this model. When this model is used, there cannot be a separate underexcitation limiter or VAr controller model. */ - class ExcSK: public ExcitationSystemDynamics + class ExcSK : public ExcitationSystemDynamics { - public: - CIMPP::PU efdmax; /* Field voltage clipping limit (Efdmax). Default: nullptr */ - CIMPP::PU efdmin; /* Field voltage clipping limit (Efdmin). Default: nullptr */ - CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 20. Default: nullptr */ - CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -20. Default: nullptr */ - CIMPP::PU k; /* Gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU k1; /* Parameter of underexcitation limit (K1). Typical Value = 0.1364. Default: nullptr */ - CIMPP::PU k2; /* Parameter of underexcitation limit (K2). Typical Value = -0.3861. Default: nullptr */ - CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 70. Default: nullptr */ - CIMPP::PU kce; /* Rectifier regulation factor (Kce). Typical Value = 0. Default: nullptr */ - CIMPP::PU kd; /* Exciter internal reactance (Kd). Typical Value = 0. Default: nullptr */ - CIMPP::PU kgob; /* P controller gain (Kgob). Typical Value = 10. Default: nullptr */ - CIMPP::PU kp; /* PI controller gain (Kp). Typical Value = 1. Default: nullptr */ - CIMPP::PU kqi; /* PI controller gain of integral component (Kqi). Typical Value = 0. Default: nullptr */ - CIMPP::PU kqob; /* Rate of rise of the reactive power (Kqob). Default: nullptr */ - CIMPP::PU kqp; /* PI controller gain (Kqp). Typical Value = 0. Default: nullptr */ - CIMPP::PU nq; /* Dead band of reactive power (nq). Determines the range of sensitivity. Typical Value = 0.001. Default: nullptr */ - CIMPP::Boolean qconoff; /* Secondary voltage control state (Qc_on_off). true = secondary voltage control is ON false = secondary voltage control is OFF. Typical Value = false. Default: false */ - CIMPP::PU qz; /* Desired value (setpoint) of reactive power, manual setting (Qz). Default: nullptr */ - CIMPP::Boolean remote; /* Selector to apply automatic calculation in secondary controller model. true = automatic calculation is activated false = manual set is active; the use of desired value of reactive power (Qz) is required. Typical Value = true. Default: false */ - CIMPP::ApparentPower sbase; /* Apparent power of the unit (Sbase). Unit = MVA. Typical Value = 259. Default: nullptr */ - CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 8. Default: nullptr */ - CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ti; /* PI controller phase lead time constant (Ti). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tr; /* Voltage transducer time constant (Tr). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU uimax; /* Maximum error (Uimax). Typical Value = 10. Default: nullptr */ - CIMPP::PU uimin; /* Minimum error (UImin). Typical Value = -10. Default: nullptr */ - CIMPP::PU urmax; /* Maximum controller output (URmax). Typical Value = 10. Default: nullptr */ - CIMPP::PU urmin; /* Minimum controller output (URmin). Typical Value = -10. Default: nullptr */ - CIMPP::PU vtmax; /* Maximum terminal voltage input (Vtmax). Determines the range of voltage dead band. Typical Value = 1.05. Default: nullptr */ - CIMPP::PU vtmin; /* Minimum terminal voltage input (Vtmin). Determines the range of voltage dead band. Typical Value = 0.95. Default: nullptr */ - CIMPP::PU yp; /* Maximum output (Yp). Minimum output = 0. Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcSK(); - virtual ~ExcSK(); - + ~ExcSK() override; + + CIMPP::PU efdmax; /* Field voltage clipping limit (Efdmax). Default: nullptr */ + CIMPP::PU efdmin; /* Field voltage clipping limit (Efdmin). Default: nullptr */ + CIMPP::PU emax; /* Maximum field voltage output (Emax). Typical Value = 20. Default: nullptr */ + CIMPP::PU emin; /* Minimum field voltage output (Emin). Typical Value = -20. Default: nullptr */ + CIMPP::PU k; /* Gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU k1; /* Parameter of underexcitation limit (K1). Typical Value = 0.1364. Default: nullptr */ + CIMPP::PU k2; /* Parameter of underexcitation limit (K2). Typical Value = -0.3861. Default: nullptr */ + CIMPP::PU kc; /* PI controller gain (Kc). Typical Value = 70. Default: nullptr */ + CIMPP::PU kce; /* Rectifier regulation factor (Kce). Typical Value = 0. Default: nullptr */ + CIMPP::PU kd; /* Exciter internal reactance (Kd). Typical Value = 0. Default: nullptr */ + CIMPP::PU kgob; /* P controller gain (Kgob). Typical Value = 10. Default: nullptr */ + CIMPP::PU kp; /* PI controller gain (Kp). Typical Value = 1. Default: nullptr */ + CIMPP::PU kqi; /* PI controller gain of integral component (Kqi). Typical Value = 0. Default: nullptr */ + CIMPP::PU kqob; /* Rate of rise of the reactive power (Kqob). Default: nullptr */ + CIMPP::PU kqp; /* PI controller gain (Kqp). Typical Value = 0. Default: nullptr */ + CIMPP::PU nq; /* Dead band of reactive power (nq). Determines the range of sensitivity. Typical Value = 0.001. Default: nullptr */ + CIMPP::Boolean qconoff; /* Secondary voltage control state (Qc_on_off). true = secondary voltage control is ON false = secondary voltage control is OFF. Typical Value = false. Default: false */ + CIMPP::PU qz; /* Desired value (setpoint) of reactive power, manual setting (Qz). Default: nullptr */ + CIMPP::Boolean remote; /* Selector to apply automatic calculation in secondary controller model. true = automatic calculation is activated false = manual set is active; the use of desired value of reactive power (Qz) is required. Typical Value = true. Default: false */ + CIMPP::ApparentPower sbase; /* Apparent power of the unit (Sbase). Unit = MVA. Typical Value = 259. Default: nullptr */ + CIMPP::Seconds tc; /* PI controller phase lead time constant (Tc). Typical Value = 8. Default: nullptr */ + CIMPP::Seconds te; /* Time constant of gain block (Te). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ti; /* PI controller phase lead time constant (Ti). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tr; /* Voltage transducer time constant (Tr). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU uimax; /* Maximum error (Uimax). Typical Value = 10. Default: nullptr */ + CIMPP::PU uimin; /* Minimum error (UImin). Typical Value = -10. Default: nullptr */ + CIMPP::PU urmax; /* Maximum controller output (URmax). Typical Value = 10. Default: nullptr */ + CIMPP::PU urmin; /* Minimum controller output (URmin). Typical Value = -10. Default: nullptr */ + CIMPP::PU vtmax; /* Maximum terminal voltage input (Vtmax). Determines the range of voltage dead band. Typical Value = 1.05. Default: nullptr */ + CIMPP::PU vtmin; /* Minimum terminal voltage input (Vtmin). Determines the range of voltage dead band. Typical Value = 0.95. Default: nullptr */ + CIMPP::PU yp; /* Maximum output (Yp). Minimum output = 0. Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcSK_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST1A.cpp b/CGMES_2.4.15_27JAN2020/ExcST1A.cpp index deae1a179..cfc5dfec5 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST1A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST1A.cpp @@ -1,20 +1,24 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST1A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -24,283 +28,297 @@ using namespace CIMPP; ExcST1A::ExcST1A() {}; - ExcST1A::~ExcST1A() {}; +bool assign_ExcST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST1A_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST1A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tc1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_tb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST1A_xe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST1A_factory() { - return new ExcST1A; - } +const char ExcST1A::debugName[] = "ExcST1A"; +const char* ExcST1A::debugString() const +{ + return ExcST1A::debugName; } -void ExcST1A::addConstructToMap(std::unordered_map& factory_map) { +void ExcST1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST1A"), &ExcST1A_factory)); } -void ExcST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimax"), &assign_ExcST1A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimin"), &assign_ExcST1A_vimin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc"), &assign_ExcST1A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tb"), &assign_ExcST1A_tb)); +void ExcST1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ilr"), &assign_ExcST1A_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ka"), &assign_ExcST1A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ta"), &assign_ExcST1A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmax"), &assign_ExcST1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmin"), &assign_ExcST1A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.kc"), &assign_ExcST1A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.kf"), &assign_ExcST1A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tf"), &assign_ExcST1A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc1"), &assign_ExcST1A_tc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.klr"), &assign_ExcST1A_klr)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ta"), &assign_ExcST1A_ta)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tb"), &assign_ExcST1A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tb1"), &assign_ExcST1A_tb1)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc"), &assign_ExcST1A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tc1"), &assign_ExcST1A_tc1)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.tf"), &assign_ExcST1A_tf)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vamax"), &assign_ExcST1A_vamax)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vamin"), &assign_ExcST1A_vamin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.ilr"), &assign_ExcST1A_ilr)); - assign_map.insert(std::make_pair(std::string("cim:ExcST1A.klr"), &assign_ExcST1A_klr)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimax"), &assign_ExcST1A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vimin"), &assign_ExcST1A_vimin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmax"), &assign_ExcST1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST1A.vrmin"), &assign_ExcST1A_vrmin)); assign_map.insert(std::make_pair(std::string("cim:ExcST1A.xe"), &assign_ExcST1A_xe)); } -void ExcST1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST1A::debugName[] = "ExcST1A"; -const char* ExcST1A::debugString() +void ExcST1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST1A::debugName; } const BaseClassDefiner ExcST1A::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner ExcST1A::declare() return BaseClassDefiner(ExcST1A::addConstructToMap, ExcST1A::addPrimitiveAssignFnsToMap, ExcST1A::addClassAssignFnsToMap, ExcST1A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST1A_factory() + { + return new ExcST1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST1A.hpp b/CGMES_2.4.15_27JAN2020/ExcST1A.hpp index af4b3396c..f1d6e87f1 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST1A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST1A.hpp @@ -1,56 +1,57 @@ #ifndef ExcST1A_H #define ExcST1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modification of an old IEEE ST1A static excitation system without overexcitation limiter (OEL) and underexcitation limiter (UEL). */ - class ExcST1A: public ExcitationSystemDynamics + class ExcST1A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 999. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -999. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 190. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 7.8. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -6.7. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tc1; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb1; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 999. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -999. Default: nullptr */ - CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 0. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limiter gain (Klr). Typical Value = 0. Default: nullptr */ - CIMPP::PU xe; /* Excitation xfmr effective reactance (Xe). Typical Value = 0.04. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST1A(); - virtual ~ExcST1A(); - + ~ExcST1A() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 190. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limiter gain (Klr). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tb1; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tc1; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 999. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -999. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 999. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -999. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 7.8. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -6.7. Default: nullptr */ + CIMPP::PU xe; /* Excitation xfmr effective reactance (Xe). Typical Value = 0.04. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST2A.cpp b/CGMES_2.4.15_27JAN2020/ExcST2A.cpp index 28477a5d5..8ca08167e 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST2A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST2A.cpp @@ -1,261 +1,276 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST2A.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; ExcST2A::ExcST2A() {}; - ExcST2A::~ExcST2A() {}; +bool assign_ExcST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST2A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST2A_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST2A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST2A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST2A_factory() { - return new ExcST2A; - } +const char ExcST2A::debugName[] = "ExcST2A"; +const char* ExcST2A::debugString() const +{ + return ExcST2A::debugName; } -void ExcST2A::addConstructToMap(std::unordered_map& factory_map) { +void ExcST2A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST2A"), &ExcST2A_factory)); } -void ExcST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcST2A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.efdmax"), &assign_ExcST2A_efdmax)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ka"), &assign_ExcST2A_ka)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ta"), &assign_ExcST2A_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmax"), &assign_ExcST2A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmin"), &assign_ExcST2A_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kc"), &assign_ExcST2A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ke"), &assign_ExcST2A_ke)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.te"), &assign_ExcST2A_te)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kf"), &assign_ExcST2A_kf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tf"), &assign_ExcST2A_tf)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kp"), &assign_ExcST2A_kp)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ki"), &assign_ExcST2A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kc"), &assign_ExcST2A_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.efdmax"), &assign_ExcST2A_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST2A.uelin"), &assign_ExcST2A_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.kp"), &assign_ExcST2A_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.ta"), &assign_ExcST2A_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tb"), &assign_ExcST2A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tc"), &assign_ExcST2A_tc)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.te"), &assign_ExcST2A_te)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.tf"), &assign_ExcST2A_tf)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.uelin"), &assign_ExcST2A_uelin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmax"), &assign_ExcST2A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST2A.vrmin"), &assign_ExcST2A_vrmin)); } -void ExcST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST2A::debugName[] = "ExcST2A"; -const char* ExcST2A::debugString() +void ExcST2A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST2A::debugName; } const BaseClassDefiner ExcST2A::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner ExcST2A::declare() return BaseClassDefiner(ExcST2A::addConstructToMap, ExcST2A::addPrimitiveAssignFnsToMap, ExcST2A::addClassAssignFnsToMap, ExcST2A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST2A_factory() + { + return new ExcST2A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST2A.hpp b/CGMES_2.4.15_27JAN2020/ExcST2A.hpp index 35be34d96..6b8f5aa82 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST2A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST2A.hpp @@ -1,54 +1,55 @@ #ifndef ExcST2A_H #define ExcST2A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE ST2A static excitation system - another lead-lag block added to match the model defined by WECC. */ - class ExcST2A: public ExcitationSystemDynamics + class ExcST2A : public ExcitationSystemDynamics { - public: - CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 120. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -1. Default: nullptr */ - CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.7. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.88. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 8. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.82. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum field voltage (Efdmax). Typical Value = 99. Default: nullptr */ - CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = false. Default: false */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST2A(); - virtual ~ExcST2A(); - + ~ExcST2A() override; + + CIMPP::PU efdmax; /* Maximum field voltage (Efdmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU ka; /* Voltage regulator gain (Ka). Typical Value = 120. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.82. Default: nullptr */ + CIMPP::PU ke; /* Exciter constant related to self-excited field (Ke). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf; /* Excitation control system stabilizer gains (Kf). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 8. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 4.88. Default: nullptr */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds te; /* Exciter time constant, integration rate associated with exciter control (Te). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 0.7. Default: nullptr */ + CIMPP::Boolean uelin; /* UEL input (UELin). true = HV gate false = add to error signal. Typical Value = false. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator outputs (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator outputs (Vrmin). Typical Value = -1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST2A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST3A.cpp b/CGMES_2.4.15_27JAN2020/ExcST3A.cpp index a343ec35e..3c0cddb9b 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST3A.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST3A.cpp @@ -1,20 +1,24 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST3A.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "AngleDegrees.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -26,311 +30,327 @@ using namespace CIMPP; ExcST3A::ExcST3A() {}; - ExcST3A::~ExcST3A() {}; +bool assign_ExcST3A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kj; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vgmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST3A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST3A_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kj(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kj; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_efdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vgmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST3A_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST3A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST3A_factory() { - return new ExcST3A; - } +const char ExcST3A::debugName[] = "ExcST3A"; +const char* ExcST3A::debugString() const +{ + return ExcST3A::debugName; } -void ExcST3A::addConstructToMap(std::unordered_map& factory_map) { +void ExcST3A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST3A"), &ExcST3A_factory)); } -void ExcST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimax"), &assign_ExcST3A_vimax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimin"), &assign_ExcST3A_vimin)); +void ExcST3A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.efdmax"), &assign_ExcST3A_efdmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kc"), &assign_ExcST3A_kc)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kg"), &assign_ExcST3A_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ki"), &assign_ExcST3A_ki)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kj"), &assign_ExcST3A_kj)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.km"), &assign_ExcST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kp"), &assign_ExcST3A_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks"), &assign_ExcST3A_ks)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks1"), &assign_ExcST3A_ks1)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.tb"), &assign_ExcST3A_tb)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.tc"), &assign_ExcST3A_tc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.efdmax"), &assign_ExcST3A_efdmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.km"), &assign_ExcST3A_km)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.thetap"), &assign_ExcST3A_thetap)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.tm"), &assign_ExcST3A_tm)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vbmax"), &assign_ExcST3A_vbmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vgmax"), &assign_ExcST3A_vgmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimax"), &assign_ExcST3A_vimax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vimin"), &assign_ExcST3A_vimin)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vrmax"), &assign_ExcST3A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vrmin"), &assign_ExcST3A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kg"), &assign_ExcST3A_kg)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kp"), &assign_ExcST3A_kp)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.thetap"), &assign_ExcST3A_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ki"), &assign_ExcST3A_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.kc"), &assign_ExcST3A_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST3A.xl"), &assign_ExcST3A_xl)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vbmax"), &assign_ExcST3A_vbmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.vgmax"), &assign_ExcST3A_vgmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks"), &assign_ExcST3A_ks)); - assign_map.insert(std::make_pair(std::string("cim:ExcST3A.ks1"), &assign_ExcST3A_ks1)); } -void ExcST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST3A::debugName[] = "ExcST3A"; -const char* ExcST3A::debugString() +void ExcST3A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST3A::debugName; } const BaseClassDefiner ExcST3A::declare() @@ -338,4 +358,10 @@ const BaseClassDefiner ExcST3A::declare() return BaseClassDefiner(ExcST3A::addConstructToMap, ExcST3A::addPrimitiveAssignFnsToMap, ExcST3A::addClassAssignFnsToMap, ExcST3A::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST3A_factory() + { + return new ExcST3A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST3A.hpp b/CGMES_2.4.15_27JAN2020/ExcST3A.hpp index e239148d3..23856c5c5 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST3A.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST3A.hpp @@ -1,59 +1,60 @@ #ifndef ExcST3A_H #define ExcST3A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE ST3A static excitation system with added speed multiplier. */ - class ExcST3A: public ExcitationSystemDynamics + class ExcST3A : public ExcitationSystemDynamics { - public: - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -0.2. Default: nullptr */ - CIMPP::PU kj; /* AVR gain (Kj). Typical Value = 200. Default: nullptr */ - CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 6.67. Default: nullptr */ - CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::PU efdmax; /* Maximum AVR output (Efdmax). Typical Value = 6.9. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 7.04. Default: nullptr */ - CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (Tm). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ - CIMPP::PU kp; /* Potential source gain (Kp) (>0). Typical Value = 4.37. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 20. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.09. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 8.63. Default: nullptr */ - CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 6.53. Default: nullptr */ - CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks1; /* Coefficient to allow different usage of the model-speed coefficient (Ks1). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST3A(); - virtual ~ExcST3A(); - + ~ExcST3A() override; + + CIMPP::PU efdmax; /* Maximum AVR output (Efdmax). Typical Value = 6.9. Default: nullptr */ + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 4.83. Default: nullptr */ + CIMPP::PU kj; /* AVR gain (Kj). Typical Value = 200. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 7.04. Default: nullptr */ + CIMPP::PU kp; /* Potential source gain (Kp) (>0). Typical Value = 4.37. Default: nullptr */ + CIMPP::PU ks; /* Coefficient to allow different usage of the model-speed coefficient (Ks). Typical Value = 0. Default: nullptr */ + CIMPP::PU ks1; /* Coefficient to allow different usage of the model-speed coefficient (Ks1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Voltage regulator time constant (Tb). Typical Value = 6.67. Default: nullptr */ + CIMPP::Seconds tc; /* Voltage regulator time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 20. Default: nullptr */ + CIMPP::Seconds tm; /* Forward time constant of inner loop field regulator (Tm). Typical Value = 1. Default: nullptr */ + CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 8.63. Default: nullptr */ + CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 6.53. Default: nullptr */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -0.2. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.09. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST3A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST4B.cpp b/CGMES_2.4.15_27JAN2020/ExcST4B.cpp index 4a148e627..ad7d7540d 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST4B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST4B.cpp @@ -1,321 +1,340 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST4B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Seconds.hpp" +#include "AngleDegrees.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "AngleDegrees.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" using namespace CIMPP; ExcST4B::ExcST4B() {}; - ExcST4B::~ExcST4B() {}; +bool assign_ExcST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kir; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lvgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetap; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_uel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uel; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vbmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vgmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST4B_kpr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kir(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kir; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kpm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vmmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vmmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_thetap(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetap; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_xl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vbmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vbmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_vgmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vgmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_uel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uel; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST4B_lvgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lvgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST4B_factory() { - return new ExcST4B; - } +const char ExcST4B::debugName[] = "ExcST4B"; +const char* ExcST4B::debugString() const +{ + return ExcST4B::debugName; } -void ExcST4B::addConstructToMap(std::unordered_map& factory_map) { +void ExcST4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST4B"), &ExcST4B_factory)); } -void ExcST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpr"), &assign_ExcST4B_kpr)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kir"), &assign_ExcST4B_kir)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ta"), &assign_ExcST4B_ta)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmax"), &assign_ExcST4B_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmin"), &assign_ExcST4B_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpm"), &assign_ExcST4B_kpm)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kim"), &assign_ExcST4B_kim)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmax"), &assign_ExcST4B_vmmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmin"), &assign_ExcST4B_vmmin)); +void ExcST4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kc"), &assign_ExcST4B_kc)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kg"), &assign_ExcST4B_kg)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ki"), &assign_ExcST4B_ki)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kim"), &assign_ExcST4B_kim)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kir"), &assign_ExcST4B_kir)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kp"), &assign_ExcST4B_kp)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpm"), &assign_ExcST4B_kpm)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kpr"), &assign_ExcST4B_kpr)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.lvgate"), &assign_ExcST4B_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ta"), &assign_ExcST4B_ta)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.thetap"), &assign_ExcST4B_thetap)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.ki"), &assign_ExcST4B_ki)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.kc"), &assign_ExcST4B_kc)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.xl"), &assign_ExcST4B_xl)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.uel"), &assign_ExcST4B_uel)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vbmax"), &assign_ExcST4B_vbmax)); assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vgmax"), &assign_ExcST4B_vgmax)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.uel"), &assign_ExcST4B_uel)); - assign_map.insert(std::make_pair(std::string("cim:ExcST4B.lvgate"), &assign_ExcST4B_lvgate)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmax"), &assign_ExcST4B_vmmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vmmin"), &assign_ExcST4B_vmmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmax"), &assign_ExcST4B_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.vrmin"), &assign_ExcST4B_vrmin)); + assign_map.insert(std::make_pair(std::string("cim:ExcST4B.xl"), &assign_ExcST4B_xl)); } -void ExcST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST4B::debugName[] = "ExcST4B"; -const char* ExcST4B::debugString() +void ExcST4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST4B::debugName; } const BaseClassDefiner ExcST4B::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner ExcST4B::declare() return BaseClassDefiner(ExcST4B::addConstructToMap, ExcST4B::addPrimitiveAssignFnsToMap, ExcST4B::addClassAssignFnsToMap, ExcST4B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST4B_factory() + { + return new ExcST4B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST4B.hpp b/CGMES_2.4.15_27JAN2020/ExcST4B.hpp index 77de87f47..a1f945fde 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST4B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST4B.hpp @@ -1,59 +1,60 @@ #ifndef ExcST4B_H #define ExcST4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" -#include "Seconds.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE ST4B static excitation system with maximum inner loop feedback gain . */ - class ExcST4B: public ExcitationSystemDynamics + class ExcST4B : public ExcitationSystemDynamics { - public: - CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 10.75. Default: nullptr */ - CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 10.75. Default: nullptr */ - CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.87. Default: nullptr */ - CIMPP::PU kpm; /* Voltage regulator proportional gain output (Kpm). Typical Value = 1. Default: nullptr */ - CIMPP::PU kim; /* Voltage regulator integral gain output (Kim). Typical Value = 0. Default: nullptr */ - CIMPP::PU vmmax; /* Maximum inner loop output (Vmmax). Typical Value = 99. Default: nullptr */ - CIMPP::PU vmmin; /* Minimum inner loop output (Vmmin). Typical Value = -99. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 9.3. Default: nullptr */ - CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 0. Default: nullptr */ - CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.113. Default: nullptr */ - CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.124. Default: nullptr */ - CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 11.63. Default: nullptr */ - CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 5.8. Default: nullptr */ - CIMPP::Boolean uel; /* Selector (Uel). true = UEL is part of block diagram false = UEL is not part of block diagram. Typical Value = false. Default: false */ - CIMPP::Boolean lvgate; /* Selector (LVgate). true = LVgate is part of the block diagram false = LVgate is not part of the block diagram. Typical Value = false. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST4B(); - virtual ~ExcST4B(); - + ~ExcST4B() override; + + CIMPP::PU kc; /* Rectifier loading factor proportional to commutating reactance (Kc). Typical Value = 0.113. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Potential circuit gain coefficient (Ki). Typical Value = 0. Default: nullptr */ + CIMPP::PU kim; /* Voltage regulator integral gain output (Kim). Typical Value = 0. Default: nullptr */ + CIMPP::PU kir; /* Voltage regulator integral gain (Kir). Typical Value = 10.75. Default: nullptr */ + CIMPP::PU kp; /* Potential circuit gain coefficient (Kp). Typical Value = 9.3. Default: nullptr */ + CIMPP::PU kpm; /* Voltage regulator proportional gain output (Kpm). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpr; /* Voltage regulator proportional gain (Kpr). Typical Value = 10.75. Default: nullptr */ + CIMPP::Boolean lvgate; /* Selector (LVgate). true = LVgate is part of the block diagram false = LVgate is not part of the block diagram. Typical Value = false. Default: false */ + CIMPP::Seconds ta; /* Voltage regulator time constant (Ta). Typical Value = 0.02. Default: nullptr */ + CIMPP::AngleDegrees thetap; /* Potential circuit phase angle (thetap). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean uel; /* Selector (Uel). true = UEL is part of block diagram false = UEL is not part of block diagram. Typical Value = false. Default: false */ + CIMPP::PU vbmax; /* Maximum excitation voltage (Vbmax). Typical Value = 11.63. Default: nullptr */ + CIMPP::PU vgmax; /* Maximum inner loop feedback voltage (Vgmax). Typical Value = 5.8. Default: nullptr */ + CIMPP::PU vmmax; /* Maximum inner loop output (Vmmax). Typical Value = 99. Default: nullptr */ + CIMPP::PU vmmin; /* Minimum inner loop output (Vmmin). Typical Value = -99. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -0.87. Default: nullptr */ + CIMPP::PU xl; /* Reactance associated with potential source (Xl). Typical Value = 0.124. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST4B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST6B.cpp b/CGMES_2.4.15_27JAN2020/ExcST6B.cpp index 8cc7852af..29ef119cf 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST6B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST6B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST6B.hpp" +#include +#include + #include "PU.hpp" #include "Boolean.hpp" #include "PU.hpp" @@ -29,321 +33,345 @@ using namespace CIMPP; ExcST6B::ExcST6B() {}; - ExcST6B::~ExcST6B() {}; +bool assign_ExcST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ilr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_kvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_tvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vilim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vilim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmult; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST6B_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST6B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST6B_ilr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ilr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_klr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_kvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_tvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vilim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vilim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vmult(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmult; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST6B_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST6B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST6B_factory() { - return new ExcST6B; - } +const char ExcST6B::debugName[] = "ExcST6B"; +const char* ExcST6B::debugString() const +{ + return ExcST6B::debugName; } -void ExcST6B::addConstructToMap(std::unordered_map& factory_map) { +void ExcST6B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST6B"), &ExcST6B_factory)); } -void ExcST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcST6B.ilr"), &assign_ExcST6B_ilr)); assign_map.insert(std::make_pair(std::string("cim:ExcST6B.k1"), &assign_ExcST6B_k1)); assign_map.insert(std::make_pair(std::string("cim:ExcST6B.kcl"), &assign_ExcST6B_kcl)); @@ -369,13 +397,8 @@ void ExcST6B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST6B::debugName[] = "ExcST6B"; -const char* ExcST6B::debugString() +void ExcST6B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST6B::debugName; } const BaseClassDefiner ExcST6B::declare() @@ -383,4 +406,10 @@ const BaseClassDefiner ExcST6B::declare() return BaseClassDefiner(ExcST6B::addConstructToMap, ExcST6B::addPrimitiveAssignFnsToMap, ExcST6B::addClassAssignFnsToMap, ExcST6B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST6B_factory() + { + return new ExcST6B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST6B.hpp b/CGMES_2.4.15_27JAN2020/ExcST6B.hpp index e7c799981..2f218adba 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST6B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST6B.hpp @@ -1,63 +1,64 @@ #ifndef ExcST6B_H #define ExcST6B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "ExcST6BOELselectorKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE ST6B static excitation system with PID controller and optional inner feedbacks loop. */ - class ExcST6B: public ExcitationSystemDynamics + class ExcST6B : public ExcitationSystemDynamics { - public: - CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 4.164. Default: nullptr */ - CIMPP::Boolean k1; /* Selector (K1). true = feedback is from Ifd false = feedback is not from Ifd. Typical Value = true. Default: false */ - CIMPP::PU kcl; /* Exciter output current limit adjustment (Kcl). Typical Value = 1.0577. Default: nullptr */ - CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (Kff). Typical Value = 1. Default: nullptr */ - CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 45.094. Default: nullptr */ - CIMPP::PU klr; /* Exciter output current limit adjustment (Kcl). Typical Value = 17.33. Default: nullptr */ - CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 18.038. Default: nullptr */ - CIMPP::PU kvd; /* Voltage regulator derivative gain (Kvd). Typical Value = 0. Default: nullptr */ - CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tvd; /* Voltage regulator derivative gain (Tvd). Typical Value = 0. Default: nullptr */ - CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -3.85. Default: nullptr */ - CIMPP::Boolean vilim; /* Selector (Vilim). true = Vimin-Vimax limiter is active false = Vimin-Vimax limiter is not active. Typical Value = true. Default: false */ - CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ - CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ - CIMPP::Boolean vmult; /* Selector (Vmult). true = multiply regulator output by terminal voltage false = do not multiply regulator output by terminal voltage. Typical Value = true. Default: false */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.81. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -3.85. Default: nullptr */ - CIMPP::PU xc; /* Excitation source reactance (Xc). Typical Value = 0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST6B(); - virtual ~ExcST6B(); - + ~ExcST6B() override; + + CIMPP::PU ilr; /* Exciter output current limit reference (Ilr). Typical Value = 4.164. Default: nullptr */ + CIMPP::Boolean k1; /* Selector (K1). true = feedback is from Ifd false = feedback is not from Ifd. Typical Value = true. Default: false */ + CIMPP::PU kcl; /* Exciter output current limit adjustment (Kcl). Typical Value = 1.0577. Default: nullptr */ + CIMPP::PU kff; /* Pre-control gain constant of the inner loop field regulator (Kff). Typical Value = 1. Default: nullptr */ + CIMPP::PU kg; /* Feedback gain constant of the inner loop field regulator (Kg). Typical Value = 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 45.094. Default: nullptr */ + CIMPP::PU klr; /* Exciter output current limit adjustment (Kcl). Typical Value = 17.33. Default: nullptr */ + CIMPP::PU km; /* Forward gain constant of the inner loop field regulator (Km). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 18.038. Default: nullptr */ + CIMPP::PU kvd; /* Voltage regulator derivative gain (Kvd). Typical Value = 0. Default: nullptr */ + CIMPP::ExcST6BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tvd; /* Voltage regulator derivative gain (Tvd). Typical Value = 0. Default: nullptr */ + CIMPP::PU vamax; /* Maximum voltage regulator output (Vamax). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vamin; /* Minimum voltage regulator output (Vamin). Typical Value = -3.85. Default: nullptr */ + CIMPP::Boolean vilim; /* Selector (Vilim). true = Vimin-Vimax limiter is active false = Vimin-Vimax limiter is not active. Typical Value = true. Default: false */ + CIMPP::PU vimax; /* Maximum voltage regulator input limit (Vimax). Typical Value = 10. Default: nullptr */ + CIMPP::PU vimin; /* Minimum voltage regulator input limit (Vimin). Typical Value = -10. Default: nullptr */ + CIMPP::Boolean vmult; /* Selector (Vmult). true = multiply regulator output by terminal voltage false = do not multiply regulator output by terminal voltage. Typical Value = true. Default: false */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 4.81. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -3.85. Default: nullptr */ + CIMPP::PU xc; /* Excitation source reactance (Xc). Typical Value = 0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST6B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.cpp b/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.cpp index ed4095208..4a1e0d921 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST6BOELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcST6BOELselectorKind& rop) +ExcST6BOELselectorKind& ExcST6BOELselectorKind::operator=(ExcST6BOELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcST6BOELselectorKind::operator ExcST6BOELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcST6BOELselectorKind::debugName[] = "ExcST6BOELselectorKind"; +const char* ExcST6BOELselectorKind::debugString() const +{ + return ExcST6BOELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcST6BOELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcST6BOELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcST6BOELselectorKind::noOELinput) + { + EnumSymbol = "noOELinput"; + } + if (obj.value == ExcST6BOELselectorKind::beforeUEL) + { + EnumSymbol = "beforeUEL"; + } + if (obj.value == ExcST6BOELselectorKind::afterUEL) + { + EnumSymbol = "afterUEL"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcST6BOELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.hpp b/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.hpp index 0b6f498ff..b30b3b8df 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST6BOELselectorKind.hpp @@ -1,25 +1,50 @@ #ifndef ExcST6BOELselectorKind_H #define ExcST6BOELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the OEL input used for static excitation systems type 6B. */ - enum class ExcST6BOELselectorKind + class ExcST6BOELselectorKind { - /** - * No OEL input is used. - */ - noOELinput, - /** - * The connection is before UEL. - */ - beforeUEL, - /** - * The connection is after UEL. - */ - afterUEL, + public: + enum ExcST6BOELselectorKind_ENUM + { + /** + * No OEL input is used. + */ + noOELinput, + /** + * The connection is before UEL. + */ + beforeUEL, + /** + * The connection is after UEL. + */ + afterUEL, + }; + + ExcST6BOELselectorKind() : value(), initialized(false) {} + ExcST6BOELselectorKind(ExcST6BOELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcST6BOELselectorKind& operator=(ExcST6BOELselectorKind_ENUM rop); + operator ExcST6BOELselectorKind_ENUM() const; + + ExcST6BOELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcST6BOELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcST6BOELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcST6BOELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ExcST7B.cpp b/CGMES_2.4.15_27JAN2020/ExcST7B.cpp index 81e1a08cf..37e50539b 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST7B.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST7B.cpp @@ -1,7 +1,11 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST7B.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -22,230 +26,247 @@ using namespace CIMPP; ExcST7B::ExcST7B() {}; - ExcST7B::~ExcST7B() {}; +bool assign_ExcST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uelin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExcST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcST7B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExcST7B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_kia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_kpa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_oelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_tia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_uelin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uelin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExcST7B_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcST7B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExcST7B_factory() { - return new ExcST7B; - } +const char ExcST7B::debugName[] = "ExcST7B"; +const char* ExcST7B::debugString() const +{ + return ExcST7B::debugName; } -void ExcST7B::addConstructToMap(std::unordered_map& factory_map) { +void ExcST7B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcST7B"), &ExcST7B_factory)); } -void ExcST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcST7B.kh"), &assign_ExcST7B_kh)); assign_map.insert(std::make_pair(std::string("cim:ExcST7B.kia"), &assign_ExcST7B_kia)); assign_map.insert(std::make_pair(std::string("cim:ExcST7B.kl"), &assign_ExcST7B_kl)); @@ -264,13 +285,8 @@ void ExcST7B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char ExcST7B::debugName[] = "ExcST7B"; -const char* ExcST7B::debugString() +void ExcST7B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcST7B::debugName; } const BaseClassDefiner ExcST7B::declare() @@ -278,4 +294,10 @@ const BaseClassDefiner ExcST7B::declare() return BaseClassDefiner(ExcST7B::addConstructToMap, ExcST7B::addPrimitiveAssignFnsToMap, ExcST7B::addClassAssignFnsToMap, ExcST7B::debugName); } - +namespace CIMPP +{ + BaseClass* ExcST7B_factory() + { + return new ExcST7B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST7B.hpp b/CGMES_2.4.15_27JAN2020/ExcST7B.hpp index 143a34cc1..50f30bca5 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST7B.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST7B.hpp @@ -1,56 +1,57 @@ #ifndef ExcST7B_H #define ExcST7B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ExcST7BOELselectorKind.hpp" -#include "Seconds.hpp" #include "ExcST7BUELselectorKind.hpp" +#include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE ST7B static excitation system without stator current limiter (SCL) and current compensator (DROOP) inputs. */ - class ExcST7B: public ExcitationSystemDynamics + class ExcST7B : public ExcitationSystemDynamics { - public: - CIMPP::PU kh; /* High-value gate feedback gain (Kh). Typical Value = 1. Default: nullptr */ - CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl; /* Low-value gate feedback gain (Kl). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 40. Default: nullptr */ - CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ - CIMPP::Seconds tb; /* Regulator lag time constant (Tb). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tc; /* Regulator lead time constant (Tc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tia; /* Feedback time constant (Tia). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ - CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ - CIMPP::PU vmax; /* Maximum voltage reference signal (Vmax). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum voltage reference signal (Vmin). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcST7B(); - virtual ~ExcST7B(); - + ~ExcST7B() override; + + CIMPP::PU kh; /* High-value gate feedback gain (Kh). Typical Value = 1. Default: nullptr */ + CIMPP::PU kia; /* Voltage regulator integral gain (Kia). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl; /* Low-value gate feedback gain (Kl). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpa; /* Voltage regulator proportional gain (Kpa). Typical Value = 40. Default: nullptr */ + CIMPP::ExcST7BOELselectorKind oelin; /* OEL input selector (OELin). Typical Value = noOELinput. Default: 0 */ + CIMPP::Seconds tb; /* Regulator lag time constant (Tb). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tc; /* Regulator lead time constant (Tc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tf; /* Excitation control system stabilizer time constant (Tf). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tg; /* Feedback time constant of inner loop field voltage regulator (Tg). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tia; /* Feedback time constant (Tia). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ts; /* Rectifier firing time constant (Ts). Typical Value = 0. Default: nullptr */ + CIMPP::ExcST7BUELselectorKind uelin; /* UEL input selector (UELin). Typical Value = noUELinput. Default: 0 */ + CIMPP::PU vmax; /* Maximum voltage reference signal (Vmax). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum voltage reference signal (Vmin). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum voltage regulator output (Vrmax). Typical Value = 5. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum voltage regulator output (Vrmin). Typical Value = -4.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcST7B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.cpp b/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.cpp index c0dac0ada..d400a7859 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST7BOELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BOELselectorKind& rop) +ExcST7BOELselectorKind& ExcST7BOELselectorKind::operator=(ExcST7BOELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcST7BOELselectorKind::operator ExcST7BOELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcST7BOELselectorKind::debugName[] = "ExcST7BOELselectorKind"; +const char* ExcST7BOELselectorKind::debugString() const +{ + return ExcST7BOELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcST7BOELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcST7BOELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcST7BOELselectorKind::noOELinput) + { + EnumSymbol = "noOELinput"; + } + if (obj.value == ExcST7BOELselectorKind::addVref) + { + EnumSymbol = "addVref"; + } + if (obj.value == ExcST7BOELselectorKind::inputLVgate) + { + EnumSymbol = "inputLVgate"; + } + if (obj.value == ExcST7BOELselectorKind::outputLVgate) + { + EnumSymbol = "outputLVgate"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcST7BOELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.hpp b/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.hpp index 24b2f3c6f..66d97cdae 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST7BOELselectorKind.hpp @@ -1,29 +1,54 @@ #ifndef ExcST7BOELselectorKind_H #define ExcST7BOELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the OEL input used for static excitation systems type 7B. */ - enum class ExcST7BOELselectorKind + class ExcST7BOELselectorKind { - /** - * No OEL input is used. - */ - noOELinput, - /** - * The signal is added to Vref. - */ - addVref, - /** - * The signal is connected in the input of the LV gate. - */ - inputLVgate, - /** - * The signal is connected in the output of the LV gate. - */ - outputLVgate, + public: + enum ExcST7BOELselectorKind_ENUM + { + /** + * No OEL input is used. + */ + noOELinput, + /** + * The signal is added to Vref. + */ + addVref, + /** + * The signal is connected in the input of the LV gate. + */ + inputLVgate, + /** + * The signal is connected in the output of the LV gate. + */ + outputLVgate, + }; + + ExcST7BOELselectorKind() : value(), initialized(false) {} + ExcST7BOELselectorKind(ExcST7BOELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcST7BOELselectorKind& operator=(ExcST7BOELselectorKind_ENUM rop); + operator ExcST7BOELselectorKind_ENUM() const; + + ExcST7BOELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcST7BOELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcST7BOELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BOELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.cpp b/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.cpp index a49cd137b..2260a4e4d 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcST7BUELselectorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BUELselectorKind& rop) +ExcST7BUELselectorKind& ExcST7BUELselectorKind::operator=(ExcST7BUELselectorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ExcST7BUELselectorKind::operator ExcST7BUELselectorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ExcST7BUELselectorKind::debugName[] = "ExcST7BUELselectorKind"; +const char* ExcST7BUELselectorKind::debugString() const +{ + return ExcST7BUELselectorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ExcST7BUELselectorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ExcST7BUELselectorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ExcST7BUELselectorKind::noUELinput) + { + EnumSymbol = "noUELinput"; + } + if (obj.value == ExcST7BUELselectorKind::addVref) + { + EnumSymbol = "addVref"; + } + if (obj.value == ExcST7BUELselectorKind::inputHVgate) + { + EnumSymbol = "inputHVgate"; + } + if (obj.value == ExcST7BUELselectorKind::outputHVgate) + { + EnumSymbol = "outputHVgate"; + } + + if (!EnumSymbol.empty()) + { + os << "ExcST7BUELselectorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.hpp b/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.hpp index a00014985..b509d7dad 100644 --- a/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcST7BUELselectorKind.hpp @@ -1,29 +1,54 @@ #ifndef ExcST7BUELselectorKind_H #define ExcST7BUELselectorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of connection for the UEL input used for static excitation systems type 7B. */ - enum class ExcST7BUELselectorKind + class ExcST7BUELselectorKind { - /** - * No UEL input is used. - */ - noUELinput, - /** - * The signal is added to Vref. - */ - addVref, - /** - * The signal is connected in the input of the HV gate. - */ - inputHVgate, - /** - * The signal is connected in the output of the HV gate. - */ - outputHVgate, + public: + enum ExcST7BUELselectorKind_ENUM + { + /** + * No UEL input is used. + */ + noUELinput, + /** + * The signal is added to Vref. + */ + addVref, + /** + * The signal is connected in the input of the HV gate. + */ + inputHVgate, + /** + * The signal is connected in the output of the HV gate. + */ + outputHVgate, + }; + + ExcST7BUELselectorKind() : value(), initialized(false) {} + ExcST7BUELselectorKind(ExcST7BUELselectorKind_ENUM value) : value(value), initialized(true) {} + + ExcST7BUELselectorKind& operator=(ExcST7BUELselectorKind_ENUM rop); + operator ExcST7BUELselectorKind_ENUM() const; + + ExcST7BUELselectorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ExcST7BUELselectorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ExcST7BUELselectorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ExcST7BUELselectorKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.cpp b/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.cpp index 9abe66f1b..806190c25 100644 --- a/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.cpp @@ -1,133 +1,196 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcitationSystemDynamics.hpp" -#include "SynchronousMachineDynamics.hpp" -#include "PowerSystemStabilizerDynamics.hpp" -#include "PFVArControllerType1Dynamics.hpp" -#include "VoltageCompensatorDynamics.hpp" +#include +#include + #include "DiscontinuousExcitationControlDynamics.hpp" -#include "UnderexcitationLimiterDynamics.hpp" -#include "PFVArControllerType2Dynamics.hpp" #include "OverexcitationLimiterDynamics.hpp" +#include "PFVArControllerType1Dynamics.hpp" +#include "PFVArControllerType2Dynamics.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "SynchronousMachineDynamics.hpp" +#include "UnderexcitationLimiterDynamics.hpp" +#include "VoltageCompensatorDynamics.hpp" using namespace CIMPP; -ExcitationSystemDynamics::ExcitationSystemDynamics(): SynchronousMachineDynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), PFVArControllerType1Dynamics(nullptr), VoltageCompensatorDynamics(nullptr), DiscontinuousExcitationControlDynamics(nullptr), UnderexcitationLimiterDynamics(nullptr), PFVArControllerType2Dynamics(nullptr), OverexcitationLimiterDynamics(nullptr) {}; - +ExcitationSystemDynamics::ExcitationSystemDynamics() : DiscontinuousExcitationControlDynamics(nullptr), OverexcitationLimiterDynamics(nullptr), PFVArControllerType1Dynamics(nullptr), PFVArControllerType2Dynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), SynchronousMachineDynamics(nullptr), UnderexcitationLimiterDynamics(nullptr), VoltageCompensatorDynamics(nullptr) {}; ExcitationSystemDynamics::~ExcitationSystemDynamics() {}; -bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); -bool assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemStabilizerDynamics = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemStabilizerDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1Dynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageCompensatorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->VoltageCompensatorDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscontinuousExcitationControlDynamics = dynamic_cast(BaseClass_ptr2); - if(element->DiscontinuousExcitationControlDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->UnderexcitationLimiterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->UnderexcitationLimiterDynamics != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType2Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType2Dynamics != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->OverexcitationLimiterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->OverexcitationLimiterDynamics != nullptr) - return true; - } - return false; -} +bool assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + DiscontinuousExcitationControlDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscontinuousExcitationControlDynamics != element2) + { + element->DiscontinuousExcitationControlDynamics = element2; + return assign_DiscontinuousExcitationControlDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + OverexcitationLimiterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OverexcitationLimiterDynamics != element2) + { + element->OverexcitationLimiterDynamics = element2; + return assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1Dynamics != element2) + { + element->PFVArControllerType1Dynamics = element2; + return assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType2Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType2Dynamics != element2) + { + element->PFVArControllerType2Dynamics = element2; + return assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + PowerSystemStabilizerDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemStabilizerDynamics != element2) + { + element->PowerSystemStabilizerDynamics = element2; + return assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + UnderexcitationLimiterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->UnderexcitationLimiterDynamics != element2) + { + element->UnderexcitationLimiterDynamics = element2; + return assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* ExcitationSystemDynamics_factory() { - return new ExcitationSystemDynamics; +bool assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass*, BaseClass*); +bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemDynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageCompensatorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageCompensatorDynamics != element2) + { + element->VoltageCompensatorDynamics = element2; + return assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void ExcitationSystemDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics"), &ExcitationSystemDynamics_factory)); +const char ExcitationSystemDynamics::debugName[] = "ExcitationSystemDynamics"; +const char* ExcitationSystemDynamics::debugString() const +{ + return ExcitationSystemDynamics::debugName; } -void ExcitationSystemDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ExcitationSystemDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics"), &ExcitationSystemDynamics_factory)); +} -void ExcitationSystemDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.SynchronousMachineDynamics"), &assign_ExcitationSystemDynamics_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PowerSystemStabilizerDynamics"), &assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType1Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.VoltageCompensatorDynamics"), &assign_ExcitationSystemDynamics_VoltageCompensatorDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.DiscontinuousExcitationControlDynamics"), &assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.UnderexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType2Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics)); - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.OverexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics)); +void ExcitationSystemDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ExcitationSystemDynamics::debugName[] = "ExcitationSystemDynamics"; -const char* ExcitationSystemDynamics::debugString() +void ExcitationSystemDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcitationSystemDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.DiscontinuousExcitationControlDynamics"), &assign_ExcitationSystemDynamics_DiscontinuousExcitationControlDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.OverexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType1Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PFVArControllerType2Dynamics"), &assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.PowerSystemStabilizerDynamics"), &assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.SynchronousMachineDynamics"), &assign_ExcitationSystemDynamics_SynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.UnderexcitationLimiterDynamics"), &assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics)); + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemDynamics.VoltageCompensatorDynamics"), &assign_ExcitationSystemDynamics_VoltageCompensatorDynamics)); } const BaseClassDefiner ExcitationSystemDynamics::declare() @@ -135,4 +198,10 @@ const BaseClassDefiner ExcitationSystemDynamics::declare() return BaseClassDefiner(ExcitationSystemDynamics::addConstructToMap, ExcitationSystemDynamics::addPrimitiveAssignFnsToMap, ExcitationSystemDynamics::addClassAssignFnsToMap, ExcitationSystemDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* ExcitationSystemDynamics_factory() + { + return new ExcitationSystemDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.hpp b/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.hpp index 2a08820cf..c4896aed2 100644 --- a/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcitationSystemDynamics.hpp @@ -1,52 +1,53 @@ #ifndef ExcitationSystemDynamics_H #define ExcitationSystemDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { +#include +#include +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" + +namespace CIMPP +{ + class DiscontinuousExcitationControlDynamics; + class OverexcitationLimiterDynamics; + class PFVArControllerType1Dynamics; + class PFVArControllerType2Dynamics; + class PowerSystemStabilizerDynamics; + class SynchronousMachineDynamics; + class UnderexcitationLimiterDynamics; + class VoltageCompensatorDynamics; -class SynchronousMachineDynamics; -class PowerSystemStabilizerDynamics; -class PFVArControllerType1Dynamics; -class VoltageCompensatorDynamics; -class DiscontinuousExcitationControlDynamics; -class UnderexcitationLimiterDynamics; -class PFVArControllerType2Dynamics; -class OverexcitationLimiterDynamics; /* Excitation system function block whose behavior is described by reference to a standard model */ - class ExcitationSystemDynamics: public DynamicsFunctionBlock + class ExcitationSystemDynamics : public DynamicsFunctionBlock { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this excitation system model is associated. Default: 0 */ - CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model associated with this excitation system model. Default: 0 */ - CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model associated with this excitation system model. Default: 0 */ - CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model associated with this excitation system model. Default: 0 */ - CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model associated with this excitation system model. Default: 0 */ - CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Undrexcitation limiter model associated with this excitation system model. Default: 0 */ - CIMPP::PFVArControllerType2Dynamics* PFVArControllerType2Dynamics; /* Power Factor or VAr controller Type II model associated with this excitation system model. Default: 0 */ - CIMPP::OverexcitationLimiterDynamics* OverexcitationLimiterDynamics; /* Overexcitation limiter model associated with this excitation system model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcitationSystemDynamics(); - virtual ~ExcitationSystemDynamics(); - + ~ExcitationSystemDynamics() override; + + CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model associated with this excitation system model. Default: 0 */ + CIMPP::OverexcitationLimiterDynamics* OverexcitationLimiterDynamics; /* Overexcitation limiter model associated with this excitation system model. Default: 0 */ + CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model associated with this excitation system model. Default: 0 */ + CIMPP::PFVArControllerType2Dynamics* PFVArControllerType2Dynamics; /* Power Factor or VAr controller Type II model associated with this excitation system model. Default: 0 */ + CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model associated with this excitation system model. Default: 0 */ + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this excitation system model is associated. Default: 0 */ + CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Undrexcitation limiter model associated with this excitation system model. Default: 0 */ + CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model associated with this excitation system model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcitationSystemDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.cpp b/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.cpp index 43d197da0..463b994b9 100644 --- a/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "ExcitationSystemDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExcitationSystemUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; ExcitationSystemUserDefined::ExcitationSystemUserDefined() {}; - ExcitationSystemUserDefined::~ExcitationSystemUserDefined() {}; -bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_ExcitationSystemUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_ExcitationSystemUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass*, BaseClass*); +bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ExcitationSystemUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ExcitationSystemUserDefined_factory() { - return new ExcitationSystemUserDefined; - } +const char ExcitationSystemUserDefined::debugName[] = "ExcitationSystemUserDefined"; +const char* ExcitationSystemUserDefined::debugString() const +{ + return ExcitationSystemUserDefined::debugName; } -void ExcitationSystemUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void ExcitationSystemUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined"), &ExcitationSystemUserDefined_factory)); } -void ExcitationSystemUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ExcitationSystemUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined.proprietary"), &assign_ExcitationSystemUserDefined_proprietary)); - } - -void ExcitationSystemUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined.ProprietaryParameterDynamics"), &assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics)); } -const char ExcitationSystemUserDefined::debugName[] = "ExcitationSystemUserDefined"; -const char* ExcitationSystemUserDefined::debugString() +void ExcitationSystemUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExcitationSystemUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:ExcitationSystemUserDefined.ProprietaryParameterDynamics"), &assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner ExcitationSystemUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner ExcitationSystemUserDefined::declare() return BaseClassDefiner(ExcitationSystemUserDefined::addConstructToMap, ExcitationSystemUserDefined::addPrimitiveAssignFnsToMap, ExcitationSystemUserDefined::addClassAssignFnsToMap, ExcitationSystemUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* ExcitationSystemUserDefined_factory() + { + return new ExcitationSystemUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.hpp b/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.hpp index 9340f681e..ed84868ea 100644 --- a/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/ExcitationSystemUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef ExcitationSystemUserDefined_H #define ExcitationSystemUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ExcitationSystemDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ExcitationSystemDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Excitation system function block whose dynamic behaviour is described by */ - class ExcitationSystemUserDefined: public ExcitationSystemDynamics + class ExcitationSystemUserDefined : public ExcitationSystemDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExcitationSystemUserDefined(); - virtual ~ExcitationSystemUserDefined(); - + ~ExcitationSystemUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExcitationSystemUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.cpp b/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.cpp index 477a7c2c4..52ba55b11 100644 --- a/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.cpp +++ b/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.cpp @@ -1,303 +1,324 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ExternalNetworkInjection.hpp" +#include +#include + #include "ActivePowerPerFrequency.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "CurrentFlow.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "Integer.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" +#include "Integer.hpp" +#include "PU.hpp" using namespace CIMPP; -ExternalNetworkInjection::ExternalNetworkInjection(): governorSCD(nullptr) {}; - +ExternalNetworkInjection::ExternalNetworkInjection() {}; ExternalNetworkInjection::~ExternalNetworkInjection() {}; -bool assign_ExternalNetworkInjection_governorSCD(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - element->governorSCD = dynamic_cast(BaseClass_ptr2); - if(element->governorSCD != nullptr) - return true; - } - return false; +bool assign_ExternalNetworkInjection_governorSCD(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorSCD; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ExternalNetworkInjection_ikSecond(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ikSecond; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxInitialSymShCCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxR0ToX0Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxR1ToX1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_maxZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxZ0ToZ1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minInitialSymShCCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minR0ToX0Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minR1ToX1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_minZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minZ0ToZ1Ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->referencePriority; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ExternalNetworkInjection_voltageFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageFactor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ExternalNetworkInjection_maxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_ikSecond(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ikSecond; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxInitialSymShCCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxR0ToX0Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxR1ToX1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_maxZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxZ0ToZ1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minInitialSymShCCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minInitialSymShCCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minR0ToX0Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minR0ToX0Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minR1ToX1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minR1ToX1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_minZ0ToZ1Ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minZ0ToZ1Ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_voltageFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageFactor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->referencePriority; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ExternalNetworkInjection_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ExternalNetworkInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* ExternalNetworkInjection_factory() { - return new ExternalNetworkInjection; - } +const char ExternalNetworkInjection::debugName[] = "ExternalNetworkInjection"; +const char* ExternalNetworkInjection::debugString() const +{ + return ExternalNetworkInjection::debugName; } -void ExternalNetworkInjection::addConstructToMap(std::unordered_map& factory_map) { +void ExternalNetworkInjection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection"), &ExternalNetworkInjection_factory)); } -void ExternalNetworkInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxP"), &assign_ExternalNetworkInjection_maxP)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxQ"), &assign_ExternalNetworkInjection_maxQ)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minP"), &assign_ExternalNetworkInjection_minP)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minQ"), &assign_ExternalNetworkInjection_minQ)); +void ExternalNetworkInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.governorSCD"), &assign_ExternalNetworkInjection_governorSCD)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.ikSecond"), &assign_ExternalNetworkInjection_ikSecond)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxInitialSymShCCurrent"), &assign_ExternalNetworkInjection_maxInitialSymShCCurrent)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxP"), &assign_ExternalNetworkInjection_maxP)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxQ"), &assign_ExternalNetworkInjection_maxQ)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxR0ToX0Ratio"), &assign_ExternalNetworkInjection_maxR0ToX0Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxR1ToX1Ratio"), &assign_ExternalNetworkInjection_maxR1ToX1Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.maxZ0ToZ1Ratio"), &assign_ExternalNetworkInjection_maxZ0ToZ1Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minInitialSymShCCurrent"), &assign_ExternalNetworkInjection_minInitialSymShCCurrent)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minP"), &assign_ExternalNetworkInjection_minP)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minQ"), &assign_ExternalNetworkInjection_minQ)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minR0ToX0Ratio"), &assign_ExternalNetworkInjection_minR0ToX0Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minR1ToX1Ratio"), &assign_ExternalNetworkInjection_minR1ToX1Ratio)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.minZ0ToZ1Ratio"), &assign_ExternalNetworkInjection_minZ0ToZ1Ratio)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.voltageFactor"), &assign_ExternalNetworkInjection_voltageFactor)); - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.referencePriority"), &assign_ExternalNetworkInjection_referencePriority)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.p"), &assign_ExternalNetworkInjection_p)); assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.q"), &assign_ExternalNetworkInjection_q)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.referencePriority"), &assign_ExternalNetworkInjection_referencePriority)); + assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.voltageFactor"), &assign_ExternalNetworkInjection_voltageFactor)); } -void ExternalNetworkInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ExternalNetworkInjection.governorSCD"), &assign_ExternalNetworkInjection_governorSCD)); - } - -const char ExternalNetworkInjection::debugName[] = "ExternalNetworkInjection"; -const char* ExternalNetworkInjection::debugString() +void ExternalNetworkInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ExternalNetworkInjection::debugName; } const BaseClassDefiner ExternalNetworkInjection::declare() @@ -305,4 +326,10 @@ const BaseClassDefiner ExternalNetworkInjection::declare() return BaseClassDefiner(ExternalNetworkInjection::addConstructToMap, ExternalNetworkInjection::addPrimitiveAssignFnsToMap, ExternalNetworkInjection::addClassAssignFnsToMap, ExternalNetworkInjection::debugName); } - +namespace CIMPP +{ + BaseClass* ExternalNetworkInjection_factory() + { + return new ExternalNetworkInjection; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.hpp b/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.hpp index 7f8cf11c3..8fc781a70 100644 --- a/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.hpp +++ b/CGMES_2.4.15_27JAN2020/ExternalNetworkInjection.hpp @@ -1,62 +1,63 @@ #ifndef ExternalNetworkInjection_H #define ExternalNetworkInjection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "ReactivePower.hpp" +#include "ActivePowerPerFrequency.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" #include "Integer.hpp" +#include "PU.hpp" +#include "ReactivePower.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ -class ActivePowerPerFrequency; /* This class represents external network and it is used for IEC 60909 calculations. */ - class ExternalNetworkInjection: public RegulatingCondEq + class ExternalNetworkInjection : public RegulatingCondEq { - public: - CIMPP::ActivePowerPerFrequency* governorSCD; /* Power Frequency Bias. This is the change in power injection divided by the change in frequency and negated. A positive value of the power frequency bias provides additional power injection upon a drop in frequency. Default: nullptr */ - CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower maxQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ - CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ - CIMPP::ReactivePower minQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ - CIMPP::Boolean ikSecond; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Default: false */ - CIMPP::CurrentFlow maxInitialSymShCCurrent; /* Maximum initial symmetrical short-circuit currents (Ik` max) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float maxR0ToX0Ratio; /* Maximum ratio of zero sequence resistance of Network Feeder to its zero sequence reactance (R(0)/X(0) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float maxR1ToX1Ratio; /* Maximum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float maxZ0ToZ1Ratio; /* Maximum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::CurrentFlow minInitialSymShCCurrent; /* Minimum initial symmetrical short-circuit currents (Ik` min) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float minR0ToX0Ratio; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Used for short circuit data exchange according to IEC 6090 Default: nullptr */ - CIMPP::Simple_Float minR1ToX1Ratio; /* Minimum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Simple_Float minZ0ToZ1Ratio; /* Minimum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::PU voltageFactor; /* Voltage factor in pu, which was used to calculate short-circuit current Ik` and power Sk`. Default: nullptr */ - CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ - CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ExternalNetworkInjection(); - virtual ~ExternalNetworkInjection(); - + ~ExternalNetworkInjection() override; + + CIMPP::ActivePowerPerFrequency governorSCD; /* Power Frequency Bias. This is the change in power injection divided by the change in frequency and negated. A positive value of the power frequency bias provides additional power injection upon a drop in frequency. Default: nullptr */ + CIMPP::Boolean ikSecond; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Default: false */ + CIMPP::CurrentFlow maxInitialSymShCCurrent; /* Maximum initial symmetrical short-circuit currents (Ik` max) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::ActivePower maxP; /* Maximum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower maxQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ + CIMPP::Simple_Float maxR0ToX0Ratio; /* Maximum ratio of zero sequence resistance of Network Feeder to its zero sequence reactance (R(0)/X(0) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float maxR1ToX1Ratio; /* Maximum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float maxZ0ToZ1Ratio; /* Maximum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) max). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::CurrentFlow minInitialSymShCCurrent; /* Minimum initial symmetrical short-circuit currents (Ik` min) in A (Ik` = Sk`/(SQRT(3) Un)). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::ActivePower minP; /* Minimum active power of the injection. Default: nullptr */ + CIMPP::ReactivePower minQ; /* Not for short circuit modelling; It is used for modelling of infeed for load flow exchange. If maxQ and minQ are not used ReactiveCapabilityCurve can be used Default: nullptr */ + CIMPP::Simple_Float minR0ToX0Ratio; /* Indicates whether initial symmetrical short-circuit current and power have been calculated according to IEC (Ik`). Used for short circuit data exchange according to IEC 6090 Default: nullptr */ + CIMPP::Simple_Float minR1ToX1Ratio; /* Minimum ratio of positive sequence resistance of Network Feeder to its positive sequence reactance (R(1)/X(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Simple_Float minZ0ToZ1Ratio; /* Minimum ratio of zero sequence impedance to its positive sequence impedance (Z(0)/Z(1) min). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for steady state solutions. Default: nullptr */ + CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ + CIMPP::PU voltageFactor; /* Voltage factor in pu, which was used to calculate short-circuit current Ik` and power Sk`. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ExternalNetworkInjection_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Float.cpp b/CGMES_2.4.15_27JAN2020/Float.cpp new file mode 100644 index 000000000..04c13ae6e --- /dev/null +++ b/CGMES_2.4.15_27JAN2020/Float.cpp @@ -0,0 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ +#include "Float.hpp" + +#include + +#include "../src/CIMExceptions.hpp" + +using namespace CIMPP; + +Float& Float::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} + +Float::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Float::debugName[] = "Float"; +const char* Float::debugString() const +{ + return Float::debugName; +} + +Float& Float::operator+=(const Float& rhs) +{ + value += rhs.value; + return *this; +} + +Float& Float::operator-=(const Float& rhs) +{ + value -= rhs.value; + return *this; +} + +Float& Float::operator*=(const Float& rhs) +{ + value *= rhs.value; + return *this; +} + +Float& Float::operator/=(const Float& rhs) +{ + value /= rhs.value; + return *this; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Float& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + + std::ostream& operator<<(std::ostream& os, const Float& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Float.hpp b/CGMES_2.4.15_27JAN2020/Float.hpp new file mode 100644 index 000000000..ede68d395 --- /dev/null +++ b/CGMES_2.4.15_27JAN2020/Float.hpp @@ -0,0 +1,39 @@ +#ifndef Float_H +#define Float_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + +#include +#include + +namespace CIMPP +{ + /* + A floating point number. The range is unspecified and not limited. + */ + class Float + { + public: + Float() : value(0.0), initialized(false) {} + Float(long double value) : value(value), initialized(true) {} + + Float& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + Float& operator+=(const Float& rhs); + Float& operator-=(const Float& rhs); + Float& operator*=(const Float& rhs); + Float& operator/=(const Float& rhs); + + friend std::istream& operator>>(std::istream& lop, Float& rop); + friend std::ostream& operator<<(std::ostream& os, const Float& obj); + }; +} +#endif diff --git a/CGMES_2.4.15_27JAN2020/FossilFuel.cpp b/CGMES_2.4.15_27JAN2020/FossilFuel.cpp index de2cd0ae7..cead5d6ea 100644 --- a/CGMES_2.4.15_27JAN2020/FossilFuel.cpp +++ b/CGMES_2.4.15_27JAN2020/FossilFuel.cpp @@ -1,64 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "FossilFuel.hpp" -#include "FuelType.hpp" +#include +#include + #include "ThermalGeneratingUnit.hpp" +#include "FuelType.hpp" using namespace CIMPP; -FossilFuel::FossilFuel(): ThermalGeneratingUnit(nullptr) {}; - +FossilFuel::FossilFuel() : ThermalGeneratingUnit(nullptr) {}; FossilFuel::~FossilFuel() {}; -bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass*, BaseClass*); -bool assign_FossilFuel_ThermalGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(FossilFuel* element = dynamic_cast(BaseClass_ptr1)) { - element->ThermalGeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->ThermalGeneratingUnit != nullptr) - return assign_ThermalGeneratingUnit_FossilFuels(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_FossilFuel_fossilFuelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (FossilFuel* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fossilFuelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_FossilFuel_fossilFuelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(FossilFuel* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fossilFuelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass*, BaseClass*); +bool assign_FossilFuel_ThermalGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + FossilFuel* element = dynamic_cast(BaseClass_ptr1); + ThermalGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ThermalGeneratingUnit != element2) + { + element->ThermalGeneratingUnit = element2; + return assign_ThermalGeneratingUnit_FossilFuels(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* FossilFuel_factory() { - return new FossilFuel; - } +const char FossilFuel::debugName[] = "FossilFuel"; +const char* FossilFuel::debugString() const +{ + return FossilFuel::debugName; } -void FossilFuel::addConstructToMap(std::unordered_map& factory_map) { +void FossilFuel::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:FossilFuel"), &FossilFuel_factory)); } -void FossilFuel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void FossilFuel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:FossilFuel.fossilFuelType"), &assign_FossilFuel_fossilFuelType)); - } - -void FossilFuel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:FossilFuel.ThermalGeneratingUnit"), &assign_FossilFuel_ThermalGeneratingUnit)); } -const char FossilFuel::debugName[] = "FossilFuel"; -const char* FossilFuel::debugString() +void FossilFuel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return FossilFuel::debugName; + assign_map.insert(std::make_pair(std::string("cim:FossilFuel.ThermalGeneratingUnit"), &assign_FossilFuel_ThermalGeneratingUnit)); } const BaseClassDefiner FossilFuel::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner FossilFuel::declare() return BaseClassDefiner(FossilFuel::addConstructToMap, FossilFuel::addPrimitiveAssignFnsToMap, FossilFuel::addClassAssignFnsToMap, FossilFuel::debugName); } - +namespace CIMPP +{ + BaseClass* FossilFuel_factory() + { + return new FossilFuel; + } +} diff --git a/CGMES_2.4.15_27JAN2020/FossilFuel.hpp b/CGMES_2.4.15_27JAN2020/FossilFuel.hpp index b11d3b781..2c683ecd5 100644 --- a/CGMES_2.4.15_27JAN2020/FossilFuel.hpp +++ b/CGMES_2.4.15_27JAN2020/FossilFuel.hpp @@ -1,40 +1,41 @@ #ifndef FossilFuel_H #define FossilFuel_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "FuelType.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ThermalGeneratingUnit; - -class ThermalGeneratingUnit; /* The fossil fuel consumed by the non-nuclear thermal generating unit. For example, coal, oil, gas, etc. This a the specific fuels that the generating unit can consume. */ - class FossilFuel: public IdentifiedObject + class FossilFuel : public IdentifiedObject { - public: - CIMPP::FuelType fossilFuelType; /* The type of fossil fuel, such as coal, oil, or gas. Default: 0 */ - CIMPP::ThermalGeneratingUnit* ThermalGeneratingUnit; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ FossilFuel(); - virtual ~FossilFuel(); - + ~FossilFuel() override; + + CIMPP::ThermalGeneratingUnit* ThermalGeneratingUnit; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ + CIMPP::FuelType fossilFuelType; /* The type of fossil fuel, such as coal, oil, or gas. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* FossilFuel_factory(); diff --git a/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.cpp b/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.cpp index 4a69509a8..dd419372c 100644 --- a/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.cpp +++ b/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "FrancisGovernorControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::FrancisGovernorControlKind& rop) +FrancisGovernorControlKind& FrancisGovernorControlKind::operator=(FrancisGovernorControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +FrancisGovernorControlKind::operator FrancisGovernorControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char FrancisGovernorControlKind::debugName[] = "FrancisGovernorControlKind"; +const char* FrancisGovernorControlKind::debugString() const +{ + return FrancisGovernorControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, FrancisGovernorControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const FrancisGovernorControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == FrancisGovernorControlKind::mechanicHydrolicTachoAccelerator) + { + EnumSymbol = "mechanicHydrolicTachoAccelerator"; + } + if (obj.value == FrancisGovernorControlKind::mechanicHydraulicTransientFeedback) + { + EnumSymbol = "mechanicHydraulicTransientFeedback"; + } + if (obj.value == FrancisGovernorControlKind::electromechanicalElectrohydraulic) + { + EnumSymbol = "electromechanicalElectrohydraulic"; + } + + if (!EnumSymbol.empty()) + { + os << "FrancisGovernorControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.hpp b/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.hpp index 64f948396..a694f5429 100644 --- a/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.hpp +++ b/CGMES_2.4.15_27JAN2020/FrancisGovernorControlKind.hpp @@ -1,25 +1,50 @@ #ifndef FrancisGovernorControlKind_H #define FrancisGovernorControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Governor control flag for Francis hydro model. */ - enum class FrancisGovernorControlKind + class FrancisGovernorControlKind { - /** - * Mechanic-hydraulic regulator with tacho-accelerometer (Cflag = 1). - */ - mechanicHydrolicTachoAccelerator, - /** - * Mechanic-hydraulic regulator with transient feedback (Cflag=2). - */ - mechanicHydraulicTransientFeedback, - /** - * Electromechanical and electrohydraulic regulator (Cflag=3). - */ - electromechanicalElectrohydraulic, + public: + enum FrancisGovernorControlKind_ENUM + { + /** + * Mechanic-hydraulic regulator with tacho-accelerometer (Cflag = 1). + */ + mechanicHydrolicTachoAccelerator, + /** + * Mechanic-hydraulic regulator with transient feedback (Cflag=2). + */ + mechanicHydraulicTransientFeedback, + /** + * Electromechanical and electrohydraulic regulator (Cflag=3). + */ + electromechanicalElectrohydraulic, + }; + + FrancisGovernorControlKind() : value(), initialized(false) {} + FrancisGovernorControlKind(FrancisGovernorControlKind_ENUM value) : value(value), initialized(true) {} + + FrancisGovernorControlKind& operator=(FrancisGovernorControlKind_ENUM rop); + operator FrancisGovernorControlKind_ENUM() const; + + FrancisGovernorControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, FrancisGovernorControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const FrancisGovernorControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::FrancisGovernorControlKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/Frequency.cpp b/CGMES_2.4.15_27JAN2020/Frequency.cpp index 438b4caff..1809ef8c4 100644 --- a/CGMES_2.4.15_27JAN2020/Frequency.cpp +++ b/CGMES_2.4.15_27JAN2020/Frequency.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Frequency.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Frequency::Frequency() {} -Frequency::~Frequency(){} +#include -Frequency::Frequency(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Frequency::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Frequency::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Frequency& Frequency::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Frequency::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Frequency::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Frequency::debugName[] = "Frequency"; -const char* Frequency::debugString() { +const char* Frequency::debugString() const +{ return Frequency::debugName; } - -const BaseClassDefiner Frequency::declare() { - return BaseClassDefiner(Frequency::addConstructToMap, Frequency::addPrimitiveAssignFnsToMap, Frequency::addClassAssignFnsToMap, Frequency::debugName); +Frequency& Frequency::operator+=(const Frequency& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Frequency& Frequency::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Frequency& Frequency::operator-=(const Frequency& rhs) { - value -= rhs.value; - return *this; - } - - Frequency& Frequency::operator*=(const Frequency& rhs) { - value *= rhs.value; - return *this; - } - - Frequency& Frequency::operator/=(const Frequency& rhs) { - value /= rhs.value; - return *this; - } +Frequency& Frequency::operator-=(const Frequency& rhs) +{ + value -= rhs.value; + return *this; +} - Frequency& Frequency::operator+=(const Frequency& rhs) { - value += rhs.value; - return *this; - } +Frequency& Frequency::operator*=(const Frequency& rhs) +{ + value *= rhs.value; + return *this; +} - Frequency::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Frequency& Frequency::operator/=(const Frequency& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Frequency& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Frequency& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Frequency& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Frequency.hpp b/CGMES_2.4.15_27JAN2020/Frequency.hpp index 87cdc33c2..28f5a1022 100644 --- a/CGMES_2.4.15_27JAN2020/Frequency.hpp +++ b/CGMES_2.4.15_27JAN2020/Frequency.hpp @@ -1,38 +1,39 @@ #ifndef Frequency_H #define Frequency_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Frequency : public BaseClass + /* + Cycles per second. + */ + class Frequency { - public: - Frequency(); - virtual ~Frequency(); - Frequency(long double value); - static const BaseClassDefiner declare(); - Frequency& operator=(long double &rop); + Frequency() : value(0.0), initialized(false) {} + Frequency(long double value) : value(value), initialized(true) {} + + Frequency& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Frequency& operator+=(const Frequency& rhs); Frequency& operator-=(const Frequency& rhs); Frequency& operator*=(const Frequency& rhs); Frequency& operator/=(const Frequency& rhs); + friend std::istream& operator>>(std::istream& lop, Frequency& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Frequency& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/FuelType.cpp b/CGMES_2.4.15_27JAN2020/FuelType.cpp index 88f0d85ff..e59bf1fd4 100644 --- a/CGMES_2.4.15_27JAN2020/FuelType.cpp +++ b/CGMES_2.4.15_27JAN2020/FuelType.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "FuelType.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::FuelType& rop) +FuelType& FuelType::operator=(FuelType_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +FuelType::operator FuelType_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char FuelType::debugName[] = "FuelType"; +const char* FuelType::debugString() const +{ + return FuelType::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, FuelType& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -53,5 +84,43 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const FuelType& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == FuelType::coal) + { + EnumSymbol = "coal"; + } + if (obj.value == FuelType::oil) + { + EnumSymbol = "oil"; + } + if (obj.value == FuelType::gas) + { + EnumSymbol = "gas"; + } + if (obj.value == FuelType::lignite) + { + EnumSymbol = "lignite"; + } + if (obj.value == FuelType::hardCoal) + { + EnumSymbol = "hardCoal"; + } + if (obj.value == FuelType::oilShale) + { + EnumSymbol = "oilShale"; + } + + if (!EnumSymbol.empty()) + { + os << "FuelType." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/FuelType.hpp b/CGMES_2.4.15_27JAN2020/FuelType.hpp index e16c3d7f0..452590f12 100644 --- a/CGMES_2.4.15_27JAN2020/FuelType.hpp +++ b/CGMES_2.4.15_27JAN2020/FuelType.hpp @@ -1,37 +1,62 @@ #ifndef FuelType_H #define FuelType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of fuel. */ - enum class FuelType + class FuelType { - /** - * Generic coal, not including lignite type. - */ - coal, - /** - * Oil. - */ - oil, - /** - * Natural gas. - */ - gas, - /** - * The fuel is lignite coal. Note that this is a special type of coal, so the other enum of coal is reserved for hard coal types or if the exact type of coal is not known. - */ - lignite, - /** - * Hard coal - */ - hardCoal, - /** - * Oil Shale - */ - oilShale, + public: + enum FuelType_ENUM + { + /** + * Generic coal, not including lignite type. + */ + coal, + /** + * Oil. + */ + oil, + /** + * Natural gas. + */ + gas, + /** + * The fuel is lignite coal. Note that this is a special type of coal, so the other enum of coal is reserved for hard coal types or if the exact type of coal is not known. + */ + lignite, + /** + * Hard coal + */ + hardCoal, + /** + * Oil Shale + */ + oilShale, + }; + + FuelType() : value(), initialized(false) {} + FuelType(FuelType_ENUM value) : value(value), initialized(true) {} + + FuelType& operator=(FuelType_ENUM rop); + operator FuelType_ENUM() const; + + FuelType_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, FuelType& rop); + friend std::ostream& operator<<(std::ostream& os, const FuelType& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::FuelType& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.cpp b/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.cpp index af0535fe0..c78172e82 100644 --- a/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.cpp +++ b/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GenICompensationForGenJ.hpp" +#include +#include + #include "SynchronousMachineDynamics.hpp" #include "VCompIEEEType2.hpp" #include "PU.hpp" @@ -9,84 +13,96 @@ using namespace CIMPP; -GenICompensationForGenJ::GenICompensationForGenJ(): SynchronousMachineDynamics(nullptr), VcompIEEEType2(nullptr) {}; - +GenICompensationForGenJ::GenICompensationForGenJ() : SynchronousMachineDynamics(nullptr), VcompIEEEType2(nullptr) {}; GenICompensationForGenJ::~GenICompensationForGenJ() {}; -bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass*, BaseClass*); -bool assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass*, BaseClass*); -bool assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - element->VcompIEEEType2 = dynamic_cast(BaseClass_ptr2); - if(element->VcompIEEEType2 != nullptr) - return assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_GenICompensationForGenJ_rcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcij; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GenICompensationForGenJ_xcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xcij; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GenICompensationForGenJ_rcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcij; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass*, BaseClass*); +bool assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GenICompensationForGenJ_xcij(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xcij; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass*, BaseClass*); +bool assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GenICompensationForGenJ* element = dynamic_cast(BaseClass_ptr1); + VCompIEEEType2* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VcompIEEEType2 != element2) + { + element->VcompIEEEType2 = element2; + return assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* GenICompensationForGenJ_factory() { - return new GenICompensationForGenJ; - } + + +const char GenICompensationForGenJ::debugName[] = "GenICompensationForGenJ"; +const char* GenICompensationForGenJ::debugString() const +{ + return GenICompensationForGenJ::debugName; } -void GenICompensationForGenJ::addConstructToMap(std::unordered_map& factory_map) { +void GenICompensationForGenJ::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ"), &GenICompensationForGenJ_factory)); } -void GenICompensationForGenJ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.rcij"), &assign_GenICompensationForGenJ_rcij)); +void GenICompensationForGenJ::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.rcij"), &assign_GenICompensationForGenJ_rcij)); assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.xcij"), &assign_GenICompensationForGenJ_xcij)); } -void GenICompensationForGenJ::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void GenICompensationForGenJ::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.SynchronousMachineDynamics"), &assign_GenICompensationForGenJ_SynchronousMachineDynamics)); assign_map.insert(std::make_pair(std::string("cim:GenICompensationForGenJ.VcompIEEEType2"), &assign_GenICompensationForGenJ_VcompIEEEType2)); - } - -const char GenICompensationForGenJ::debugName[] = "GenICompensationForGenJ"; -const char* GenICompensationForGenJ::debugString() -{ - return GenICompensationForGenJ::debugName; } const BaseClassDefiner GenICompensationForGenJ::declare() @@ -94,4 +110,10 @@ const BaseClassDefiner GenICompensationForGenJ::declare() return BaseClassDefiner(GenICompensationForGenJ::addConstructToMap, GenICompensationForGenJ::addPrimitiveAssignFnsToMap, GenICompensationForGenJ::addClassAssignFnsToMap, GenICompensationForGenJ::debugName); } - +namespace CIMPP +{ + BaseClass* GenICompensationForGenJ_factory() + { + return new GenICompensationForGenJ; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.hpp b/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.hpp index 46d1a5cbf..80b337103 100644 --- a/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.hpp +++ b/CGMES_2.4.15_27JAN2020/GenICompensationForGenJ.hpp @@ -1,43 +1,44 @@ #ifndef GenICompensationForGenJ_H #define GenICompensationForGenJ_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { +namespace CIMPP +{ + class SynchronousMachineDynamics; + class VCompIEEEType2; - -class SynchronousMachineDynamics; -class VCompIEEEType2; /* This class provides the resistive and reactive components of compensation for the generator associated with the IEEE Type 2 voltage compensator for current flow out of one of the other generators in the interconnection. */ - class GenICompensationForGenJ: public IdentifiedObject + class GenICompensationForGenJ : public IdentifiedObject { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Standard synchronous machine out of which current flow is being compensated for. Default: 0 */ - CIMPP::VCompIEEEType2* VcompIEEEType2; /* The standard IEEE Type 2 voltage compensator of this compensation. Default: 0 */ - CIMPP::PU rcij; /* Default: nullptr */ - CIMPP::PU xcij; /* Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GenICompensationForGenJ(); - virtual ~GenICompensationForGenJ(); - + ~GenICompensationForGenJ() override; + + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Standard synchronous machine out of which current flow is being compensated for. Default: 0 */ + CIMPP::VCompIEEEType2* VcompIEEEType2; /* The standard IEEE Type 2 voltage compensator of this compensation. Default: 0 */ + CIMPP::PU rcij; /* Default: nullptr */ + CIMPP::PU xcij; /* Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GenICompensationForGenJ_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/GeneratingUnit.cpp index be4d27eb2..b89e20d52 100644 --- a/CGMES_2.4.15_27JAN2020/GeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/GeneratingUnit.cpp @@ -1,7 +1,14 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeneratingUnit.hpp" +#include +#include + +#include "ControlAreaGeneratingUnit.hpp" +#include "GrossToNetActivePowerCurve.hpp" +#include "RotatingMachine.hpp" #include "GeneratorControlSource.hpp" #include "PerCent.hpp" #include "ActivePower.hpp" @@ -10,306 +17,336 @@ #include "ActivePower.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" +#include "Simple_Float.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" #include "ActivePower.hpp" #include "Simple_Float.hpp" #include "Money.hpp" -#include "Money.hpp" #include "PerCent.hpp" -#include "ControlAreaGeneratingUnit.hpp" -#include "RotatingMachine.hpp" -#include "GrossToNetActivePowerCurve.hpp" -#include "Simple_Float.hpp" +#include "Money.hpp" using namespace CIMPP; GeneratingUnit::GeneratingUnit() {}; - GeneratingUnit::~GeneratingUnit() {}; +bool assign_GeneratingUnit_genControlSource(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->genControlSource; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_governorSCD(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorSCD; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_initialP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->initialP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_longPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->longPF; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_maxOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxOperatingP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_maximumAllowableSpinningReserve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maximumAllowableSpinningReserve; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_minOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minOperatingP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_nominalP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_normalPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalPF; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_ratedGrossMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedGrossMaxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_ratedGrossMinP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedGrossMinP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GeneratingUnit_ratedNetMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedNetMaxP; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ControlAreaGeneratingUnit.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_GeneratingUnit_shortPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->shortPF; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_GeneratingUnit_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RotatingMachine.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_GeneratingUnit_startupCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->startupCost; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->GrossToNetActivePowerCurves.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_GeneratingUnit_totalEfficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->totalEfficiency; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_GeneratingUnit_variableCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->variableCost; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeneratingUnit_genControlSource(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->genControlSource; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass*, BaseClass*); +bool assign_GeneratingUnit_ControlAreaGeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + ControlAreaGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ControlAreaGeneratingUnit.begin(), element->ControlAreaGeneratingUnit.end(), element2) == element->ControlAreaGeneratingUnit.end()) + { + element->ControlAreaGeneratingUnit.push_back(element2); + return assign_ControlAreaGeneratingUnit_GeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GeneratingUnit_governorSCD(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->governorSCD; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass*, BaseClass*); +bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + GrossToNetActivePowerCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->GrossToNetActivePowerCurves.begin(), element->GrossToNetActivePowerCurves.end(), element2) == element->GrossToNetActivePowerCurves.end()) + { + element->GrossToNetActivePowerCurves.push_back(element2); + return assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GeneratingUnit_initialP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->initialP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RotatingMachine_GeneratingUnit(BaseClass*, BaseClass*); +bool assign_GeneratingUnit_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + RotatingMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RotatingMachine.begin(), element->RotatingMachine.end(), element2) == element->RotatingMachine.end()) + { + element->RotatingMachine.push_back(element2); + return assign_RotatingMachine_GeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_GeneratingUnit_longPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->longPF; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_maximumAllowableSpinningReserve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maximumAllowableSpinningReserve; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_maxOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxOperatingP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_minOperatingP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minOperatingP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_nominalP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_ratedGrossMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedGrossMaxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_ratedGrossMinP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedGrossMinP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_ratedNetMaxP(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedNetMaxP; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_shortPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->shortPF; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_startupCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->startupCost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_variableCost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->variableCost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_totalEfficiency(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->totalEfficiency; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GeneratingUnit_normalPF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalPF; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GeneratingUnit_factory() { - return new GeneratingUnit; - } +const char GeneratingUnit::debugName[] = "GeneratingUnit"; +const char* GeneratingUnit::debugString() const +{ + return GeneratingUnit::debugName; } -void GeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void GeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GeneratingUnit"), &GeneratingUnit_factory)); } -void GeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.genControlSource"), &assign_GeneratingUnit_genControlSource)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.governorSCD"), &assign_GeneratingUnit_governorSCD)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.initialP"), &assign_GeneratingUnit_initialP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.longPF"), &assign_GeneratingUnit_longPF)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.maximumAllowableSpinningReserve"), &assign_GeneratingUnit_maximumAllowableSpinningReserve)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.maxOperatingP"), &assign_GeneratingUnit_maxOperatingP)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.maximumAllowableSpinningReserve"), &assign_GeneratingUnit_maximumAllowableSpinningReserve)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.minOperatingP"), &assign_GeneratingUnit_minOperatingP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.nominalP"), &assign_GeneratingUnit_nominalP)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.normalPF"), &assign_GeneratingUnit_normalPF)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ratedGrossMaxP"), &assign_GeneratingUnit_ratedGrossMaxP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ratedGrossMinP"), &assign_GeneratingUnit_ratedGrossMinP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ratedNetMaxP"), &assign_GeneratingUnit_ratedNetMaxP)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.shortPF"), &assign_GeneratingUnit_shortPF)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.startupCost"), &assign_GeneratingUnit_startupCost)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.variableCost"), &assign_GeneratingUnit_variableCost)); assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.totalEfficiency"), &assign_GeneratingUnit_totalEfficiency)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.normalPF"), &assign_GeneratingUnit_normalPF)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.variableCost"), &assign_GeneratingUnit_variableCost)); } -void GeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ControlAreaGeneratingUnit"), &assign_GeneratingUnit_ControlAreaGeneratingUnit)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.RotatingMachine"), &assign_GeneratingUnit_RotatingMachine)); - assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.GrossToNetActivePowerCurves"), &assign_GeneratingUnit_GrossToNetActivePowerCurves)); - } - -const char GeneratingUnit::debugName[] = "GeneratingUnit"; -const char* GeneratingUnit::debugString() +void GeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.ControlAreaGeneratingUnit"), &assign_GeneratingUnit_ControlAreaGeneratingUnit)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.GrossToNetActivePowerCurves"), &assign_GeneratingUnit_GrossToNetActivePowerCurves)); + assign_map.insert(std::make_pair(std::string("cim:GeneratingUnit.RotatingMachine"), &assign_GeneratingUnit_RotatingMachine)); } const BaseClassDefiner GeneratingUnit::declare() @@ -317,4 +354,10 @@ const BaseClassDefiner GeneratingUnit::declare() return BaseClassDefiner(GeneratingUnit::addConstructToMap, GeneratingUnit::addPrimitiveAssignFnsToMap, GeneratingUnit::addClassAssignFnsToMap, GeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* GeneratingUnit_factory() + { + return new GeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/GeneratingUnit.hpp index 113035cdc..b2e844024 100644 --- a/CGMES_2.4.15_27JAN2020/GeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/GeneratingUnit.hpp @@ -1,63 +1,64 @@ #ifndef GeneratingUnit_H #define GeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +#include "ActivePower.hpp" #include "GeneratorControlSource.hpp" +#include "Money.hpp" #include "PerCent.hpp" -#include "ActivePower.hpp" #include "Simple_Float.hpp" -#include "Money.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class ControlAreaGeneratingUnit; + class GrossToNetActivePowerCurve; + class RotatingMachine; -class ControlAreaGeneratingUnit; -class RotatingMachine; -class GrossToNetActivePowerCurve; /* A single or set of synchronous machines for converting mechanical power into alternating-current power. For example, individual machines within a set may be defined for scheduling purposes while a single control signal is derived for the set. In this case there would be a GeneratingUnit for each member of the set and an additional GeneratingUnit corresponding to the set. */ - class GeneratingUnit: public Equipment + class GeneratingUnit : public Equipment { - public: - CIMPP::GeneratorControlSource genControlSource; /* The source of controls for a generating unit. Default: 0 */ - CIMPP::PerCent governorSCD; /* Governor Speed Changer Droop. This is the change in generator power output divided by the change in frequency normalized by the nominal power of the generator and the nominal frequency and expressed in percent and negated. A positive value of speed change droop provides additional generator output upon a drop in frequency. Default: nullptr */ - CIMPP::ActivePower initialP; /* Default initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration. Default: nullptr */ - CIMPP::Simple_Float longPF; /* Generating unit long term economic participation factor. Default: nullptr */ - CIMPP::ActivePower maximumAllowableSpinningReserve; /* Maximum allowable spinning reserve. Spinning reserve will never be considered greater than this value regardless of the current operating point. Default: nullptr */ - CIMPP::ActivePower maxOperatingP; /* This is the maximum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ - CIMPP::ActivePower minOperatingP; /* This is the minimum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ - CIMPP::ActivePower nominalP; /* The nominal power of the generating unit. Used to give precise meaning to percentage based attributes such as the governor speed change droop (governorSCD attribute). The attribute shall be a positive value equal or less than RotatingMachine.ratedS. Default: nullptr */ - CIMPP::ActivePower ratedGrossMaxP; /* The unit`s gross rated maximum capacity (book value). Default: nullptr */ - CIMPP::ActivePower ratedGrossMinP; /* The gross rated minimum generation level which the unit can safely operate at while delivering power to the transmission grid. Default: nullptr */ - CIMPP::ActivePower ratedNetMaxP; /* The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity. Default: nullptr */ - CIMPP::Simple_Float shortPF; /* Generating unit short term economic participation factor. Default: nullptr */ - CIMPP::Money startupCost; /* The initial startup cost incurred for each start of the GeneratingUnit. Default: nullptr */ - CIMPP::Money variableCost; /* The variable cost component of production per unit of ActivePower. Default: nullptr */ - CIMPP::PerCent totalEfficiency; /* The efficiency of the unit in converting the fuel into electrical energy. Default: nullptr */ - std::list ControlAreaGeneratingUnit; /* ControlArea specifications for this generating unit. Default: 0 */ - std::list RotatingMachine; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ - std::list GrossToNetActivePowerCurves; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ - CIMPP::Simple_Float normalPF; /* Generating unit economic participation factor. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GeneratingUnit(); - virtual ~GeneratingUnit(); - + ~GeneratingUnit() override; + + std::list ControlAreaGeneratingUnit; /* ControlArea specifications for this generating unit. Default: 0 */ + std::list GrossToNetActivePowerCurves; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ + std::list RotatingMachine; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ + CIMPP::GeneratorControlSource genControlSource; /* The source of controls for a generating unit. Default: 0 */ + CIMPP::PerCent governorSCD; /* Governor Speed Changer Droop. This is the change in generator power output divided by the change in frequency normalized by the nominal power of the generator and the nominal frequency and expressed in percent and negated. A positive value of speed change droop provides additional generator output upon a drop in frequency. Default: nullptr */ + CIMPP::ActivePower initialP; /* Default initial active power which is used to store a powerflow result for the initial active power for this unit in this network configuration. Default: nullptr */ + CIMPP::Simple_Float longPF; /* Generating unit long term economic participation factor. Default: nullptr */ + CIMPP::ActivePower maxOperatingP; /* This is the maximum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ + CIMPP::ActivePower maximumAllowableSpinningReserve; /* Maximum allowable spinning reserve. Spinning reserve will never be considered greater than this value regardless of the current operating point. Default: nullptr */ + CIMPP::ActivePower minOperatingP; /* This is the minimum operating active power limit the dispatcher can enter for this unit. Default: nullptr */ + CIMPP::ActivePower nominalP; /* The nominal power of the generating unit. Used to give precise meaning to percentage based attributes such as the governor speed change droop (governorSCD attribute). The attribute shall be a positive value equal or less than RotatingMachine.ratedS. Default: nullptr */ + CIMPP::Simple_Float normalPF; /* Generating unit economic participation factor. Default: nullptr */ + CIMPP::ActivePower ratedGrossMaxP; /* The unit`s gross rated maximum capacity (book value). Default: nullptr */ + CIMPP::ActivePower ratedGrossMinP; /* The gross rated minimum generation level which the unit can safely operate at while delivering power to the transmission grid. Default: nullptr */ + CIMPP::ActivePower ratedNetMaxP; /* The net rated maximum capacity determined by subtracting the auxiliary power used to operate the internal plant machinery from the rated gross maximum capacity. Default: nullptr */ + CIMPP::Simple_Float shortPF; /* Generating unit short term economic participation factor. Default: nullptr */ + CIMPP::Money startupCost; /* The initial startup cost incurred for each start of the GeneratingUnit. Default: nullptr */ + CIMPP::PerCent totalEfficiency; /* The efficiency of the unit in converting the fuel into electrical energy. Default: nullptr */ + CIMPP::Money variableCost; /* The variable cost component of production per unit of ActivePower. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GeneratorControlSource.cpp b/CGMES_2.4.15_27JAN2020/GeneratorControlSource.cpp index 2b7450967..1850d2514 100644 --- a/CGMES_2.4.15_27JAN2020/GeneratorControlSource.cpp +++ b/CGMES_2.4.15_27JAN2020/GeneratorControlSource.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeneratorControlSource.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::GeneratorControlSource& rop) +GeneratorControlSource& GeneratorControlSource::operator=(GeneratorControlSource_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +GeneratorControlSource::operator GeneratorControlSource_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char GeneratorControlSource::debugName[] = "GeneratorControlSource"; +const char* GeneratorControlSource::debugString() const +{ + return GeneratorControlSource::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, GeneratorControlSource& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const GeneratorControlSource& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == GeneratorControlSource::unavailable) + { + EnumSymbol = "unavailable"; + } + if (obj.value == GeneratorControlSource::offAGC) + { + EnumSymbol = "offAGC"; + } + if (obj.value == GeneratorControlSource::onAGC) + { + EnumSymbol = "onAGC"; + } + if (obj.value == GeneratorControlSource::plantControl) + { + EnumSymbol = "plantControl"; + } + + if (!EnumSymbol.empty()) + { + os << "GeneratorControlSource." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GeneratorControlSource.hpp b/CGMES_2.4.15_27JAN2020/GeneratorControlSource.hpp index 55e1fbf59..463a53ab3 100644 --- a/CGMES_2.4.15_27JAN2020/GeneratorControlSource.hpp +++ b/CGMES_2.4.15_27JAN2020/GeneratorControlSource.hpp @@ -1,29 +1,54 @@ #ifndef GeneratorControlSource_H #define GeneratorControlSource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The source of controls for a generating unit. */ - enum class GeneratorControlSource + class GeneratorControlSource { - /** - * Not available. - */ - unavailable, - /** - * Off of automatic generation control (AGC). - */ - offAGC, - /** - * On automatic generation control (AGC). - */ - onAGC, - /** - * Plant is controlling. - */ - plantControl, + public: + enum GeneratorControlSource_ENUM + { + /** + * Not available. + */ + unavailable, + /** + * Off of automatic generation control (AGC). + */ + offAGC, + /** + * On automatic generation control (AGC). + */ + onAGC, + /** + * Plant is controlling. + */ + plantControl, + }; + + GeneratorControlSource() : value(), initialized(false) {} + GeneratorControlSource(GeneratorControlSource_ENUM value) : value(value), initialized(true) {} + + GeneratorControlSource& operator=(GeneratorControlSource_ENUM rop); + operator GeneratorControlSource_ENUM() const; + + GeneratorControlSource_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, GeneratorControlSource& rop); + friend std::ostream& operator<<(std::ostream& os, const GeneratorControlSource& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::GeneratorControlSource& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.cpp b/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.cpp index e07e1f5f4..2d1052ed1 100644 --- a/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.cpp +++ b/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GenericNonLinearLoadModelKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::GenericNonLinearLoadModelKind& rop) +GenericNonLinearLoadModelKind& GenericNonLinearLoadModelKind::operator=(GenericNonLinearLoadModelKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +GenericNonLinearLoadModelKind::operator GenericNonLinearLoadModelKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char GenericNonLinearLoadModelKind::debugName[] = "GenericNonLinearLoadModelKind"; +const char* GenericNonLinearLoadModelKind::debugString() const +{ + return GenericNonLinearLoadModelKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, GenericNonLinearLoadModelKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const GenericNonLinearLoadModelKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == GenericNonLinearLoadModelKind::exponentialRecovery) + { + EnumSymbol = "exponentialRecovery"; + } + if (obj.value == GenericNonLinearLoadModelKind::loadAdaptive) + { + EnumSymbol = "loadAdaptive"; + } + + if (!EnumSymbol.empty()) + { + os << "GenericNonLinearLoadModelKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.hpp b/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.hpp index 2ed30c2dd..7b6aa0c38 100644 --- a/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.hpp +++ b/CGMES_2.4.15_27JAN2020/GenericNonLinearLoadModelKind.hpp @@ -1,21 +1,46 @@ #ifndef GenericNonLinearLoadModelKind_H #define GenericNonLinearLoadModelKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of generic non-linear load model. */ - enum class GenericNonLinearLoadModelKind + class GenericNonLinearLoadModelKind { - /** - * Exponential recovery model. - */ - exponentialRecovery, - /** - * Load adaptive model. - */ - loadAdaptive, + public: + enum GenericNonLinearLoadModelKind_ENUM + { + /** + * Exponential recovery model. + */ + exponentialRecovery, + /** + * Load adaptive model. + */ + loadAdaptive, + }; + + GenericNonLinearLoadModelKind() : value(), initialized(false) {} + GenericNonLinearLoadModelKind(GenericNonLinearLoadModelKind_ENUM value) : value(value), initialized(true) {} + + GenericNonLinearLoadModelKind& operator=(GenericNonLinearLoadModelKind_ENUM rop); + operator GenericNonLinearLoadModelKind_ENUM() const; + + GenericNonLinearLoadModelKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, GenericNonLinearLoadModelKind& rop); + friend std::ostream& operator<<(std::ostream& os, const GenericNonLinearLoadModelKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::GenericNonLinearLoadModelKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.cpp b/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.cpp index a09c6546f..b23c584fe 100644 --- a/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeographicalLocationVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -GeographicalLocationVersion::GeographicalLocationVersion(): date(nullptr) {}; - +GeographicalLocationVersion::GeographicalLocationVersion() {}; GeographicalLocationVersion::~GeographicalLocationVersion() {}; - - -bool assign_GeographicalLocationVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_GeographicalLocationVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_GeographicalLocationVersion_baseUML(std::stringstream &buffer, BaseC return false; } -bool assign_GeographicalLocationVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_GeographicalLocationVersion_baseURI(std::stringstream &buffer, BaseC return false; } +bool assign_GeographicalLocationVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GeographicalLocationVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_GeographicalLocationVersion_differenceModelURI(std::stringstream &bu return false; } -bool assign_GeographicalLocationVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_GeographicalLocationVersion_entsoeUML(std::stringstream &buffer, Bas return false; } -bool assign_GeographicalLocationVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_GeographicalLocationVersion_entsoeURI(std::stringstream &buffer, Bas return false; } -bool assign_GeographicalLocationVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_GeographicalLocationVersion_modelDescriptionURI(std::stringstream &b return false; } -bool assign_GeographicalLocationVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_GeographicalLocationVersion_namespaceRDF(std::stringstream &buffer, return false; } -bool assign_GeographicalLocationVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_GeographicalLocationVersion_namespaceUML(std::stringstream &buffer, return false; } -bool assign_GeographicalLocationVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_GeographicalLocationVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GeographicalLocationVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_GeographicalLocationVersion_shortName(std::stringstream &buffer, Bas return false; } -namespace CIMPP { - BaseClass* GeographicalLocationVersion_factory() { - return new GeographicalLocationVersion; - } + + + + + + + + + + + +const char GeographicalLocationVersion::debugName[] = "GeographicalLocationVersion"; +const char* GeographicalLocationVersion::debugString() const +{ + return GeographicalLocationVersion::debugName; } -void GeographicalLocationVersion::addConstructToMap(std::unordered_map& factory_map) { +void GeographicalLocationVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion"), &GeographicalLocationVersion_factory)); } -void GeographicalLocationVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GeographicalLocationVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.baseUML"), &assign_GeographicalLocationVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.baseURI"), &assign_GeographicalLocationVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.differenceModelURI"), &assign_GeographicalLocationVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.date"), &assign_GeographicalLocationVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.differenceModelURI"), &assign_GeographicalLocationVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.entsoeUML"), &assign_GeographicalLocationVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.entsoeURI"), &assign_GeographicalLocationVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.modelDescriptionURI"), &assign_GeographicalLocationVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void GeographicalLocationVersion::addPrimitiveAssignFnsToMap(std::unordered_map< assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.shortName"), &assign_GeographicalLocationVersion_shortName)); } -void GeographicalLocationVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GeographicalLocationVersion.date"), &assign_GeographicalLocationVersion_date)); - } - -const char GeographicalLocationVersion::debugName[] = "GeographicalLocationVersion"; -const char* GeographicalLocationVersion::debugString() +void GeographicalLocationVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GeographicalLocationVersion::debugName; } const BaseClassDefiner GeographicalLocationVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner GeographicalLocationVersion::declare() return BaseClassDefiner(GeographicalLocationVersion::addConstructToMap, GeographicalLocationVersion::addPrimitiveAssignFnsToMap, GeographicalLocationVersion::addClassAssignFnsToMap, GeographicalLocationVersion::debugName); } - +namespace CIMPP +{ + BaseClass* GeographicalLocationVersion_factory() + { + return new GeographicalLocationVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.hpp b/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.hpp index e3a11025a..46e7a6d4e 100644 --- a/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/GeographicalLocationVersion.hpp @@ -1,48 +1,49 @@ #ifndef GeographicalLocationVersion_H #define GeographicalLocationVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class GeographicalLocationVersion: public BaseClass + class GeographicalLocationVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/GeographicalLocation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GeographicalLocationVersion(); - virtual ~GeographicalLocationVersion(); - + ~GeographicalLocationVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/GeographicalLocation/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GeographicalLocationVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GeographicalRegion.cpp b/CGMES_2.4.15_27JAN2020/GeographicalRegion.cpp index 56f4ef7db..e2c0faf26 100644 --- a/CGMES_2.4.15_27JAN2020/GeographicalRegion.cpp +++ b/CGMES_2.4.15_27JAN2020/GeographicalRegion.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GeographicalRegion.hpp" +#include +#include + #include "SubGeographicalRegion.hpp" using namespace CIMPP; GeographicalRegion::GeographicalRegion() {}; - GeographicalRegion::~GeographicalRegion() {}; -bool assign_GeographicalRegion_Regions(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Regions.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_SubGeographicalRegion_Region(BaseClass*, BaseClass*); +bool assign_GeographicalRegion_Regions(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Regions.begin(), element->Regions.end(), element2) == element->Regions.end()) + { + element->Regions.push_back(element2); + return assign_SubGeographicalRegion_Region(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* GeographicalRegion_factory() { - return new GeographicalRegion; - } +const char GeographicalRegion::debugName[] = "GeographicalRegion"; +const char* GeographicalRegion::debugString() const +{ + return GeographicalRegion::debugName; } -void GeographicalRegion::addConstructToMap(std::unordered_map& factory_map) { +void GeographicalRegion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GeographicalRegion"), &GeographicalRegion_factory)); } -void GeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void GeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GeographicalRegion.Regions"), &assign_GeographicalRegion_Regions)); +void GeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char GeographicalRegion::debugName[] = "GeographicalRegion"; -const char* GeographicalRegion::debugString() +void GeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GeographicalRegion::debugName; + assign_map.insert(std::make_pair(std::string("cim:GeographicalRegion.Regions"), &assign_GeographicalRegion_Regions)); } const BaseClassDefiner GeographicalRegion::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner GeographicalRegion::declare() return BaseClassDefiner(GeographicalRegion::addConstructToMap, GeographicalRegion::addPrimitiveAssignFnsToMap, GeographicalRegion::addClassAssignFnsToMap, GeographicalRegion::debugName); } - +namespace CIMPP +{ + BaseClass* GeographicalRegion_factory() + { + return new GeographicalRegion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GeographicalRegion.hpp b/CGMES_2.4.15_27JAN2020/GeographicalRegion.hpp index d6e1dbe42..a629c89ff 100644 --- a/CGMES_2.4.15_27JAN2020/GeographicalRegion.hpp +++ b/CGMES_2.4.15_27JAN2020/GeographicalRegion.hpp @@ -1,38 +1,39 @@ #ifndef GeographicalRegion_H #define GeographicalRegion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubGeographicalRegion; -class SubGeographicalRegion; /* A geographical region of a power system network model. */ - class GeographicalRegion: public IdentifiedObject + class GeographicalRegion : public IdentifiedObject { - public: - std::list Regions; /* All sub-geograhpical regions within this geographical region. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GeographicalRegion(); - virtual ~GeographicalRegion(); - + ~GeographicalRegion() override; + + std::list Regions; /* All sub-geograhpical regions within this geographical region. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GeographicalRegion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovCT1.cpp b/CGMES_2.4.15_27JAN2020/GovCT1.cpp index 499d6749a..844c5138e 100644 --- a/CGMES_2.4.15_27JAN2020/GovCT1.cpp +++ b/CGMES_2.4.15_27JAN2020/GovCT1.cpp @@ -1,561 +1,596 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovCT1.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "DroopSignalFeedbackKind.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Simple_Float.hpp" +#include "DroopSignalFeedbackKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovCT1::GovCT1() {}; - GovCT1::~GovCT1() {}; +bool assign_GovCT1_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kigov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kimw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ldref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rclose; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rdown; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ropen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rselect; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rup; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tact; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->teng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpelec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT1_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfspd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovCT1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rselect; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpelec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT1_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kigov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tact; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfspd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->teng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ldref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ropen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rclose; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kimw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rup; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT1_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rdown; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovCT1_factory() { - return new GovCT1; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovCT1::debugName[] = "GovCT1"; +const char* GovCT1::debugString() const +{ + return GovCT1::debugName; } -void GovCT1::addConstructToMap(std::unordered_map& factory_map) { +void GovCT1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovCT1"), &GovCT1_factory)); } -void GovCT1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovCT1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovCT1.aset"), &assign_GovCT1_aset)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.db"), &assign_GovCT1_db)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.dm"), &assign_GovCT1_dm)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ka"), &assign_GovCT1_ka)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kdgov"), &assign_GovCT1_kdgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kigov"), &assign_GovCT1_kigov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kiload"), &assign_GovCT1_kiload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kimw"), &assign_GovCT1_kimw)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpgov"), &assign_GovCT1_kpgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpload"), &assign_GovCT1_kpload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.kturb"), &assign_GovCT1_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ldref"), &assign_GovCT1_ldref)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.maxerr"), &assign_GovCT1_maxerr)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.minerr"), &assign_GovCT1_minerr)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.mwbase"), &assign_GovCT1_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.r"), &assign_GovCT1_r)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.rclose"), &assign_GovCT1_rclose)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.rdown"), &assign_GovCT1_rdown)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ropen"), &assign_GovCT1_ropen)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.rselect"), &assign_GovCT1_rselect)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.tpelec"), &assign_GovCT1_tpelec)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.maxerr"), &assign_GovCT1_maxerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.minerr"), &assign_GovCT1_minerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpgov"), &assign_GovCT1_kpgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kigov"), &assign_GovCT1_kigov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kdgov"), &assign_GovCT1_kdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.tdgov"), &assign_GovCT1_tdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmax"), &assign_GovCT1_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmin"), &assign_GovCT1_vmin)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.rup"), &assign_GovCT1_rup)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.ta"), &assign_GovCT1_ta)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tact"), &assign_GovCT1_tact)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kturb"), &assign_GovCT1_kturb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfnl"), &assign_GovCT1_wfnl)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tb"), &assign_GovCT1_tb)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tc"), &assign_GovCT1_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfspd"), &assign_GovCT1_wfspd)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.tdgov"), &assign_GovCT1_tdgov)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.teng"), &assign_GovCT1_teng)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tfload"), &assign_GovCT1_tfload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kpload"), &assign_GovCT1_kpload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kiload"), &assign_GovCT1_kiload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ldref"), &assign_GovCT1_ldref)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.dm"), &assign_GovCT1_dm)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ropen"), &assign_GovCT1_ropen)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.rclose"), &assign_GovCT1_rclose)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.kimw"), &assign_GovCT1_kimw)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.aset"), &assign_GovCT1_aset)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ka"), &assign_GovCT1_ka)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.ta"), &assign_GovCT1_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.db"), &assign_GovCT1_db)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.tpelec"), &assign_GovCT1_tpelec)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tsa"), &assign_GovCT1_tsa)); assign_map.insert(std::make_pair(std::string("cim:GovCT1.tsb"), &assign_GovCT1_tsb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.rup"), &assign_GovCT1_rup)); - assign_map.insert(std::make_pair(std::string("cim:GovCT1.rdown"), &assign_GovCT1_rdown)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmax"), &assign_GovCT1_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.vmin"), &assign_GovCT1_vmin)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfnl"), &assign_GovCT1_wfnl)); + assign_map.insert(std::make_pair(std::string("cim:GovCT1.wfspd"), &assign_GovCT1_wfspd)); } -void GovCT1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovCT1::debugName[] = "GovCT1"; -const char* GovCT1::debugString() +void GovCT1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovCT1::debugName; } const BaseClassDefiner GovCT1::declare() @@ -563,4 +598,10 @@ const BaseClassDefiner GovCT1::declare() return BaseClassDefiner(GovCT1::addConstructToMap, GovCT1::addPrimitiveAssignFnsToMap, GovCT1::addClassAssignFnsToMap, GovCT1::debugName); } - +namespace CIMPP +{ + BaseClass* GovCT1_factory() + { + return new GovCT1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovCT1.hpp b/CGMES_2.4.15_27JAN2020/GovCT1.hpp index 7269f5817..6af926720 100644 --- a/CGMES_2.4.15_27JAN2020/GovCT1.hpp +++ b/CGMES_2.4.15_27JAN2020/GovCT1.hpp @@ -1,77 +1,78 @@ #ifndef GovCT1_H #define GovCT1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "PU.hpp" +#include "Boolean.hpp" #include "DroopSignalFeedbackKind.hpp" +#include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* General model for any prime mover with a PID governor, used primarily for combustion turbine and combined cycle units. This model can be used to represent a variety of prime movers controlled by PID governors. It is suitable, for example, for representation of Additional information on this model is available in the 2012 IEEE report, , section 3.1.2.3 page 3-4 (GGOV1). */ - class GovCT1: public TurbineGovernorDynamics + class GovCT1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ - CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ - CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU maxerr; /* Maximum value for speed error signal (maxerr). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU minerr; /* Minimum value for speed error signal (minerr). Typical Value = -0.05. Default: nullptr */ - CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 10. Default: nullptr */ - CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 2. Default: nullptr */ - CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.15. Default: nullptr */ - CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb) (>0). Typical Value = 1.5. Default: nullptr */ - CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tb; /* Turbine lag time constant (Tb) (>0). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = true. Default: false */ - CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload) (>0). Typical Value = 3. Default: nullptr */ - CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 2. Default: nullptr */ - CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 0.67. Default: nullptr */ - CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ - CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 0.10. Default: nullptr */ - CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ - CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0.01. Default: nullptr */ - CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 0.01. Default: nullptr */ - CIMPP::PU ka; /* Acceleration limiter gain (Ka). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta) (>0). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 4. Default: nullptr */ - CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 5. Default: nullptr */ - CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ - CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovCT1(); - virtual ~GovCT1(); - + ~GovCT1() override; + + CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 0.01. Default: nullptr */ + CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ + CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Acceleration limiter gain (Ka). Typical Value = 10. Default: nullptr */ + CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ + CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 2. Default: nullptr */ + CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 0.67. Default: nullptr */ + CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0.01. Default: nullptr */ + CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 10. Default: nullptr */ + CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 2. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb) (>0). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ + CIMPP::PU maxerr; /* Maximum value for speed error signal (maxerr). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU minerr; /* Minimum value for speed error signal (minerr). Typical Value = -0.05. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ + CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ + CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ + CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 0.10. Default: nullptr */ + CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ + CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ + CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta) (>0). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tb; /* Turbine lag time constant (Tb) (>0). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload) (>0). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 4. Default: nullptr */ + CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 5. Default: nullptr */ + CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.2. Default: nullptr */ + CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = true. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovCT1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovCT2.cpp b/CGMES_2.4.15_27JAN2020/GovCT2.cpp index bbaaf297b..3ff7364a2 100644 --- a/CGMES_2.4.15_27JAN2020/GovCT2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovCT2.cpp @@ -1,118 +1,801 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovCT2.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "DroopSignalFeedbackKind.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "Simple_Float.hpp" +#include "DroopSignalFeedbackKind.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" -#include "Frequency.hpp" #include "PU.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovCT2::GovCT2() {}; - GovCT2::~GovCT2() {}; +bool assign_GovCT2_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_flim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flim9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kigov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kimw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ldref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minerr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_plim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->plim9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_prate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rclose; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rdown; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ropen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rselect; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rup; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tact; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdgov; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->teng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfload; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpelec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsa; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovCT2_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovCT2_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovCT2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfspd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -123,754 +806,127 @@ GovCT2::~GovCT2() {}; -bool assign_GovCT2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_rselect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rselect; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpelec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_maxerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_minerr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minerr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovCT2_kpgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kigov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kigov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tdgov(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdgov; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tact(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tact; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_wfnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_wfspd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfspd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_teng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->teng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tfload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kpload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kiload(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiload; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ldref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ldref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_dm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ropen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ropen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_rclose(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rclose; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_kimw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kimw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_aset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tsa(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsa; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_tsb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_rup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rup; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_rdown(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rdown; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_prate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_flim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flim10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovCT2_plim10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovCT2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->plim10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovCT2_factory() { - return new GovCT2; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovCT2::debugName[] = "GovCT2"; +const char* GovCT2::debugString() const +{ + return GovCT2::debugName; } -void GovCT2::addConstructToMap(std::unordered_map& factory_map) { +void GovCT2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovCT2"), &GovCT2_factory)); } -void GovCT2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovCT2.mwbase"), &assign_GovCT2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.r"), &assign_GovCT2_r)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rselect"), &assign_GovCT2_rselect)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tpelec"), &assign_GovCT2_tpelec)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.maxerr"), &assign_GovCT2_maxerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.minerr"), &assign_GovCT2_minerr)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpgov"), &assign_GovCT2_kpgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kigov"), &assign_GovCT2_kigov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kdgov"), &assign_GovCT2_kdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tdgov"), &assign_GovCT2_tdgov)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmax"), &assign_GovCT2_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmin"), &assign_GovCT2_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tact"), &assign_GovCT2_tact)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kturb"), &assign_GovCT2_kturb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfnl"), &assign_GovCT2_wfnl)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tb"), &assign_GovCT2_tb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tc"), &assign_GovCT2_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfspd"), &assign_GovCT2_wfspd)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.teng"), &assign_GovCT2_teng)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tfload"), &assign_GovCT2_tfload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpload"), &assign_GovCT2_kpload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kiload"), &assign_GovCT2_kiload)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ldref"), &assign_GovCT2_ldref)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.dm"), &assign_GovCT2_dm)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ropen"), &assign_GovCT2_ropen)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rclose"), &assign_GovCT2_rclose)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.kimw"), &assign_GovCT2_kimw)); +void GovCT2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovCT2.aset"), &assign_GovCT2_aset)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ka"), &assign_GovCT2_ka)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.ta"), &assign_GovCT2_ta)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.db"), &assign_GovCT2_db)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsa"), &assign_GovCT2_tsa)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsb"), &assign_GovCT2_tsb)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rup"), &assign_GovCT2_rup)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.rdown"), &assign_GovCT2_rdown)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.prate"), &assign_GovCT2_prate)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.dm"), &assign_GovCT2_dm)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim1"), &assign_GovCT2_flim1)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim1"), &assign_GovCT2_plim1)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim10"), &assign_GovCT2_flim10)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim2"), &assign_GovCT2_flim2)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim2"), &assign_GovCT2_plim2)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim3"), &assign_GovCT2_flim3)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim3"), &assign_GovCT2_plim3)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim4"), &assign_GovCT2_flim4)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim4"), &assign_GovCT2_plim4)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim5"), &assign_GovCT2_flim5)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim5"), &assign_GovCT2_plim5)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim6"), &assign_GovCT2_flim6)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim6"), &assign_GovCT2_plim6)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim7"), &assign_GovCT2_flim7)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim7"), &assign_GovCT2_plim7)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim8"), &assign_GovCT2_flim8)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim8"), &assign_GovCT2_plim8)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim9"), &assign_GovCT2_flim9)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim9"), &assign_GovCT2_plim9)); - assign_map.insert(std::make_pair(std::string("cim:GovCT2.flim10"), &assign_GovCT2_flim10)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ka"), &assign_GovCT2_ka)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kdgov"), &assign_GovCT2_kdgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kigov"), &assign_GovCT2_kigov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kiload"), &assign_GovCT2_kiload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kimw"), &assign_GovCT2_kimw)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpgov"), &assign_GovCT2_kpgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kpload"), &assign_GovCT2_kpload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.kturb"), &assign_GovCT2_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ldref"), &assign_GovCT2_ldref)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.maxerr"), &assign_GovCT2_maxerr)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.minerr"), &assign_GovCT2_minerr)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.mwbase"), &assign_GovCT2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim1"), &assign_GovCT2_plim1)); assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim10"), &assign_GovCT2_plim10)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim2"), &assign_GovCT2_plim2)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim3"), &assign_GovCT2_plim3)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim4"), &assign_GovCT2_plim4)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim5"), &assign_GovCT2_plim5)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim6"), &assign_GovCT2_plim6)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim7"), &assign_GovCT2_plim7)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim8"), &assign_GovCT2_plim8)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.plim9"), &assign_GovCT2_plim9)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.prate"), &assign_GovCT2_prate)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.r"), &assign_GovCT2_r)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rclose"), &assign_GovCT2_rclose)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rdown"), &assign_GovCT2_rdown)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ropen"), &assign_GovCT2_ropen)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rselect"), &assign_GovCT2_rselect)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.rup"), &assign_GovCT2_rup)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.ta"), &assign_GovCT2_ta)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tact"), &assign_GovCT2_tact)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tb"), &assign_GovCT2_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tc"), &assign_GovCT2_tc)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tdgov"), &assign_GovCT2_tdgov)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.teng"), &assign_GovCT2_teng)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tfload"), &assign_GovCT2_tfload)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tpelec"), &assign_GovCT2_tpelec)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsa"), &assign_GovCT2_tsa)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.tsb"), &assign_GovCT2_tsb)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmax"), &assign_GovCT2_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.vmin"), &assign_GovCT2_vmin)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfnl"), &assign_GovCT2_wfnl)); + assign_map.insert(std::make_pair(std::string("cim:GovCT2.wfspd"), &assign_GovCT2_wfspd)); } -void GovCT2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovCT2::debugName[] = "GovCT2"; -const char* GovCT2::debugString() +void GovCT2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovCT2::debugName; } const BaseClassDefiner GovCT2::declare() @@ -878,4 +934,10 @@ const BaseClassDefiner GovCT2::declare() return BaseClassDefiner(GovCT2::addConstructToMap, GovCT2::addPrimitiveAssignFnsToMap, GovCT2::addClassAssignFnsToMap, GovCT2::debugName); } - +namespace CIMPP +{ + BaseClass* GovCT2_factory() + { + return new GovCT2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovCT2.hpp b/CGMES_2.4.15_27JAN2020/GovCT2.hpp index 0bfa7aba8..3e610e4c3 100644 --- a/CGMES_2.4.15_27JAN2020/GovCT2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovCT2.hpp @@ -1,99 +1,100 @@ #ifndef GovCT2_H #define GovCT2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "PU.hpp" +#include "Boolean.hpp" #include "DroopSignalFeedbackKind.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* General governor model with frequency-dependent fuel flow limit. This model is a modification of the GovCT1model in order to represent the frequency-dependent fuel flow limit of a specific gas turbine manufacturer. */ - class GovCT2: public TurbineGovernorDynamics + class GovCT2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ - CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec). Typical Value = 2.5. Default: nullptr */ - CIMPP::PU maxerr; /* Maximum value for speed error signal (Maxerr). Typical Value = 1. Default: nullptr */ - CIMPP::PU minerr; /* Minimum value for speed error signal (Minerr). Typical Value = -1. Default: nullptr */ - CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 4. Default: nullptr */ - CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 0.45. Default: nullptr */ - CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.175. Default: nullptr */ - CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1.9168. Default: nullptr */ - CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.187. Default: nullptr */ - CIMPP::Seconds tb; /* Turbine lag time constant (Tb). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = false. Default: false */ - CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload). Typical Value = 3. Default: nullptr */ - CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 1. Default: nullptr */ - CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 1. Default: nullptr */ - CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ - CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 99. Default: nullptr */ - CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -99. Default: nullptr */ - CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 10. Default: nullptr */ - CIMPP::PU ka; /* Acceleration limiter Gain (Ka). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta). Typical Value = 1. Default: nullptr */ - CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 50. Default: nullptr */ - CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ - CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ - CIMPP::PU prate; /* Ramp rate for frequency-dependent power limit (Prate). Typical Value = 0.017. Default: nullptr */ - CIMPP::Frequency flim1; /* Frequency threshold 1 (Flim1). Unit = Hz. Typical Value = 59. Default: nullptr */ - CIMPP::PU plim1; /* Power limit 1 (Plim1). Typical Value = 0.8325. Default: nullptr */ - CIMPP::Frequency flim2; /* Frequency threshold 2 (Flim2). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim2; /* Power limit 2 (Plim2). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim3; /* Frequency threshold 3 (Flim3). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim3; /* Power limit 3 (Plim3). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim4; /* Frequency threshold 4 (Flim4). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim4; /* Power limit 4 (Plim4). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim5; /* Frequency threshold 5 (Flim5). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim5; /* Power limit 5 (Plim5). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim6; /* Frequency threshold 6 (Flim6). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim6; /* Power limit 6 (Plim6). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim7; /* Frequency threshold 7 (Flim7). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim7; /* Power limit 7 (Plim7). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim8; /* Frequency threshold 8 (Flim8). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim8; /* Power limit 8 (Plim8). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim9; /* Frequency threshold 9 (Flim9). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim9; /* Power Limit 9 (Plim9). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency flim10; /* Frequency threshold 10 (Flim10). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU plim10; /* Power limit 10 (Plim10). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovCT2(); - virtual ~GovCT2(); - + ~GovCT2() override; + + CIMPP::Simple_Float aset; /* Acceleration limiter setpoint (Aset). Unit = PU/sec. Typical Value = 10. Default: nullptr */ + CIMPP::PU db; /* Speed governor dead band in per unit speed (db). In the majority of applications, it is recommended that this value be set to zero. Typical Value = 0. Default: nullptr */ + CIMPP::PU dm; /* Speed sensitivity coefficient (Dm). Dm can represent either the variation of the engine power with the shaft speed or the variation of maximum power capability with shaft speed. If it is positive it describes the falling slope of the engine speed verses power characteristic as speed increases. A slightly falling characteristic is typical for reciprocating engines and some aero-derivative turbines. If it is negative the engine power is assumed to be unaffected by the shaft speed, but the maximum permissible fuel flow is taken to fall with falling shaft speed. This is characteristic of single-shaft industrial turbines due to exhaust temperature limits. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim1; /* Frequency threshold 1 (Flim1). Unit = Hz. Typical Value = 59. Default: nullptr */ + CIMPP::Frequency flim10; /* Frequency threshold 10 (Flim10). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim2; /* Frequency threshold 2 (Flim2). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim3; /* Frequency threshold 3 (Flim3). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim4; /* Frequency threshold 4 (Flim4). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim5; /* Frequency threshold 5 (Flim5). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim6; /* Frequency threshold 6 (Flim6). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim7; /* Frequency threshold 7 (Flim7). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim8; /* Frequency threshold 8 (Flim8). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency flim9; /* Frequency threshold 9 (Flim9). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Acceleration limiter Gain (Ka). Typical Value = 10. Default: nullptr */ + CIMPP::PU kdgov; /* Governor derivative gain (Kdgov). Typical Value = 0. Default: nullptr */ + CIMPP::PU kigov; /* Governor integral gain (Kigov). Typical Value = 0.45. Default: nullptr */ + CIMPP::PU kiload; /* Load limiter integral gain for PI controller (Kiload). Typical Value = 1. Default: nullptr */ + CIMPP::PU kimw; /* Power controller (reset) gain (Kimw). The default value of 0.01 corresponds to a reset time of 100 seconds. A value of 0.001 corresponds to a relatively slow acting load controller. Typical Value = 0. Default: nullptr */ + CIMPP::PU kpgov; /* Governor proportional gain (Kpgov). Typical Value = 4. Default: nullptr */ + CIMPP::PU kpload; /* Load limiter proportional gain for PI controller (Kpload). Typical Value = 1. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1.9168. Default: nullptr */ + CIMPP::PU ldref; /* Load limiter reference value (Ldref). Typical Value = 1. Default: nullptr */ + CIMPP::PU maxerr; /* Maximum value for speed error signal (Maxerr). Typical Value = 1. Default: nullptr */ + CIMPP::PU minerr; /* Minimum value for speed error signal (Minerr). Typical Value = -1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU plim1; /* Power limit 1 (Plim1). Typical Value = 0.8325. Default: nullptr */ + CIMPP::PU plim10; /* Power limit 10 (Plim10). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim2; /* Power limit 2 (Plim2). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim3; /* Power limit 3 (Plim3). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim4; /* Power limit 4 (Plim4). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim5; /* Power limit 5 (Plim5). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim6; /* Power limit 6 (Plim6). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim7; /* Power limit 7 (Plim7). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim8; /* Power limit 8 (Plim8). Typical Value = 0. Default: nullptr */ + CIMPP::PU plim9; /* Power Limit 9 (Plim9). Typical Value = 0. Default: nullptr */ + CIMPP::PU prate; /* Ramp rate for frequency-dependent power limit (Prate). Typical Value = 0.017. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float rclose; /* Minimum valve closing rate (Rclose). Unit = PU/sec. Typical Value = -99. Default: nullptr */ + CIMPP::PU rdown; /* Maximum rate of load limit decrease (Rdown). Typical Value = -99. Default: nullptr */ + CIMPP::Simple_Float ropen; /* Maximum valve opening rate (Ropen). Unit = PU/sec. Typical Value = 99. Default: nullptr */ + CIMPP::DroopSignalFeedbackKind rselect; /* Feedback signal for droop (Rselect). Typical Value = electricalPower. Default: 0 */ + CIMPP::PU rup; /* Maximum rate of load limit increase (Rup). Typical Value = 99. Default: nullptr */ + CIMPP::Seconds ta; /* Acceleration limiter time constant (Ta). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tact; /* Actuator time constant (Tact). Typical Value = 0.4. Default: nullptr */ + CIMPP::Seconds tb; /* Turbine lag time constant (Tb). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tc; /* Turbine lead time constant (Tc). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tdgov; /* Governor derivative controller time constant (Tdgov). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds teng; /* Transport time delay for diesel engine used in representing diesel engines where there is a small but measurable transport delay between a change in fuel flow setting and the development of torque (Teng). Teng should be zero in all but special cases where this transport delay is of particular concern. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tfload; /* Load Limiter time constant (Tfload). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tpelec; /* Electrical power transducer time constant (Tpelec). Typical Value = 2.5. Default: nullptr */ + CIMPP::Seconds tsa; /* Temperature detection lead time constant (Tsa). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tsb; /* Temperature detection lag time constant (Tsb). Typical Value = 50. Default: nullptr */ + CIMPP::PU vmax; /* Maximum valve position limit (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum valve position limit (Vmin). Typical Value = 0.175. Default: nullptr */ + CIMPP::PU wfnl; /* No load fuel flow (Wfnl). Typical Value = 0.187. Default: nullptr */ + CIMPP::Boolean wfspd; /* Switch for fuel source characteristic to recognize that fuel flow, for a given fuel valve stroke, can be proportional to engine speed (Wfspd). true = fuel flow proportional to speed (for some gas turbines and diesel engines with positive displacement fuel injectors) false = fuel control system keeps fuel flow independent of engine speed. Typical Value = false. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovCT2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovGAST.cpp b/CGMES_2.4.15_27JAN2020/GovGAST.cpp index d4e3d20cc..0f657d21e 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST.cpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST.cpp @@ -1,7 +1,14 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" @@ -9,178 +16,181 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; GovGAST::GovGAST() {}; - GovGAST::~GovGAST() {}; +bool assign_GovGAST_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST_factory() { - return new GovGAST; - } + + + +const char GovGAST::debugName[] = "GovGAST"; +const char* GovGAST::debugString() const +{ + return GovGAST::debugName; } -void GovGAST::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST"), &GovGAST_factory)); } -void GovGAST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovGAST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovGAST.at"), &assign_GovGAST_at)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST.dturb"), &assign_GovGAST_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST.kt"), &assign_GovGAST_kt)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.mwbase"), &assign_GovGAST_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.r"), &assign_GovGAST_r)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.t1"), &assign_GovGAST_t1)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.t2"), &assign_GovGAST_t2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.t3"), &assign_GovGAST_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST.at"), &assign_GovGAST_at)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST.kt"), &assign_GovGAST_kt)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.vmax"), &assign_GovGAST_vmax)); assign_map.insert(std::make_pair(std::string("cim:GovGAST.vmin"), &assign_GovGAST_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST.dturb"), &assign_GovGAST_dturb)); } -void GovGAST::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST::debugName[] = "GovGAST"; -const char* GovGAST::debugString() +void GovGAST::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST::debugName; } const BaseClassDefiner GovGAST::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner GovGAST::declare() return BaseClassDefiner(GovGAST::addConstructToMap, GovGAST::addPrimitiveAssignFnsToMap, GovGAST::addClassAssignFnsToMap, GovGAST::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST_factory() + { + return new GovGAST; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovGAST.hpp b/CGMES_2.4.15_27JAN2020/GovGAST.hpp index 133dca546..e0b807a03 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST.hpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST.hpp @@ -1,49 +1,50 @@ #ifndef GovGAST_H #define GovGAST_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Single shaft gas turbine. */ - class GovGAST: public TurbineGovernorDynamics + class GovGAST : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ - CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of a the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). Typical Value = 3. Default: nullptr */ - CIMPP::PU at; /* Ambient temperature load limit (Load Limit). Typical Value = 1. Default: nullptr */ - CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ - CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.18. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST(); - virtual ~GovGAST(); - + ~GovGAST() override; + + CIMPP::PU at; /* Ambient temperature load limit (Load Limit). Typical Value = 1. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ + CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of a the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). Typical Value = 3. Default: nullptr */ + CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovGAST1.cpp b/CGMES_2.4.15_27JAN2020/GovGAST1.cpp index 9408d556e..260daa6e7 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST1.cpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST1.cpp @@ -1,32 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST1.hpp" +#include +#include + +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Frequency.hpp" #include "ActivePower.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -34,513 +31,550 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovGAST1::GovGAST1() {}; - GovGAST1::~GovGAST1() {}; +bool assign_GovGAST1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_fidle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fidle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_lmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_loadinc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->loadinc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_ltrate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ltrate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_tltr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tltr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_lmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST1_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_fidle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fidle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_loadinc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->loadinc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_tltr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tltr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_ltrate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ltrate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST1_factory() { - return new GovGAST1; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovGAST1::debugName[] = "GovGAST1"; +const char* GovGAST1::debugString() const +{ + return GovGAST1::debugName; } -void GovGAST1::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST1"), &GovGAST1_factory)); } -void GovGAST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.mwbase"), &assign_GovGAST1_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.r"), &assign_GovGAST1_r)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t1"), &assign_GovGAST1_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t2"), &assign_GovGAST1_t2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t3"), &assign_GovGAST1_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.lmax"), &assign_GovGAST1_lmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.kt"), &assign_GovGAST1_kt)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmax"), &assign_GovGAST1_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmin"), &assign_GovGAST1_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.fidle"), &assign_GovGAST1_fidle)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.rmax"), &assign_GovGAST1_rmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.loadinc"), &assign_GovGAST1_loadinc)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.tltr"), &assign_GovGAST1_tltr)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.ltrate"), &assign_GovGAST1_ltrate)); +void GovGAST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST1.a"), &assign_GovGAST1_a)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.b"), &assign_GovGAST1_b)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.db1"), &assign_GovGAST1_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.eps"), &assign_GovGAST1_eps)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.db2"), &assign_GovGAST1_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.eps"), &assign_GovGAST1_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.fidle"), &assign_GovGAST1_fidle)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv1"), &assign_GovGAST1_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv1"), &assign_GovGAST1_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv2"), &assign_GovGAST1_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv2"), &assign_GovGAST1_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv3"), &assign_GovGAST1_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv3"), &assign_GovGAST1_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv4"), &assign_GovGAST1_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv4"), &assign_GovGAST1_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv5"), &assign_GovGAST1_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv5"), &assign_GovGAST1_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.gv6"), &assign_GovGAST1_gv6)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv6"), &assign_GovGAST1_pgv6)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.ka"), &assign_GovGAST1_ka)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.kt"), &assign_GovGAST1_kt)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.lmax"), &assign_GovGAST1_lmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.loadinc"), &assign_GovGAST1_loadinc)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.ltrate"), &assign_GovGAST1_ltrate)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.mwbase"), &assign_GovGAST1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv1"), &assign_GovGAST1_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv2"), &assign_GovGAST1_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv3"), &assign_GovGAST1_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv4"), &assign_GovGAST1_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv5"), &assign_GovGAST1_pgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.pgv6"), &assign_GovGAST1_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.r"), &assign_GovGAST1_r)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.rmax"), &assign_GovGAST1_rmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t1"), &assign_GovGAST1_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t2"), &assign_GovGAST1_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t3"), &assign_GovGAST1_t3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t4"), &assign_GovGAST1_t4)); assign_map.insert(std::make_pair(std::string("cim:GovGAST1.t5"), &assign_GovGAST1_t5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.tltr"), &assign_GovGAST1_tltr)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmax"), &assign_GovGAST1_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST1.vmin"), &assign_GovGAST1_vmin)); } -void GovGAST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST1::debugName[] = "GovGAST1"; -const char* GovGAST1::debugString() +void GovGAST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST1::debugName; } const BaseClassDefiner GovGAST1::declare() @@ -548,4 +582,10 @@ const BaseClassDefiner GovGAST1::declare() return BaseClassDefiner(GovGAST1::addConstructToMap, GovGAST1::addPrimitiveAssignFnsToMap, GovGAST1::addClassAssignFnsToMap, GovGAST1::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST1_factory() + { + return new GovGAST1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovGAST1.hpp b/CGMES_2.4.15_27JAN2020/GovGAST1.hpp index c5655d7a1..cd37a1798 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST1.hpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST1.hpp @@ -1,75 +1,76 @@ #ifndef GovGAST1_H #define GovGAST1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified single shaft gas turbine. */ - class GovGAST1: public TurbineGovernorDynamics + class GovGAST1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ - CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). T3 represents delay in the exhaust temperature and load limiting system. Typical Value = 3. Default: nullptr */ - CIMPP::PU lmax; /* Ambient temperature load limit (Lmax). Lmax is the turbine power output corresponding to the limiting exhaust gas temperature. Typical Value = 1. Default: nullptr */ - CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ - CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU fidle; /* Fuel flow at zero power output (Fidle). Typical Value = 0.18. Default: nullptr */ - CIMPP::Simple_Float rmax; /* Maximum fuel valve opening rate (Rmax). Unit = PU/sec. Typical Value = 1. Default: nullptr */ - CIMPP::PU loadinc; /* Valve position change allowed at fast rate (Loadinc). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tltr; /* Valve position averaging time constant (Tltr). Typical Value = 10. Default: nullptr */ - CIMPP::Simple_Float ltrate; /* Maximum long term fuel valve opening rate (Ltrate). Typical Value = 0.02. Default: nullptr */ - CIMPP::Simple_Float a; /* Turbine power time constant numerator scale factor (a). Typical Value = 0.8. Default: nullptr */ - CIMPP::Simple_Float b; /* Turbine power time constant denominator scale factor (b). Typical Value = 1. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2,PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU ka; /* Governor gain (Ka). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Governor lead time constant (T4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t5; /* Governor lag time constant (T5). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST1(); - virtual ~GovGAST1(); - + ~GovGAST1() override; + + CIMPP::Simple_Float a; /* Turbine power time constant numerator scale factor (a). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float b; /* Turbine power time constant denominator scale factor (b). Typical Value = 1. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU fidle; /* Fuel flow at zero power output (Fidle). Typical Value = 0.18. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2,PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU ka; /* Governor gain (Ka). Typical Value = 0. Default: nullptr */ + CIMPP::PU kt; /* Temperature limiter gain (Kt). Typical Value = 3. Default: nullptr */ + CIMPP::PU lmax; /* Ambient temperature load limit (Lmax). Lmax is the turbine power output corresponding to the limiting exhaust gas temperature. Typical Value = 1. Default: nullptr */ + CIMPP::PU loadinc; /* Valve position change allowed at fast rate (Loadinc). Typical Value = 0.05. Default: nullptr */ + CIMPP::Simple_Float ltrate; /* Maximum long term fuel valve opening rate (Ltrate). Typical Value = 0.02. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.04. Default: nullptr */ + CIMPP::Simple_Float rmax; /* Maximum fuel valve opening rate (Rmax). Unit = PU/sec. Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t1; /* Governor mechanism time constant (T1). T1 represents the natural valve positioning time constant of the governor for small disturbances, as seen when rate limiting is not in effect. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t2; /* Turbine power time constant (T2). T2 represents delay due to internal energy storage of the gas turbine engine. T2 can be used to give a rough approximation to the delay associated with acceleration of the compressor spool of a multi-shaft engine, or with the compressibility of gas in the plenum of the free power turbine of an aero-derivative unit, for example. Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t3; /* Turbine exhaust temperature time constant (T3). T3 represents delay in the exhaust temperature and load limiting system. Typical Value = 3. Default: nullptr */ + CIMPP::Seconds t4; /* Governor lead time constant (T4). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t5; /* Governor lag time constant (T5). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tltr; /* Valve position averaging time constant (Tltr). Typical Value = 10. Default: nullptr */ + CIMPP::PU vmax; /* Maximum turbine power, PU of MWbase (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum turbine power, PU of MWbase (Vmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovGAST2.cpp b/CGMES_2.4.15_27JAN2020/GovGAST2.cpp index a68ea44b1..d800dff6c 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST2.cpp @@ -1,516 +1,548 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST2.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include "PU.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "ActivePower.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include "Temperature.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "Temperature.hpp" +#include "ActivePower.hpp" +#include "Seconds.hpp" #include "PU.hpp" -#include "Temperature.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovGAST2::GovGAST2() {}; - GovGAST2::~GovGAST2() {}; +bool assign_GovGAST2_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->c; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ecr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->etd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGAST2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGAST2_w(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->w; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGAST2_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST2_z(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->z; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_w(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->w; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_z(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->z; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->etd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST2_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ecr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->c; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST2_factory() { - return new GovGAST2; - } + + + + + + + + + + + + + + + + + + + + + + + +const char GovGAST2::debugName[] = "GovGAST2"; +const char* GovGAST2::debugString() const +{ + return GovGAST2::debugName; } -void GovGAST2::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST2"), &GovGAST2_factory)); } -void GovGAST2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.mwbase"), &assign_GovGAST2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.w"), &assign_GovGAST2_w)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.x"), &assign_GovGAST2_x)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.y"), &assign_GovGAST2_y)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.z"), &assign_GovGAST2_z)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.etd"), &assign_GovGAST2_etd)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tcd"), &assign_GovGAST2_tcd)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.trate"), &assign_GovGAST2_trate)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t"), &assign_GovGAST2_t)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmax"), &assign_GovGAST2_tmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmin"), &assign_GovGAST2_tmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.ecr"), &assign_GovGAST2_ecr)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k3"), &assign_GovGAST2_k3)); +void GovGAST2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST2.a"), &assign_GovGAST2_a)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af1"), &assign_GovGAST2_af1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af2"), &assign_GovGAST2_af2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.b"), &assign_GovGAST2_b)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf1"), &assign_GovGAST2_bf1)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf2"), &assign_GovGAST2_bf2)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.c"), &assign_GovGAST2_c)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tf"), &assign_GovGAST2_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.kf"), &assign_GovGAST2_kf)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k5"), &assign_GovGAST2_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.cf2"), &assign_GovGAST2_cf2)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.ecr"), &assign_GovGAST2_ecr)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.etd"), &assign_GovGAST2_etd)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k3"), &assign_GovGAST2_k3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k4"), &assign_GovGAST2_k4)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k5"), &assign_GovGAST2_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k6"), &assign_GovGAST2_k6)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.kf"), &assign_GovGAST2_kf)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.mwbase"), &assign_GovGAST2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t"), &assign_GovGAST2_t)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t3"), &assign_GovGAST2_t3)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t4"), &assign_GovGAST2_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tt"), &assign_GovGAST2_tt)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.t5"), &assign_GovGAST2_t5)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af1"), &assign_GovGAST2_af1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf1"), &assign_GovGAST2_bf1)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.af2"), &assign_GovGAST2_af2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.bf2"), &assign_GovGAST2_bf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.cf2"), &assign_GovGAST2_cf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tr"), &assign_GovGAST2_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST2.k6"), &assign_GovGAST2_k6)); assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tc"), &assign_GovGAST2_tc)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tcd"), &assign_GovGAST2_tcd)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tf"), &assign_GovGAST2_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmax"), &assign_GovGAST2_tmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tmin"), &assign_GovGAST2_tmin)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tr"), &assign_GovGAST2_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.trate"), &assign_GovGAST2_trate)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.tt"), &assign_GovGAST2_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.w"), &assign_GovGAST2_w)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.x"), &assign_GovGAST2_x)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.y"), &assign_GovGAST2_y)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST2.z"), &assign_GovGAST2_z)); } -void GovGAST2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST2::debugName[] = "GovGAST2"; -const char* GovGAST2::debugString() +void GovGAST2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST2::debugName; } const BaseClassDefiner GovGAST2::declare() @@ -518,4 +550,10 @@ const BaseClassDefiner GovGAST2::declare() return BaseClassDefiner(GovGAST2::addConstructToMap, GovGAST2::addPrimitiveAssignFnsToMap, GovGAST2::addClassAssignFnsToMap, GovGAST2::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST2_factory() + { + return new GovGAST2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovGAST2.hpp b/CGMES_2.4.15_27JAN2020/GovGAST2.hpp index 514013ea0..dd07400d5 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST2.hpp @@ -1,74 +1,75 @@ #ifndef GovGAST2_H #define GovGAST2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Gas turbine model. */ - class GovGAST2: public TurbineGovernorDynamics + class GovGAST2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU w; /* Governor gain (1/droop) on turbine rating (W). Default: nullptr */ - CIMPP::Seconds x; /* Governor lead time constant (X). Default: nullptr */ - CIMPP::Seconds y; /* Governor lag time constant (Y) (>0). Default: nullptr */ - CIMPP::Boolean z; /* Governor mode (Z). true = Droop false = ISO. Default: false */ - CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ - CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ - CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ - CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ - CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ - CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ - CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ - CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ - CIMPP::Simple_Float a; /* Valve positioner (A). Default: nullptr */ - CIMPP::Simple_Float b; /* Valve positioner (B). Default: nullptr */ - CIMPP::Simple_Float c; /* Valve positioner (C). Default: nullptr */ - CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ - CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ - CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ - CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ - CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ - CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ - CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ - CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ - CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ - CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ - CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ - CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K (23% fuel flow). Default: nullptr */ - CIMPP::Temperature tr; /* Rated temperature (Tr). Unit = [SYMBOL REMOVED]C depending on parameters Af1 and Bf1. Default: nullptr */ - CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ - CIMPP::Temperature tc; /* Temperature control (Tc). Unit = [SYMBOL REMOVED]F or [SYMBOL REMOVED]C depending on constants Af1 and Bf1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST2(); - virtual ~GovGAST2(); - + ~GovGAST2() override; + + CIMPP::Simple_Float a; /* Valve positioner (A). Default: nullptr */ + CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ + CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ + CIMPP::Simple_Float b; /* Valve positioner (B). Default: nullptr */ + CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Unit = per unit temperature. Based on temperature in degrees C. Default: nullptr */ + CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ + CIMPP::Simple_Float c; /* Valve positioner (C). Default: nullptr */ + CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K (23% fuel flow). Default: nullptr */ + CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ + CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ + CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ + CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ + CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ + CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ + CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ + CIMPP::Temperature tc; /* Temperature control (Tc). Unit = [SYMBOL REMOVED]F or [SYMBOL REMOVED]C depending on constants Af1 and Bf1. Default: nullptr */ + CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ + CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ + CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ + CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ + CIMPP::Temperature tr; /* Rated temperature (Tr). Unit = [SYMBOL REMOVED]C depending on parameters Af1 and Bf1. Default: nullptr */ + CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ + CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ + CIMPP::PU w; /* Governor gain (1/droop) on turbine rating (W). Default: nullptr */ + CIMPP::Seconds x; /* Governor lead time constant (X). Default: nullptr */ + CIMPP::Seconds y; /* Governor lag time constant (Y) (>0). Default: nullptr */ + CIMPP::Boolean z; /* Governor mode (Z). true = Droop false = ISO. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovGAST3.cpp b/CGMES_2.4.15_27JAN2020/GovGAST3.cpp index bbb3afc72..cc6585f6e 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST3.cpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST3.cpp @@ -1,351 +1,372 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST3.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "PU.hpp" +#include "Temperature.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Temperature.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Temperature.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" #include "Temperature.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovGAST3::GovGAST3() {}; - GovGAST3::~GovGAST3() {}; +bool assign_GovGAST3_bca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bca; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ka; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_kac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_kca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kca; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ksi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ksi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ky(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ky; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_rcmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_rcmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rcmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tfen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tsi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tsi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ttc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ttc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST3_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ty; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST3_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_rcmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_rcmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rcmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ky(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ky; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ty; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_kac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_bca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bca; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_kca(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kca; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ka(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ka; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tsi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tsi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ksi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ksi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_ttc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ttc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tfen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST3_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovGAST3_factory() { - return new GovGAST3; - } +const char GovGAST3::debugName[] = "GovGAST3"; +const char* GovGAST3::debugString() const +{ + return GovGAST3::debugName; } -void GovGAST3::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST3"), &GovGAST3_factory)); } -void GovGAST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.bp"), &assign_GovGAST3_bp)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tg"), &assign_GovGAST3_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmx"), &assign_GovGAST3_rcmx)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmn"), &assign_GovGAST3_rcmn)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ky"), &assign_GovGAST3_ky)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ty"), &assign_GovGAST3_ty)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tac"), &assign_GovGAST3_tac)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kac"), &assign_GovGAST3_kac)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tc"), &assign_GovGAST3_tc)); +void GovGAST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST3.bca"), &assign_GovGAST3_bca)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kca"), &assign_GovGAST3_kca)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.bp"), &assign_GovGAST3_bp)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.dtc"), &assign_GovGAST3_dtc)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ka"), &assign_GovGAST3_ka)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tsi"), &assign_GovGAST3_tsi)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kac"), &assign_GovGAST3_kac)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.kca"), &assign_GovGAST3_kca)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ksi"), &assign_GovGAST3_ksi)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ttc"), &assign_GovGAST3_ttc)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tfen"), &assign_GovGAST3_tfen)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ky"), &assign_GovGAST3_ky)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mnef"), &assign_GovGAST3_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mxef"), &assign_GovGAST3_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmn"), &assign_GovGAST3_rcmn)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.rcmx"), &assign_GovGAST3_rcmx)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tac"), &assign_GovGAST3_tac)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tc"), &assign_GovGAST3_tc)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.td"), &assign_GovGAST3_td)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tfen"), &assign_GovGAST3_tfen)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tg"), &assign_GovGAST3_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tsi"), &assign_GovGAST3_tsi)); assign_map.insert(std::make_pair(std::string("cim:GovGAST3.tt"), &assign_GovGAST3_tt)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mxef"), &assign_GovGAST3_mxef)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST3.mnef"), &assign_GovGAST3_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ttc"), &assign_GovGAST3_ttc)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST3.ty"), &assign_GovGAST3_ty)); } -void GovGAST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST3::debugName[] = "GovGAST3"; -const char* GovGAST3::debugString() +void GovGAST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST3::debugName; } const BaseClassDefiner GovGAST3::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner GovGAST3::declare() return BaseClassDefiner(GovGAST3::addConstructToMap, GovGAST3::addPrimitiveAssignFnsToMap, GovGAST3::addClassAssignFnsToMap, GovGAST3::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST3_factory() + { + return new GovGAST3; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovGAST3.hpp b/CGMES_2.4.15_27JAN2020/GovGAST3.hpp index d97568171..dad20cfc8 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST3.hpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST3.hpp @@ -1,61 +1,62 @@ #ifndef GovGAST3_H #define GovGAST3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Generic turbogas with acceleration and temperature controller. */ - class GovGAST3: public TurbineGovernorDynamics + class GovGAST3 : public TurbineGovernorDynamics { - public: - CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tg; /* Time constant of speed governor (Tg). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU rcmx; /* Maximum fuel flow (RCMX). Typical Value = 1. Default: nullptr */ - CIMPP::PU rcmn; /* Minimum fuel flow (RCMN). Typical Value = -0.1. Default: nullptr */ - CIMPP::Simple_Float ky; /* Coefficient of transfer function of fuel valve positioner (Ky). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ty; /* Time constant of fuel valve positioner (Ty). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tac; /* Fuel control time constant (Tac). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float kac; /* Fuel system feedback (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tc; /* Compressor discharge volume time constant (Tc). Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float bca; /* Acceleration limit set-point (Bca). Unit = 1/s. Typical Value = 0.01. Default: nullptr */ - CIMPP::Simple_Float kca; /* Acceleration control integral gain (Kca). Unit = 1/s. Typical Value = 100. Default: nullptr */ - CIMPP::Temperature dtc; /* Exhaust temperature variation due to fuel flow increasing from 0 to 1 PU (deltaTc). Typical Value = 390. Default: nullptr */ - CIMPP::PU ka; /* Minimum fuel flow (Ka). Typical Value = 0.23. Default: nullptr */ - CIMPP::Seconds tsi; /* Time constant of radiation shield (Tsi). Typical Value = 15. Default: nullptr */ - CIMPP::Simple_Float ksi; /* Gain of radiation shield (Ksi). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds ttc; /* Time constant of thermocouple (Ttc). Typical Value = 2.5. Default: nullptr */ - CIMPP::Temperature tfen; /* Turbine rated exhaust temperature correspondent to Pm=1 PU (Tfen). Typical Value = 540. Default: nullptr */ - CIMPP::Seconds td; /* Temperature controller derivative gain (Td). Typical Value = 3.3. Default: nullptr */ - CIMPP::Temperature tt; /* Temperature controller integration rate (Tt). Typical Value = 250. Default: nullptr */ - CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST3(); - virtual ~GovGAST3(); - + ~GovGAST3() override; + + CIMPP::Simple_Float bca; /* Acceleration limit set-point (Bca). Unit = 1/s. Typical Value = 0.01. Default: nullptr */ + CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Temperature dtc; /* Exhaust temperature variation due to fuel flow increasing from 0 to 1 PU (deltaTc). Typical Value = 390. Default: nullptr */ + CIMPP::PU ka; /* Minimum fuel flow (Ka). Typical Value = 0.23. Default: nullptr */ + CIMPP::Simple_Float kac; /* Fuel system feedback (K). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float kca; /* Acceleration control integral gain (Kca). Unit = 1/s. Typical Value = 100. Default: nullptr */ + CIMPP::Simple_Float ksi; /* Gain of radiation shield (Ksi). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float ky; /* Coefficient of transfer function of fuel valve positioner (Ky). Typical Value = 1. Default: nullptr */ + CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rcmn; /* Minimum fuel flow (RCMN). Typical Value = -0.1. Default: nullptr */ + CIMPP::PU rcmx; /* Maximum fuel flow (RCMX). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tac; /* Fuel control time constant (Tac). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tc; /* Compressor discharge volume time constant (Tc). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds td; /* Temperature controller derivative gain (Td). Typical Value = 3.3. Default: nullptr */ + CIMPP::Temperature tfen; /* Turbine rated exhaust temperature correspondent to Pm=1 PU (Tfen). Typical Value = 540. Default: nullptr */ + CIMPP::Seconds tg; /* Time constant of speed governor (Tg). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tsi; /* Time constant of radiation shield (Tsi). Typical Value = 15. Default: nullptr */ + CIMPP::Temperature tt; /* Temperature controller integration rate (Tt). Typical Value = 250. Default: nullptr */ + CIMPP::Seconds ttc; /* Time constant of thermocouple (Ttc). Typical Value = 2.5. Default: nullptr */ + CIMPP::Seconds ty; /* Time constant of fuel valve positioner (Ty). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST3_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovGAST4.cpp b/CGMES_2.4.15_27JAN2020/GovGAST4.cpp index ba189ce50..5d9f66540 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST4.cpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST4.cpp @@ -1,201 +1,212 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGAST4.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovGAST4::GovGAST4() {}; - GovGAST4::~GovGAST4() {}; +bool assign_GovGAST4_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_ktm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ktm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_rymn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rymn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_rymx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rymx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGAST4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGAST4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGAST4_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGAST4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_ktm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ktm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_rymx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rymx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_rymn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rymn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGAST4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGAST4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGAST4_factory() { - return new GovGAST4; - } + + + + + + + + + +const char GovGAST4::debugName[] = "GovGAST4"; +const char* GovGAST4::debugString() const +{ + return GovGAST4::debugName; } -void GovGAST4::addConstructToMap(std::unordered_map& factory_map) { +void GovGAST4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGAST4"), &GovGAST4_factory)); } -void GovGAST4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovGAST4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGAST4.bp"), &assign_GovGAST4_bp)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tv"), &assign_GovGAST4_tv)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.ktm"), &assign_GovGAST4_ktm)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mnef"), &assign_GovGAST4_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mxef"), &assign_GovGAST4_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymn"), &assign_GovGAST4_rymn)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymx"), &assign_GovGAST4_rymx)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.ta"), &assign_GovGAST4_ta)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tc"), &assign_GovGAST4_tc)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tcm"), &assign_GovGAST4_tcm)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.ktm"), &assign_GovGAST4_ktm)); assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tm"), &assign_GovGAST4_tm)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymx"), &assign_GovGAST4_rymx)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.rymn"), &assign_GovGAST4_rymn)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mxef"), &assign_GovGAST4_mxef)); - assign_map.insert(std::make_pair(std::string("cim:GovGAST4.mnef"), &assign_GovGAST4_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovGAST4.tv"), &assign_GovGAST4_tv)); } -void GovGAST4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGAST4::debugName[] = "GovGAST4"; -const char* GovGAST4::debugString() +void GovGAST4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGAST4::debugName; } const BaseClassDefiner GovGAST4::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner GovGAST4::declare() return BaseClassDefiner(GovGAST4::addConstructToMap, GovGAST4::addPrimitiveAssignFnsToMap, GovGAST4::addClassAssignFnsToMap, GovGAST4::debugName); } - +namespace CIMPP +{ + BaseClass* GovGAST4_factory() + { + return new GovGAST4; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovGAST4.hpp b/CGMES_2.4.15_27JAN2020/GovGAST4.hpp index fdcc4c47f..db6a06980 100644 --- a/CGMES_2.4.15_27JAN2020/GovGAST4.hpp +++ b/CGMES_2.4.15_27JAN2020/GovGAST4.hpp @@ -1,49 +1,50 @@ #ifndef GovGAST4_H #define GovGAST4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Generic turbogas. */ - class GovGAST4: public TurbineGovernorDynamics + class GovGAST4 : public TurbineGovernorDynamics { - public: - CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tv; /* Time constant of fuel valve positioner (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ta; /* Maximum gate opening velocity (T). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tc; /* Maximum gate closing velocity (T). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tcm; /* Fuel control time constant (T). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ktm; /* Compressor gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tm; /* Compressor discharge volume time constant (T). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU rymx; /* Maximum valve opening (RYMX). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU rymn; /* Minimum valve opening (RYMN). Typical Value = 0. Default: nullptr */ - CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGAST4(); - virtual ~GovGAST4(); - + ~GovGAST4() override; + + CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ktm; /* Compressor gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rymn; /* Minimum valve opening (RYMN). Typical Value = 0. Default: nullptr */ + CIMPP::PU rymx; /* Maximum valve opening (RYMX). Typical Value = 1.1. Default: nullptr */ + CIMPP::Seconds ta; /* Maximum gate opening velocity (T). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tc; /* Maximum gate closing velocity (T). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tcm; /* Fuel control time constant (T). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tm; /* Compressor discharge volume time constant (T). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tv; /* Time constant of fuel valve positioner (T). Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGAST4_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovGASTWD.cpp b/CGMES_2.4.15_27JAN2020/GovGASTWD.cpp index 1d48d82fc..553f65613 100644 --- a/CGMES_2.4.15_27JAN2020/GovGASTWD.cpp +++ b/CGMES_2.4.15_27JAN2020/GovGASTWD.cpp @@ -1,531 +1,564 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovGASTWD.hpp" -#include "ActivePower.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "ActivePower.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Temperature.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" #include "PU.hpp" #include "Temperature.hpp" +#include "ActivePower.hpp" #include "Seconds.hpp" using namespace CIMPP; GovGASTWD::GovGASTWD() {}; - GovGASTWD::~GovGASTWD() {}; +bool assign_GovGASTWD_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->af2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->c; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ecr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->etd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovGASTWD_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovGASTWD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovGASTWD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_etd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->etd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovGASTWD_tcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_trate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_ecr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ecr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_c(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->c; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_af1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_bf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_af2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->af2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_bf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_cf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovGASTWD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovGASTWD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovGASTWD_factory() { - return new GovGASTWD; - } + + + + + + + + + + + + + + + + + + + + + + + +const char GovGASTWD::debugName[] = "GovGASTWD"; +const char* GovGASTWD::debugString() const +{ + return GovGASTWD::debugName; } -void GovGASTWD::addConstructToMap(std::unordered_map& factory_map) { +void GovGASTWD::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovGASTWD"), &GovGASTWD_factory)); } -void GovGASTWD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.mwbase"), &assign_GovGASTWD_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kdroop"), &assign_GovGASTWD_kdroop)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kp"), &assign_GovGASTWD_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ki"), &assign_GovGASTWD_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kd"), &assign_GovGASTWD_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.etd"), &assign_GovGASTWD_etd)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tcd"), &assign_GovGASTWD_tcd)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.trate"), &assign_GovGASTWD_trate)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t"), &assign_GovGASTWD_t)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmax"), &assign_GovGASTWD_tmax)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmin"), &assign_GovGASTWD_tmin)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ecr"), &assign_GovGASTWD_ecr)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k3"), &assign_GovGASTWD_k3)); +void GovGASTWD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.a"), &assign_GovGASTWD_a)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af1"), &assign_GovGASTWD_af1)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af2"), &assign_GovGASTWD_af2)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.b"), &assign_GovGASTWD_b)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf1"), &assign_GovGASTWD_bf1)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf2"), &assign_GovGASTWD_bf2)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.c"), &assign_GovGASTWD_c)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tf"), &assign_GovGASTWD_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kf"), &assign_GovGASTWD_kf)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k5"), &assign_GovGASTWD_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.cf2"), &assign_GovGASTWD_cf2)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ecr"), &assign_GovGASTWD_ecr)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.etd"), &assign_GovGASTWD_etd)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k3"), &assign_GovGASTWD_k3)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k4"), &assign_GovGASTWD_k4)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k5"), &assign_GovGASTWD_k5)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k6"), &assign_GovGASTWD_k6)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kd"), &assign_GovGASTWD_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kdroop"), &assign_GovGASTWD_kdroop)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kf"), &assign_GovGASTWD_kf)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.ki"), &assign_GovGASTWD_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.kp"), &assign_GovGASTWD_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.mwbase"), &assign_GovGASTWD_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t"), &assign_GovGASTWD_t)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t3"), &assign_GovGASTWD_t3)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t4"), &assign_GovGASTWD_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tt"), &assign_GovGASTWD_tt)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.t5"), &assign_GovGASTWD_t5)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af1"), &assign_GovGASTWD_af1)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf1"), &assign_GovGASTWD_bf1)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.af2"), &assign_GovGASTWD_af2)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.bf2"), &assign_GovGASTWD_bf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.cf2"), &assign_GovGASTWD_cf2)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tr"), &assign_GovGASTWD_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.k6"), &assign_GovGASTWD_k6)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tc"), &assign_GovGASTWD_tc)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tcd"), &assign_GovGASTWD_tcd)); assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.td"), &assign_GovGASTWD_td)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tf"), &assign_GovGASTWD_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmax"), &assign_GovGASTWD_tmax)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tmin"), &assign_GovGASTWD_tmin)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tr"), &assign_GovGASTWD_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.trate"), &assign_GovGASTWD_trate)); + assign_map.insert(std::make_pair(std::string("cim:GovGASTWD.tt"), &assign_GovGASTWD_tt)); } -void GovGASTWD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovGASTWD::debugName[] = "GovGASTWD"; -const char* GovGASTWD::debugString() +void GovGASTWD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovGASTWD::debugName; } const BaseClassDefiner GovGASTWD::declare() @@ -533,4 +566,10 @@ const BaseClassDefiner GovGASTWD::declare() return BaseClassDefiner(GovGASTWD::addConstructToMap, GovGASTWD::addPrimitiveAssignFnsToMap, GovGASTWD::addClassAssignFnsToMap, GovGASTWD::debugName); } - +namespace CIMPP +{ + BaseClass* GovGASTWD_factory() + { + return new GovGASTWD; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovGASTWD.hpp b/CGMES_2.4.15_27JAN2020/GovGASTWD.hpp index d159b76c0..f37266ee1 100644 --- a/CGMES_2.4.15_27JAN2020/GovGASTWD.hpp +++ b/CGMES_2.4.15_27JAN2020/GovGASTWD.hpp @@ -1,74 +1,75 @@ #ifndef GovGASTWD_H #define GovGASTWD_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" #include "Temperature.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Woodward Gas turbine governor model. */ - class GovGASTWD: public TurbineGovernorDynamics + class GovGASTWD : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU kdroop; /* (Kdroop). Default: nullptr */ - CIMPP::PU kp; /* PID Proportional gain (Kp). Default: nullptr */ - CIMPP::PU ki; /* Isochronous Governor Gain (Ki). Default: nullptr */ - CIMPP::PU kd; /* Drop Governor Gain (Kd). Default: nullptr */ - CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ - CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ - CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ - CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ - CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ - CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ - CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ - CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ - CIMPP::Simple_Float a; /* Valve positioner (). Default: nullptr */ - CIMPP::Simple_Float b; /* Valve positioner (). Default: nullptr */ - CIMPP::Simple_Float c; /* Valve positioner (). Default: nullptr */ - CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ - CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ - CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ - CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ - CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ - CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ - CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ - CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Default: nullptr */ - CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Default: nullptr */ - CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ - CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ - CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K(23% fuel flow). Default: nullptr */ - CIMPP::Temperature tr; /* Rated temperature (Tr). Default: nullptr */ - CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ - CIMPP::Temperature tc; /* Temperature control (Tc). Default: nullptr */ - CIMPP::Seconds td; /* Power transducer time constant (Td). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovGASTWD(); - virtual ~GovGASTWD(); - + ~GovGASTWD() override; + + CIMPP::Simple_Float a; /* Valve positioner (). Default: nullptr */ + CIMPP::PU af1; /* Exhaust temperature Parameter (Af1). Default: nullptr */ + CIMPP::PU af2; /* Coefficient equal to 0.5(1-speed) (Af2). Default: nullptr */ + CIMPP::Simple_Float b; /* Valve positioner (). Default: nullptr */ + CIMPP::PU bf1; /* (Bf1). Bf1 = E(1-w) where E (speed sensitivity coefficient) is 0.55 to 0.65 x Tr. Default: nullptr */ + CIMPP::PU bf2; /* Turbine Torque Coefficient K (depends on heating value of fuel stream in combustion chamber) (Bf2). Default: nullptr */ + CIMPP::Simple_Float c; /* Valve positioner (). Default: nullptr */ + CIMPP::PU cf2; /* Coefficient defining fuel flow where power output is 0% (Cf2). Synchronous but no output. Typically 0.23 x K(23% fuel flow). Default: nullptr */ + CIMPP::Seconds ecr; /* Combustion reaction time delay (Ecr). Default: nullptr */ + CIMPP::Seconds etd; /* Turbine and exhaust delay (Etd). Default: nullptr */ + CIMPP::PU k3; /* Ratio of Fuel Adjustment (K3). Default: nullptr */ + CIMPP::PU k4; /* Gain of radiation shield (K4). Default: nullptr */ + CIMPP::PU k5; /* Gain of radiation shield (K5). Default: nullptr */ + CIMPP::PU k6; /* Minimum fuel flow (K6). Default: nullptr */ + CIMPP::PU kd; /* Drop Governor Gain (Kd). Default: nullptr */ + CIMPP::PU kdroop; /* (Kdroop). Default: nullptr */ + CIMPP::PU kf; /* Fuel system feedback (Kf). Default: nullptr */ + CIMPP::PU ki; /* Isochronous Governor Gain (Ki). Default: nullptr */ + CIMPP::PU kp; /* PID Proportional gain (Kp). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::Seconds t; /* Fuel Control Time Constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Radiation shield time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Thermocouple time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Temperature control time constant (T5). Default: nullptr */ + CIMPP::Temperature tc; /* Temperature control (Tc). Default: nullptr */ + CIMPP::Seconds tcd; /* Compressor discharge time constant (Tcd). Default: nullptr */ + CIMPP::Seconds td; /* Power transducer time constant (Td). Default: nullptr */ + CIMPP::Seconds tf; /* Fuel system time constant (Tf). Default: nullptr */ + CIMPP::PU tmax; /* Maximum Turbine limit (Tmax). Default: nullptr */ + CIMPP::PU tmin; /* Minimum Turbine limit (Tmin). Default: nullptr */ + CIMPP::Temperature tr; /* Rated temperature (Tr). Default: nullptr */ + CIMPP::ActivePower trate; /* Turbine rating (Trate). Unit = MW. Default: nullptr */ + CIMPP::Seconds tt; /* Temperature controller integration rate (Tt). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovGASTWD_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydro1.cpp b/CGMES_2.4.15_27JAN2020/GovHydro1.cpp index 3c59a34c4..5905eed08 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro1.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro1.cpp @@ -1,246 +1,260 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro1.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro1::GovHydro1() {}; - GovHydro1::~GovHydro1() {}; +bool assign_GovHydro1_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hdam; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro1_velm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_velm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro1_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hdam; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro1_factory() { - return new GovHydro1; - } + + + + + + + + + + +const char GovHydro1::debugName[] = "GovHydro1"; +const char* GovHydro1::debugString() const +{ + return GovHydro1::debugName; } -void GovHydro1::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro1"), &GovHydro1_factory)); } -void GovHydro1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydro1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.at"), &assign_GovHydro1_at)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.dturb"), &assign_GovHydro1_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmax"), &assign_GovHydro1_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmin"), &assign_GovHydro1_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.hdam"), &assign_GovHydro1_hdam)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.mwbase"), &assign_GovHydro1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.qnl"), &assign_GovHydro1_qnl)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.rperm"), &assign_GovHydro1_rperm)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.rtemp"), &assign_GovHydro1_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tr"), &assign_GovHydro1_tr)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tf"), &assign_GovHydro1_tf)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tg"), &assign_GovHydro1_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.velm"), &assign_GovHydro1_velm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmax"), &assign_GovHydro1_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.gmin"), &assign_GovHydro1_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tr"), &assign_GovHydro1_tr)); assign_map.insert(std::make_pair(std::string("cim:GovHydro1.tw"), &assign_GovHydro1_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.at"), &assign_GovHydro1_at)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.dturb"), &assign_GovHydro1_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.qnl"), &assign_GovHydro1_qnl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro1.hdam"), &assign_GovHydro1_hdam)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro1.velm"), &assign_GovHydro1_velm)); } -void GovHydro1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro1::debugName[] = "GovHydro1"; -const char* GovHydro1::debugString() +void GovHydro1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro1::debugName; } const BaseClassDefiner GovHydro1::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner GovHydro1::declare() return BaseClassDefiner(GovHydro1::addConstructToMap, GovHydro1::addPrimitiveAssignFnsToMap, GovHydro1::addClassAssignFnsToMap, GovHydro1::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro1_factory() + { + return new GovHydro1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydro1.hpp b/CGMES_2.4.15_27JAN2020/GovHydro1.hpp index f69867144..cb56f9b66 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro1.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro1.hpp @@ -1,54 +1,55 @@ #ifndef GovHydro1_H #define GovHydro1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Basic Hydro turbine governor model. */ - class GovHydro1: public TurbineGovernorDynamics + class GovHydro1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU rperm; /* Permanent droop (R) (>0). Typical Value = 0.04. Default: nullptr */ - CIMPP::PU rtemp; /* Temporary droop (r) (>R). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tr; /* Washout time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tf; /* Filter time constant () (>0). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float velm; /* Maximum gate velocity (Vlem) (>0). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening (Gmax) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening (Gmin) (>=0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At) (>0). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb) (>=0). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU qnl; /* No-load flow at nominal head (qnl) (>=0). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU hdam; /* Turbine nominal head (hdam). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro1(); - virtual ~GovHydro1(); - + ~GovHydro1() override; + + CIMPP::PU at; /* Turbine gain (At) (>0). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb) (>=0). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening (Gmax) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening (Gmin) (>=0). Typical Value = 0. Default: nullptr */ + CIMPP::PU hdam; /* Turbine nominal head (hdam). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU qnl; /* No-load flow at nominal head (qnl) (>=0). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU rperm; /* Permanent droop (R) (>0). Typical Value = 0.04. Default: nullptr */ + CIMPP::PU rtemp; /* Temporary droop (r) (>R). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tf; /* Filter time constant () (>0). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tr; /* Washout time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float velm; /* Maximum gate velocity (Vlem) (>0). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydro2.cpp b/CGMES_2.4.15_27JAN2020/GovHydro2.cpp index 7bbc244c5..5ce722b05 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro2.cpp @@ -1,26 +1,24 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro2.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -31,441 +29,472 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro2::GovHydro2() {}; - GovHydro2::~GovHydro2() {}; +bool assign_GovHydro2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro2_factory() { - return new GovHydro2; - } + + + + + + + + + + + + + + + + + + + + + + +const char GovHydro2::debugName[] = "GovHydro2"; +const char* GovHydro2::debugString() const +{ + return GovHydro2::debugName; } -void GovHydro2::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro2"), &GovHydro2_factory)); } -void GovHydro2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.mwbase"), &assign_GovHydro2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tg"), &assign_GovHydro2_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tp"), &assign_GovHydro2_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uo"), &assign_GovHydro2_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uc"), &assign_GovHydro2_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmax"), &assign_GovHydro2_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmin"), &assign_GovHydro2_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rperm"), &assign_GovHydro2_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rtemp"), &assign_GovHydro2_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tr"), &assign_GovHydro2_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tw"), &assign_GovHydro2_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.kturb"), &assign_GovHydro2_kturb)); +void GovHydro2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydro2.aturb"), &assign_GovHydro2_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.bturb"), &assign_GovHydro2_bturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.db1"), &assign_GovHydro2_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.eps"), &assign_GovHydro2_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.db2"), &assign_GovHydro2_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.eps"), &assign_GovHydro2_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv1"), &assign_GovHydro2_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv1"), &assign_GovHydro2_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv2"), &assign_GovHydro2_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv2"), &assign_GovHydro2_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv3"), &assign_GovHydro2_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv3"), &assign_GovHydro2_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv4"), &assign_GovHydro2_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv4"), &assign_GovHydro2_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv5"), &assign_GovHydro2_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv5"), &assign_GovHydro2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.gv6"), &assign_GovHydro2_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.kturb"), &assign_GovHydro2_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.mwbase"), &assign_GovHydro2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv1"), &assign_GovHydro2_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv2"), &assign_GovHydro2_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv3"), &assign_GovHydro2_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv4"), &assign_GovHydro2_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv5"), &assign_GovHydro2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pgv6"), &assign_GovHydro2_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmax"), &assign_GovHydro2_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.pmin"), &assign_GovHydro2_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rperm"), &assign_GovHydro2_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.rtemp"), &assign_GovHydro2_rtemp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tg"), &assign_GovHydro2_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tp"), &assign_GovHydro2_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tr"), &assign_GovHydro2_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.tw"), &assign_GovHydro2_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uc"), &assign_GovHydro2_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro2.uo"), &assign_GovHydro2_uo)); } -void GovHydro2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro2::debugName[] = "GovHydro2"; -const char* GovHydro2::debugString() +void GovHydro2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro2::debugName; } const BaseClassDefiner GovHydro2::declare() @@ -473,4 +502,10 @@ const BaseClassDefiner GovHydro2::declare() return BaseClassDefiner(GovHydro2::addConstructToMap, GovHydro2::addPrimitiveAssignFnsToMap, GovHydro2::addClassAssignFnsToMap, GovHydro2::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro2_factory() + { + return new GovHydro2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydro2.hpp b/CGMES_2.4.15_27JAN2020/GovHydro2.hpp index 0b0ccddef..551e5adfb 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro2.hpp @@ -1,70 +1,71 @@ #ifndef GovHydro2_H #define GovHydro2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* IEEE hydro turbine governor model represents plants with straightforward penstock configurations and hydraulic-dashpot governors. */ - class GovHydro2: public TurbineGovernorDynamics + class GovHydro2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening; (). Typical Value = 0. Default: nullptr */ - CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro2(); - virtual ~GovHydro2(); - + ~GovHydro2() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening; (). Typical Value = 0. Default: nullptr */ + CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -0.1. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydro3.cpp b/CGMES_2.4.15_27JAN2020/GovHydro3.cpp index fa1c1c461..e14871a36 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro3.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro3.cpp @@ -1,32 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro3.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" #include "PU.hpp" +#include "Frequency.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -38,539 +35,578 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro3::GovHydro3() {}; - GovHydro3::~GovHydro3() {}; +bool assign_GovHydro3_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_relec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->relec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_rgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rgate; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro3_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydro3_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro3_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->governorControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_rgate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rgate; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_relec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->relec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro3_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro3_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro3_factory() { - return new GovHydro3; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydro3::debugName[] = "GovHydro3"; +const char* GovHydro3::debugString() const +{ + return GovHydro3::debugName; } -void GovHydro3::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro3"), &GovHydro3_factory)); } -void GovHydro3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.mwbase"), &assign_GovHydro3_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmax"), &assign_GovHydro3_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmin"), &assign_GovHydro3_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.governorControl"), &assign_GovHydro3_governorControl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.rgate"), &assign_GovHydro3_rgate)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.relec"), &assign_GovHydro3_relec)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.td"), &assign_GovHydro3_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tf"), &assign_GovHydro3_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tp"), &assign_GovHydro3_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velop"), &assign_GovHydro3_velop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velcl"), &assign_GovHydro3_velcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k1"), &assign_GovHydro3_k1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k2"), &assign_GovHydro3_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.ki"), &assign_GovHydro3_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.kg"), &assign_GovHydro3_kg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tt"), &assign_GovHydro3_tt)); +void GovHydro3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.at"), &assign_GovHydro3_at)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.db1"), &assign_GovHydro3_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.eps"), &assign_GovHydro3_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.db2"), &assign_GovHydro3_db2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tw"), &assign_GovHydro3_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.at"), &assign_GovHydro3_at)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.dturb"), &assign_GovHydro3_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.qnl"), &assign_GovHydro3_qnl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.h0"), &assign_GovHydro3_h0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.eps"), &assign_GovHydro3_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.governorControl"), &assign_GovHydro3_governorControl)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv1"), &assign_GovHydro3_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv1"), &assign_GovHydro3_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv2"), &assign_GovHydro3_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv2"), &assign_GovHydro3_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv3"), &assign_GovHydro3_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv3"), &assign_GovHydro3_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv4"), &assign_GovHydro3_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv4"), &assign_GovHydro3_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv5"), &assign_GovHydro3_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv5"), &assign_GovHydro3_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.gv6"), &assign_GovHydro3_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.h0"), &assign_GovHydro3_h0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k1"), &assign_GovHydro3_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.k2"), &assign_GovHydro3_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.kg"), &assign_GovHydro3_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.ki"), &assign_GovHydro3_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.mwbase"), &assign_GovHydro3_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv1"), &assign_GovHydro3_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv2"), &assign_GovHydro3_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv3"), &assign_GovHydro3_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv4"), &assign_GovHydro3_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv5"), &assign_GovHydro3_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pgv6"), &assign_GovHydro3_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmax"), &assign_GovHydro3_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.pmin"), &assign_GovHydro3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.qnl"), &assign_GovHydro3_qnl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.relec"), &assign_GovHydro3_relec)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.rgate"), &assign_GovHydro3_rgate)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.td"), &assign_GovHydro3_td)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tf"), &assign_GovHydro3_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tp"), &assign_GovHydro3_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tt"), &assign_GovHydro3_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.tw"), &assign_GovHydro3_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velcl"), &assign_GovHydro3_velcl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro3.velop"), &assign_GovHydro3_velop)); } -void GovHydro3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro3::debugName[] = "GovHydro3"; -const char* GovHydro3::debugString() +void GovHydro3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro3::debugName; } const BaseClassDefiner GovHydro3::declare() @@ -578,4 +614,10 @@ const BaseClassDefiner GovHydro3::declare() return BaseClassDefiner(GovHydro3::addConstructToMap, GovHydro3::addPrimitiveAssignFnsToMap, GovHydro3::addClassAssignFnsToMap, GovHydro3::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro3_factory() + { + return new GovHydro3; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydro3.hpp b/CGMES_2.4.15_27JAN2020/GovHydro3.hpp index 24d55981e..833479d65 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro3.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro3.hpp @@ -1,78 +1,79 @@ #ifndef GovHydro3_H #define GovHydro3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "PU.hpp" #include "Boolean.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Modified IEEE Hydro Governor-Turbine Model. This model differs from that defined in the IEEE modeling guideline paper in that the limits on gate position and velocity do not permit "wind up" of the upstream signals. */ - class GovHydro3: public TurbineGovernorDynamics + class GovHydro3 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean governorControl; /* Governor control flag (Cflag). true = PID control is active false = double derivative control is active. Typical Value = true. Default: false */ - CIMPP::PU rgate; /* Steady-state droop, PU, for governor output feedback (Rgate). Typical Value = 0. Default: nullptr */ - CIMPP::PU relec; /* Steady-state droop, PU, for electrical power feedback (Relec). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ - CIMPP::PU k1; /* Derivative gain (K1). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU k2; /* Double derivative gain, if Cflag = -1 (K2). Typical Value = 2.5. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.2. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro3(); - virtual ~GovHydro3(); - + ~GovHydro3() override; + + CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Boolean governorControl; /* Governor control flag (Cflag). true = PID control is active false = double derivative control is active. Typical Value = true. Default: false */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ + CIMPP::PU k1; /* Derivative gain (K1). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU k2; /* Double derivative gain, if Cflag = -1 (K2). Typical Value = 2.5. Default: nullptr */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU relec; /* Steady-state droop, PU, for electrical power feedback (Relec). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rgate; /* Steady-state droop, PU, for governor output feedback (Rgate). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro3_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydro4.cpp b/CGMES_2.4.15_27JAN2020/GovHydro4.cpp index c53c0b5e1..fd340cff5 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro4.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro4.cpp @@ -1,26 +1,23 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydro4.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Frequency.hpp" +#include "PU.hpp" +#include "Simple_Float.hpp" #include "Frequency.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -30,6 +27,7 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -37,570 +35,610 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydro4::GovHydro4() {}; - GovHydro4::~GovHydro4() {}; +bool assign_GovHydro4_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_bmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hdam; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_qn1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qn1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tblade(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tblade; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydro4_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydro4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydro4_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydro4_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_hdam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hdam; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_qn1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qn1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_bmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydro4_tblade(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydro4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tblade; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydro4_factory() { - return new GovHydro4; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydro4::debugName[] = "GovHydro4"; +const char* GovHydro4::debugString() const +{ + return GovHydro4::debugName; } -void GovHydro4::addConstructToMap(std::unordered_map& factory_map) { +void GovHydro4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydro4"), &GovHydro4_factory)); } -void GovHydro4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.mwbase"), &assign_GovHydro4_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tg"), &assign_GovHydro4_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tp"), &assign_GovHydro4_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uo"), &assign_GovHydro4_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uc"), &assign_GovHydro4_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmax"), &assign_GovHydro4_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmin"), &assign_GovHydro4_gmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rperm"), &assign_GovHydro4_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rtemp"), &assign_GovHydro4_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tr"), &assign_GovHydro4_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tw"), &assign_GovHydro4_tw)); +void GovHydro4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydro4.at"), &assign_GovHydro4_at)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.dturb"), &assign_GovHydro4_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.hdam"), &assign_GovHydro4_hdam)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.qn1"), &assign_GovHydro4_qn1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv0"), &assign_GovHydro4_bgv0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv1"), &assign_GovHydro4_bgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv2"), &assign_GovHydro4_bgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv3"), &assign_GovHydro4_bgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv4"), &assign_GovHydro4_bgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv5"), &assign_GovHydro4_bgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bmax"), &assign_GovHydro4_bmax)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.db1"), &assign_GovHydro4_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.eps"), &assign_GovHydro4_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.db2"), &assign_GovHydro4_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.dturb"), &assign_GovHydro4_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.eps"), &assign_GovHydro4_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmax"), &assign_GovHydro4_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gmin"), &assign_GovHydro4_gmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv0"), &assign_GovHydro4_gv0)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv0"), &assign_GovHydro4_pgv0)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv1"), &assign_GovHydro4_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv1"), &assign_GovHydro4_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv2"), &assign_GovHydro4_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv2"), &assign_GovHydro4_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv3"), &assign_GovHydro4_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv3"), &assign_GovHydro4_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv4"), &assign_GovHydro4_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv4"), &assign_GovHydro4_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.gv5"), &assign_GovHydro4_gv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.hdam"), &assign_GovHydro4_hdam)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.mwbase"), &assign_GovHydro4_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv0"), &assign_GovHydro4_pgv0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv1"), &assign_GovHydro4_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv2"), &assign_GovHydro4_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv3"), &assign_GovHydro4_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv4"), &assign_GovHydro4_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.pgv5"), &assign_GovHydro4_pgv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv0"), &assign_GovHydro4_bgv0)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv1"), &assign_GovHydro4_bgv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv2"), &assign_GovHydro4_bgv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv3"), &assign_GovHydro4_bgv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv4"), &assign_GovHydro4_bgv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bgv5"), &assign_GovHydro4_bgv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydro4.bmax"), &assign_GovHydro4_bmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.qn1"), &assign_GovHydro4_qn1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rperm"), &assign_GovHydro4_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.rtemp"), &assign_GovHydro4_rtemp)); assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tblade"), &assign_GovHydro4_tblade)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tg"), &assign_GovHydro4_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tp"), &assign_GovHydro4_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tr"), &assign_GovHydro4_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.tw"), &assign_GovHydro4_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uc"), &assign_GovHydro4_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovHydro4.uo"), &assign_GovHydro4_uo)); } -void GovHydro4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydro4::debugName[] = "GovHydro4"; -const char* GovHydro4::debugString() +void GovHydro4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydro4::debugName; } const BaseClassDefiner GovHydro4::declare() @@ -608,4 +646,10 @@ const BaseClassDefiner GovHydro4::declare() return BaseClassDefiner(GovHydro4::addConstructToMap, GovHydro4::addPrimitiveAssignFnsToMap, GovHydro4::addClassAssignFnsToMap, GovHydro4::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydro4_factory() + { + return new GovHydro4; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydro4.hpp b/CGMES_2.4.15_27JAN2020/GovHydro4.hpp index 947e2a6fa..f91554cfd 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydro4.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydro4.hpp @@ -1,79 +1,80 @@ #ifndef GovHydro4_H #define GovHydro4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Hydro turbine and governor. Represents plants with straight-forward penstock configurations and hydraulic governors of traditional 'dashpot' type. This model can be used to represent simple, Francis, Pelton or Kaplan turbines. */ - class GovHydro4: public TurbineGovernorDynamics + class GovHydro4 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tp; /* Pilot servo time constant (Tp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uo; /* Max gate opening velocity (Uo). Typical Vlaue = 0.2. Default: nullptr */ - CIMPP::Simple_Float uc; /* Max gate closing velocity (Uc). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening, PU of MWbase (Gmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening, PU of MWbase (Gmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds rtemp; /* Temporary droop (Rtemp). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tr; /* Dashpot time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Typical Value = 0.5. Typical Value Francis = 1.1, Kaplan = 1.1. Default: nullptr */ - CIMPP::PU hdam; /* Head available at dam (hdam). Typical Value = 1. Default: nullptr */ - CIMPP::PU qn1; /* No-load flow at nominal head (Qnl). Typical Value = 0.08. Typical Value Francis = 0, Kaplan = 0. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv0; /* Nonlinear gain point 0, PU gv (Gv0). Typical Value = 0. Typical Value Francis = 0.1, Kaplan = 0.1. Default: nullptr */ - CIMPP::PU pgv0; /* Nonlinear gain point 0, PU power (Pgv0). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Typical Value Francis = 0.4, Kaplan = 0.4. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Typical Value Francis = 0.42, Kaplan = 0.35. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Typical Value Francis = 0.5, Kaplan = 0.5. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Typical Value Francis = 0.56, Kaplan = 0.468. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Typical Value Francis = 0.7, Kaplan = 0.7. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.796. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.8. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.917. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.9. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Typical Value Francis = 0.97, Kaplan = 0.99. Default: nullptr */ - CIMPP::PU bgv0; /* Kaplan blade servo point 0 (Bgv0). Typical Value = 0. Default: nullptr */ - CIMPP::PU bgv1; /* Kaplan blade servo point 1 (Bgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU bgv2; /* Kaplan blade servo point 2 (Bgv2). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.1. Default: nullptr */ - CIMPP::PU bgv3; /* Kaplan blade servo point 3 (Bgv3). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.667. Default: nullptr */ - CIMPP::PU bgv4; /* Kaplan blade servo point 4 (Bgv4). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.9. Default: nullptr */ - CIMPP::PU bgv5; /* Kaplan blade servo point 5 (Bgv5). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1. Default: nullptr */ - CIMPP::Simple_Float bmax; /* Maximum blade adjustment factor (Bmax). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1.1276. Default: nullptr */ - CIMPP::Seconds tblade; /* Blade servo time constant (Tblade). Typical Value = 100. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydro4(); - virtual ~GovHydro4(); - + ~GovHydro4() override; + + CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU bgv0; /* Kaplan blade servo point 0 (Bgv0). Typical Value = 0. Default: nullptr */ + CIMPP::PU bgv1; /* Kaplan blade servo point 1 (Bgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU bgv2; /* Kaplan blade servo point 2 (Bgv2). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.1. Default: nullptr */ + CIMPP::PU bgv3; /* Kaplan blade servo point 3 (Bgv3). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.667. Default: nullptr */ + CIMPP::PU bgv4; /* Kaplan blade servo point 4 (Bgv4). Typical Value = 0. Typical Value Francis = 0, Kaplan = 0.9. Default: nullptr */ + CIMPP::PU bgv5; /* Kaplan blade servo point 5 (Bgv5). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1. Default: nullptr */ + CIMPP::Simple_Float bmax; /* Maximum blade adjustment factor (Bmax). Typical Value = 0. Typical Value Francis = 0, Kaplan = 1.1276. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Typical Value = 0.5. Typical Value Francis = 1.1, Kaplan = 1.1. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening, PU of MWbase (Gmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening, PU of MWbase (Gmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv0; /* Nonlinear gain point 0, PU gv (Gv0). Typical Value = 0. Typical Value Francis = 0.1, Kaplan = 0.1. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Typical Value Francis = 0.4, Kaplan = 0.4. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Typical Value Francis = 0.5, Kaplan = 0.5. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Typical Value Francis = 0.7, Kaplan = 0.7. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.8. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.9. Default: nullptr */ + CIMPP::PU hdam; /* Head available at dam (hdam). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv0; /* Nonlinear gain point 0, PU power (Pgv0). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Typical Value Francis = 0.42, Kaplan = 0.35. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Typical Value Francis = 0.56, Kaplan = 0.468. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Typical Value Francis = 0.8, Kaplan = 0.796. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Typical Value Francis = 0.9, Kaplan = 0.917. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Typical Value Francis = 0.97, Kaplan = 0.99. Default: nullptr */ + CIMPP::PU qn1; /* No-load flow at nominal head (Qnl). Typical Value = 0.08. Typical Value Francis = 0, Kaplan = 0. Default: nullptr */ + CIMPP::Seconds rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds rtemp; /* Temporary droop (Rtemp). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tblade; /* Blade servo time constant (Tblade). Typical Value = 100. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg) (>0). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tp; /* Pilot servo time constant (Tp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tr; /* Dashpot time constant (Tr) (>0). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float uc; /* Max gate closing velocity (Uc). Typical Value = 0.2. Default: nullptr */ + CIMPP::Simple_Float uo; /* Max gate opening velocity (Uo). Typical Vlaue = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydro4_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroDD.cpp b/CGMES_2.4.15_27JAN2020/GovHydroDD.cpp index 99cdbbd9b..af9c6f749 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroDD.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroDD.cpp @@ -1,32 +1,30 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroDD.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -36,526 +34,563 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroDD::GovHydroDD() {}; - GovHydroDD::~GovHydroDD() {}; +bool assign_GovHydroDD_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroDD_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroDD_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroDD_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroDD_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroDD* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroDD_factory() { - return new GovHydroDD; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroDD::debugName[] = "GovHydroDD"; +const char* GovHydroDD::debugString() const +{ + return GovHydroDD::debugName; } -void GovHydroDD::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroDD::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroDD"), &GovHydroDD_factory)); } -void GovHydroDD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.mwbase"), &assign_GovHydroDD_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmax"), &assign_GovHydroDD_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmin"), &assign_GovHydroDD_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.r"), &assign_GovHydroDD_r)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.td"), &assign_GovHydroDD_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tf"), &assign_GovHydroDD_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tp"), &assign_GovHydroDD_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velop"), &assign_GovHydroDD_velop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velcl"), &assign_GovHydroDD_velcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k1"), &assign_GovHydroDD_k1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k2"), &assign_GovHydroDD_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.ki"), &assign_GovHydroDD_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.kg"), &assign_GovHydroDD_kg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tturb"), &assign_GovHydroDD_tturb)); +void GovHydroDD::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.aturb"), &assign_GovHydroDD_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.bturb"), &assign_GovHydroDD_bturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tt"), &assign_GovHydroDD_tt)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.db1"), &assign_GovHydroDD_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.eps"), &assign_GovHydroDD_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.db2"), &assign_GovHydroDD_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.eps"), &assign_GovHydroDD_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmax"), &assign_GovHydroDD_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmin"), &assign_GovHydroDD_gmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv1"), &assign_GovHydroDD_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv1"), &assign_GovHydroDD_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv2"), &assign_GovHydroDD_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv2"), &assign_GovHydroDD_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv3"), &assign_GovHydroDD_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv3"), &assign_GovHydroDD_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv4"), &assign_GovHydroDD_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv4"), &assign_GovHydroDD_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv5"), &assign_GovHydroDD_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv5"), &assign_GovHydroDD_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gv6"), &assign_GovHydroDD_gv6)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv6"), &assign_GovHydroDD_pgv6)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmax"), &assign_GovHydroDD_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.gmin"), &assign_GovHydroDD_gmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.inputSignal"), &assign_GovHydroDD_inputSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k1"), &assign_GovHydroDD_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.k2"), &assign_GovHydroDD_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.kg"), &assign_GovHydroDD_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.ki"), &assign_GovHydroDD_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.mwbase"), &assign_GovHydroDD_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv1"), &assign_GovHydroDD_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv2"), &assign_GovHydroDD_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv3"), &assign_GovHydroDD_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv4"), &assign_GovHydroDD_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv5"), &assign_GovHydroDD_pgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pgv6"), &assign_GovHydroDD_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmax"), &assign_GovHydroDD_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.pmin"), &assign_GovHydroDD_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.r"), &assign_GovHydroDD_r)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.td"), &assign_GovHydroDD_td)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tf"), &assign_GovHydroDD_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tp"), &assign_GovHydroDD_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tt"), &assign_GovHydroDD_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.tturb"), &assign_GovHydroDD_tturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velcl"), &assign_GovHydroDD_velcl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroDD.velop"), &assign_GovHydroDD_velop)); } -void GovHydroDD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroDD::debugName[] = "GovHydroDD"; -const char* GovHydroDD::debugString() +void GovHydroDD::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroDD::debugName; } const BaseClassDefiner GovHydroDD::declare() @@ -563,4 +598,10 @@ const BaseClassDefiner GovHydroDD::declare() return BaseClassDefiner(GovHydroDD::addConstructToMap, GovHydroDD::addPrimitiveAssignFnsToMap, GovHydroDD::addClassAssignFnsToMap, GovHydroDD::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroDD_factory() + { + return new GovHydroDD; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroDD.hpp b/CGMES_2.4.15_27JAN2020/GovHydroDD.hpp index 5d2377df0..66448cd4e 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroDD.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroDD.hpp @@ -1,77 +1,78 @@ #ifndef GovHydroDD_H #define GovHydroDD_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Double derivative hydro governor and turbine. */ - class GovHydroDD: public TurbineGovernorDynamics + class GovHydroDD : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ - CIMPP::PU k1; /* Single derivative gain (K1). Typical Value = 3.6. Default: nullptr */ - CIMPP::PU k2; /* Double derivative gain (K2). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 1. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value = -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroDD(); - virtual ~GovHydroDD(); - + ~GovHydroDD() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value = -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ + CIMPP::PU k1; /* Single derivative gain (K1). Typical Value = 3.6. Default: nullptr */ + CIMPP::PU k2; /* Double derivative gain (K2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 3. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroDD_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroFrancis.cpp b/CGMES_2.4.15_27JAN2020/GovHydroFrancis.cpp index 168b227f5..69a4aec31 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroFrancis.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroFrancis.cpp @@ -1,7 +1,11 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroFrancis.hpp" +#include +#include + #include "PU.hpp" #include "Area.hpp" #include "Area.hpp" @@ -32,32 +36,359 @@ using namespace CIMPP; -GovHydroFrancis::GovHydroFrancis(): qn(nullptr) {}; - +GovHydroFrancis::GovHydroFrancis() {}; GovHydroFrancis::~GovHydroFrancis() {}; +bool assign_GovHydroFrancis_am(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->am; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_etamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->etamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->governorControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qc0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_qn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroFrancis_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twnc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->va; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroFrancis_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->waterTunnelSurgeChamberSimulation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroFrancis_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - element->qn = dynamic_cast(BaseClass_ptr2); - if(element->qn != nullptr) - return true; - } - return false; +bool assign_GovHydroFrancis_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zsfc; + if (buffer.fail()) + return false; + else + return true; + } + return false; } @@ -73,330 +404,34 @@ bool assign_GovHydroFrancis_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_p -bool assign_GovHydroFrancis_am(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->am; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_etamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->etamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroFrancis_governorControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->governorControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_kt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qc0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_GovHydroFrancis_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twnc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->va; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->waterTunnelSurgeChamberSimulation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroFrancis_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroFrancis* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zsfc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroFrancis_factory() { - return new GovHydroFrancis; - } + + + + + + + + + +const char GovHydroFrancis::debugName[] = "GovHydroFrancis"; +const char* GovHydroFrancis::debugString() const +{ + return GovHydroFrancis::debugName; } -void GovHydroFrancis::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroFrancis::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroFrancis"), &GovHydroFrancis_factory)); } -void GovHydroFrancis::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydroFrancis::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.am"), &assign_GovHydroFrancis_am)); assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.av0"), &assign_GovHydroFrancis_av0)); assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.av1"), &assign_GovHydroFrancis_av1)); @@ -411,7 +446,8 @@ void GovHydroFrancis::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroFrancis.qn"), &assign_GovHydroFrancis_qn)); - } - -const char GovHydroFrancis::debugName[] = "GovHydroFrancis"; -const char* GovHydroFrancis::debugString() +void GovHydroFrancis::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroFrancis::debugName; } const BaseClassDefiner GovHydroFrancis::declare() @@ -440,4 +470,10 @@ const BaseClassDefiner GovHydroFrancis::declare() return BaseClassDefiner(GovHydroFrancis::addConstructToMap, GovHydroFrancis::addPrimitiveAssignFnsToMap, GovHydroFrancis::addClassAssignFnsToMap, GovHydroFrancis::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroFrancis_factory() + { + return new GovHydroFrancis; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroFrancis.hpp b/CGMES_2.4.15_27JAN2020/GovHydroFrancis.hpp index 8a5077ada..82318836e 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroFrancis.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroFrancis.hpp @@ -1,72 +1,73 @@ #ifndef GovHydroFrancis_H #define GovHydroFrancis_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Area.hpp" -#include "Frequency.hpp" +#include "Boolean.hpp" #include "FrancisGovernorControlKind.hpp" +#include "Frequency.hpp" #include "Length.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "VolumeFlowRate.hpp" +namespace CIMPP +{ -class VolumeFlowRate; /* Detailed hydro unit - Francis model. This model can be used to represent three types of governors. A schematic of the hydraulic system of detailed hydro unit models, like Francis and Pelton, is provided in the DetailedHydroModelHydraulicSystem diagram. */ - class GovHydroFrancis: public TurbineGovernorDynamics + class GovHydroFrancis : public TurbineGovernorDynamics { - public: - CIMPP::PU am; /* Opening section S at the maximum efficiency (Am). Typical Value = 0.7. Default: nullptr */ - CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ - CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ - CIMPP::PU bp; /* Droop (Bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::PU etamax; /* Maximum efficiency (EtaMax). Typical Value = 1.05. Default: nullptr */ - CIMPP::FrancisGovernorControlKind governorControl; /* Governor control flag (Cflag). Typical Value = mechanicHydrolicTachoAccelerator. Default: 0 */ - CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ - CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ - CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ - CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ - CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = 0.025. Default: nullptr */ - CIMPP::PU kt; /* Washout gain (Kt). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.21. Default: nullptr */ - CIMPP::VolumeFlowRate* qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ - CIMPP::Seconds ta; /* Derivative gain (Ta). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds td; /* Washout time constant (Td). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tx; /* Derivative feedback gain (Tx). Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.011. Default: nullptr */ - CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ - CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.011. Default: nullptr */ - CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ - CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroFrancis(); - virtual ~GovHydroFrancis(); - + ~GovHydroFrancis() override; + + CIMPP::PU am; /* Opening section S at the maximum efficiency (Am). Typical Value = 0.7. Default: nullptr */ + CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ + CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ + CIMPP::PU bp; /* Droop (Bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU etamax; /* Maximum efficiency (EtaMax). Typical Value = 1.05. Default: nullptr */ + CIMPP::FrancisGovernorControlKind governorControl; /* Governor control flag (Cflag). Typical Value = mechanicHydrolicTachoAccelerator. Default: 0 */ + CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ + CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ + CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ + CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ + CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = 0.025. Default: nullptr */ + CIMPP::PU kt; /* Washout gain (Kt). Typical Value = 0.25. Default: nullptr */ + CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.21. Default: nullptr */ + CIMPP::VolumeFlowRate qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ + CIMPP::Seconds ta; /* Derivative gain (Ta). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds td; /* Washout time constant (Td). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tx; /* Derivative feedback gain (Tx). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.011. Default: nullptr */ + CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ + CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.011. Default: nullptr */ + CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ + CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroFrancis_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.cpp b/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.cpp index dcb491f86..282e23474 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.cpp @@ -1,156 +1,164 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroIEEE0.hpp" +#include +#include + +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; GovHydroIEEE0::GovHydroIEEE0() {}; - GovHydroIEEE0::~GovHydroIEEE0() {}; +bool assign_GovHydroIEEE0_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE0_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroIEEE0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE0_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovHydroIEEE0_factory() { - return new GovHydroIEEE0; - } +const char GovHydroIEEE0::debugName[] = "GovHydroIEEE0"; +const char* GovHydroIEEE0::debugString() const +{ + return GovHydroIEEE0::debugName; } -void GovHydroIEEE0::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroIEEE0::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0"), &GovHydroIEEE0_factory)); } -void GovHydroIEEE0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.mwbase"), &assign_GovHydroIEEE0_mwbase)); +void GovHydroIEEE0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.k"), &assign_GovHydroIEEE0_k)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.mwbase"), &assign_GovHydroIEEE0_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmax"), &assign_GovHydroIEEE0_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmin"), &assign_GovHydroIEEE0_pmin)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t1"), &assign_GovHydroIEEE0_t1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t2"), &assign_GovHydroIEEE0_t2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t3"), &assign_GovHydroIEEE0_t3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.t4"), &assign_GovHydroIEEE0_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmax"), &assign_GovHydroIEEE0_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE0.pmin"), &assign_GovHydroIEEE0_pmin)); } -void GovHydroIEEE0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroIEEE0::debugName[] = "GovHydroIEEE0"; -const char* GovHydroIEEE0::debugString() +void GovHydroIEEE0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroIEEE0::debugName; } const BaseClassDefiner GovHydroIEEE0::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner GovHydroIEEE0::declare() return BaseClassDefiner(GovHydroIEEE0::addConstructToMap, GovHydroIEEE0::addPrimitiveAssignFnsToMap, GovHydroIEEE0::addClassAssignFnsToMap, GovHydroIEEE0::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroIEEE0_factory() + { + return new GovHydroIEEE0; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.hpp b/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.hpp index 070477617..f7ce7aa7d 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroIEEE0.hpp @@ -1,47 +1,48 @@ #ifndef GovHydroIEEE0_H #define GovHydroIEEE0_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEEE Simplified Hydro Governor-Turbine Model. Used for Mechanical-Hydraulic and Electro-Hydraulic turbine governors, with our without steam feedback. Typical values given are for Mechanical-Hydraulic. Ref */ - class GovHydroIEEE0: public TurbineGovernorDynamics + class GovHydroIEEE0 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::PU k; /* Governor gain (K. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0.25. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T2. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Gate actuator time constant (T3). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4; /* Water starting time (T4). Default: nullptr */ - CIMPP::PU pmax; /* Gate maximum (Pmax). Default: nullptr */ - CIMPP::PU pmin; /* Gate minimum (Pmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroIEEE0(); - virtual ~GovHydroIEEE0(); - + ~GovHydroIEEE0() override; + + CIMPP::PU k; /* Governor gain (K. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Gate maximum (Pmax). Default: nullptr */ + CIMPP::PU pmin; /* Gate minimum (Pmin). Default: nullptr */ + CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0.25. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T2. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Gate actuator time constant (T3). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Water starting time (T4). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroIEEE0_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.cpp b/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.cpp index 1cc29756a..7eba81a7d 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.cpp @@ -1,23 +1,21 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroIEEE2.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -28,399 +26,427 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroIEEE2::GovHydroIEEE2() {}; - GovHydroIEEE2::~GovHydroIEEE2() {}; +bool assign_GovHydroIEEE2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rtemp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroIEEE2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroIEEE2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroIEEE2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_rtemp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rtemp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_kturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroIEEE2_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroIEEE2_factory() { - return new GovHydroIEEE2; - } + + + + + + + + + + + + + + + + + + + + +const char GovHydroIEEE2::debugName[] = "GovHydroIEEE2"; +const char* GovHydroIEEE2::debugString() const +{ + return GovHydroIEEE2::debugName; } -void GovHydroIEEE2::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroIEEE2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2"), &GovHydroIEEE2_factory)); } -void GovHydroIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.mwbase"), &assign_GovHydroIEEE2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tg"), &assign_GovHydroIEEE2_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tp"), &assign_GovHydroIEEE2_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uo"), &assign_GovHydroIEEE2_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uc"), &assign_GovHydroIEEE2_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmax"), &assign_GovHydroIEEE2_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmin"), &assign_GovHydroIEEE2_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rperm"), &assign_GovHydroIEEE2_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rtemp"), &assign_GovHydroIEEE2_rtemp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tr"), &assign_GovHydroIEEE2_tr)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tw"), &assign_GovHydroIEEE2_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.kturb"), &assign_GovHydroIEEE2_kturb)); +void GovHydroIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.aturb"), &assign_GovHydroIEEE2_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.bturb"), &assign_GovHydroIEEE2_bturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv1"), &assign_GovHydroIEEE2_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv1"), &assign_GovHydroIEEE2_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv2"), &assign_GovHydroIEEE2_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv2"), &assign_GovHydroIEEE2_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv3"), &assign_GovHydroIEEE2_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv3"), &assign_GovHydroIEEE2_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv4"), &assign_GovHydroIEEE2_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv4"), &assign_GovHydroIEEE2_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv5"), &assign_GovHydroIEEE2_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv5"), &assign_GovHydroIEEE2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.gv6"), &assign_GovHydroIEEE2_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.kturb"), &assign_GovHydroIEEE2_kturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.mwbase"), &assign_GovHydroIEEE2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv1"), &assign_GovHydroIEEE2_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv2"), &assign_GovHydroIEEE2_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv3"), &assign_GovHydroIEEE2_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv4"), &assign_GovHydroIEEE2_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv5"), &assign_GovHydroIEEE2_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pgv6"), &assign_GovHydroIEEE2_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmax"), &assign_GovHydroIEEE2_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.pmin"), &assign_GovHydroIEEE2_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rperm"), &assign_GovHydroIEEE2_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.rtemp"), &assign_GovHydroIEEE2_rtemp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tg"), &assign_GovHydroIEEE2_tg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tp"), &assign_GovHydroIEEE2_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tr"), &assign_GovHydroIEEE2_tr)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.tw"), &assign_GovHydroIEEE2_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uc"), &assign_GovHydroIEEE2_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroIEEE2.uo"), &assign_GovHydroIEEE2_uo)); } -void GovHydroIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroIEEE2::debugName[] = "GovHydroIEEE2"; -const char* GovHydroIEEE2::debugString() +void GovHydroIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroIEEE2::debugName; } const BaseClassDefiner GovHydroIEEE2::declare() @@ -428,4 +454,10 @@ const BaseClassDefiner GovHydroIEEE2::declare() return BaseClassDefiner(GovHydroIEEE2::addConstructToMap, GovHydroIEEE2::addPrimitiveAssignFnsToMap, GovHydroIEEE2::addClassAssignFnsToMap, GovHydroIEEE2::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroIEEE2_factory() + { + return new GovHydroIEEE2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.hpp b/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.hpp index c26fd2f36..db7fb4c8f 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroIEEE2.hpp @@ -1,66 +1,67 @@ #ifndef GovHydroIEEE2_H #define GovHydroIEEE2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* IEEE hydro turbine governor model represents plants with straightforward penstock configurations and hydraulic-dashpot governors. Ref */ - class GovHydroIEEE2: public TurbineGovernorDynamics + class GovHydroIEEE2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Typical Value = -0.1. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ - CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroIEEE2(); - virtual ~GovHydroIEEE2(); - + ~GovHydroIEEE2() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb). Typical Value = -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU kturb; /* Turbine gain (Kturb). Typical Value = 1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU rperm; /* Permanent droop (Rperm). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rtemp; /* Temporary droop (Rtemp). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tg; /* Gate servo time constant (Tg). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tp; /* Pilot servo valve time constant (Tp). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tr; /* Dashpot time constant (Tr). Typical Value = 12. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum gate closing velocity (Uc) (<0). Typical Value = -0.1. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum gate opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroIEEE2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroPID.cpp b/CGMES_2.4.15_27JAN2020/GovHydroPID.cpp index 13df5253d..a6e48d00d 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroPID.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroPID.cpp @@ -1,32 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroPID.hpp" -#include "ActivePower.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include "Frequency.hpp" +#include "ActivePower.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Frequency.hpp" #include "Boolean.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -35,497 +32,533 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroPID::GovHydroPID() {}; - GovHydroPID::~GovHydroPID() {}; +bool assign_GovHydroPID_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPID_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPID_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPID_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_tturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_aturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_bturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPID_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroPID_factory() { - return new GovHydroPID; - } + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroPID::debugName[] = "GovHydroPID"; +const char* GovHydroPID::debugString() const +{ + return GovHydroPID::debugName; } -void GovHydroPID::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroPID::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroPID"), &GovHydroPID_factory)); } -void GovHydroPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.mwbase"), &assign_GovHydroPID_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmax"), &assign_GovHydroPID_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmin"), &assign_GovHydroPID_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.r"), &assign_GovHydroPID_r)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.td"), &assign_GovHydroPID_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tf"), &assign_GovHydroPID_tf)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tp"), &assign_GovHydroPID_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velop"), &assign_GovHydroPID_velop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velcl"), &assign_GovHydroPID_velcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kd"), &assign_GovHydroPID_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kp"), &assign_GovHydroPID_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.ki"), &assign_GovHydroPID_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kg"), &assign_GovHydroPID_kg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tturb"), &assign_GovHydroPID_tturb)); +void GovHydroPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.aturb"), &assign_GovHydroPID_aturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.bturb"), &assign_GovHydroPID_bturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tt"), &assign_GovHydroPID_tt)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.db1"), &assign_GovHydroPID_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.inputSignal"), &assign_GovHydroPID_inputSignal)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.eps"), &assign_GovHydroPID_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.db2"), &assign_GovHydroPID_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.eps"), &assign_GovHydroPID_eps)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv1"), &assign_GovHydroPID_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv1"), &assign_GovHydroPID_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv2"), &assign_GovHydroPID_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv2"), &assign_GovHydroPID_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv3"), &assign_GovHydroPID_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv3"), &assign_GovHydroPID_pgv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv4"), &assign_GovHydroPID_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv4"), &assign_GovHydroPID_pgv4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv5"), &assign_GovHydroPID_gv5)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv5"), &assign_GovHydroPID_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.gv6"), &assign_GovHydroPID_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.inputSignal"), &assign_GovHydroPID_inputSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kd"), &assign_GovHydroPID_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kg"), &assign_GovHydroPID_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.ki"), &assign_GovHydroPID_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.kp"), &assign_GovHydroPID_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.mwbase"), &assign_GovHydroPID_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv1"), &assign_GovHydroPID_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv2"), &assign_GovHydroPID_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv3"), &assign_GovHydroPID_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv4"), &assign_GovHydroPID_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv5"), &assign_GovHydroPID_pgv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pgv6"), &assign_GovHydroPID_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmax"), &assign_GovHydroPID_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.pmin"), &assign_GovHydroPID_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.r"), &assign_GovHydroPID_r)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.td"), &assign_GovHydroPID_td)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tf"), &assign_GovHydroPID_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tp"), &assign_GovHydroPID_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tt"), &assign_GovHydroPID_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.tturb"), &assign_GovHydroPID_tturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velcl"), &assign_GovHydroPID_velcl)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID.velop"), &assign_GovHydroPID_velop)); } -void GovHydroPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroPID::debugName[] = "GovHydroPID"; -const char* GovHydroPID::debugString() +void GovHydroPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroPID::debugName; } const BaseClassDefiner GovHydroPID::declare() @@ -533,4 +566,10 @@ const BaseClassDefiner GovHydroPID::declare() return BaseClassDefiner(GovHydroPID::addConstructToMap, GovHydroPID::addPrimitiveAssignFnsToMap, GovHydroPID::addClassAssignFnsToMap, GovHydroPID::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroPID_factory() + { + return new GovHydroPID; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroPID.hpp b/CGMES_2.4.15_27JAN2020/GovHydroPID.hpp index b181c9197..62b09b74c 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroPID.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroPID.hpp @@ -1,75 +1,76 @@ #ifndef GovHydroPID_H #define GovHydroPID_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* PID governor and turbine. */ - class GovHydroPID: public TurbineGovernorDynamics + class GovHydroPID : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ - CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.36. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2.5. Default: nullptr */ - CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value -1. Default: nullptr */ - CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroPID(); - virtual ~GovHydroPID(); - + ~GovHydroPID() override; + + CIMPP::PU aturb; /* Turbine numerator multiplier (Aturb) (note 3). Typical Value -1. Default: nullptr */ + CIMPP::PU bturb; /* Turbine denominator multiplier (Bturb) (note 3). Typical Value = 0.5. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ + CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2.5. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.36. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU r; /* Steady state droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tf; /* Washout time constant (Tf). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tturb; /* Turbine time constant (Tturb) (note 3). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.14. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.09. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroPID_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroPID2.cpp b/CGMES_2.4.15_27JAN2020/GovHydroPID2.cpp index a6b5ae218..4d1cc7efb 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroPID2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroPID2.cpp @@ -1,366 +1,388 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroPID2.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" +#include "Boolean.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroPID2::GovHydroPID2() {}; - GovHydroPID2::~GovHydroPID2() {}; +bool assign_GovHydroPID2_atw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->atw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->feedbackSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_g1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_g2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rperm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->treg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPID2_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroPID2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->treg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_rperm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rperm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_g1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_g2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_atw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->atw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPID2_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPID2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->feedbackSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovHydroPID2_factory() { - return new GovHydroPID2; - } +const char GovHydroPID2::debugName[] = "GovHydroPID2"; +const char* GovHydroPID2::debugString() const +{ + return GovHydroPID2::debugName; } -void GovHydroPID2::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroPID2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroPID2"), &GovHydroPID2_factory)); } -void GovHydroPID2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.mwbase"), &assign_GovHydroPID2_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.treg"), &assign_GovHydroPID2_treg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.rperm"), &assign_GovHydroPID2_rperm)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kp"), &assign_GovHydroPID2_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ki"), &assign_GovHydroPID2_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kd"), &assign_GovHydroPID2_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ta"), &assign_GovHydroPID2_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tb"), &assign_GovHydroPID2_tb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmax"), &assign_GovHydroPID2_velmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmin"), &assign_GovHydroPID2_velmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmax"), &assign_GovHydroPID2_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmin"), &assign_GovHydroPID2_gmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tw"), &assign_GovHydroPID2_tw)); +void GovHydroPID2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.atw"), &assign_GovHydroPID2_atw)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.d"), &assign_GovHydroPID2_d)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.feedbackSignal"), &assign_GovHydroPID2_feedbackSignal)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.g0"), &assign_GovHydroPID2_g0)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.g1"), &assign_GovHydroPID2_g1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p1"), &assign_GovHydroPID2_p1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.g2"), &assign_GovHydroPID2_g2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmax"), &assign_GovHydroPID2_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.gmin"), &assign_GovHydroPID2_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kd"), &assign_GovHydroPID2_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ki"), &assign_GovHydroPID2_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.kp"), &assign_GovHydroPID2_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.mwbase"), &assign_GovHydroPID2_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p1"), &assign_GovHydroPID2_p1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p2"), &assign_GovHydroPID2_p2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.p3"), &assign_GovHydroPID2_p3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.atw"), &assign_GovHydroPID2_atw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.feedbackSignal"), &assign_GovHydroPID2_feedbackSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.rperm"), &assign_GovHydroPID2_rperm)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.ta"), &assign_GovHydroPID2_ta)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tb"), &assign_GovHydroPID2_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.treg"), &assign_GovHydroPID2_treg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.tw"), &assign_GovHydroPID2_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmax"), &assign_GovHydroPID2_velmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroPID2.velmin"), &assign_GovHydroPID2_velmin)); } -void GovHydroPID2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroPID2::debugName[] = "GovHydroPID2"; -const char* GovHydroPID2::debugString() +void GovHydroPID2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroPID2::debugName; } const BaseClassDefiner GovHydroPID2::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner GovHydroPID2::declare() return BaseClassDefiner(GovHydroPID2::addConstructToMap, GovHydroPID2::addPrimitiveAssignFnsToMap, GovHydroPID2::addClassAssignFnsToMap, GovHydroPID2::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroPID2_factory() + { + return new GovHydroPID2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroPID2.hpp b/CGMES_2.4.15_27JAN2020/GovHydroPID2.hpp index e65ae27f1..4927a18e5 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroPID2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroPID2.hpp @@ -1,63 +1,64 @@ #ifndef GovHydroPID2_H #define GovHydroPID2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Hydro turbine and governor. Represents plants with straight forward penstock configurations and "three term" electro-hydraulic governors (i.e. Woodard electronic). */ - class GovHydroPID2: public TurbineGovernorDynamics + class GovHydroPID2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds treg; /* Speed detector time constant (Treg). Typical Value = 0. Default: nullptr */ - CIMPP::PU rperm; /* Permanent drop (Rperm). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float ki; /* Reset gain (Ki). Unit = PU/ sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ - CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ - CIMPP::PU g0; /* Gate opening at speed no load (G0). Typical Value = 0. Default: nullptr */ - CIMPP::PU g1; /* Intermediate gate opening (G1). Typical Value = 0. Default: nullptr */ - CIMPP::PU p1; /* Power at gate opening G1 (P1). Typical Value = 0. Default: nullptr */ - CIMPP::PU g2; /* Intermediate gate opening (G2). Typical Value = 0. Default: nullptr */ - CIMPP::PU p2; /* Power at gate opening G2 (P2). Typical Value = 0. Default: nullptr */ - CIMPP::PU p3; /* Power at full opened gate (P3). Typical Value = 0. Default: nullptr */ - CIMPP::PU atw; /* Factor multiplying Tw (Atw). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean feedbackSignal; /* Feedback signal type flag (Flag). true = use gate position feedback signal false = use Pe. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroPID2(); - virtual ~GovHydroPID2(); - + ~GovHydroPID2() override; + + CIMPP::PU atw; /* Factor multiplying Tw (Atw). Typical Value = 0. Default: nullptr */ + CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ + CIMPP::Boolean feedbackSignal; /* Feedback signal type flag (Flag). true = use gate position feedback signal false = use Pe. Default: false */ + CIMPP::PU g0; /* Gate opening at speed no load (G0). Typical Value = 0. Default: nullptr */ + CIMPP::PU g1; /* Intermediate gate opening (G1). Typical Value = 0. Default: nullptr */ + CIMPP::PU g2; /* Intermediate gate opening (G2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum gate opening (Gmax). Typical Value = 0. Default: nullptr */ + CIMPP::PU gmin; /* Minimum gate opening (Gmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float ki; /* Reset gain (Ki). Unit = PU/ sec. Typical Value = 0. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU p1; /* Power at gate opening G1 (P1). Typical Value = 0. Default: nullptr */ + CIMPP::PU p2; /* Power at gate opening G2 (P2). Typical Value = 0. Default: nullptr */ + CIMPP::PU p3; /* Power at full opened gate (P3). Typical Value = 0. Default: nullptr */ + CIMPP::PU rperm; /* Permanent drop (Rperm). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds treg; /* Speed detector time constant (Treg). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroPID2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroPelton.cpp b/CGMES_2.4.15_27JAN2020/GovHydroPelton.cpp index 707d20f93..beecbd3c5 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroPelton.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroPelton.cpp @@ -1,7 +1,11 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroPelton.hpp" +#include +#include + #include "Area.hpp" #include "Area.hpp" #include "PU.hpp" @@ -33,29 +37,372 @@ using namespace CIMPP; -GovHydroPelton::GovHydroPelton(): qn(nullptr) {}; - +GovHydroPelton::GovHydroPelton() {}; GovHydroPelton::~GovHydroPelton() {}; +bool assign_GovHydroPelton_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->av1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qc0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_qn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_simplifiedPelton(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->simplifiedPelton; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_staticCompensating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->staticCompensating; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovHydroPelton_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twnc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twng; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->va; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valvmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_vav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vav; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_vcv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroPelton_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->waterTunnelSurgeChamberSimulation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroPelton_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - element->qn = dynamic_cast(BaseClass_ptr2); - if(element->qn != nullptr) - return true; - } - return false; +bool assign_GovHydroPelton_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zsfc; + if (buffer.fail()) + return false; + else + return true; + } + return false; } @@ -75,342 +422,31 @@ bool assign_GovHydroPelton_qn(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_pt -bool assign_GovHydroPelton_av0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_av1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->av1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_bp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_h1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroPelton_h2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_hn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_kc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_qc0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qc0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -bool assign_GovHydroPelton_simplifiedPelton(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->simplifiedPelton; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_staticCompensating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->staticCompensating; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_ts(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_twnc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twnc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_twng(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twng; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_tx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_va(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->va; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_valvmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_valvmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valvmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_vav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vav; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_vc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_vcv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_waterTunnelSurgeChamberSimulation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->waterTunnelSurgeChamberSimulation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroPelton_zsfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroPelton* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zsfc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroPelton_factory() { - return new GovHydroPelton; - } + + + + + + +const char GovHydroPelton::debugName[] = "GovHydroPelton"; +const char* GovHydroPelton::debugString() const +{ + return GovHydroPelton::debugName; } -void GovHydroPelton::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroPelton::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroPelton"), &GovHydroPelton_factory)); } -void GovHydroPelton::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydroPelton::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.av0"), &assign_GovHydroPelton_av0)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.av1"), &assign_GovHydroPelton_av1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.bp"), &assign_GovHydroPelton_bp)); @@ -422,7 +458,8 @@ void GovHydroPelton::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroPelton.qn"), &assign_GovHydroPelton_qn)); - } - -const char GovHydroPelton::debugName[] = "GovHydroPelton"; -const char* GovHydroPelton::debugString() +void GovHydroPelton::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroPelton::debugName; } const BaseClassDefiner GovHydroPelton::declare() @@ -455,4 +486,10 @@ const BaseClassDefiner GovHydroPelton::declare() return BaseClassDefiner(GovHydroPelton::addConstructToMap, GovHydroPelton::addPrimitiveAssignFnsToMap, GovHydroPelton::addClassAssignFnsToMap, GovHydroPelton::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroPelton_factory() + { + return new GovHydroPelton; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroPelton.hpp b/CGMES_2.4.15_27JAN2020/GovHydroPelton.hpp index 1cdd59f95..e891067ca 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroPelton.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroPelton.hpp @@ -1,72 +1,73 @@ #ifndef GovHydroPelton_H #define GovHydroPelton_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Area.hpp" -#include "PU.hpp" +#include "Boolean.hpp" #include "Frequency.hpp" #include "Length.hpp" -#include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" +#include "VolumeFlowRate.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class VolumeFlowRate; /* Detailed hydro unit - Pelton model. This model can be used to represent the dynamic related to water tunnel and surge chamber. A schematic of the hydraulic system of detailed hydro unit models, like Francis and Pelton, is located under the GovHydroFrancis class. */ - class GovHydroPelton: public TurbineGovernorDynamics + class GovHydroPelton : public TurbineGovernorDynamics { - public: - CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ - CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ - CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency db2; /* Intentional dead-band width of valve opening error (DB2). Unit = Hz. Typical Value = 0.01. Default: nullptr */ - CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ - CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ - CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ - CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ - CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = -0.025. Default: nullptr */ - CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.05. Default: nullptr */ - CIMPP::VolumeFlowRate* qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ - CIMPP::Boolean simplifiedPelton; /* Simplified Pelton model simulation (Sflag). true = enable of simplified Pelton model simulation false = enable of complete Pelton model simulation (non linear gain). Typical Value = false. Default: false */ - CIMPP::Boolean staticCompensating; /* Static compensating characteristic (Cflag). true = enable of static compensating characteristic false = inhibit of static compensating characteristic. Typical Value = false. Default: false */ - CIMPP::Seconds ta; /* Derivative gain (accelerometer time constant) (Ta). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.15. Default: nullptr */ - CIMPP::Seconds tv; /* Servomotor integrator time constant (TV). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds tx; /* Electronic integrator time constant (Tx). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.016. Default: nullptr */ - CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ - CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ - CIMPP::PU vav; /* Maximum servomotor valve opening velocity (Vav). Typical Value = 0.017. Default: nullptr */ - CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.016. Default: nullptr */ - CIMPP::PU vcv; /* Maximum servomotor valve closing velocity (Vcv). Typical Value = -0.017. Default: nullptr */ - CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ - CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroPelton(); - virtual ~GovHydroPelton(); - + ~GovHydroPelton() override; + + CIMPP::Area av0; /* Area of the surge tank (A). Unit = m. Typical Value = 30. Default: nullptr */ + CIMPP::Area av1; /* Area of the compensation tank (A). Unit = m. Typical Value = 700. Default: nullptr */ + CIMPP::PU bp; /* Droop (bp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (DB1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency db2; /* Intentional dead-band width of valve opening error (DB2). Unit = Hz. Typical Value = 0.01. Default: nullptr */ + CIMPP::Length h1; /* Head of compensation chamber water level with respect to the level of penstock (H). Unit = m. Typical Value = 4. Default: nullptr */ + CIMPP::Length h2; /* Head of surge tank water level with respect to the level of penstock (H). Unit = m. Typical Value = 40. Default: nullptr */ + CIMPP::Length hn; /* Rated hydraulic head (H). Unit = m. Typical Value = 250. Default: nullptr */ + CIMPP::PU kc; /* Penstock loss coefficient (due to friction) (Kc). Typical Value = 0.025. Default: nullptr */ + CIMPP::PU kg; /* Water tunnel and surge chamber loss coefficient (due to friction) (Kg). Typical Value = -0.025. Default: nullptr */ + CIMPP::PU qc0; /* No-load turbine flow at nominal head (Qc0). Typical Value = 0.05. Default: nullptr */ + CIMPP::VolumeFlowRate qn; /* Rated flow (Q). Unit = m/s. Typical Value = 40. Default: nullptr */ + CIMPP::Boolean simplifiedPelton; /* Simplified Pelton model simulation (Sflag). true = enable of simplified Pelton model simulation false = enable of complete Pelton model simulation (non linear gain). Typical Value = false. Default: false */ + CIMPP::Boolean staticCompensating; /* Static compensating characteristic (Cflag). true = enable of static compensating characteristic false = inhibit of static compensating characteristic. Typical Value = false. Default: false */ + CIMPP::Seconds ta; /* Derivative gain (accelerometer time constant) (Ta). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds ts; /* Gate servo time constant (Ts). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tv; /* Servomotor integrator time constant (TV). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds twnc; /* Water inertia time constant (Twnc). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds twng; /* Water tunnel and surge chamber inertia time constant (Twng). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds tx; /* Electronic integrator time constant (Tx). Typical Value = 0.5. Default: nullptr */ + CIMPP::Simple_Float va; /* Maximum gate opening velocity (Va). Unit = PU/sec. Typical Value = 0.016. Default: nullptr */ + CIMPP::PU valvmax; /* Maximum gate opening (ValvMax). Typical Value = 1. Default: nullptr */ + CIMPP::PU valvmin; /* Minimum gate opening (ValvMin). Typical Value = 0. Default: nullptr */ + CIMPP::PU vav; /* Maximum servomotor valve opening velocity (Vav). Typical Value = 0.017. Default: nullptr */ + CIMPP::Simple_Float vc; /* Maximum gate closing velocity (Vc). Unit = PU/sec. Typical Value = -0.016. Default: nullptr */ + CIMPP::PU vcv; /* Maximum servomotor valve closing velocity (Vcv). Typical Value = -0.017. Default: nullptr */ + CIMPP::Boolean waterTunnelSurgeChamberSimulation; /* Water tunnel and surge chamber simulation (Tflag). true = enable of water tunnel and surge chamber simulation false = inhibit of water tunnel and surge chamber simulation. Typical Value = false. Default: false */ + CIMPP::Length zsfc; /* Head of upper water level with respect to the level of penstock (Zsfc). Unit = m. Typical Value = 25. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroPelton_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroR.cpp b/CGMES_2.4.15_27JAN2020/GovHydroR.cpp index 42e1bcc8d..d4491f137 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroR.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroR.cpp @@ -1,39 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroR.hpp" +#include +#include + +#include "PU.hpp" +#include "Frequency.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Boolean.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -44,577 +34,657 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovHydroR::GovHydroR() {}; - GovHydroR::~GovHydroR() {}; +bool assign_GovHydroR_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->at; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qnl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroR_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroR* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroR_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroR_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_velop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_velcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_kg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_inputSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_at(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->at; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_qnl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qnl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_h0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroR_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroR* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroR_factory() { - return new GovHydroR; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroR::debugName[] = "GovHydroR"; +const char* GovHydroR::debugString() const +{ + return GovHydroR::debugName; } -void GovHydroR::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroR::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroR"), &GovHydroR_factory)); } -void GovHydroR::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovHydroR::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.at"), &assign_GovHydroR_at)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.db1"), &assign_GovHydroR_db1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.db2"), &assign_GovHydroR_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.dturb"), &assign_GovHydroR_dturb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.eps"), &assign_GovHydroR_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gmax"), &assign_GovHydroR_gmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gmin"), &assign_GovHydroR_gmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv1"), &assign_GovHydroR_gv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv2"), &assign_GovHydroR_gv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv3"), &assign_GovHydroR_gv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv4"), &assign_GovHydroR_gv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv5"), &assign_GovHydroR_gv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.gv6"), &assign_GovHydroR_gv6)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.h0"), &assign_GovHydroR_h0)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.inputSignal"), &assign_GovHydroR_inputSignal)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.kg"), &assign_GovHydroR_kg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.ki"), &assign_GovHydroR_ki)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.mwbase"), &assign_GovHydroR_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv1"), &assign_GovHydroR_pgv1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv2"), &assign_GovHydroR_pgv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv3"), &assign_GovHydroR_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv4"), &assign_GovHydroR_pgv4)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv5"), &assign_GovHydroR_pgv5)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pgv6"), &assign_GovHydroR_pgv6)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pmax"), &assign_GovHydroR_pmax)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.pmin"), &assign_GovHydroR_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroR.qnl"), &assign_GovHydroR_qnl)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.r"), &assign_GovHydroR_r)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroR.td"), &assign_GovHydroR_td)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.t1"), &assign_GovHydroR_t1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.t2"), &assign_GovHydroR_t2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroR.t3"), &assign_GovHydroR_t3)); @@ -623,44 +693,16 @@ void GovHydroR::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroR::debugName[] = "GovHydroR"; -const char* GovHydroR::debugString() +void GovHydroR::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroR::debugName; } const BaseClassDefiner GovHydroR::declare() @@ -668,4 +710,10 @@ const BaseClassDefiner GovHydroR::declare() return BaseClassDefiner(GovHydroR::addConstructToMap, GovHydroR::addPrimitiveAssignFnsToMap, GovHydroR::addClassAssignFnsToMap, GovHydroR::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroR_factory() + { + return new GovHydroR; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroR.hpp b/CGMES_2.4.15_27JAN2020/GovHydroR.hpp index 0a48d42e3..116b646d5 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroR.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroR.hpp @@ -1,84 +1,85 @@ #ifndef GovHydroR_H #define GovHydroR_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" -#include "Frequency.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Fourth order lead-lag governor and hydro turbine. */ - class GovHydroR: public TurbineGovernorDynamics + class GovHydroR : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::PU r; /* Steady-state droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1; /* Lead time constant 1 (T1). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t2; /* Lag time constant 1 (T2). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t3; /* Lead time constant 2 (T3). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t4; /* Lag time constant 2 (T4). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t5; /* Lead time constant 3 (T5). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t6; /* Lag time constant 3 (T6). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t7; /* Lead time constant 4 (T7). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t8; /* Lag time constant 4 (T8). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ - CIMPP::PU gmax; /* Maximum governor output (Gmax). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU gmin; /* Minimum governor output (Gmin). Typical Value = -0.05. Default: nullptr */ - CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ - CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ - CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ - CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ - CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroR(); - virtual ~GovHydroR(); - + ~GovHydroR() override; + + CIMPP::PU at; /* Turbine gain (At). Typical Value = 1.2. Default: nullptr */ + CIMPP::Frequency db1; /* Intentional dead-band width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional dead-band (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Typical Value = 0.2. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gmax; /* Maximum governor output (Gmax). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU gmin; /* Minimum governor output (Gmin). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain point 1, PU gv (Gv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain point 2, PU gv (Gv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain point 3, PU gv (Gv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain point 4, PU gv (Gv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain point 5, PU gv (Gv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain point 6, PU gv (Gv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU h0; /* Turbine nominal head (H0). Typical Value = 1. Default: nullptr */ + CIMPP::Boolean inputSignal; /* Input signal switch (Flag). true = Pe input is used false = feedback is received from CV. Flag is normally dependent on Tt. If Tf is zero, Flag is set to false. If Tf is not zero, Flag is set to true. Typical Value = true. Default: false */ + CIMPP::PU kg; /* Gate servo gain (Kg). Typical Value = 2. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0.5. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain point 1, PU power (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain point 2, PU power (Pgv2). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain point 3, PU power (Pgv3). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain point 4, PU power (Pgv4). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain point 5, PU power (Pgv5). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain point 6, PU power (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum gate opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum gate opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU qnl; /* No-load turbine flow at nominal head (Qnl). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU r; /* Steady-state droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t1; /* Lead time constant 1 (T1). Typical Value = 1.5. Default: nullptr */ + CIMPP::Seconds t2; /* Lag time constant 1 (T2). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3; /* Lead time constant 2 (T3). Typical Value = 1.5. Default: nullptr */ + CIMPP::Seconds t4; /* Lag time constant 2 (T4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t5; /* Lead time constant 3 (T5). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t6; /* Lag time constant 3 (T6). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t7; /* Lead time constant 4 (T7). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t8; /* Lag time constant 4 (T8). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds td; /* Input filter time constant (Td). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tp; /* Gate servo time constant (Tp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tt; /* Power feedback time constant (Tt). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float velcl; /* Maximum gate closing velocity (Velcl). Unit = PU/sec. Typical Value = -0.2. Default: nullptr */ + CIMPP::Simple_Float velop; /* Maximum gate opening velocity (Velop). Unit = PU/sec. Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroR_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroWEH.cpp b/CGMES_2.4.15_27JAN2020/GovHydroWEH.cpp index 62f9d50e6..5a81200a1 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroWEH.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroWEH.cpp @@ -1,28 +1,23 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroWEH.hpp" -#include "ActivePower.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -43,6 +38,7 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -53,721 +49,761 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovHydroWEH::GovHydroWEH() {}; - GovHydroWEH::~GovHydroWEH() {}; +bool assign_GovHydroWEH_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_dicn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dicn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_dpv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dturb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->feedbackSignal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fl5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_fp9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fp9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gtmxcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gtmxcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gtmxop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gtmxop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_pmss9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmss9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_rpg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rpg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_rpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tdv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWEH_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroWEH_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_rpg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rpg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_rpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWEH_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tdv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gtmxop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gtmxop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gtmxcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gtmxcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_dturb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dturb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_dpv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_dicn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dicn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_feedbackSignal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->feedbackSignal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fl5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_fp10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fp10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovHydroWEH_pmss10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWEH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmss10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovHydroWEH_factory() { - return new GovHydroWEH; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovHydroWEH::debugName[] = "GovHydroWEH"; +const char* GovHydroWEH::debugString() const +{ + return GovHydroWEH::debugName; } -void GovHydroWEH::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroWEH::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroWEH"), &GovHydroWEH_factory)); } -void GovHydroWEH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.mwbase"), &assign_GovHydroWEH_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.rpg"), &assign_GovHydroWEH_rpg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.rpp"), &assign_GovHydroWEH_rpp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tpe"), &assign_GovHydroWEH_tpe)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.kp"), &assign_GovHydroWEH_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.ki"), &assign_GovHydroWEH_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.kd"), &assign_GovHydroWEH_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.td"), &assign_GovHydroWEH_td)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tp"), &assign_GovHydroWEH_tp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tdv"), &assign_GovHydroWEH_tdv)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tg"), &assign_GovHydroWEH_tg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gtmxop"), &assign_GovHydroWEH_gtmxop)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gtmxcl"), &assign_GovHydroWEH_gtmxcl)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gmax"), &assign_GovHydroWEH_gmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gmin"), &assign_GovHydroWEH_gmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dturb"), &assign_GovHydroWEH_dturb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.tw"), &assign_GovHydroWEH_tw)); +void GovHydroWEH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.db"), &assign_GovHydroWEH_db)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dpv"), &assign_GovHydroWEH_dpv)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dicn"), &assign_GovHydroWEH_dicn)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dpv"), &assign_GovHydroWEH_dpv)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.dturb"), &assign_GovHydroWEH_dturb)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.feedbackSignal"), &assign_GovHydroWEH_feedbackSignal)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv1"), &assign_GovHydroWEH_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv2"), &assign_GovHydroWEH_gv2)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv3"), &assign_GovHydroWEH_gv3)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv4"), &assign_GovHydroWEH_gv4)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.gv5"), &assign_GovHydroWEH_gv5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl1"), &assign_GovHydroWEH_fl1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl2"), &assign_GovHydroWEH_fl2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl3"), &assign_GovHydroWEH_fl3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl4"), &assign_GovHydroWEH_fl4)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fl5"), &assign_GovHydroWEH_fl5)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp1"), &assign_GovHydroWEH_fp1)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp10"), &assign_GovHydroWEH_fp10)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp2"), &assign_GovHydroWEH_fp2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp3"), &assign_GovHydroWEH_fp3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWEH.fp4"), &assign_GovHydroWEH_fp4)); @@ -776,8 +812,21 @@ void GovHydroWEH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroWEH::debugName[] = "GovHydroWEH"; -const char* GovHydroWEH::debugString() +void GovHydroWEH::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroWEH::debugName; } const BaseClassDefiner GovHydroWEH::declare() @@ -803,4 +854,10 @@ const BaseClassDefiner GovHydroWEH::declare() return BaseClassDefiner(GovHydroWEH::addConstructToMap, GovHydroWEH::addPrimitiveAssignFnsToMap, GovHydroWEH::addClassAssignFnsToMap, GovHydroWEH::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroWEH_factory() + { + return new GovHydroWEH; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroWEH.hpp b/CGMES_2.4.15_27JAN2020/GovHydroWEH.hpp index 5836eb6b8..acefea27a 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroWEH.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroWEH.hpp @@ -1,92 +1,93 @@ #ifndef GovHydroWEH_H #define GovHydroWEH_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Woodward Electric Hydro Governor Model. */ - class GovHydroWEH: public TurbineGovernorDynamics + class GovHydroWEH : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Simple_Float rpg; /* Permanent droop for governor output feedback (R-Perm-Gate). Default: nullptr */ - CIMPP::Simple_Float rpp; /* Permanent droop for electrical power feedback (R-Perm-Pe). Default: nullptr */ - CIMPP::Seconds tpe; /* Electrical power droop time constant (Tpe). Default: nullptr */ - CIMPP::PU kp; /* Derivative control gain (Kp). Default: nullptr */ - CIMPP::PU ki; /* Derivative controller Integral gain (Ki). Default: nullptr */ - CIMPP::PU kd; /* Derivative controller derivative gain (Kd). Default: nullptr */ - CIMPP::Seconds td; /* Derivative controller time constant to limit the derivative characteristic beyond a breakdown frequency to avoid amplification of high-frequency noise (Td). Default: nullptr */ - CIMPP::Seconds tp; /* Pilot Valve time lag time constant (Tp). Default: nullptr */ - CIMPP::Seconds tdv; /* Distributive Valve time lag time constant (Tdv). Default: nullptr */ - CIMPP::Seconds tg; /* Value to allow the Distribution valve controller to advance beyond the gate movement rate limit (Tg). Default: nullptr */ - CIMPP::PU gtmxop; /* Maximum gate opening rate (Gtmxop). Default: nullptr */ - CIMPP::PU gtmxcl; /* Maximum gate closing rate (Gtmxcl). Default: nullptr */ - CIMPP::PU gmax; /* Maximum Gate Position (Gmax). Default: nullptr */ - CIMPP::PU gmin; /* Minimum Gate Position (Gmin). Default: nullptr */ - CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Default: nullptr */ - CIMPP::PU db; /* Speed Dead Band (db). Default: nullptr */ - CIMPP::PU dpv; /* Value to allow the Pilot valve controller to advance beyond the gate limits (Dpv). Default: nullptr */ - CIMPP::PU dicn; /* Value to allow the integral controller to advance beyond the gate limits (Dicn). Default: nullptr */ - CIMPP::Boolean feedbackSignal; /* Feedback signal selection (Sw). true = PID Output (if R-Perm-Gate=droop and R-Perm-Pe=0) false = Electrical Power (if R-Perm-Gate=0 and R-Perm-Pe=droop) or false = Gate Position (if R-Perm-Gate=droop and R-Perm-Pe=0). Default: false */ - CIMPP::PU gv1; /* Gate 1 (Gv1). Gate Position value for point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv2; /* Gate 2 (Gv2). Gate Position value for point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv3; /* Gate 3 (Gv3). Gate Position value for point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv4; /* Gate 4 (Gv4). Gate Position value for point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU gv5; /* Gate 5 (Gv5). Gate Position value for point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl1; /* Flow Gate 1 (Fl1). Flow value for gate position point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl2; /* Flow Gate 2 (Fl2). Flow value for gate position point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl3; /* Flow Gate 3 (Fl3). Flow value for gate position point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl4; /* Flow Gate 4 (Fl4). Flow value for gate position point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fl5; /* Flow Gate 5 (Fl5). Flow value for gate position point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ - CIMPP::PU fp1; /* Flow P1 (Fp1). Turbine Flow value for point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp2; /* Flow P2 (Fp2). Turbine Flow value for point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp3; /* Flow P3 (Fp3). Turbine Flow value for point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp4; /* Flow P4 (Fp4). Turbine Flow value for point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp5; /* Flow P5 (Fp5). Turbine Flow value for point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp6; /* Flow P6 (Fp6). Turbine Flow value for point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp7; /* Flow P7 (Fp7). Turbine Flow value for point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp8; /* Flow P8 (Fp8). Turbine Flow value for point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp9; /* Flow P9 (Fp9). Turbine Flow value for point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU fp10; /* Flow P10 (Fp10). Turbine Flow value for point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss1; /* Pmss Flow P1 (Pmss1). Mechanical Power output Pmss for Turbine Flow point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss2; /* Pmss Flow P2 (Pmss2). Mechanical Power output Pmss for Turbine Flow point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss3; /* Pmss Flow P3 (Pmss3). Mechanical Power output Pmss for Turbine Flow point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss4; /* Pmss Flow P4 (Pmss4). Mechanical Power output Pmss for Turbine Flow point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss5; /* Pmss Flow P5 (Pmss5). Mechanical Power output Pmss for Turbine Flow point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss6; /* Pmss Flow P6 (Pmss6). Mechanical Power output Pmss for Turbine Flow point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss7; /* Pmss Flow P7 (Pmss7). Mechanical Power output Pmss for Turbine Flow point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss8; /* Pmss Flow P8 (Pmss8). Mechanical Power output Pmss for Turbine Flow point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss9; /* Pmss Flow P9 (Pmss9). Mechanical Power output Pmss for Turbine Flow point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - CIMPP::PU pmss10; /* Pmss Flow P10 (Pmss10). Mechanical Power output Pmss for Turbine Flow point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroWEH(); - virtual ~GovHydroWEH(); - + ~GovHydroWEH() override; + + CIMPP::PU db; /* Speed Dead Band (db). Default: nullptr */ + CIMPP::PU dicn; /* Value to allow the integral controller to advance beyond the gate limits (Dicn). Default: nullptr */ + CIMPP::PU dpv; /* Value to allow the Pilot valve controller to advance beyond the gate limits (Dpv). Default: nullptr */ + CIMPP::PU dturb; /* Turbine damping factor (Dturb). Unit = delta P (PU of MWbase) / delta speed (PU). Default: nullptr */ + CIMPP::Boolean feedbackSignal; /* Feedback signal selection (Sw). true = PID Output (if R-Perm-Gate=droop and R-Perm-Pe=0) false = Electrical Power (if R-Perm-Gate=0 and R-Perm-Pe=droop) or false = Gate Position (if R-Perm-Gate=droop and R-Perm-Pe=0). Default: false */ + CIMPP::PU fl1; /* Flow Gate 1 (Fl1). Flow value for gate position point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl2; /* Flow Gate 2 (Fl2). Flow value for gate position point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl3; /* Flow Gate 3 (Fl3). Flow value for gate position point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl4; /* Flow Gate 4 (Fl4). Flow value for gate position point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fl5; /* Flow Gate 5 (Fl5). Flow value for gate position point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU fp1; /* Flow P1 (Fp1). Turbine Flow value for point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp10; /* Flow P10 (Fp10). Turbine Flow value for point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp2; /* Flow P2 (Fp2). Turbine Flow value for point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp3; /* Flow P3 (Fp3). Turbine Flow value for point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp4; /* Flow P4 (Fp4). Turbine Flow value for point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp5; /* Flow P5 (Fp5). Turbine Flow value for point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp6; /* Flow P6 (Fp6). Turbine Flow value for point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp7; /* Flow P7 (Fp7). Turbine Flow value for point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp8; /* Flow P8 (Fp8). Turbine Flow value for point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU fp9; /* Flow P9 (Fp9). Turbine Flow value for point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU gmax; /* Maximum Gate Position (Gmax). Default: nullptr */ + CIMPP::PU gmin; /* Minimum Gate Position (Gmin). Default: nullptr */ + CIMPP::PU gtmxcl; /* Maximum gate closing rate (Gtmxcl). Default: nullptr */ + CIMPP::PU gtmxop; /* Maximum gate opening rate (Gtmxop). Default: nullptr */ + CIMPP::PU gv1; /* Gate 1 (Gv1). Gate Position value for point 1 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv2; /* Gate 2 (Gv2). Gate Position value for point 2 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv3; /* Gate 3 (Gv3). Gate Position value for point 3 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv4; /* Gate 4 (Gv4). Gate Position value for point 4 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU gv5; /* Gate 5 (Gv5). Gate Position value for point 5 for lookup table representing water flow through the turbine as a function of gate position to produce steady state flow. Default: nullptr */ + CIMPP::PU kd; /* Derivative controller derivative gain (Kd). Default: nullptr */ + CIMPP::PU ki; /* Derivative controller Integral gain (Ki). Default: nullptr */ + CIMPP::PU kp; /* Derivative control gain (Kp). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmss1; /* Pmss Flow P1 (Pmss1). Mechanical Power output Pmss for Turbine Flow point 1 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss10; /* Pmss Flow P10 (Pmss10). Mechanical Power output Pmss for Turbine Flow point 10 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss2; /* Pmss Flow P2 (Pmss2). Mechanical Power output Pmss for Turbine Flow point 2 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss3; /* Pmss Flow P3 (Pmss3). Mechanical Power output Pmss for Turbine Flow point 3 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss4; /* Pmss Flow P4 (Pmss4). Mechanical Power output Pmss for Turbine Flow point 4 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss5; /* Pmss Flow P5 (Pmss5). Mechanical Power output Pmss for Turbine Flow point 5 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss6; /* Pmss Flow P6 (Pmss6). Mechanical Power output Pmss for Turbine Flow point 6 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss7; /* Pmss Flow P7 (Pmss7). Mechanical Power output Pmss for Turbine Flow point 7 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss8; /* Pmss Flow P8 (Pmss8). Mechanical Power output Pmss for Turbine Flow point 8 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::PU pmss9; /* Pmss Flow P9 (Pmss9). Mechanical Power output Pmss for Turbine Flow point 9 for lookup table representing per unit mechanical power on machine MVA rating as a function of turbine flow. Default: nullptr */ + CIMPP::Simple_Float rpg; /* Permanent droop for governor output feedback (R-Perm-Gate). Default: nullptr */ + CIMPP::Simple_Float rpp; /* Permanent droop for electrical power feedback (R-Perm-Pe). Default: nullptr */ + CIMPP::Seconds td; /* Derivative controller time constant to limit the derivative characteristic beyond a breakdown frequency to avoid amplification of high-frequency noise (Td). Default: nullptr */ + CIMPP::Seconds tdv; /* Distributive Valve time lag time constant (Tdv). Default: nullptr */ + CIMPP::Seconds tg; /* Value to allow the Distribution valve controller to advance beyond the gate movement rate limit (Tg). Default: nullptr */ + CIMPP::Seconds tp; /* Pilot Valve time lag time constant (Tp). Default: nullptr */ + CIMPP::Seconds tpe; /* Electrical power droop time constant (Tpe). Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroWEH_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovHydroWPID.cpp b/CGMES_2.4.15_27JAN2020/GovHydroWPID.cpp index 1bc4b1d82..951e73be7 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroWPID.cpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroWPID.cpp @@ -1,366 +1,388 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovHydroWPID.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; GovHydroWPID::GovHydroWPID() {}; - GovHydroWPID::~GovHydroWPID() {}; +bool assign_GovHydroWPID_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gatmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gatmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gatmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gatmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_reg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->reg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->treg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovHydroWPID_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->velmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovHydroWPID_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_treg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->treg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_reg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->reg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_velmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_velmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->velmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gatmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gatmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gatmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gatmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovHydroWPID_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovHydroWPID* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovHydroWPID_factory() { - return new GovHydroWPID; - } +const char GovHydroWPID::debugName[] = "GovHydroWPID"; +const char* GovHydroWPID::debugString() const +{ + return GovHydroWPID::debugName; } -void GovHydroWPID::addConstructToMap(std::unordered_map& factory_map) { +void GovHydroWPID::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovHydroWPID"), &GovHydroWPID_factory)); } -void GovHydroWPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.mwbase"), &assign_GovHydroWPID_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.treg"), &assign_GovHydroWPID_treg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.reg"), &assign_GovHydroWPID_reg)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kp"), &assign_GovHydroWPID_kp)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ki"), &assign_GovHydroWPID_ki)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kd"), &assign_GovHydroWPID_kd)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ta"), &assign_GovHydroWPID_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tb"), &assign_GovHydroWPID_tb)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmax"), &assign_GovHydroWPID_velmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmin"), &assign_GovHydroWPID_velmin)); +void GovHydroWPID::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.d"), &assign_GovHydroWPID_d)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gatmax"), &assign_GovHydroWPID_gatmax)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gatmin"), &assign_GovHydroWPID_gatmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tw"), &assign_GovHydroWPID_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmax"), &assign_GovHydroWPID_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmin"), &assign_GovHydroWPID_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.d"), &assign_GovHydroWPID_d)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv3"), &assign_GovHydroWPID_gv3)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv1"), &assign_GovHydroWPID_gv1)); - assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv1"), &assign_GovHydroWPID_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv2"), &assign_GovHydroWPID_gv2)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.gv3"), &assign_GovHydroWPID_gv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kd"), &assign_GovHydroWPID_kd)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ki"), &assign_GovHydroWPID_ki)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.kp"), &assign_GovHydroWPID_kp)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.mwbase"), &assign_GovHydroWPID_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv1"), &assign_GovHydroWPID_pgv1)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv2"), &assign_GovHydroWPID_pgv2)); assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pgv3"), &assign_GovHydroWPID_pgv3)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmax"), &assign_GovHydroWPID_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.pmin"), &assign_GovHydroWPID_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.reg"), &assign_GovHydroWPID_reg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.ta"), &assign_GovHydroWPID_ta)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tb"), &assign_GovHydroWPID_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.treg"), &assign_GovHydroWPID_treg)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.tw"), &assign_GovHydroWPID_tw)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmax"), &assign_GovHydroWPID_velmax)); + assign_map.insert(std::make_pair(std::string("cim:GovHydroWPID.velmin"), &assign_GovHydroWPID_velmin)); } -void GovHydroWPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovHydroWPID::debugName[] = "GovHydroWPID"; -const char* GovHydroWPID::debugString() +void GovHydroWPID::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovHydroWPID::debugName; } const BaseClassDefiner GovHydroWPID::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner GovHydroWPID::declare() return BaseClassDefiner(GovHydroWPID::addConstructToMap, GovHydroWPID::addPrimitiveAssignFnsToMap, GovHydroWPID::addClassAssignFnsToMap, GovHydroWPID::debugName); } - +namespace CIMPP +{ + BaseClass* GovHydroWPID_factory() + { + return new GovHydroWPID; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovHydroWPID.hpp b/CGMES_2.4.15_27JAN2020/GovHydroWPID.hpp index a9fe2c041..fb769d79e 100644 --- a/CGMES_2.4.15_27JAN2020/GovHydroWPID.hpp +++ b/CGMES_2.4.15_27JAN2020/GovHydroWPID.hpp @@ -1,61 +1,62 @@ #ifndef GovHydroWPID_H #define GovHydroWPID_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Woodward PID Hydro Governor. */ - class GovHydroWPID: public TurbineGovernorDynamics + class GovHydroWPID : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds treg; /* Speed detector time constant (Treg). Default: nullptr */ - CIMPP::PU reg; /* Permanent drop (Reg). Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ki; /* Reset gain (Ki). Typical Value = 0.36. Default: nullptr */ - CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ - CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::PU velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ - CIMPP::PU gatmax; /* Gate opening Limit Maximum (Gatmax). Default: nullptr */ - CIMPP::PU gatmin; /* Gate opening Limit Minimum (Gatmin). Default: nullptr */ - CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ - CIMPP::PU pmax; /* Maximum Power Output (Pmax). Default: nullptr */ - CIMPP::PU pmin; /* Minimum Power Output (Pmin). Default: nullptr */ - CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Default: nullptr */ - CIMPP::PU gv3; /* Gate position 3 (Gv3). Default: nullptr */ - CIMPP::PU gv1; /* Gate position 1 (Gv1). Default: nullptr */ - CIMPP::PU pgv1; /* Output at Gv1 PU of MWbase (Pgv1). Default: nullptr */ - CIMPP::PU gv2; /* Gate position 2 (Gv2). Default: nullptr */ - CIMPP::PU pgv2; /* Output at Gv2 PU of MWbase (Pgv2). Default: nullptr */ - CIMPP::PU pgv3; /* Output at Gv3 PU of MWbase (Pgv3). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovHydroWPID(); - virtual ~GovHydroWPID(); - + ~GovHydroWPID() override; + + CIMPP::PU d; /* Turbine damping factor (D). Unit = delta P / delta speed. Default: nullptr */ + CIMPP::PU gatmax; /* Gate opening Limit Maximum (Gatmax). Default: nullptr */ + CIMPP::PU gatmin; /* Gate opening Limit Minimum (Gatmin). Default: nullptr */ + CIMPP::PU gv1; /* Gate position 1 (Gv1). Default: nullptr */ + CIMPP::PU gv2; /* Gate position 2 (Gv2). Default: nullptr */ + CIMPP::PU gv3; /* Gate position 3 (Gv3). Default: nullptr */ + CIMPP::PU kd; /* Derivative gain (Kd). Typical Value = 1.11. Default: nullptr */ + CIMPP::PU ki; /* Reset gain (Ki). Typical Value = 0.36. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0.1. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Output at Gv1 PU of MWbase (Pgv1). Default: nullptr */ + CIMPP::PU pgv2; /* Output at Gv2 PU of MWbase (Pgv2). Default: nullptr */ + CIMPP::PU pgv3; /* Output at Gv3 PU of MWbase (Pgv3). Default: nullptr */ + CIMPP::PU pmax; /* Maximum Power Output (Pmax). Default: nullptr */ + CIMPP::PU pmin; /* Minimum Power Output (Pmin). Default: nullptr */ + CIMPP::PU reg; /* Permanent drop (Reg). Default: nullptr */ + CIMPP::Seconds ta; /* Controller time constant (Ta) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Gate servo time constant (Tb) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds treg; /* Speed detector time constant (Treg). Default: nullptr */ + CIMPP::Seconds tw; /* Water inertia time constant (Tw) (>0). Typical Value = 0. Default: nullptr */ + CIMPP::PU velmax; /* Maximum gate opening velocity (Velmax). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + CIMPP::PU velmin; /* Maximum gate closing velocity (Velmin). Unit = PU/sec. Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovHydroWPID_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteam0.cpp b/CGMES_2.4.15_27JAN2020/GovSteam0.cpp index 09842372b..a1e1a0254 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteam0.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteam0.cpp @@ -1,156 +1,164 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteam0.hpp" +#include +#include + +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovSteam0::GovSteam0() {}; - GovSteam0::~GovSteam0() {}; +bool assign_GovSteam0_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam0_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam0* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteam0_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam0_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam0* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteam0_factory() { - return new GovSteam0; - } +const char GovSteam0::debugName[] = "GovSteam0"; +const char* GovSteam0::debugString() const +{ + return GovSteam0::debugName; } -void GovSteam0::addConstructToMap(std::unordered_map& factory_map) { +void GovSteam0::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteam0"), &GovSteam0_factory)); } -void GovSteam0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteam0::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteam0.dt"), &assign_GovSteam0_dt)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.mwbase"), &assign_GovSteam0_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.r"), &assign_GovSteam0_r)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.t1"), &assign_GovSteam0_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmax"), &assign_GovSteam0_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmin"), &assign_GovSteam0_vmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.t2"), &assign_GovSteam0_t2)); assign_map.insert(std::make_pair(std::string("cim:GovSteam0.t3"), &assign_GovSteam0_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam0.dt"), &assign_GovSteam0_dt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmax"), &assign_GovSteam0_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam0.vmin"), &assign_GovSteam0_vmin)); } -void GovSteam0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteam0::debugName[] = "GovSteam0"; -const char* GovSteam0::debugString() +void GovSteam0::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteam0::debugName; } const BaseClassDefiner GovSteam0::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner GovSteam0::declare() return BaseClassDefiner(GovSteam0::addConstructToMap, GovSteam0::addPrimitiveAssignFnsToMap, GovSteam0::addClassAssignFnsToMap, GovSteam0::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteam0_factory() + { + return new GovSteam0; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteam0.hpp b/CGMES_2.4.15_27JAN2020/GovSteam0.hpp index d25f0238a..942e644f8 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteam0.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteam0.hpp @@ -1,47 +1,48 @@ #ifndef GovSteam0_H #define GovSteam0_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A simplified steam turbine governor model. */ - class GovSteam0: public TurbineGovernorDynamics + class GovSteam0 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1; /* Steam bowl time constant (T1). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU vmax; /* Maximum valve position, PU of mwcap (Vmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU vmin; /* Minimum valve position, PU of mwcap (Vmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Numerator time constant of T2/T3 block (T2). Typical Value = 3. Default: nullptr */ - CIMPP::Seconds t3; /* Reheater time constant (T3). Typical Value = 10. Default: nullptr */ - CIMPP::PU dt; /* Turbine damping coefficient (Dt). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteam0(); - virtual ~GovSteam0(); - + ~GovSteam0() override; + + CIMPP::PU dt; /* Turbine damping coefficient (Dt). Unit = delta P / delta speed. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU r; /* Permanent droop (R). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t1; /* Steam bowl time constant (T1). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t2; /* Numerator time constant of T2/T3 block (T2). Typical Value = 3. Default: nullptr */ + CIMPP::Seconds t3; /* Reheater time constant (T3). Typical Value = 10. Default: nullptr */ + CIMPP::PU vmax; /* Maximum valve position, PU of mwcap (Vmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU vmin; /* Minimum valve position, PU of mwcap (Vmin). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteam0_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteam1.cpp b/CGMES_2.4.15_27JAN2020/GovSteam1.cpp index a41c168bc..ef3c598f9 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteam1.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteam1.cpp @@ -1,38 +1,30 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteam1.hpp" +#include +#include + +#include "Frequency.hpp" #include "ActivePower.hpp" +#include "Frequency.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" -#include "Boolean.hpp" #include "ActivePower.hpp" -#include "Boolean.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -41,581 +33,628 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Boolean.hpp" using namespace CIMPP; GovSteam1::GovSteam1() {}; - GovSteam1::~GovSteam1() {}; +bool assign_GovSteam1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pgv6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_sdb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sdb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_sdb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sdb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam1_valve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->valve; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteam1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_eps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_sdb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sdb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_sdb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sdb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_valve(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->valve; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_gv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteam1_pgv6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pgv6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteam1_factory() { - return new GovSteam1; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovSteam1::debugName[] = "GovSteam1"; +const char* GovSteam1::debugString() const +{ + return GovSteam1::debugName; } -void GovSteam1::addConstructToMap(std::unordered_map& factory_map) { +void GovSteam1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteam1"), &GovSteam1_factory)); } -void GovSteam1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.mwbase"), &assign_GovSteam1_mwbase)); +void GovSteam1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db1"), &assign_GovSteam1_db1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db2"), &assign_GovSteam1_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.eps"), &assign_GovSteam1_eps)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv1"), &assign_GovSteam1_gv1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv2"), &assign_GovSteam1_gv2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv3"), &assign_GovSteam1_gv3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv4"), &assign_GovSteam1_gv4)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv5"), &assign_GovSteam1_gv5)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv6"), &assign_GovSteam1_gv6)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k"), &assign_GovSteam1_k)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t1"), &assign_GovSteam1_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t2"), &assign_GovSteam1_t2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t3"), &assign_GovSteam1_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uo"), &assign_GovSteam1_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uc"), &assign_GovSteam1_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmax"), &assign_GovSteam1_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmin"), &assign_GovSteam1_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t4"), &assign_GovSteam1_t4)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k1"), &assign_GovSteam1_k1)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k2"), &assign_GovSteam1_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t5"), &assign_GovSteam1_t5)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k3"), &assign_GovSteam1_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k4"), &assign_GovSteam1_k4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t6"), &assign_GovSteam1_t6)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k5"), &assign_GovSteam1_k5)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k6"), &assign_GovSteam1_k6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t7"), &assign_GovSteam1_t7)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k7"), &assign_GovSteam1_k7)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.k8"), &assign_GovSteam1_k8)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db1"), &assign_GovSteam1_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.eps"), &assign_GovSteam1_eps)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb1"), &assign_GovSteam1_sdb1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb2"), &assign_GovSteam1_sdb2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.db2"), &assign_GovSteam1_db2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.valve"), &assign_GovSteam1_valve)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv1"), &assign_GovSteam1_gv1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.mwbase"), &assign_GovSteam1_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv1"), &assign_GovSteam1_pgv1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv2"), &assign_GovSteam1_gv2)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv2"), &assign_GovSteam1_pgv2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv3"), &assign_GovSteam1_gv3)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv3"), &assign_GovSteam1_pgv3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv4"), &assign_GovSteam1_gv4)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv4"), &assign_GovSteam1_pgv4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv5"), &assign_GovSteam1_gv5)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv5"), &assign_GovSteam1_pgv5)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam1.gv6"), &assign_GovSteam1_gv6)); assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pgv6"), &assign_GovSteam1_pgv6)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmax"), &assign_GovSteam1_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.pmin"), &assign_GovSteam1_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb1"), &assign_GovSteam1_sdb1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.sdb2"), &assign_GovSteam1_sdb2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t1"), &assign_GovSteam1_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t2"), &assign_GovSteam1_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t3"), &assign_GovSteam1_t3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t4"), &assign_GovSteam1_t4)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t5"), &assign_GovSteam1_t5)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t6"), &assign_GovSteam1_t6)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.t7"), &assign_GovSteam1_t7)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uc"), &assign_GovSteam1_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.uo"), &assign_GovSteam1_uo)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam1.valve"), &assign_GovSteam1_valve)); } -void GovSteam1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteam1::debugName[] = "GovSteam1"; -const char* GovSteam1::debugString() +void GovSteam1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteam1::debugName; } const BaseClassDefiner GovSteam1::declare() @@ -623,4 +662,10 @@ const BaseClassDefiner GovSteam1::declare() return BaseClassDefiner(GovSteam1::addConstructToMap, GovSteam1::addPrimitiveAssignFnsToMap, GovSteam1::addClassAssignFnsToMap, GovSteam1::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteam1_factory() + { + return new GovSteam1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteam1.hpp b/CGMES_2.4.15_27JAN2020/GovSteam1.hpp index 02b477df4..ee0ccf5fb 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteam1.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteam1.hpp @@ -1,81 +1,82 @@ #ifndef GovSteam1_H #define GovSteam1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "Boolean.hpp" +#include "Frequency.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -#include "Frequency.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Steam turbine governor model, based on the GovSteamIEEE1 model (with optional deadband and nonlinear valve gain added). */ - class GovSteam1: public TurbineGovernorDynamics + class GovSteam1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (>0). Typical Value = 25. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Valve positioner time constant (T3(>0). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (>0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ - CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>=0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ - CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ - CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ - CIMPP::Boolean sdb1; /* Intentional deadband indicator. true = intentional deadband is applied false = intentional deadband is not applied. Typical Value = true. Default: false */ - CIMPP::Boolean sdb2; /* Unintentional deadband location. true = intentional deadband is applied before point `A` false = intentional deadband is applied after point `A`. Typical Value = true. Default: false */ - CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ - CIMPP::Boolean valve; /* Nonlinear valve characteristic. true = nonlinear valve characteristic is used false = nonlinear valve characteristic is not used. Typical Value = true. Default: false */ - CIMPP::PU gv1; /* Nonlinear gain valve position point 1 (GV1). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv1; /* Nonlinear gain power value point 1 (Pgv1). Typical Value = 0. Default: nullptr */ - CIMPP::PU gv2; /* Nonlinear gain valve position point 2 (GV2). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU pgv2; /* Nonlinear gain power value point 2 (Pgv2). Typical Value = 0.75. Default: nullptr */ - CIMPP::PU gv3; /* Nonlinear gain valve position point 3 (GV3). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU pgv3; /* Nonlinear gain power value point 3 (Pgv3). Typical Value = 0.91. Default: nullptr */ - CIMPP::PU gv4; /* Nonlinear gain valve position point 4 (GV4). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU pgv4; /* Nonlinear gain power value point 4 (Pgv4). Typical Value = 0.98. Default: nullptr */ - CIMPP::PU gv5; /* Nonlinear gain valve position point 5 (GV5). Typical Value = 1. Default: nullptr */ - CIMPP::PU pgv5; /* Nonlinear gain power value point 5 (Pgv5). Typical Value = 1. Default: nullptr */ - CIMPP::PU gv6; /* Nonlinear gain valve position point 6 (GV6). Typical Value = 0. Default: nullptr */ - CIMPP::PU pgv6; /* Nonlinear gain power value point 6 (Pgv6). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteam1(); - virtual ~GovSteam1(); - + ~GovSteam1() override; + + CIMPP::Frequency db1; /* Intentional deadband width (db1). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower db2; /* Unintentional deadband (db2). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Frequency eps; /* Intentional db hysteresis (eps). Unit = Hz. Typical Value = 0. Default: nullptr */ + CIMPP::PU gv1; /* Nonlinear gain valve position point 1 (GV1). Typical Value = 0. Default: nullptr */ + CIMPP::PU gv2; /* Nonlinear gain valve position point 2 (GV2). Typical Value = 0.4. Default: nullptr */ + CIMPP::PU gv3; /* Nonlinear gain valve position point 3 (GV3). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU gv4; /* Nonlinear gain valve position point 4 (GV4). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU gv5; /* Nonlinear gain valve position point 5 (GV5). Typical Value = 1. Default: nullptr */ + CIMPP::PU gv6; /* Nonlinear gain valve position point 6 (GV6). Typical Value = 0. Default: nullptr */ + CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (>0). Typical Value = 25. Default: nullptr */ + CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ + CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ + CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pgv1; /* Nonlinear gain power value point 1 (Pgv1). Typical Value = 0. Default: nullptr */ + CIMPP::PU pgv2; /* Nonlinear gain power value point 2 (Pgv2). Typical Value = 0.75. Default: nullptr */ + CIMPP::PU pgv3; /* Nonlinear gain power value point 3 (Pgv3). Typical Value = 0.91. Default: nullptr */ + CIMPP::PU pgv4; /* Nonlinear gain power value point 4 (Pgv4). Typical Value = 0.98. Default: nullptr */ + CIMPP::PU pgv5; /* Nonlinear gain power value point 5 (Pgv5). Typical Value = 1. Default: nullptr */ + CIMPP::PU pgv6; /* Nonlinear gain power value point 6 (Pgv6). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>=0). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean sdb1; /* Intentional deadband indicator. true = intentional deadband is applied false = intentional deadband is not applied. Typical Value = true. Default: false */ + CIMPP::Boolean sdb2; /* Unintentional deadband location. true = intentional deadband is applied before point `A` false = intentional deadband is applied after point `A`. Typical Value = true. Default: false */ + CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Valve positioner time constant (T3(>0). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (<0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (>0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ + CIMPP::Boolean valve; /* Nonlinear valve characteristic. true = nonlinear valve characteristic is used false = nonlinear valve characteristic is not used. Typical Value = true. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteam1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteam2.cpp b/CGMES_2.4.15_27JAN2020/GovSteam2.cpp index 7fa5c8ba4..dae038a86 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteam2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteam2.cpp @@ -1,156 +1,164 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteam2.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; GovSteam2::GovSteam2() {}; - GovSteam2::~GovSteam2() {}; +bool assign_GovSteam2_dbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteam2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteam2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteam2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_dbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteam2_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteam2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteam2_factory() { - return new GovSteam2; - } +const char GovSteam2::debugName[] = "GovSteam2"; +const char* GovSteam2::debugString() const +{ + return GovSteam2::debugName; } -void GovSteam2::addConstructToMap(std::unordered_map& factory_map) { +void GovSteam2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteam2"), &GovSteam2_factory)); } -void GovSteam2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.k"), &assign_GovSteam2_k)); +void GovSteam2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovSteam2.dbf"), &assign_GovSteam2_dbf)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t1"), &assign_GovSteam2_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t2"), &assign_GovSteam2_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.k"), &assign_GovSteam2_k)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mnef"), &assign_GovSteam2_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mxef"), &assign_GovSteam2_mxef)); assign_map.insert(std::make_pair(std::string("cim:GovSteam2.pmax"), &assign_GovSteam2_pmax)); assign_map.insert(std::make_pair(std::string("cim:GovSteam2.pmin"), &assign_GovSteam2_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mxef"), &assign_GovSteam2_mxef)); - assign_map.insert(std::make_pair(std::string("cim:GovSteam2.mnef"), &assign_GovSteam2_mnef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t1"), &assign_GovSteam2_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteam2.t2"), &assign_GovSteam2_t2)); } -void GovSteam2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteam2::debugName[] = "GovSteam2"; -const char* GovSteam2::debugString() +void GovSteam2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteam2::debugName; } const BaseClassDefiner GovSteam2::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner GovSteam2::declare() return BaseClassDefiner(GovSteam2::addConstructToMap, GovSteam2::addPrimitiveAssignFnsToMap, GovSteam2::addClassAssignFnsToMap, GovSteam2::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteam2_factory() + { + return new GovSteam2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteam2.hpp b/CGMES_2.4.15_27JAN2020/GovSteam2.hpp index 0bbbead01..855305c31 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteam2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteam2.hpp @@ -1,47 +1,48 @@ #ifndef GovSteam2_H #define GovSteam2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified governor model. */ - class GovSteam2: public TurbineGovernorDynamics + class GovSteam2 : public TurbineGovernorDynamics { - public: - CIMPP::Simple_Float k; /* Governor gain (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ - CIMPP::PU dbf; /* Frequency dead band (DBF). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T) (>0). Typical Value = 0.45. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T) (may be 0). Typical Value = 0. Default: nullptr */ - CIMPP::PU pmax; /* Maximum fuel flow (P). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum fuel flow (P). Typical Value = 0. Default: nullptr */ - CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 1. Default: nullptr */ - CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteam2(); - virtual ~GovSteam2(); - + ~GovSteam2() override; + + CIMPP::PU dbf; /* Frequency dead band (DBF). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k; /* Governor gain (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU mnef; /* Fuel flow maximum negative error value (MN). Typical Value = -1. Default: nullptr */ + CIMPP::PU mxef; /* Fuel flow maximum positive error value (MX). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmax; /* Maximum fuel flow (P). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum fuel flow (P). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t1; /* Governor lag time constant (T) (>0). Typical Value = 0.45. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T) (may be 0). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteam2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamCC.cpp b/CGMES_2.4.15_27JAN2020/GovSteamCC.cpp index eb9bd88ba..b99f888df 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamCC.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamCC.cpp @@ -1,291 +1,308 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamCC.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; GovSteamCC::GovSteamCC() {}; - GovSteamCC::~GovSteamCC() {}; +bool assign_GovSteamCC_dhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_dlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_fhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_flp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->flp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_pmaxhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmaxhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_pmaxlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmaxlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_rhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_rlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t1hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t1lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t3hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t3lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t4hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t4lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t5hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5hp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamCC_t5lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamCC_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_pmaxhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmaxhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_rhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t1hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t3hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t4hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t5hp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5hp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_fhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_dhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_pmaxlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmaxlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_rlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t1lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t3lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t4lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_t5lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_flp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->flp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamCC_dlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamCC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteamCC_factory() { - return new GovSteamCC; - } +const char GovSteamCC::debugName[] = "GovSteamCC"; +const char* GovSteamCC::debugString() const +{ + return GovSteamCC::debugName; } -void GovSteamCC::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamCC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamCC"), &GovSteamCC_factory)); } -void GovSteamCC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamCC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dhp"), &assign_GovSteamCC_dhp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dlp"), &assign_GovSteamCC_dlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.fhp"), &assign_GovSteamCC_fhp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.flp"), &assign_GovSteamCC_flp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.mwbase"), &assign_GovSteamCC_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.pmaxhp"), &assign_GovSteamCC_pmaxhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.rhp"), &assign_GovSteamCC_rhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t1hp"), &assign_GovSteamCC_t1hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t3hp"), &assign_GovSteamCC_t3hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t4hp"), &assign_GovSteamCC_t4hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t5hp"), &assign_GovSteamCC_t5hp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.fhp"), &assign_GovSteamCC_fhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dhp"), &assign_GovSteamCC_dhp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.pmaxlp"), &assign_GovSteamCC_pmaxlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.rhp"), &assign_GovSteamCC_rhp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.rlp"), &assign_GovSteamCC_rlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t1hp"), &assign_GovSteamCC_t1hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t1lp"), &assign_GovSteamCC_t1lp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t3hp"), &assign_GovSteamCC_t3hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t3lp"), &assign_GovSteamCC_t3lp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t4hp"), &assign_GovSteamCC_t4hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t4lp"), &assign_GovSteamCC_t4lp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t5hp"), &assign_GovSteamCC_t5hp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.t5lp"), &assign_GovSteamCC_t5lp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.flp"), &assign_GovSteamCC_flp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamCC.dlp"), &assign_GovSteamCC_dlp)); } -void GovSteamCC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamCC::debugName[] = "GovSteamCC"; -const char* GovSteamCC::debugString() +void GovSteamCC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamCC::debugName; } const BaseClassDefiner GovSteamCC::declare() @@ -293,4 +310,10 @@ const BaseClassDefiner GovSteamCC::declare() return BaseClassDefiner(GovSteamCC::addConstructToMap, GovSteamCC::addPrimitiveAssignFnsToMap, GovSteamCC::addClassAssignFnsToMap, GovSteamCC::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamCC_factory() + { + return new GovSteamCC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamCC.hpp b/CGMES_2.4.15_27JAN2020/GovSteamCC.hpp index 7bb44f76b..72759ea29 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamCC.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamCC.hpp @@ -1,56 +1,57 @@ #ifndef GovSteamCC_H #define GovSteamCC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Cross compound turbine governor model. */ - class GovSteamCC: public TurbineGovernorDynamics + class GovSteamCC : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU pmaxhp; /* Maximum HP value position (Pmaxhp). Typical Value = 1. Default: nullptr */ - CIMPP::PU rhp; /* HP governor droop (Rhp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1hp; /* HP governor time constant (T1hp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t3hp; /* HP turbine time constant (T3hp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4hp; /* HP turbine time constant (T4hp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t5hp; /* HP reheater time constant (T5hp). Typical Value = 10. Default: nullptr */ - CIMPP::PU fhp; /* Fraction of HP power ahead of reheater (Fhp). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU dhp; /* HP damping factor (Dhp). Typical Value = 0. Default: nullptr */ - CIMPP::PU pmaxlp; /* Maximum LP value position (Pmaxlp). Typical Value = 1. Default: nullptr */ - CIMPP::PU rlp; /* LP governor droop (Rlp). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t1lp; /* LP governor time constant (T1lp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t3lp; /* LP turbine time constant (T3lp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t4lp; /* LP turbine time constant (T4lp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t5lp; /* LP reheater time constant (T5lp). Typical Value = 10. Default: nullptr */ - CIMPP::PU flp; /* Fraction of LP power ahead of reheater (Flp). Typical Value = 0.7. Default: nullptr */ - CIMPP::PU dlp; /* LP damping factor (Dlp). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamCC(); - virtual ~GovSteamCC(); - + ~GovSteamCC() override; + + CIMPP::PU dhp; /* HP damping factor (Dhp). Typical Value = 0. Default: nullptr */ + CIMPP::PU dlp; /* LP damping factor (Dlp). Typical Value = 0. Default: nullptr */ + CIMPP::PU fhp; /* Fraction of HP power ahead of reheater (Fhp). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU flp; /* Fraction of LP power ahead of reheater (Flp). Typical Value = 0.7. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmaxhp; /* Maximum HP value position (Pmaxhp). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmaxlp; /* Maximum LP value position (Pmaxlp). Typical Value = 1. Default: nullptr */ + CIMPP::PU rhp; /* HP governor droop (Rhp). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU rlp; /* LP governor droop (Rlp). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t1hp; /* HP governor time constant (T1hp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t1lp; /* LP governor time constant (T1lp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3hp; /* HP turbine time constant (T3hp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t3lp; /* LP turbine time constant (T3lp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4hp; /* HP turbine time constant (T4hp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4lp; /* LP turbine time constant (T4lp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t5hp; /* HP reheater time constant (T5hp). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds t5lp; /* LP reheater time constant (T5lp). Typical Value = 10. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamCC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamEU.cpp b/CGMES_2.4.15_27JAN2020/GovSteamEU.cpp index d65b3ef66..b5a684c62 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamEU.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamEU.cpp @@ -1,561 +1,596 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamEU.hpp" -#include "ActivePower.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovSteamEU::GovSteamEU() {}; - GovSteamEU::~GovSteamEU() {}; +bool assign_GovSteamEU_chc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->chc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_cho(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cho; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_cic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_cio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_hhpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hhpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ke; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_kfcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kfcor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->khp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_klp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->klp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_kwcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kwcor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_prhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_simx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->simx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tdp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_ten(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ten; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tfp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tlp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tvhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvhp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tvip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wfmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wmax1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wmax2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wwmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wwmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamEU_wwmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wwmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamEU_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_ke(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ke; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tdp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tfp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamEU_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_kfcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kfcor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_db1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wfmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wfmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wfmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_ten(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ten; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_kwcor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kwcor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_db2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wwmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wwmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wwmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wwmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wmax1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wmax1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_wmax2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wmax2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tvhp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvhp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_cho(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cho; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_chc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->chc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_hhpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hhpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tvip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_cio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_cic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_simx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->simx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tlp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tlp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_prhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->khp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_klp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->klp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamEU_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamEU* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamEU_factory() { - return new GovSteamEU; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovSteamEU::debugName[] = "GovSteamEU"; +const char* GovSteamEU::debugString() const +{ + return GovSteamEU::debugName; } -void GovSteamEU::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamEU::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamEU"), &GovSteamEU_factory)); } -void GovSteamEU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.mwbase"), &assign_GovSteamEU_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tp"), &assign_GovSteamEU_tp)); +void GovSteamEU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.chc"), &assign_GovSteamEU_chc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cho"), &assign_GovSteamEU_cho)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cic"), &assign_GovSteamEU_cic)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cio"), &assign_GovSteamEU_cio)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db1"), &assign_GovSteamEU_db1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db2"), &assign_GovSteamEU_db2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.hhpmax"), &assign_GovSteamEU_hhpmax)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.ke"), &assign_GovSteamEU_ke)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tip"), &assign_GovSteamEU_tip)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tdp"), &assign_GovSteamEU_tdp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tfp"), &assign_GovSteamEU_tfp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tf"), &assign_GovSteamEU_tf)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.kfcor"), &assign_GovSteamEU_kfcor)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db1"), &assign_GovSteamEU_db1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmax"), &assign_GovSteamEU_wfmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmin"), &assign_GovSteamEU_wfmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.khp"), &assign_GovSteamEU_khp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.klp"), &assign_GovSteamEU_klp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.kwcor"), &assign_GovSteamEU_kwcor)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.mwbase"), &assign_GovSteamEU_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.pmax"), &assign_GovSteamEU_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.prhmax"), &assign_GovSteamEU_prhmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.simx"), &assign_GovSteamEU_simx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tb"), &assign_GovSteamEU_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tdp"), &assign_GovSteamEU_tdp)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.ten"), &assign_GovSteamEU_ten)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tf"), &assign_GovSteamEU_tf)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tfp"), &assign_GovSteamEU_tfp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.thp"), &assign_GovSteamEU_thp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tip"), &assign_GovSteamEU_tip)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tlp"), &assign_GovSteamEU_tlp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tp"), &assign_GovSteamEU_tp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.trh"), &assign_GovSteamEU_trh)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvhp"), &assign_GovSteamEU_tvhp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvip"), &assign_GovSteamEU_tvip)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tw"), &assign_GovSteamEU_tw)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.kwcor"), &assign_GovSteamEU_kwcor)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.db2"), &assign_GovSteamEU_db2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmax"), &assign_GovSteamEU_wwmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmin"), &assign_GovSteamEU_wwmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmax"), &assign_GovSteamEU_wfmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wfmin"), &assign_GovSteamEU_wfmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wmax1"), &assign_GovSteamEU_wmax1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wmax2"), &assign_GovSteamEU_wmax2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvhp"), &assign_GovSteamEU_tvhp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cho"), &assign_GovSteamEU_cho)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.chc"), &assign_GovSteamEU_chc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.hhpmax"), &assign_GovSteamEU_hhpmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tvip"), &assign_GovSteamEU_tvip)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cio"), &assign_GovSteamEU_cio)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.cic"), &assign_GovSteamEU_cic)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.simx"), &assign_GovSteamEU_simx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.thp"), &assign_GovSteamEU_thp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.trh"), &assign_GovSteamEU_trh)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tlp"), &assign_GovSteamEU_tlp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.prhmax"), &assign_GovSteamEU_prhmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.khp"), &assign_GovSteamEU_khp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.klp"), &assign_GovSteamEU_klp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.tb"), &assign_GovSteamEU_tb)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmax"), &assign_GovSteamEU_wwmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamEU.wwmin"), &assign_GovSteamEU_wwmin)); } -void GovSteamEU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamEU::debugName[] = "GovSteamEU"; -const char* GovSteamEU::debugString() +void GovSteamEU::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamEU::debugName; } const BaseClassDefiner GovSteamEU::declare() @@ -563,4 +598,10 @@ const BaseClassDefiner GovSteamEU::declare() return BaseClassDefiner(GovSteamEU::addConstructToMap, GovSteamEU::addPrimitiveAssignFnsToMap, GovSteamEU::addClassAssignFnsToMap, GovSteamEU::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamEU_factory() + { + return new GovSteamEU; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamEU.hpp b/CGMES_2.4.15_27JAN2020/GovSteamEU.hpp index a29f4cbae..11e4f65eb 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamEU.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamEU.hpp @@ -1,75 +1,76 @@ #ifndef GovSteamEU_H #define GovSteamEU_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified model of boiler and steam turbine with PID governor. */ - class GovSteamEU: public TurbineGovernorDynamics + class GovSteamEU : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds tp; /* Power transducer time constant (Tp). Typical Value = 0.07. Default: nullptr */ - CIMPP::PU ke; /* Gain of the power controller (Ke). Typical Value = 0.65. Default: nullptr */ - CIMPP::Seconds tip; /* Integral time constant of the power controller (Tip). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tdp; /* Derivative time constant of the power controller (Tdp). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tfp; /* Time constant of the power controller (Tfp). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tf; /* Frequency transducer time constant (Tf). Typical Value = 0. Default: nullptr */ - CIMPP::PU kfcor; /* Gain of the frequency corrector (Kfcor). Typical Value = 20. Default: nullptr */ - CIMPP::PU db1; /* Dead band of the frequency corrector (db1). Typical Value = 0. Default: nullptr */ - CIMPP::PU wfmax; /* Upper limit for frequency correction (Wfmax). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU wfmin; /* Lower limit for frequency correction (Wfmin). Typical Value = -0.05. Default: nullptr */ - CIMPP::PU pmax; /* Maximal active power of the turbine (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ten; /* Electro hydraulic transducer (Ten). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tw; /* Speed transducer time constant (Tw). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU kwcor; /* Gain of the speed governor (Kwcor). Typical Value = 20. Default: nullptr */ - CIMPP::PU db2; /* Dead band of the speed governor (db2). Typical Value = 0.0004. Default: nullptr */ - CIMPP::PU wwmax; /* Upper limit for the speed governor (Wwmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU wwmin; /* Lower limit for the speed governor frequency correction (Wwmin). Typical Value = -1. Default: nullptr */ - CIMPP::PU wmax1; /* Emergency speed control lower limit (wmax1). Typical Value = 1.025. Default: nullptr */ - CIMPP::PU wmax2; /* Emergency speed control upper limit (wmax2). Typical Value = 1.05. Default: nullptr */ - CIMPP::Seconds tvhp; /* Control valves servo time constant (Tvhp). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float cho; /* Control valves rate opening limit (Cho). Unit = PU/sec. Typical Value = 0.17. Default: nullptr */ - CIMPP::Simple_Float chc; /* Control valves rate closing limit (Chc). Unit = PU/sec. Typical Value = -3.3. Default: nullptr */ - CIMPP::PU hhpmax; /* Maximum control valve position (Hhpmax). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tvip; /* Intercept valves servo time constant (Tvip). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU cio; /* Intercept valves rate opening limit (Cio). Typical Value = 0.123. Default: nullptr */ - CIMPP::PU cic; /* Intercept valves rate closing limit (Cic). Typical Value = -2.2. Default: nullptr */ - CIMPP::PU simx; /* Intercept valves transfer limit (Simx). Typical Value = 0.425. Default: nullptr */ - CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.31. Default: nullptr */ - CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 8. Default: nullptr */ - CIMPP::Seconds tlp; /* Low pressure(LP) time constant of the turbine (Tlp). Typical Value = 0.45. Default: nullptr */ - CIMPP::PU prhmax; /* Maximum low pressure limit (Prhmax). Typical Value = 1.4. Default: nullptr */ - CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.277. Default: nullptr */ - CIMPP::PU klp; /* Fraction of total turbine output generated by HP part (Klp). Typical Value = 0.723. Default: nullptr */ - CIMPP::Seconds tb; /* Boiler time constant (Tb). Typical Value = 100. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamEU(); - virtual ~GovSteamEU(); - + ~GovSteamEU() override; + + CIMPP::Simple_Float chc; /* Control valves rate closing limit (Chc). Unit = PU/sec. Typical Value = -3.3. Default: nullptr */ + CIMPP::Simple_Float cho; /* Control valves rate opening limit (Cho). Unit = PU/sec. Typical Value = 0.17. Default: nullptr */ + CIMPP::PU cic; /* Intercept valves rate closing limit (Cic). Typical Value = -2.2. Default: nullptr */ + CIMPP::PU cio; /* Intercept valves rate opening limit (Cio). Typical Value = 0.123. Default: nullptr */ + CIMPP::PU db1; /* Dead band of the frequency corrector (db1). Typical Value = 0. Default: nullptr */ + CIMPP::PU db2; /* Dead band of the speed governor (db2). Typical Value = 0.0004. Default: nullptr */ + CIMPP::PU hhpmax; /* Maximum control valve position (Hhpmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU ke; /* Gain of the power controller (Ke). Typical Value = 0.65. Default: nullptr */ + CIMPP::PU kfcor; /* Gain of the frequency corrector (Kfcor). Typical Value = 20. Default: nullptr */ + CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.277. Default: nullptr */ + CIMPP::PU klp; /* Fraction of total turbine output generated by HP part (Klp). Typical Value = 0.723. Default: nullptr */ + CIMPP::PU kwcor; /* Gain of the speed governor (Kwcor). Typical Value = 20. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Maximal active power of the turbine (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU prhmax; /* Maximum low pressure limit (Prhmax). Typical Value = 1.4. Default: nullptr */ + CIMPP::PU simx; /* Intercept valves transfer limit (Simx). Typical Value = 0.425. Default: nullptr */ + CIMPP::Seconds tb; /* Boiler time constant (Tb). Typical Value = 100. Default: nullptr */ + CIMPP::Seconds tdp; /* Derivative time constant of the power controller (Tdp). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ten; /* Electro hydraulic transducer (Ten). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tf; /* Frequency transducer time constant (Tf). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tfp; /* Time constant of the power controller (Tfp). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.31. Default: nullptr */ + CIMPP::Seconds tip; /* Integral time constant of the power controller (Tip). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tlp; /* Low pressure(LP) time constant of the turbine (Tlp). Typical Value = 0.45. Default: nullptr */ + CIMPP::Seconds tp; /* Power transducer time constant (Tp). Typical Value = 0.07. Default: nullptr */ + CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 8. Default: nullptr */ + CIMPP::Seconds tvhp; /* Control valves servo time constant (Tvhp). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tvip; /* Intercept valves servo time constant (Tvip). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tw; /* Speed transducer time constant (Tw). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU wfmax; /* Upper limit for frequency correction (Wfmax). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU wfmin; /* Lower limit for frequency correction (Wfmin). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU wmax1; /* Emergency speed control lower limit (wmax1). Typical Value = 1.025. Default: nullptr */ + CIMPP::PU wmax2; /* Emergency speed control upper limit (wmax2). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU wwmax; /* Upper limit for the speed governor (Wwmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU wwmin; /* Lower limit for the speed governor frequency correction (Wwmin). Typical Value = -1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamEU_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamFV2.cpp b/CGMES_2.4.15_27JAN2020/GovSteamFV2.cpp index c907305f9..6fb69673f 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamFV2.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamFV2.cpp @@ -1,31 +1,199 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamFV2.hpp" -#include "ActivePower.hpp" -#include "PU.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" +#include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; GovSteamFV2::GovSteamFV2() {}; - GovSteamFV2::~GovSteamFV2() {}; +bool assign_GovSteamFV2_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_GovSteamFV2_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +205,40 @@ GovSteamFV2::~GovSteamFV2() {}; -bool assign_GovSteamFV2_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV2_vmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_vmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_dt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV2_ti(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamFV2_factory() { - return new GovSteamFV2; - } + +const char GovSteamFV2::debugName[] = "GovSteamFV2"; +const char* GovSteamFV2::debugString() const +{ + return GovSteamFV2::debugName; } -void GovSteamFV2::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamFV2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamFV2"), &GovSteamFV2_factory)); } -void GovSteamFV2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamFV2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.dt"), &assign_GovSteamFV2_dt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.k"), &assign_GovSteamFV2_k)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.mwbase"), &assign_GovSteamFV2_mwbase)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.r"), &assign_GovSteamFV2_r)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.t1"), &assign_GovSteamFV2_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmax"), &assign_GovSteamFV2_vmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmin"), &assign_GovSteamFV2_vmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.k"), &assign_GovSteamFV2_k)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.t3"), &assign_GovSteamFV2_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.dt"), &assign_GovSteamFV2_dt)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tt"), &assign_GovSteamFV2_tt)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.ta"), &assign_GovSteamFV2_ta)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tb"), &assign_GovSteamFV2_tb)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tc"), &assign_GovSteamFV2_tc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.ti"), &assign_GovSteamFV2_ti)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.tt"), &assign_GovSteamFV2_tt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmax"), &assign_GovSteamFV2_vmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV2.vmin"), &assign_GovSteamFV2_vmin)); } -void GovSteamFV2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamFV2::debugName[] = "GovSteamFV2"; -const char* GovSteamFV2::debugString() +void GovSteamFV2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamFV2::debugName; } const BaseClassDefiner GovSteamFV2::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner GovSteamFV2::declare() return BaseClassDefiner(GovSteamFV2::addConstructToMap, GovSteamFV2::addPrimitiveAssignFnsToMap, GovSteamFV2::addClassAssignFnsToMap, GovSteamFV2::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamFV2_factory() + { + return new GovSteamFV2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamFV2.hpp b/CGMES_2.4.15_27JAN2020/GovSteamFV2.hpp index 5346ddee4..6271ab5b3 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamFV2.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamFV2.hpp @@ -1,52 +1,53 @@ #ifndef GovSteamFV2_H #define GovSteamFV2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Steam turbine governor with reheat time constants and modeling of the effects of fast valve closing to reduce mechanical power. */ - class GovSteamFV2: public TurbineGovernorDynamics + class GovSteamFV2 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Alternate Base used instead of Machine base in equipment model if necessary (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU r; /* (R). Default: nullptr */ - CIMPP::Seconds t1; /* Governor time constant (T1). Default: nullptr */ - CIMPP::PU vmax; /* (Vmax). Default: nullptr */ - CIMPP::PU vmin; /* (Vmin). Default: nullptr */ - CIMPP::PU k; /* Fraction of the turbine power developed by turbine sections not involved in fast valving (K). Default: nullptr */ - CIMPP::Seconds t3; /* Reheater time constant (T3). Default: nullptr */ - CIMPP::PU dt; /* (Dt). Default: nullptr */ - CIMPP::Seconds tt; /* Time constant with which power falls off after intercept valve closure (Tt). Default: nullptr */ - CIMPP::Seconds ta; /* Time after initial time for valve to close (Ta). Default: nullptr */ - CIMPP::Seconds tb; /* Time after initial time for valve to begin opening (Tb). Default: nullptr */ - CIMPP::Seconds tc; /* Time after initial time for valve to become fully open (Tc). Default: nullptr */ - CIMPP::Seconds ti; /* Initial time to begin fast valving (Ti). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamFV2(); - virtual ~GovSteamFV2(); - + ~GovSteamFV2() override; + + CIMPP::PU dt; /* (Dt). Default: nullptr */ + CIMPP::PU k; /* Fraction of the turbine power developed by turbine sections not involved in fast valving (K). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Alternate Base used instead of Machine base in equipment model if necessary (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU r; /* (R). Default: nullptr */ + CIMPP::Seconds t1; /* Governor time constant (T1). Default: nullptr */ + CIMPP::Seconds t3; /* Reheater time constant (T3). Default: nullptr */ + CIMPP::Seconds ta; /* Time after initial time for valve to close (Ta). Default: nullptr */ + CIMPP::Seconds tb; /* Time after initial time for valve to begin opening (Tb). Default: nullptr */ + CIMPP::Seconds tc; /* Time after initial time for valve to become fully open (Tc). Default: nullptr */ + CIMPP::Seconds ti; /* Initial time to begin fast valving (Ti). Default: nullptr */ + CIMPP::Seconds tt; /* Time constant with which power falls off after intercept valve closure (Tt). Default: nullptr */ + CIMPP::PU vmax; /* (Vmax). Default: nullptr */ + CIMPP::PU vmin; /* (Vmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamFV2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamFV3.cpp b/CGMES_2.4.15_27JAN2020/GovSteamFV3.cpp index 8b48f1cb6..3bdf5d1ba 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamFV3.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamFV3.cpp @@ -1,321 +1,340 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamFV3.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; GovSteamFV3::GovSteamFV3() {}; - GovSteamFV3::~GovSteamFV3() {}; +bool assign_GovSteamFV3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_prmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV3_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamFV3_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV3_prmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteamFV3_factory() { - return new GovSteamFV3; - } +const char GovSteamFV3::debugName[] = "GovSteamFV3"; +const char* GovSteamFV3::debugString() const +{ + return GovSteamFV3::debugName; } -void GovSteamFV3::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamFV3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamFV3"), &GovSteamFV3_factory)); } -void GovSteamFV3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.mwbase"), &assign_GovSteamFV3_mwbase)); +void GovSteamFV3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k"), &assign_GovSteamFV3_k)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k1"), &assign_GovSteamFV3_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k2"), &assign_GovSteamFV3_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k3"), &assign_GovSteamFV3_k3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.mwbase"), &assign_GovSteamFV3_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmax"), &assign_GovSteamFV3_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmin"), &assign_GovSteamFV3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.prmax"), &assign_GovSteamFV3_prmax)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t1"), &assign_GovSteamFV3_t1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t2"), &assign_GovSteamFV3_t2)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t3"), &assign_GovSteamFV3_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uo"), &assign_GovSteamFV3_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uc"), &assign_GovSteamFV3_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmax"), &assign_GovSteamFV3_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.pmin"), &assign_GovSteamFV3_pmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t4"), &assign_GovSteamFV3_t4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k1"), &assign_GovSteamFV3_k1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t5"), &assign_GovSteamFV3_t5)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k2"), &assign_GovSteamFV3_k2)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.t6"), &assign_GovSteamFV3_t6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.k3"), &assign_GovSteamFV3_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.ta"), &assign_GovSteamFV3_ta)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.tb"), &assign_GovSteamFV3_tb)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.tc"), &assign_GovSteamFV3_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.prmax"), &assign_GovSteamFV3_prmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uc"), &assign_GovSteamFV3_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV3.uo"), &assign_GovSteamFV3_uo)); } -void GovSteamFV3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamFV3::debugName[] = "GovSteamFV3"; -const char* GovSteamFV3::debugString() +void GovSteamFV3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamFV3::debugName; } const BaseClassDefiner GovSteamFV3::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner GovSteamFV3::declare() return BaseClassDefiner(GovSteamFV3::addConstructToMap, GovSteamFV3::addPrimitiveAssignFnsToMap, GovSteamFV3::addClassAssignFnsToMap, GovSteamFV3::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamFV3_factory() + { + return new GovSteamFV3; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamFV3.hpp b/CGMES_2.4.15_27JAN2020/GovSteamFV3.hpp index fc3650f3f..6a09f094e 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamFV3.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamFV3.hpp @@ -1,59 +1,60 @@ #ifndef GovSteamFV3_H #define GovSteamFV3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified GovSteamIEEE1 Steam turbine governor model with Prmax limit and fast valving. */ - class GovSteamFV3: public TurbineGovernorDynamics + class GovSteamFV3 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::PU k; /* Governor gain, (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lead time constant (T1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lag time constant (T2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Valve positioner time constant (T3). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc). Unit = PU/sec. Typical Value = -1. Default: nullptr */ - CIMPP::PU pmax; /* Maximum valve opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum valve opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU k1; /* Fraction of turbine power developed after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant of second boiler pass (i.e. reheater) (T5). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU k2; /* Fraction of turbine power developed after second boiler pass (K2). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant of crossover or third boiler pass (T6). Typical Value = 10. Default: nullptr */ - CIMPP::PU k3; /* Fraction of hp turbine power developed after crossover or third boiler pass (K3). Typical Value = 0.6. Default: nullptr */ - CIMPP::Seconds ta; /* Time to close intercept valve (IV) (Ta). Typical Value = 0.97. Default: nullptr */ - CIMPP::Seconds tb; /* Time until IV starts to reopen (Tb). Typical Value = 0.98. Default: nullptr */ - CIMPP::Seconds tc; /* Time until IV is fully open (Tc). Typical Value = 0.99. Default: nullptr */ - CIMPP::PU prmax; /* Max. pressure in reheater (Prmax). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamFV3(); - virtual ~GovSteamFV3(); - + ~GovSteamFV3() override; + + CIMPP::PU k; /* Governor gain, (reciprocal of droop) (K). Typical Value = 20. Default: nullptr */ + CIMPP::PU k1; /* Fraction of turbine power developed after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU k2; /* Fraction of turbine power developed after second boiler pass (K2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU k3; /* Fraction of hp turbine power developed after crossover or third boiler pass (K3). Typical Value = 0.6. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Maximum valve opening, PU of MWbase (Pmax). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum valve opening, PU of MWbase (Pmin). Typical Value = 0. Default: nullptr */ + CIMPP::PU prmax; /* Max. pressure in reheater (Prmax). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t1; /* Governor lead time constant (T1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lag time constant (T2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Valve positioner time constant (T3). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant of second boiler pass (i.e. reheater) (T5). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant of crossover or third boiler pass (T6). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds ta; /* Time to close intercept valve (IV) (Ta). Typical Value = 0.97. Default: nullptr */ + CIMPP::Seconds tb; /* Time until IV starts to reopen (Tb). Typical Value = 0.98. Default: nullptr */ + CIMPP::Seconds tc; /* Time until IV is fully open (Tc). Typical Value = 0.99. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc). Unit = PU/sec. Typical Value = -1. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo). Unit = PU/sec. Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamFV3_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamFV4.cpp b/CGMES_2.4.15_27JAN2020/GovSteamFV4.cpp index 98d03a636..3c3628870 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamFV4.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamFV4.cpp @@ -1,7 +1,11 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamFV4.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -14,8 +18,6 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -25,777 +27,826 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "PU.hpp" using namespace CIMPP; GovSteamFV4::GovSteamFV4() {}; - GovSteamFV4::~GovSteamFV4() {}; +bool assign_GovSteamFV4_cpsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cpsmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_cpsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cpsmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_crmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->crmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_crmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->crmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->khp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kmp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmp1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kmp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmp2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_kpt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_krc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->krc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ksh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ksh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_lpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lpi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_lps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lps; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mnef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mxef; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_pr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pr1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_pr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pr2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_psmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->psmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rsmimn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rsmimn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rsmimx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rsmimx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rvgmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rvgmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_rvgmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rvgmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_srmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->srmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_srmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->srmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_srsmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->srsmp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_svmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->svmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_svmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->svmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tam; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tcm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tmp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->trh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ty; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->y; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_yhpmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yhpmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_yhpmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->yhpmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ympmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ympmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamFV4_ympmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ympmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamFV4_kf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_kf3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_lps(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lps; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_lpi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lpi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_mxef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mxef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_mnef(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mnef; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamFV4_crmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->crmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_crmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->crmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kpt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rvgmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rvgmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rvgmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rvgmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_svmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->svmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_svmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->svmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_srmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->srmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_srmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->srmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rsmimx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rsmimx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_rsmimn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rsmimn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kmp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmp1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kmp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmp2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_srsmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->srsmp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ty(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ty; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_yhpmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yhpmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_yhpmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->yhpmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tam(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tam; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tcm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tcm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ympmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ympmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ympmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ympmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_y(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->y; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_thp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_trh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->trh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tmp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tmp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_khp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->khp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_pr1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pr1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_pr2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pr2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_psmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->psmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_kdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tdc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_cpsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cpsmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_cpsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cpsmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_krc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->krc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tf1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamFV4_ksh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamFV4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ksh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamFV4_factory() { - return new GovSteamFV4; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char GovSteamFV4::debugName[] = "GovSteamFV4"; +const char* GovSteamFV4::debugString() const +{ + return GovSteamFV4::debugName; } -void GovSteamFV4::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamFV4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamFV4"), &GovSteamFV4_factory)); } -void GovSteamFV4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamFV4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmn"), &assign_GovSteamFV4_cpsmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmx"), &assign_GovSteamFV4_cpsmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmn"), &assign_GovSteamFV4_crmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmx"), &assign_GovSteamFV4_crmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kdc"), &assign_GovSteamFV4_kdc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kf1"), &assign_GovSteamFV4_kf1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kf3"), &assign_GovSteamFV4_kf3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.lps"), &assign_GovSteamFV4_lps)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.khp"), &assign_GovSteamFV4_khp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kic"), &assign_GovSteamFV4_kic)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kip"), &assign_GovSteamFV4_kip)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kit"), &assign_GovSteamFV4_kit)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp1"), &assign_GovSteamFV4_kmp1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp2"), &assign_GovSteamFV4_kmp2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpc"), &assign_GovSteamFV4_kpc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpp"), &assign_GovSteamFV4_kpp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpt"), &assign_GovSteamFV4_kpt)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.krc"), &assign_GovSteamFV4_krc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ksh"), &assign_GovSteamFV4_ksh)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.lpi"), &assign_GovSteamFV4_lpi)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.mxef"), &assign_GovSteamFV4_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.lps"), &assign_GovSteamFV4_lps)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.mnef"), &assign_GovSteamFV4_mnef)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmx"), &assign_GovSteamFV4_crmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.crmn"), &assign_GovSteamFV4_crmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpt"), &assign_GovSteamFV4_kpt)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kit"), &assign_GovSteamFV4_kit)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rvgmx"), &assign_GovSteamFV4_rvgmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.mxef"), &assign_GovSteamFV4_mxef)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr1"), &assign_GovSteamFV4_pr1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr2"), &assign_GovSteamFV4_pr2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.psmn"), &assign_GovSteamFV4_psmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimn"), &assign_GovSteamFV4_rsmimn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimx"), &assign_GovSteamFV4_rsmimx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rvgmn"), &assign_GovSteamFV4_rvgmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmx"), &assign_GovSteamFV4_svmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmn"), &assign_GovSteamFV4_svmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srmx"), &assign_GovSteamFV4_srmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rvgmx"), &assign_GovSteamFV4_rvgmx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srmn"), &assign_GovSteamFV4_srmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpp"), &assign_GovSteamFV4_kpp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kip"), &assign_GovSteamFV4_kip)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimx"), &assign_GovSteamFV4_rsmimx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.rsmimn"), &assign_GovSteamFV4_rsmimn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp1"), &assign_GovSteamFV4_kmp1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kmp2"), &assign_GovSteamFV4_kmp2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srmx"), &assign_GovSteamFV4_srmx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.srsmp"), &assign_GovSteamFV4_srsmp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmn"), &assign_GovSteamFV4_svmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.svmx"), &assign_GovSteamFV4_svmx)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ta"), &assign_GovSteamFV4_ta)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tc"), &assign_GovSteamFV4_tc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ty"), &assign_GovSteamFV4_ty)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmx"), &assign_GovSteamFV4_yhpmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmn"), &assign_GovSteamFV4_yhpmn)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tam"), &assign_GovSteamFV4_tam)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tc"), &assign_GovSteamFV4_tc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tcm"), &assign_GovSteamFV4_tcm)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmx"), &assign_GovSteamFV4_ympmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmn"), &assign_GovSteamFV4_ympmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.y"), &assign_GovSteamFV4_y)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.thp"), &assign_GovSteamFV4_thp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.trh"), &assign_GovSteamFV4_trh)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tmp"), &assign_GovSteamFV4_tmp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.khp"), &assign_GovSteamFV4_khp)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr1"), &assign_GovSteamFV4_pr1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.pr2"), &assign_GovSteamFV4_pr2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.psmn"), &assign_GovSteamFV4_psmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kpc"), &assign_GovSteamFV4_kpc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kic"), &assign_GovSteamFV4_kic)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.kdc"), &assign_GovSteamFV4_kdc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tdc"), &assign_GovSteamFV4_tdc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmx"), &assign_GovSteamFV4_cpsmx)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.cpsmn"), &assign_GovSteamFV4_cpsmn)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.krc"), &assign_GovSteamFV4_krc)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tf1"), &assign_GovSteamFV4_tf1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tf2"), &assign_GovSteamFV4_tf2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.thp"), &assign_GovSteamFV4_thp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tmp"), &assign_GovSteamFV4_tmp)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.trh"), &assign_GovSteamFV4_trh)); assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.tv"), &assign_GovSteamFV4_tv)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ksh"), &assign_GovSteamFV4_ksh)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ty"), &assign_GovSteamFV4_ty)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.y"), &assign_GovSteamFV4_y)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmn"), &assign_GovSteamFV4_yhpmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.yhpmx"), &assign_GovSteamFV4_yhpmx)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmn"), &assign_GovSteamFV4_ympmn)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamFV4.ympmx"), &assign_GovSteamFV4_ympmx)); } -void GovSteamFV4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamFV4::debugName[] = "GovSteamFV4"; -const char* GovSteamFV4::debugString() +void GovSteamFV4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamFV4::debugName; } const BaseClassDefiner GovSteamFV4::declare() @@ -803,4 +854,10 @@ const BaseClassDefiner GovSteamFV4::declare() return BaseClassDefiner(GovSteamFV4::addConstructToMap, GovSteamFV4::addPrimitiveAssignFnsToMap, GovSteamFV4::addClassAssignFnsToMap, GovSteamFV4::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamFV4_factory() + { + return new GovSteamFV4; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamFV4.hpp b/CGMES_2.4.15_27JAN2020/GovSteamFV4.hpp index 0054e6425..2b19c8f6e 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamFV4.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamFV4.hpp @@ -1,90 +1,91 @@ #ifndef GovSteamFV4_H #define GovSteamFV4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Detailed electro-hydraulic governor for steam unit. */ - class GovSteamFV4: public TurbineGovernorDynamics + class GovSteamFV4 : public TurbineGovernorDynamics { - public: - CIMPP::PU kf1; /* Frequency bias (reciprocal of droop) (Kf1). Typical Value = 20. Default: nullptr */ - CIMPP::PU kf3; /* Frequency control (reciprocal of droop) (Kf3). Typical Value = 20. Default: nullptr */ - CIMPP::PU lps; /* Maximum positive power error (Lps). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU lpi; /* Maximum negative power error (Lpi). Typical Value = -0.15. Default: nullptr */ - CIMPP::PU mxef; /* Upper limit for frequency correction (MX). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU mnef; /* Lower limit for frequency correction (MN). Typical Value = -0.05. Default: nullptr */ - CIMPP::PU crmx; /* Maximum value of regulator set-point (Crmx). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU crmn; /* Minimum value of regulator set-point (Crmn). Typical Value = 0. Default: nullptr */ - CIMPP::PU kpt; /* Proportional gain of electro-hydraulic regulator (Kpt). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU kit; /* Integral gain of electro-hydraulic regulator (Kit). Typical Value = 0.04. Default: nullptr */ - CIMPP::PU rvgmx; /* Maximum value of integral regulator (Rvgmx). Typical Value = 1.2. Default: nullptr */ - CIMPP::PU rvgmn; /* Minimum value of integral regulator (Rvgmn). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float svmx; /* Maximum regulator gate opening velocity (Svmx). Typical Value = 0.0333. Default: nullptr */ - CIMPP::Simple_Float svmn; /* Maximum regulator gate closing velocity (Svmn). Typical Value = -0.0333. Default: nullptr */ - CIMPP::PU srmx; /* Maximum valve opening (Srmx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU srmn; /* Minimum valve opening (Srmn). Typical Value = 0. Default: nullptr */ - CIMPP::PU kpp; /* Proportional gain of pressure feedback regulator (Kpp). Typical Value = 1. Default: nullptr */ - CIMPP::PU kip; /* Integral gain of pressure feedback regulator (Kip). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU rsmimx; /* Maximum value of integral regulator (Rsmimx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU rsmimn; /* Minimum value of integral regulator (Rsmimn). Typical Value = 0. Default: nullptr */ - CIMPP::PU kmp1; /* First gain coefficient of intercept valves characteristic (Kmp1). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kmp2; /* Second gain coefficient of intercept valves characteristic (Kmp2). Typical Value = 3.5. Default: nullptr */ - CIMPP::PU srsmp; /* Intercept valves characteristic discontinuity point (Srsmp). Typical Value = 0.43. Default: nullptr */ - CIMPP::Seconds ta; /* Control valves rate opening time (Ta). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tc; /* Control valves rate closing time (Tc). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds ty; /* Control valves servo time constant (Ty). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU yhpmx; /* Maximum control valve position (Yhpmx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU yhpmn; /* Minimum control valve position (Yhpmn). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tam; /* Intercept valves rate opening time (Tam). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds tcm; /* Intercept valves rate closing time (Tcm). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU ympmx; /* Maximum intercept valve position (Ympmx). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU ympmn; /* Minimum intercept valve position (Ympmn). Typical Value = 0. Default: nullptr */ - CIMPP::PU y; /* Coefficient of linearized equations of turbine (Stodola formulation) (Y). Typical Value = 0.13. Default: nullptr */ - CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.15. Default: nullptr */ - CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tmp; /* Low pressure (LP) time constant of the turbine (Tmp). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.35. Default: nullptr */ - CIMPP::PU pr1; /* First value of pressure set point static characteristic (Pr1). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU pr2; /* Second value of pressure set point static characteristic, corresponding to Ps0 = 1.0 PU (Pr2). Typical Value = 0.75. Default: nullptr */ - CIMPP::PU psmn; /* Minimum value of pressure set point static characteristic (Psmn). Typical Value = 1. Default: nullptr */ - CIMPP::PU kpc; /* Proportional gain of pressure regulator (Kpc). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kic; /* Integral gain of pressure regulator (Kic). Typical Value = 0.0033. Default: nullptr */ - CIMPP::PU kdc; /* Derivative gain of pressure regulator (Kdc). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tdc; /* Derivative time constant of pressure regulator (Tdc). Typical Value = 90. Default: nullptr */ - CIMPP::PU cpsmx; /* Maximum value of pressure regulator output (Cpsmx). Typical Value = 1. Default: nullptr */ - CIMPP::PU cpsmn; /* Minimum value of pressure regulator output (Cpsmn). Typical Value = -1. Default: nullptr */ - CIMPP::PU krc; /* Maximum variation of fuel flow (Krc). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tf1; /* Time constant of fuel regulation (Tf1). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tf2; /* Time constant of steam chest (Tf2). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds tv; /* Boiler time constant (Tv). Typical Value = 60. Default: nullptr */ - CIMPP::PU ksh; /* Pressure loss due to flow friction in the boiler tubes (Ksh). Typical Value = 0.08. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamFV4(); - virtual ~GovSteamFV4(); - + ~GovSteamFV4() override; + + CIMPP::PU cpsmn; /* Minimum value of pressure regulator output (Cpsmn). Typical Value = -1. Default: nullptr */ + CIMPP::PU cpsmx; /* Maximum value of pressure regulator output (Cpsmx). Typical Value = 1. Default: nullptr */ + CIMPP::PU crmn; /* Minimum value of regulator set-point (Crmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU crmx; /* Maximum value of regulator set-point (Crmx). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU kdc; /* Derivative gain of pressure regulator (Kdc). Typical Value = 1. Default: nullptr */ + CIMPP::PU kf1; /* Frequency bias (reciprocal of droop) (Kf1). Typical Value = 20. Default: nullptr */ + CIMPP::PU kf3; /* Frequency control (reciprocal of droop) (Kf3). Typical Value = 20. Default: nullptr */ + CIMPP::PU khp; /* Fraction of total turbine output generated by HP part (Khp). Typical Value = 0.35. Default: nullptr */ + CIMPP::PU kic; /* Integral gain of pressure regulator (Kic). Typical Value = 0.0033. Default: nullptr */ + CIMPP::PU kip; /* Integral gain of pressure feedback regulator (Kip). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kit; /* Integral gain of electro-hydraulic regulator (Kit). Typical Value = 0.04. Default: nullptr */ + CIMPP::PU kmp1; /* First gain coefficient of intercept valves characteristic (Kmp1). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kmp2; /* Second gain coefficient of intercept valves characteristic (Kmp2). Typical Value = 3.5. Default: nullptr */ + CIMPP::PU kpc; /* Proportional gain of pressure regulator (Kpc). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kpp; /* Proportional gain of pressure feedback regulator (Kpp). Typical Value = 1. Default: nullptr */ + CIMPP::PU kpt; /* Proportional gain of electro-hydraulic regulator (Kpt). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU krc; /* Maximum variation of fuel flow (Krc). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU ksh; /* Pressure loss due to flow friction in the boiler tubes (Ksh). Typical Value = 0.08. Default: nullptr */ + CIMPP::PU lpi; /* Maximum negative power error (Lpi). Typical Value = -0.15. Default: nullptr */ + CIMPP::PU lps; /* Maximum positive power error (Lps). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU mnef; /* Lower limit for frequency correction (MN). Typical Value = -0.05. Default: nullptr */ + CIMPP::PU mxef; /* Upper limit for frequency correction (MX). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU pr1; /* First value of pressure set point static characteristic (Pr1). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU pr2; /* Second value of pressure set point static characteristic, corresponding to Ps0 = 1.0 PU (Pr2). Typical Value = 0.75. Default: nullptr */ + CIMPP::PU psmn; /* Minimum value of pressure set point static characteristic (Psmn). Typical Value = 1. Default: nullptr */ + CIMPP::PU rsmimn; /* Minimum value of integral regulator (Rsmimn). Typical Value = 0. Default: nullptr */ + CIMPP::PU rsmimx; /* Maximum value of integral regulator (Rsmimx). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU rvgmn; /* Minimum value of integral regulator (Rvgmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU rvgmx; /* Maximum value of integral regulator (Rvgmx). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU srmn; /* Minimum valve opening (Srmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU srmx; /* Maximum valve opening (Srmx). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU srsmp; /* Intercept valves characteristic discontinuity point (Srsmp). Typical Value = 0.43. Default: nullptr */ + CIMPP::Simple_Float svmn; /* Maximum regulator gate closing velocity (Svmn). Typical Value = -0.0333. Default: nullptr */ + CIMPP::Simple_Float svmx; /* Maximum regulator gate opening velocity (Svmx). Typical Value = 0.0333. Default: nullptr */ + CIMPP::Seconds ta; /* Control valves rate opening time (Ta). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tam; /* Intercept valves rate opening time (Tam). Typical Value = 0.8. Default: nullptr */ + CIMPP::Seconds tc; /* Control valves rate closing time (Tc). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tcm; /* Intercept valves rate closing time (Tcm). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds tdc; /* Derivative time constant of pressure regulator (Tdc). Typical Value = 90. Default: nullptr */ + CIMPP::Seconds tf1; /* Time constant of fuel regulation (Tf1). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tf2; /* Time constant of steam chest (Tf2). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds thp; /* High pressure (HP) time constant of the turbine (Thp). Typical Value = 0.15. Default: nullptr */ + CIMPP::Seconds tmp; /* Low pressure (LP) time constant of the turbine (Tmp). Typical Value = 0.4. Default: nullptr */ + CIMPP::Seconds trh; /* Reheater time constant of the turbine (Trh). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds tv; /* Boiler time constant (Tv). Typical Value = 60. Default: nullptr */ + CIMPP::Seconds ty; /* Control valves servo time constant (Ty). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU y; /* Coefficient of linearized equations of turbine (Stodola formulation) (Y). Typical Value = 0.13. Default: nullptr */ + CIMPP::PU yhpmn; /* Minimum control valve position (Yhpmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU yhpmx; /* Maximum control valve position (Yhpmx). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU ympmn; /* Minimum intercept valve position (Ympmn). Typical Value = 0. Default: nullptr */ + CIMPP::PU ympmx; /* Maximum intercept valve position (Ympmx). Typical Value = 1.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamFV4_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.cpp b/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.cpp index de0955544..e21c36d0a 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.cpp @@ -1,25 +1,29 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamIEEE1.hpp" -#include "ActivePower.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "ActivePower.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -27,325 +31,342 @@ using namespace CIMPP; GovSteamIEEE1::GovSteamIEEE1() {}; - GovSteamIEEE1::~GovSteamIEEE1() {}; +bool assign_GovSteamIEEE1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamIEEE1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamIEEE1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_uo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_uc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamIEEE1_k8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GovSteamIEEE1_factory() { - return new GovSteamIEEE1; - } +const char GovSteamIEEE1::debugName[] = "GovSteamIEEE1"; +const char* GovSteamIEEE1::debugString() const +{ + return GovSteamIEEE1::debugName; } -void GovSteamIEEE1::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamIEEE1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1"), &GovSteamIEEE1_factory)); } -void GovSteamIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.mwbase"), &assign_GovSteamIEEE1_mwbase)); +void GovSteamIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k"), &assign_GovSteamIEEE1_k)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t1"), &assign_GovSteamIEEE1_t1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t2"), &assign_GovSteamIEEE1_t2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t3"), &assign_GovSteamIEEE1_t3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uo"), &assign_GovSteamIEEE1_uo)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uc"), &assign_GovSteamIEEE1_uc)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmax"), &assign_GovSteamIEEE1_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmin"), &assign_GovSteamIEEE1_pmin)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t4"), &assign_GovSteamIEEE1_t4)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k1"), &assign_GovSteamIEEE1_k1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k2"), &assign_GovSteamIEEE1_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t5"), &assign_GovSteamIEEE1_t5)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k3"), &assign_GovSteamIEEE1_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k4"), &assign_GovSteamIEEE1_k4)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t6"), &assign_GovSteamIEEE1_t6)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k5"), &assign_GovSteamIEEE1_k5)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k6"), &assign_GovSteamIEEE1_k6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t7"), &assign_GovSteamIEEE1_t7)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k7"), &assign_GovSteamIEEE1_k7)); assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.k8"), &assign_GovSteamIEEE1_k8)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.mwbase"), &assign_GovSteamIEEE1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmax"), &assign_GovSteamIEEE1_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.pmin"), &assign_GovSteamIEEE1_pmin)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t1"), &assign_GovSteamIEEE1_t1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t2"), &assign_GovSteamIEEE1_t2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t3"), &assign_GovSteamIEEE1_t3)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t4"), &assign_GovSteamIEEE1_t4)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t5"), &assign_GovSteamIEEE1_t5)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t6"), &assign_GovSteamIEEE1_t6)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.t7"), &assign_GovSteamIEEE1_t7)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uc"), &assign_GovSteamIEEE1_uc)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamIEEE1.uo"), &assign_GovSteamIEEE1_uo)); } -void GovSteamIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamIEEE1::debugName[] = "GovSteamIEEE1"; -const char* GovSteamIEEE1::debugString() +void GovSteamIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamIEEE1::debugName; } const BaseClassDefiner GovSteamIEEE1::declare() @@ -353,4 +374,10 @@ const BaseClassDefiner GovSteamIEEE1::declare() return BaseClassDefiner(GovSteamIEEE1::addConstructToMap, GovSteamIEEE1::addPrimitiveAssignFnsToMap, GovSteamIEEE1::addClassAssignFnsToMap, GovSteamIEEE1::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamIEEE1_factory() + { + return new GovSteamIEEE1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.hpp b/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.hpp index 5d42a4071..e42a8348c 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamIEEE1.hpp @@ -1,61 +1,62 @@ #ifndef GovSteamIEEE1_H #define GovSteamIEEE1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEEE steam turbine governor model. Ref */ - class GovSteamIEEE1: public TurbineGovernorDynamics + class GovSteamIEEE1 : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0) Default: nullptr */ - CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (> 0). Typical Value = 25. Default: nullptr */ - CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t3; /* Valve positioner time constant (T3) (> 0). Typical Value = 0.1. Default: nullptr */ - CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (> 0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (< 0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ - CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ - CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>= 0). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ - CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ - CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ - CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamIEEE1(); - virtual ~GovSteamIEEE1(); - + ~GovSteamIEEE1() override; + + CIMPP::PU k; /* Governor gain (reciprocal of droop) (K) (> 0). Typical Value = 25. Default: nullptr */ + CIMPP::Simple_Float k1; /* Fraction of HP shaft power after first boiler pass (K1). Typical Value = 0.2. Default: nullptr */ + CIMPP::Simple_Float k2; /* Fraction of LP shaft power after first boiler pass (K2). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k3; /* Fraction of HP shaft power after second boiler pass (K3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float k4; /* Fraction of LP shaft power after second boiler pass (K4). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k5; /* Fraction of HP shaft power after third boiler pass (K5). Typical Value = 0.5. Default: nullptr */ + CIMPP::Simple_Float k6; /* Fraction of LP shaft power after third boiler pass (K6). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k7; /* Fraction of HP shaft power after fourth boiler pass (K7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float k8; /* Fraction of LP shaft power after fourth boiler pass (K8). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (> 0) Default: nullptr */ + CIMPP::PU pmax; /* Maximum valve opening (Pmax) (> Pmin). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmin; /* Minimum valve opening (Pmin) (>= 0). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t1; /* Governor lag time constant (T1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Governor lead time constant (T2). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t3; /* Valve positioner time constant (T3) (> 0). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t4; /* Inlet piping/steam bowl time constant (T4). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant of second boiler pass (T5). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant of third boiler pass (T6). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant of fourth boiler pass (T7). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float uc; /* Maximum valve closing velocity (Uc) (< 0). Unit = PU/sec. Typical Value = -10. Default: nullptr */ + CIMPP::Simple_Float uo; /* Maximum valve opening velocity (Uo) (> 0). Unit = PU/sec. Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamIEEE1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GovSteamSGO.cpp b/CGMES_2.4.15_27JAN2020/GovSteamSGO.cpp index 009818518..6ebbc4068 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamSGO.cpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamSGO.cpp @@ -1,216 +1,228 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GovSteamSGO.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "ActivePower.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" using namespace CIMPP; GovSteamSGO::GovSteamSGO() {}; - GovSteamSGO::~GovSteamSGO() {}; +bool assign_GovSteamSGO_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_GovSteamSGO_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GovSteamSGO_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamSGO_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamSGO_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_GovSteamSGO_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_pmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_GovSteamSGO_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GovSteamSGO* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* GovSteamSGO_factory() { - return new GovSteamSGO; - } + + + + + + + + + +const char GovSteamSGO::debugName[] = "GovSteamSGO"; +const char* GovSteamSGO::debugString() const +{ + return GovSteamSGO::debugName; } -void GovSteamSGO::addConstructToMap(std::unordered_map& factory_map) { +void GovSteamSGO::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GovSteamSGO"), &GovSteamSGO_factory)); } -void GovSteamSGO::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GovSteamSGO::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k1"), &assign_GovSteamSGO_k1)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k2"), &assign_GovSteamSGO_k2)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k3"), &assign_GovSteamSGO_k3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.mwbase"), &assign_GovSteamSGO_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmax"), &assign_GovSteamSGO_pmax)); + assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmin"), &assign_GovSteamSGO_pmin)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t1"), &assign_GovSteamSGO_t1)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t2"), &assign_GovSteamSGO_t2)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t3"), &assign_GovSteamSGO_t3)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t4"), &assign_GovSteamSGO_t4)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t5"), &assign_GovSteamSGO_t5)); assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.t6"), &assign_GovSteamSGO_t6)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k1"), &assign_GovSteamSGO_k1)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k2"), &assign_GovSteamSGO_k2)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.k3"), &assign_GovSteamSGO_k3)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmax"), &assign_GovSteamSGO_pmax)); - assign_map.insert(std::make_pair(std::string("cim:GovSteamSGO.pmin"), &assign_GovSteamSGO_pmin)); } -void GovSteamSGO::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GovSteamSGO::debugName[] = "GovSteamSGO"; -const char* GovSteamSGO::debugString() +void GovSteamSGO::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GovSteamSGO::debugName; } const BaseClassDefiner GovSteamSGO::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner GovSteamSGO::declare() return BaseClassDefiner(GovSteamSGO::addConstructToMap, GovSteamSGO::addPrimitiveAssignFnsToMap, GovSteamSGO::addClassAssignFnsToMap, GovSteamSGO::debugName); } - +namespace CIMPP +{ + BaseClass* GovSteamSGO_factory() + { + return new GovSteamSGO; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GovSteamSGO.hpp b/CGMES_2.4.15_27JAN2020/GovSteamSGO.hpp index 01f856226..24b2aab7f 100644 --- a/CGMES_2.4.15_27JAN2020/GovSteamSGO.hpp +++ b/CGMES_2.4.15_27JAN2020/GovSteamSGO.hpp @@ -1,51 +1,52 @@ #ifndef GovSteamSGO_H #define GovSteamSGO_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Simplified Steam turbine governor model. */ - class GovSteamSGO: public TurbineGovernorDynamics + class GovSteamSGO : public TurbineGovernorDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Seconds t1; /* Controller lag (T1). Default: nullptr */ - CIMPP::Seconds t2; /* Controller lead compensation (T2). Default: nullptr */ - CIMPP::Seconds t3; /* Governor lag (T3) (>0). Default: nullptr */ - CIMPP::Seconds t4; /* Delay due to steam inlet volumes associated with steam chest and inlet piping (T4). Default: nullptr */ - CIMPP::Seconds t5; /* Reheater delay including hot and cold leads (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Delay due to IP-LP turbine, crossover pipes and LP end hoods (T6). Default: nullptr */ - CIMPP::PU k1; /* One/per unit regulation (K1). Default: nullptr */ - CIMPP::PU k2; /* Fraction (K2). Default: nullptr */ - CIMPP::PU k3; /* Fraction (K3). Default: nullptr */ - CIMPP::PU pmax; /* Upper power limit (Pmax). Default: nullptr */ - CIMPP::Seconds pmin; /* Lower power limit (Pmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GovSteamSGO(); - virtual ~GovSteamSGO(); - + ~GovSteamSGO() override; + + CIMPP::PU k1; /* One/per unit regulation (K1). Default: nullptr */ + CIMPP::PU k2; /* Fraction (K2). Default: nullptr */ + CIMPP::PU k3; /* Fraction (K3). Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::PU pmax; /* Upper power limit (Pmax). Default: nullptr */ + CIMPP::Seconds pmin; /* Lower power limit (Pmin). Default: nullptr */ + CIMPP::Seconds t1; /* Controller lag (T1). Default: nullptr */ + CIMPP::Seconds t2; /* Controller lead compensation (T2). Default: nullptr */ + CIMPP::Seconds t3; /* Governor lag (T3) (>0). Default: nullptr */ + CIMPP::Seconds t4; /* Delay due to steam inlet volumes associated with steam chest and inlet piping (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Reheater delay including hot and cold leads (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Delay due to IP-LP turbine, crossover pipes and LP end hoods (T6). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GovSteamSGO_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.cpp b/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.cpp index f2b70de95..5613e7343 100644 --- a/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.cpp +++ b/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.cpp @@ -1,49 +1,56 @@ -#include -#include "Curve.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GrossToNetActivePowerCurve.hpp" +#include +#include + #include "GeneratingUnit.hpp" using namespace CIMPP; -GrossToNetActivePowerCurve::GrossToNetActivePowerCurve(): GeneratingUnit(nullptr) {}; - +GrossToNetActivePowerCurve::GrossToNetActivePowerCurve() : GeneratingUnit(nullptr) {}; GrossToNetActivePowerCurve::~GrossToNetActivePowerCurve() {}; -bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass*, BaseClass*); -bool assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(GrossToNetActivePowerCurve* element = dynamic_cast(BaseClass_ptr1)) { - element->GeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->GeneratingUnit != nullptr) - return assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* GrossToNetActivePowerCurve_factory() { - return new GrossToNetActivePowerCurve; +bool assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass*, BaseClass*); +bool assign_GrossToNetActivePowerCurve_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + GrossToNetActivePowerCurve* element = dynamic_cast(BaseClass_ptr1); + GeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->GeneratingUnit != element2) + { + element->GeneratingUnit = element2; + return assign_GeneratingUnit_GrossToNetActivePowerCurves(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void GrossToNetActivePowerCurve::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve"), &GrossToNetActivePowerCurve_factory)); +const char GrossToNetActivePowerCurve::debugName[] = "GrossToNetActivePowerCurve"; +const char* GrossToNetActivePowerCurve::debugString() const +{ + return GrossToNetActivePowerCurve::debugName; } -void GrossToNetActivePowerCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void GrossToNetActivePowerCurve::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve"), &GrossToNetActivePowerCurve_factory)); +} -void GrossToNetActivePowerCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve.GeneratingUnit"), &assign_GrossToNetActivePowerCurve_GeneratingUnit)); +void GrossToNetActivePowerCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char GrossToNetActivePowerCurve::debugName[] = "GrossToNetActivePowerCurve"; -const char* GrossToNetActivePowerCurve::debugString() +void GrossToNetActivePowerCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GrossToNetActivePowerCurve::debugName; + assign_map.insert(std::make_pair(std::string("cim:GrossToNetActivePowerCurve.GeneratingUnit"), &assign_GrossToNetActivePowerCurve_GeneratingUnit)); } const BaseClassDefiner GrossToNetActivePowerCurve::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner GrossToNetActivePowerCurve::declare() return BaseClassDefiner(GrossToNetActivePowerCurve::addConstructToMap, GrossToNetActivePowerCurve::addPrimitiveAssignFnsToMap, GrossToNetActivePowerCurve::addClassAssignFnsToMap, GrossToNetActivePowerCurve::debugName); } - +namespace CIMPP +{ + BaseClass* GrossToNetActivePowerCurve_factory() + { + return new GrossToNetActivePowerCurve; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.hpp b/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.hpp index 5b039fbee..9d1c592a5 100644 --- a/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.hpp +++ b/CGMES_2.4.15_27JAN2020/GrossToNetActivePowerCurve.hpp @@ -1,38 +1,39 @@ #ifndef GrossToNetActivePowerCurve_H #define GrossToNetActivePowerCurve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Curve.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Curve.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class GeneratingUnit; -class GeneratingUnit; /* Relationship between the generating unit's gross active power output on the X-axis (measured at the terminals of the machine(s)) and the generating unit's net active power output on the Y-axis (based on utility-defined measurements at the power station). Station service loads, when modeled, should be treated as non-conforming bus loads. There may be more than one curve, depending on the auxiliary equipment that is in service. */ - class GrossToNetActivePowerCurve: public Curve + class GrossToNetActivePowerCurve : public Curve { - public: - CIMPP::GeneratingUnit* GeneratingUnit; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GrossToNetActivePowerCurve(); - virtual ~GrossToNetActivePowerCurve(); - + ~GrossToNetActivePowerCurve() override; + + CIMPP::GeneratingUnit* GeneratingUnit; /* A generating unit may have a gross active power to net active power curve, describing the losses and auxiliary power requirements of the unit. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GrossToNetActivePowerCurve_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Ground.cpp b/CGMES_2.4.15_27JAN2020/Ground.cpp index f4782840d..6ecc2e31b 100644 --- a/CGMES_2.4.15_27JAN2020/Ground.cpp +++ b/CGMES_2.4.15_27JAN2020/Ground.cpp @@ -1,36 +1,36 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Ground.hpp" +#include +#include + using namespace CIMPP; Ground::Ground() {}; - Ground::~Ground() {}; -namespace CIMPP { - BaseClass* Ground_factory() { - return new Ground; - } +const char Ground::debugName[] = "Ground"; +const char* Ground::debugString() const +{ + return Ground::debugName; } -void Ground::addConstructToMap(std::unordered_map& factory_map) { +void Ground::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Ground"), &Ground_factory)); } -void Ground::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Ground::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Ground::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Ground::debugName[] = "Ground"; -const char* Ground::debugString() +void Ground::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Ground::debugName; } const BaseClassDefiner Ground::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Ground::declare() return BaseClassDefiner(Ground::addConstructToMap, Ground::addPrimitiveAssignFnsToMap, Ground::addClassAssignFnsToMap, Ground::debugName); } - +namespace CIMPP +{ + BaseClass* Ground_factory() + { + return new Ground; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Ground.hpp b/CGMES_2.4.15_27JAN2020/Ground.hpp index 957975aec..884ee0ea2 100644 --- a/CGMES_2.4.15_27JAN2020/Ground.hpp +++ b/CGMES_2.4.15_27JAN2020/Ground.hpp @@ -1,36 +1,37 @@ #ifndef Ground_H #define Ground_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A point where the system is grounded used for connecting conducting equipment to ground. The power system model can have any number of grounds. */ - class Ground: public ConductingEquipment + class Ground : public ConductingEquipment { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Ground(); - virtual ~Ground(); - + ~Ground() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Ground_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GroundDisconnector.cpp b/CGMES_2.4.15_27JAN2020/GroundDisconnector.cpp index 916d77d68..0e0e20f77 100644 --- a/CGMES_2.4.15_27JAN2020/GroundDisconnector.cpp +++ b/CGMES_2.4.15_27JAN2020/GroundDisconnector.cpp @@ -1,36 +1,36 @@ -#include -#include "Switch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GroundDisconnector.hpp" +#include +#include + using namespace CIMPP; GroundDisconnector::GroundDisconnector() {}; - GroundDisconnector::~GroundDisconnector() {}; -namespace CIMPP { - BaseClass* GroundDisconnector_factory() { - return new GroundDisconnector; - } +const char GroundDisconnector::debugName[] = "GroundDisconnector"; +const char* GroundDisconnector::debugString() const +{ + return GroundDisconnector::debugName; } -void GroundDisconnector::addConstructToMap(std::unordered_map& factory_map) { +void GroundDisconnector::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GroundDisconnector"), &GroundDisconnector_factory)); } -void GroundDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void GroundDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void GroundDisconnector::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char GroundDisconnector::debugName[] = "GroundDisconnector"; -const char* GroundDisconnector::debugString() +void GroundDisconnector::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GroundDisconnector::debugName; } const BaseClassDefiner GroundDisconnector::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner GroundDisconnector::declare() return BaseClassDefiner(GroundDisconnector::addConstructToMap, GroundDisconnector::addPrimitiveAssignFnsToMap, GroundDisconnector::addClassAssignFnsToMap, GroundDisconnector::debugName); } - +namespace CIMPP +{ + BaseClass* GroundDisconnector_factory() + { + return new GroundDisconnector; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GroundDisconnector.hpp b/CGMES_2.4.15_27JAN2020/GroundDisconnector.hpp index 6468eb944..205e960d4 100644 --- a/CGMES_2.4.15_27JAN2020/GroundDisconnector.hpp +++ b/CGMES_2.4.15_27JAN2020/GroundDisconnector.hpp @@ -1,36 +1,37 @@ #ifndef GroundDisconnector_H #define GroundDisconnector_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Switch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Switch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A manually operated or motor operated mechanical switching device used for isolating a circuit or equipment from ground. */ - class GroundDisconnector: public Switch + class GroundDisconnector : public Switch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GroundDisconnector(); - virtual ~GroundDisconnector(); - + ~GroundDisconnector() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GroundDisconnector_factory(); diff --git a/CGMES_2.4.15_27JAN2020/GroundingImpedance.cpp b/CGMES_2.4.15_27JAN2020/GroundingImpedance.cpp index 2921d989c..69249ef74 100644 --- a/CGMES_2.4.15_27JAN2020/GroundingImpedance.cpp +++ b/CGMES_2.4.15_27JAN2020/GroundingImpedance.cpp @@ -1,51 +1,52 @@ -#include -#include "EarthFaultCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "GroundingImpedance.hpp" +#include +#include + #include "Reactance.hpp" using namespace CIMPP; GroundingImpedance::GroundingImpedance() {}; - GroundingImpedance::~GroundingImpedance() {}; +bool assign_GroundingImpedance_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (GroundingImpedance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_GroundingImpedance_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(GroundingImpedance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* GroundingImpedance_factory() { - return new GroundingImpedance; - } +const char GroundingImpedance::debugName[] = "GroundingImpedance"; +const char* GroundingImpedance::debugString() const +{ + return GroundingImpedance::debugName; } -void GroundingImpedance::addConstructToMap(std::unordered_map& factory_map) { +void GroundingImpedance::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:GroundingImpedance"), &GroundingImpedance_factory)); } -void GroundingImpedance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void GroundingImpedance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:GroundingImpedance.x"), &assign_GroundingImpedance_x)); } -void GroundingImpedance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char GroundingImpedance::debugName[] = "GroundingImpedance"; -const char* GroundingImpedance::debugString() +void GroundingImpedance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return GroundingImpedance::debugName; } const BaseClassDefiner GroundingImpedance::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner GroundingImpedance::declare() return BaseClassDefiner(GroundingImpedance::addConstructToMap, GroundingImpedance::addPrimitiveAssignFnsToMap, GroundingImpedance::addClassAssignFnsToMap, GroundingImpedance::debugName); } - +namespace CIMPP +{ + BaseClass* GroundingImpedance_factory() + { + return new GroundingImpedance; + } +} diff --git a/CGMES_2.4.15_27JAN2020/GroundingImpedance.hpp b/CGMES_2.4.15_27JAN2020/GroundingImpedance.hpp index 9dff17f5d..38e6733ff 100644 --- a/CGMES_2.4.15_27JAN2020/GroundingImpedance.hpp +++ b/CGMES_2.4.15_27JAN2020/GroundingImpedance.hpp @@ -1,38 +1,39 @@ #ifndef GroundingImpedance_H #define GroundingImpedance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EarthFaultCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "EarthFaultCompensator.hpp" +#include "BaseClassDefiner.hpp" #include "Reactance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A fixed impedance device used for grounding. */ - class GroundingImpedance: public EarthFaultCompensator + class GroundingImpedance : public EarthFaultCompensator { - public: - CIMPP::Reactance x; /* Reactance of device. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ GroundingImpedance(); - virtual ~GroundingImpedance(); - + ~GroundingImpedance() override; + + CIMPP::Reactance x; /* Reactance of device. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* GroundingImpedance_factory(); diff --git a/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.cpp b/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.cpp index 4b2174501..1bc81701f 100644 --- a/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.cpp +++ b/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroEnergyConversionKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::HydroEnergyConversionKind& rop) +HydroEnergyConversionKind& HydroEnergyConversionKind::operator=(HydroEnergyConversionKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +HydroEnergyConversionKind::operator HydroEnergyConversionKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char HydroEnergyConversionKind::debugName[] = "HydroEnergyConversionKind"; +const char* HydroEnergyConversionKind::debugString() const +{ + return HydroEnergyConversionKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, HydroEnergyConversionKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const HydroEnergyConversionKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == HydroEnergyConversionKind::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == HydroEnergyConversionKind::pumpAndGenerator) + { + EnumSymbol = "pumpAndGenerator"; + } + + if (!EnumSymbol.empty()) + { + os << "HydroEnergyConversionKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.hpp b/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.hpp index 8c8a2bc26..fb666b097 100644 --- a/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.hpp +++ b/CGMES_2.4.15_27JAN2020/HydroEnergyConversionKind.hpp @@ -1,21 +1,46 @@ #ifndef HydroEnergyConversionKind_H #define HydroEnergyConversionKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Specifies the capability of the hydro generating unit to convert energy as a generator or pump. */ - enum class HydroEnergyConversionKind + class HydroEnergyConversionKind { - /** - * Able to generate power, but not able to pump water for energy storage. - */ - generator, - /** - * Able to both generate power and pump water for energy storage. - */ - pumpAndGenerator, + public: + enum HydroEnergyConversionKind_ENUM + { + /** + * Able to generate power, but not able to pump water for energy storage. + */ + generator, + /** + * Able to both generate power and pump water for energy storage. + */ + pumpAndGenerator, + }; + + HydroEnergyConversionKind() : value(), initialized(false) {} + HydroEnergyConversionKind(HydroEnergyConversionKind_ENUM value) : value(value), initialized(true) {} + + HydroEnergyConversionKind& operator=(HydroEnergyConversionKind_ENUM rop); + operator HydroEnergyConversionKind_ENUM() const; + + HydroEnergyConversionKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, HydroEnergyConversionKind& rop); + friend std::ostream& operator<<(std::ostream& os, const HydroEnergyConversionKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::HydroEnergyConversionKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.cpp index 0ec06387c..f9ce566a9 100644 --- a/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.cpp @@ -1,64 +1,72 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroGeneratingUnit.hpp" -#include "HydroEnergyConversionKind.hpp" +#include +#include + #include "HydroPowerPlant.hpp" +#include "HydroEnergyConversionKind.hpp" using namespace CIMPP; -HydroGeneratingUnit::HydroGeneratingUnit(): HydroPowerPlant(nullptr) {}; - +HydroGeneratingUnit::HydroGeneratingUnit() : HydroPowerPlant(nullptr) {}; HydroGeneratingUnit::~HydroGeneratingUnit() {}; -bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass*, BaseClass*); -bool assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - element->HydroPowerPlant = dynamic_cast(BaseClass_ptr2); - if(element->HydroPowerPlant != nullptr) - return assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_HydroGeneratingUnit_energyConversionCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->energyConversionCapability; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_HydroGeneratingUnit_energyConversionCapability(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->energyConversionCapability; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass*, BaseClass*); +bool assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + HydroPowerPlant* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->HydroPowerPlant != element2) + { + element->HydroPowerPlant = element2; + return assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* HydroGeneratingUnit_factory() { - return new HydroGeneratingUnit; - } +const char HydroGeneratingUnit::debugName[] = "HydroGeneratingUnit"; +const char* HydroGeneratingUnit::debugString() const +{ + return HydroGeneratingUnit::debugName; } -void HydroGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void HydroGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit"), &HydroGeneratingUnit_factory)); } -void HydroGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void HydroGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit.energyConversionCapability"), &assign_HydroGeneratingUnit_energyConversionCapability)); - } - -void HydroGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit.HydroPowerPlant"), &assign_HydroGeneratingUnit_HydroPowerPlant)); } -const char HydroGeneratingUnit::debugName[] = "HydroGeneratingUnit"; -const char* HydroGeneratingUnit::debugString() +void HydroGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return HydroGeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:HydroGeneratingUnit.HydroPowerPlant"), &assign_HydroGeneratingUnit_HydroPowerPlant)); } const BaseClassDefiner HydroGeneratingUnit::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner HydroGeneratingUnit::declare() return BaseClassDefiner(HydroGeneratingUnit::addConstructToMap, HydroGeneratingUnit::addPrimitiveAssignFnsToMap, HydroGeneratingUnit::addClassAssignFnsToMap, HydroGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* HydroGeneratingUnit_factory() + { + return new HydroGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.hpp index 06c820579..c431967f3 100644 --- a/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/HydroGeneratingUnit.hpp @@ -1,40 +1,41 @@ #ifndef HydroGeneratingUnit_H #define HydroGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" #include "HydroEnergyConversionKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class HydroPowerPlant; - -class HydroPowerPlant; /* A generating unit whose prime mover is a hydraulic turbine (e.g., Francis, Pelton, Kaplan). */ - class HydroGeneratingUnit: public GeneratingUnit + class HydroGeneratingUnit : public GeneratingUnit { - public: - CIMPP::HydroEnergyConversionKind energyConversionCapability; /* Energy conversion capability for generating. Default: 0 */ - CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ HydroGeneratingUnit(); - virtual ~HydroGeneratingUnit(); - + ~HydroGeneratingUnit() override; + + CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ + CIMPP::HydroEnergyConversionKind energyConversionCapability; /* Energy conversion capability for generating. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* HydroGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.cpp b/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.cpp index 253416bd5..4930efb66 100644 --- a/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.cpp +++ b/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroPlantStorageKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::HydroPlantStorageKind& rop) +HydroPlantStorageKind& HydroPlantStorageKind::operator=(HydroPlantStorageKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +HydroPlantStorageKind::operator HydroPlantStorageKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char HydroPlantStorageKind::debugName[] = "HydroPlantStorageKind"; +const char* HydroPlantStorageKind::debugString() const +{ + return HydroPlantStorageKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, HydroPlantStorageKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const HydroPlantStorageKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == HydroPlantStorageKind::runOfRiver) + { + EnumSymbol = "runOfRiver"; + } + if (obj.value == HydroPlantStorageKind::pumpedStorage) + { + EnumSymbol = "pumpedStorage"; + } + if (obj.value == HydroPlantStorageKind::storage) + { + EnumSymbol = "storage"; + } + + if (!EnumSymbol.empty()) + { + os << "HydroPlantStorageKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.hpp b/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.hpp index 80b35ab00..ddd375110 100644 --- a/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.hpp +++ b/CGMES_2.4.15_27JAN2020/HydroPlantStorageKind.hpp @@ -1,25 +1,50 @@ #ifndef HydroPlantStorageKind_H #define HydroPlantStorageKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The type of hydro power plant. */ - enum class HydroPlantStorageKind + class HydroPlantStorageKind { - /** - * Run of river. - */ - runOfRiver, - /** - * Pumped storage. - */ - pumpedStorage, - /** - * Storage. - */ - storage, + public: + enum HydroPlantStorageKind_ENUM + { + /** + * Run of river. + */ + runOfRiver, + /** + * Pumped storage. + */ + pumpedStorage, + /** + * Storage. + */ + storage, + }; + + HydroPlantStorageKind() : value(), initialized(false) {} + HydroPlantStorageKind(HydroPlantStorageKind_ENUM value) : value(value), initialized(true) {} + + HydroPlantStorageKind& operator=(HydroPlantStorageKind_ENUM rop); + operator HydroPlantStorageKind_ENUM() const; + + HydroPlantStorageKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, HydroPlantStorageKind& rop); + friend std::ostream& operator<<(std::ostream& os, const HydroPlantStorageKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::HydroPlantStorageKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/HydroPowerPlant.cpp b/CGMES_2.4.15_27JAN2020/HydroPowerPlant.cpp index 4e5888666..d17dd63dc 100644 --- a/CGMES_2.4.15_27JAN2020/HydroPowerPlant.cpp +++ b/CGMES_2.4.15_27JAN2020/HydroPowerPlant.cpp @@ -1,77 +1,92 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroPowerPlant.hpp" +#include +#include + #include "HydroGeneratingUnit.hpp" -#include "HydroPlantStorageKind.hpp" #include "HydroPump.hpp" +#include "HydroPlantStorageKind.hpp" using namespace CIMPP; HydroPowerPlant::HydroPowerPlant() {}; - HydroPowerPlant::~HydroPowerPlant() {}; -bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HydroGeneratingUnits.push_back(dynamic_cast(BaseClass_ptr2)); + + +bool assign_HydroPowerPlant_hydroPlantStorageType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hydroPlantStorageType; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_HydroPowerPlant_HydroPumps(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HydroPumps.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass*, BaseClass*); +bool assign_HydroPowerPlant_HydroGeneratingUnits(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1); + HydroGeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HydroGeneratingUnits.begin(), element->HydroGeneratingUnits.end(), element2) == element->HydroGeneratingUnits.end()) + { + element->HydroGeneratingUnits.push_back(element2); + return assign_HydroGeneratingUnit_HydroPowerPlant(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -bool assign_HydroPowerPlant_hydroPlantStorageType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hydroPlantStorageType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_HydroPump_HydroPowerPlant(BaseClass*, BaseClass*); +bool assign_HydroPowerPlant_HydroPumps(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPowerPlant* element = dynamic_cast(BaseClass_ptr1); + HydroPump* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HydroPumps.begin(), element->HydroPumps.end(), element2) == element->HydroPumps.end()) + { + element->HydroPumps.push_back(element2); + return assign_HydroPump_HydroPowerPlant(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* HydroPowerPlant_factory() { - return new HydroPowerPlant; - } +const char HydroPowerPlant::debugName[] = "HydroPowerPlant"; +const char* HydroPowerPlant::debugString() const +{ + return HydroPowerPlant::debugName; } -void HydroPowerPlant::addConstructToMap(std::unordered_map& factory_map) { +void HydroPowerPlant::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:HydroPowerPlant"), &HydroPowerPlant_factory)); } -void HydroPowerPlant::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.hydroPlantStorageType"), &assign_HydroPowerPlant_hydroPlantStorageType)); - } - -void HydroPowerPlant::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroGeneratingUnits"), &assign_HydroPowerPlant_HydroGeneratingUnits)); - assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroPumps"), &assign_HydroPowerPlant_HydroPumps)); +void HydroPowerPlant::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.hydroPlantStorageType"), &assign_HydroPowerPlant_hydroPlantStorageType)); } -const char HydroPowerPlant::debugName[] = "HydroPowerPlant"; -const char* HydroPowerPlant::debugString() +void HydroPowerPlant::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return HydroPowerPlant::debugName; + assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroGeneratingUnits"), &assign_HydroPowerPlant_HydroGeneratingUnits)); + assign_map.insert(std::make_pair(std::string("cim:HydroPowerPlant.HydroPumps"), &assign_HydroPowerPlant_HydroPumps)); } const BaseClassDefiner HydroPowerPlant::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner HydroPowerPlant::declare() return BaseClassDefiner(HydroPowerPlant::addConstructToMap, HydroPowerPlant::addPrimitiveAssignFnsToMap, HydroPowerPlant::addClassAssignFnsToMap, HydroPowerPlant::debugName); } - +namespace CIMPP +{ + BaseClass* HydroPowerPlant_factory() + { + return new HydroPowerPlant; + } +} diff --git a/CGMES_2.4.15_27JAN2020/HydroPowerPlant.hpp b/CGMES_2.4.15_27JAN2020/HydroPowerPlant.hpp index b059060a8..40f735bc6 100644 --- a/CGMES_2.4.15_27JAN2020/HydroPowerPlant.hpp +++ b/CGMES_2.4.15_27JAN2020/HydroPowerPlant.hpp @@ -1,42 +1,43 @@ #ifndef HydroPowerPlant_H #define HydroPowerPlant_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "HydroPlantStorageKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class HydroGeneratingUnit; + class HydroPump; - -class HydroGeneratingUnit; -class HydroPump; /* A hydro power station which can generate or pump. When generating, the generator turbines receive water from an upper reservoir. When pumping, the pumps receive their water from a lower reservoir. */ - class HydroPowerPlant: public PowerSystemResource + class HydroPowerPlant : public PowerSystemResource { - public: - std::list HydroGeneratingUnits; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ - CIMPP::HydroPlantStorageKind hydroPlantStorageType; /* The type of hydro power plant water storage. Default: 0 */ - std::list HydroPumps; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ HydroPowerPlant(); - virtual ~HydroPowerPlant(); - + ~HydroPowerPlant() override; + + std::list HydroGeneratingUnits; /* The hydro generating unit belongs to a hydro power plant. Default: 0 */ + std::list HydroPumps; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ + CIMPP::HydroPlantStorageKind hydroPlantStorageType; /* The type of hydro power plant water storage. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* HydroPowerPlant_factory(); diff --git a/CGMES_2.4.15_27JAN2020/HydroPump.cpp b/CGMES_2.4.15_27JAN2020/HydroPump.cpp index ce26816c6..0e80d09dc 100644 --- a/CGMES_2.4.15_27JAN2020/HydroPump.cpp +++ b/CGMES_2.4.15_27JAN2020/HydroPump.cpp @@ -1,62 +1,76 @@ -#include -#include "Equipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "HydroPump.hpp" +#include +#include + #include "HydroPowerPlant.hpp" #include "RotatingMachine.hpp" using namespace CIMPP; -HydroPump::HydroPump(): HydroPowerPlant(nullptr), RotatingMachine(nullptr) {}; - +HydroPump::HydroPump() : HydroPowerPlant(nullptr), RotatingMachine(nullptr) {}; HydroPump::~HydroPump() {}; + + + bool assign_HydroPowerPlant_HydroPumps(BaseClass*, BaseClass*); -bool assign_HydroPump_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPump* element = dynamic_cast(BaseClass_ptr1)) { - element->HydroPowerPlant = dynamic_cast(BaseClass_ptr2); - if(element->HydroPowerPlant != nullptr) - return assign_HydroPowerPlant_HydroPumps(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_HydroPump_HydroPowerPlant(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPump* element = dynamic_cast(BaseClass_ptr1); + HydroPowerPlant* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->HydroPowerPlant != element2) + { + element->HydroPowerPlant = element2; + return assign_HydroPowerPlant_HydroPumps(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_RotatingMachine_HydroPump(BaseClass*, BaseClass*); -bool assign_HydroPump_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(HydroPump* element = dynamic_cast(BaseClass_ptr1)) { - element->RotatingMachine = dynamic_cast(BaseClass_ptr2); - if(element->RotatingMachine != nullptr) - return assign_RotatingMachine_HydroPump(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_HydroPump_RotatingMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + HydroPump* element = dynamic_cast(BaseClass_ptr1); + RotatingMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RotatingMachine != element2) + { + element->RotatingMachine = element2; + return assign_RotatingMachine_HydroPump(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* HydroPump_factory() { - return new HydroPump; - } +const char HydroPump::debugName[] = "HydroPump"; +const char* HydroPump::debugString() const +{ + return HydroPump::debugName; } -void HydroPump::addConstructToMap(std::unordered_map& factory_map) { +void HydroPump::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:HydroPump"), &HydroPump_factory)); } -void HydroPump::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void HydroPump::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:HydroPump.HydroPowerPlant"), &assign_HydroPump_HydroPowerPlant)); - assign_map.insert(std::make_pair(std::string("cim:HydroPump.RotatingMachine"), &assign_HydroPump_RotatingMachine)); +void HydroPump::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char HydroPump::debugName[] = "HydroPump"; -const char* HydroPump::debugString() +void HydroPump::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return HydroPump::debugName; + assign_map.insert(std::make_pair(std::string("cim:HydroPump.HydroPowerPlant"), &assign_HydroPump_HydroPowerPlant)); + assign_map.insert(std::make_pair(std::string("cim:HydroPump.RotatingMachine"), &assign_HydroPump_RotatingMachine)); } const BaseClassDefiner HydroPump::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner HydroPump::declare() return BaseClassDefiner(HydroPump::addConstructToMap, HydroPump::addPrimitiveAssignFnsToMap, HydroPump::addClassAssignFnsToMap, HydroPump::debugName); } - +namespace CIMPP +{ + BaseClass* HydroPump_factory() + { + return new HydroPump; + } +} diff --git a/CGMES_2.4.15_27JAN2020/HydroPump.hpp b/CGMES_2.4.15_27JAN2020/HydroPump.hpp index 03d6266d0..54ab372d8 100644 --- a/CGMES_2.4.15_27JAN2020/HydroPump.hpp +++ b/CGMES_2.4.15_27JAN2020/HydroPump.hpp @@ -1,40 +1,41 @@ #ifndef HydroPump_H #define HydroPump_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Equipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Equipment.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class HydroPowerPlant; + class RotatingMachine; -class HydroPowerPlant; -class RotatingMachine; /* A synchronous motor-driven pump, typically associated with a pumped storage plant. */ - class HydroPump: public Equipment + class HydroPump : public Equipment { - public: - CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ - CIMPP::RotatingMachine* RotatingMachine; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ HydroPump(); - virtual ~HydroPump(); - + ~HydroPump() override; + + CIMPP::HydroPowerPlant* HydroPowerPlant; /* The hydro pump may be a member of a pumped storage plant or a pump for distributing water. Default: 0 */ + CIMPP::RotatingMachine* RotatingMachine; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* HydroPump_factory(); diff --git a/CGMES_2.4.15_27JAN2020/IEC61970.hpp b/CGMES_2.4.15_27JAN2020/IEC61970.hpp index 792dd585d..32e9abca4 100644 --- a/CGMES_2.4.15_27JAN2020/IEC61970.hpp +++ b/CGMES_2.4.15_27JAN2020/IEC61970.hpp @@ -1,5 +1,9 @@ #ifndef IEC61970_H #define IEC61970_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + #include "ACDCConverter.hpp" #include "ACDCConverterDCTerminal.hpp" #include "ACDCTerminal.hpp" @@ -9,39 +13,25 @@ #include "AccumulatorLimitSet.hpp" #include "AccumulatorReset.hpp" #include "AccumulatorValue.hpp" -#include "ActivePower.hpp" #include "ActivePowerLimit.hpp" -#include "ActivePowerPerCurrentFlow.hpp" -#include "ActivePowerPerFrequency.hpp" #include "Analog.hpp" #include "AnalogControl.hpp" #include "AnalogLimit.hpp" #include "AnalogLimitSet.hpp" #include "AnalogValue.hpp" -#include "AngleDegrees.hpp" -#include "AngleRadians.hpp" -#include "ApparentPower.hpp" #include "ApparentPowerLimit.hpp" -#include "Area.hpp" #include "AsynchronousMachine.hpp" #include "AsynchronousMachineDynamics.hpp" #include "AsynchronousMachineEquivalentCircuit.hpp" #include "AsynchronousMachineTimeConstantReactance.hpp" #include "AsynchronousMachineUserDefined.hpp" -#include "BaseClass.hpp" -#include "BaseClassDefiner.hpp" #include "BaseVoltage.hpp" #include "BasicIntervalSchedule.hpp" #include "Bay.hpp" -#include "Boolean.hpp" #include "Breaker.hpp" #include "BusNameMarker.hpp" #include "BusbarSection.hpp" -#include "CIMFactory.hpp" -#include "Capacitance.hpp" -#include "CapacitancePerLength.hpp" #include "Command.hpp" -#include "Conductance.hpp" #include "ConductingEquipment.hpp" #include "Conductor.hpp" #include "ConformLoad.hpp" @@ -55,7 +45,6 @@ #include "ControlAreaGeneratingUnit.hpp" #include "CoordinateSystem.hpp" #include "CsConverter.hpp" -#include "CurrentFlow.hpp" #include "CurrentLimit.hpp" #include "Curve.hpp" #include "CurveData.hpp" @@ -77,10 +66,7 @@ #include "DCTerminal.hpp" #include "DCTopologicalIsland.hpp" #include "DCTopologicalNode.hpp" -#include "Date.hpp" -#include "DateTime.hpp" #include "DayType.hpp" -#include "Decimal.hpp" #include "Diagram.hpp" #include "DiagramLayoutVersion.hpp" #include "DiagramObject.hpp" @@ -169,9 +155,7 @@ #include "ExcitationSystemDynamics.hpp" #include "ExcitationSystemUserDefined.hpp" #include "ExternalNetworkInjection.hpp" -#include "Float.hpp" #include "FossilFuel.hpp" -#include "Frequency.hpp" #include "GenICompensationForGenJ.hpp" #include "GeneratingUnit.hpp" #include "GeographicalLocationVersion.hpp" @@ -216,11 +200,7 @@ #include "HydroPowerPlant.hpp" #include "HydroPump.hpp" #include "IdentifiedObject.hpp" -#include "Inductance.hpp" -#include "InductancePerLength.hpp" -#include "Integer.hpp" #include "Junction.hpp" -#include "Length.hpp" #include "Limit.hpp" #include "LimitSet.hpp" #include "Line.hpp" @@ -244,8 +224,6 @@ #include "MechLoad1.hpp" #include "MechanicalLoadDynamics.hpp" #include "MechanicalLoadUserDefined.hpp" -#include "Money.hpp" -#include "MonthDay.hpp" #include "MutualCoupling.hpp" #include "NonConformLoad.hpp" #include "NonConformLoadGroup.hpp" @@ -271,8 +249,6 @@ #include "PFVArType2Common1.hpp" #include "PFVArType2IEEEPFController.hpp" #include "PFVArType2IEEEVArController.hpp" -#include "PU.hpp" -#include "PerCent.hpp" #include "PerLengthDCLineParameter.hpp" #include "PetersenCoil.hpp" #include "PhaseTapChanger.hpp" @@ -312,9 +288,7 @@ #include "RatioTapChanger.hpp" #include "RatioTapChangerTable.hpp" #include "RatioTapChangerTablePoint.hpp" -#include "Reactance.hpp" #include "ReactiveCapabilityCurve.hpp" -#include "ReactivePower.hpp" #include "RegularIntervalSchedule.hpp" #include "RegularTimePoint.hpp" #include "RegulatingCondEq.hpp" @@ -322,30 +296,23 @@ #include "RegulationSchedule.hpp" #include "RemoteInputSignal.hpp" #include "ReportingGroup.hpp" -#include "Resistance.hpp" -#include "ResistancePerLength.hpp" #include "RotatingMachine.hpp" #include "RotatingMachineDynamics.hpp" -#include "RotationSpeed.hpp" #include "Season.hpp" #include "SeasonDayTypeSchedule.hpp" -#include "Seconds.hpp" #include "SeriesCompensator.hpp" #include "SetPoint.hpp" #include "ShuntCompensator.hpp" -#include "Simple_Float.hpp" #include "SolarGeneratingUnit.hpp" #include "StateVariablesVersion.hpp" #include "StaticVarCompensator.hpp" #include "StationSupply.hpp" #include "SteadyStateHypothesisVersion.hpp" -#include "String.hpp" #include "StringMeasurement.hpp" #include "StringMeasurementValue.hpp" #include "SubGeographicalRegion.hpp" #include "SubLoadArea.hpp" #include "Substation.hpp" -#include "Susceptance.hpp" #include "SvInjection.hpp" #include "SvPowerFlow.hpp" #include "SvShuntCompensatorSections.hpp" @@ -365,7 +332,6 @@ #include "TapChangerControl.hpp" #include "TapChangerTablePoint.hpp" #include "TapSchedule.hpp" -#include "Temperature.hpp" #include "Terminal.hpp" #include "TextDiagramObject.hpp" #include "ThermalGeneratingUnit.hpp" @@ -387,22 +353,18 @@ #include "UnderexcLimX2.hpp" #include "UnderexcitationLimiterDynamics.hpp" #include "UnderexcitationLimiterUserDefined.hpp" -#include "UnknownType.hpp" #include "VAdjIEEE.hpp" #include "VCompIEEEType1.hpp" #include "VCompIEEEType2.hpp" #include "ValueAliasSet.hpp" #include "ValueToAlias.hpp" #include "VisibilityLayer.hpp" -#include "Voltage.hpp" #include "VoltageAdjusterDynamics.hpp" #include "VoltageAdjusterUserDefined.hpp" #include "VoltageCompensatorDynamics.hpp" #include "VoltageCompensatorUserDefined.hpp" #include "VoltageLevel.hpp" #include "VoltageLimit.hpp" -#include "VoltagePerReactivePower.hpp" -#include "VolumeFlowRate.hpp" #include "VsCapabilityCurve.hpp" #include "VsConverter.hpp" #include "WindAeroConstIEC.hpp" @@ -438,6 +400,5 @@ #include "WindTurbineType4bIEC.hpp" #include "WindType1or2UserDefined.hpp" #include "WindType3or4UserDefined.hpp" -#include "assignments.hpp" #include "UnknownType.hpp" #endif \ No newline at end of file diff --git a/CGMES_2.4.15_27JAN2020/IdentifiedObject.cpp b/CGMES_2.4.15_27JAN2020/IdentifiedObject.cpp index d17100a1f..764198002 100644 --- a/CGMES_2.4.15_27JAN2020/IdentifiedObject.cpp +++ b/CGMES_2.4.15_27JAN2020/IdentifiedObject.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "IdentifiedObject.hpp" +#include +#include + #include "DiagramObject.hpp" #include "String.hpp" #include "String.hpp" @@ -12,31 +16,16 @@ using namespace CIMPP; IdentifiedObject::IdentifiedObject() {}; - IdentifiedObject::~IdentifiedObject() {}; -bool assign_IdentifiedObject_DiagramObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DiagramObjects.push_back(dynamic_cast(BaseClass_ptr2)); - return true; - } - } - return false; -} - - - - - - - -bool assign_IdentifiedObject_mRID(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->mRID = buffer.str(); - if(buffer.fail()) +bool assign_IdentifiedObject_description(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->description = buffer.str(); + if (buffer.fail()) return false; else return true; @@ -44,10 +33,12 @@ bool assign_IdentifiedObject_mRID(std::stringstream &buffer, BaseClass* BaseClas return false; } -bool assign_IdentifiedObject_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->name = buffer.str(); - if(buffer.fail()) +bool assign_IdentifiedObject_energyIdentCodeEic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->energyIdentCodeEic = buffer.str(); + if (buffer.fail()) return false; else return true; @@ -55,10 +46,12 @@ bool assign_IdentifiedObject_name(std::stringstream &buffer, BaseClass* BaseClas return false; } -bool assign_IdentifiedObject_description(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->description = buffer.str(); - if(buffer.fail()) +bool assign_IdentifiedObject_mRID(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->mRID = buffer.str(); + if (buffer.fail()) return false; else return true; @@ -66,10 +59,12 @@ bool assign_IdentifiedObject_description(std::stringstream &buffer, BaseClass* B return false; } -bool assign_IdentifiedObject_energyIdentCodeEic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { - element->energyIdentCodeEic = buffer.str(); - if(buffer.fail()) +bool assign_IdentifiedObject_name(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { + element->name = buffer.str(); + if (buffer.fail()) return false; else return true; @@ -77,10 +72,12 @@ bool assign_IdentifiedObject_energyIdentCodeEic(std::stringstream &buffer, BaseC return false; } -bool assign_IdentifiedObject_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_IdentifiedObject_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (IdentifiedObject* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -88,32 +85,52 @@ bool assign_IdentifiedObject_shortName(std::stringstream &buffer, BaseClass* Bas return false; } -namespace CIMPP { - BaseClass* IdentifiedObject_factory() { - return new IdentifiedObject; + +bool assign_DiagramObject_IdentifiedObject(BaseClass*, BaseClass*); +bool assign_IdentifiedObject_DiagramObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + IdentifiedObject* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DiagramObjects.begin(), element->DiagramObjects.end(), element2) == element->DiagramObjects.end()) + { + element->DiagramObjects.push_back(element2); + return assign_DiagramObject_IdentifiedObject(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + +const char IdentifiedObject::debugName[] = "IdentifiedObject"; +const char* IdentifiedObject::debugString() const +{ + return IdentifiedObject::debugName; } -void IdentifiedObject::addConstructToMap(std::unordered_map& factory_map) { +void IdentifiedObject::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:IdentifiedObject"), &IdentifiedObject_factory)); } -void IdentifiedObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.mRID"), &assign_IdentifiedObject_mRID)); - assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.name"), &assign_IdentifiedObject_name)); +void IdentifiedObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.description"), &assign_IdentifiedObject_description)); assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.energyIdentCodeEic"), &assign_IdentifiedObject_energyIdentCodeEic)); + assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.mRID"), &assign_IdentifiedObject_mRID)); + assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.name"), &assign_IdentifiedObject_name)); assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.shortName"), &assign_IdentifiedObject_shortName)); } -void IdentifiedObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.DiagramObjects"), &assign_IdentifiedObject_DiagramObjects)); - } - -const char IdentifiedObject::debugName[] = "IdentifiedObject"; -const char* IdentifiedObject::debugString() +void IdentifiedObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return IdentifiedObject::debugName; + assign_map.insert(std::make_pair(std::string("cim:IdentifiedObject.DiagramObjects"), &assign_IdentifiedObject_DiagramObjects)); } const BaseClassDefiner IdentifiedObject::declare() @@ -121,4 +138,10 @@ const BaseClassDefiner IdentifiedObject::declare() return BaseClassDefiner(IdentifiedObject::addConstructToMap, IdentifiedObject::addPrimitiveAssignFnsToMap, IdentifiedObject::addClassAssignFnsToMap, IdentifiedObject::debugName); } - +namespace CIMPP +{ + BaseClass* IdentifiedObject_factory() + { + return new IdentifiedObject; + } +} diff --git a/CGMES_2.4.15_27JAN2020/IdentifiedObject.hpp b/CGMES_2.4.15_27JAN2020/IdentifiedObject.hpp index 26059e1b6..fd12212b2 100644 --- a/CGMES_2.4.15_27JAN2020/IdentifiedObject.hpp +++ b/CGMES_2.4.15_27JAN2020/IdentifiedObject.hpp @@ -1,44 +1,45 @@ #ifndef IdentifiedObject_H #define IdentifiedObject_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; - -class DiagramObject; /* This is a root class to provide common identification for all classes needing identification and naming attributes. */ - class IdentifiedObject: public BaseClass + class IdentifiedObject : public BaseClass { - public: - std::list DiagramObjects; /* The domain object to which this diagram object is associated. Default: 0 */ - CIMPP::String mRID; /* Master resource identifier issued by a model authority. The mRID is globally unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended. For CIMXML data files in RDF syntax conforming to IEC 61970-552 Edition 1, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements. Default: '' */ - CIMPP::String name; /* The name is any free human readable and possibly non unique text naming the object. Default: '' */ - CIMPP::String description; /* The description is a free human readable text describing or naming the object. It may be non unique and may not correlate to a naming hierarchy. Default: '' */ - CIMPP::String energyIdentCodeEic; /* The attribute is used for an exchange of the EIC code (Energy identification Code). The length of the string is 16 characters as defined by the EIC code. References: Default: '' */ - CIMPP::String shortName; /* The attribute is used for an exchange of a human readable short name with length of the string 12 characters maximum. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ IdentifiedObject(); - virtual ~IdentifiedObject(); - + ~IdentifiedObject() override; + + std::list DiagramObjects; /* The domain object to which this diagram object is associated. Default: 0 */ + CIMPP::String description; /* The description is a free human readable text describing or naming the object. It may be non unique and may not correlate to a naming hierarchy. Default: '' */ + CIMPP::String energyIdentCodeEic; /* The attribute is used for an exchange of the EIC code (Energy identification Code). The length of the string is 16 characters as defined by the EIC code. References: Default: '' */ + CIMPP::String mRID; /* Master resource identifier issued by a model authority. The mRID is globally unique within an exchange context. Global uniqueness is easily achieved by using a UUID, as specified in RFC 4122, for the mRID. The use of UUID is strongly recommended. For CIMXML data files in RDF syntax conforming to IEC 61970-552 Edition 1, the mRID is mapped to rdf:ID or rdf:about attributes that identify CIM object elements. Default: '' */ + CIMPP::String name; /* The name is any free human readable and possibly non unique text naming the object. Default: '' */ + CIMPP::String shortName; /* The attribute is used for an exchange of a human readable short name with length of the string 12 characters maximum. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* IdentifiedObject_factory(); diff --git a/CGMES_2.4.15_27JAN2020/IfdBaseKind.cpp b/CGMES_2.4.15_27JAN2020/IfdBaseKind.cpp index a1c2a51a3..06c6513c2 100644 --- a/CGMES_2.4.15_27JAN2020/IfdBaseKind.cpp +++ b/CGMES_2.4.15_27JAN2020/IfdBaseKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "IfdBaseKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::IfdBaseKind& rop) +IfdBaseKind& IfdBaseKind::operator=(IfdBaseKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +IfdBaseKind::operator IfdBaseKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char IfdBaseKind::debugName[] = "IfdBaseKind"; +const char* IfdBaseKind::debugString() const +{ + return IfdBaseKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, IfdBaseKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const IfdBaseKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == IfdBaseKind::ifag) + { + EnumSymbol = "ifag"; + } + if (obj.value == IfdBaseKind::ifnl) + { + EnumSymbol = "ifnl"; + } + if (obj.value == IfdBaseKind::iffl) + { + EnumSymbol = "iffl"; + } + if (obj.value == IfdBaseKind::other) + { + EnumSymbol = "other"; + } + + if (!EnumSymbol.empty()) + { + os << "IfdBaseKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/IfdBaseKind.hpp b/CGMES_2.4.15_27JAN2020/IfdBaseKind.hpp index b7a5dbfbd..6938195f3 100644 --- a/CGMES_2.4.15_27JAN2020/IfdBaseKind.hpp +++ b/CGMES_2.4.15_27JAN2020/IfdBaseKind.hpp @@ -1,29 +1,54 @@ #ifndef IfdBaseKind_H #define IfdBaseKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Excitation base system mode. */ - enum class IfdBaseKind + class IfdBaseKind { - /** - * Air gap line mode. ifdBaseValue is computed, not defined by the user, in this mode. - */ - ifag, - /** - * No load system with saturation mode. ifdBaseValue is computed, not defined by the user, in this mode. - */ - ifnl, - /** - * Full load system mode. ifdBaseValue is computed, not defined by the user, in this mode. - */ - iffl, - /** - * Free mode. ifdBaseValue is defined by the user in this mode. - */ - other, + public: + enum IfdBaseKind_ENUM + { + /** + * Air gap line mode. ifdBaseValue is computed, not defined by the user, in this mode. + */ + ifag, + /** + * No load system with saturation mode. ifdBaseValue is computed, not defined by the user, in this mode. + */ + ifnl, + /** + * Full load system mode. ifdBaseValue is computed, not defined by the user, in this mode. + */ + iffl, + /** + * Free mode. ifdBaseValue is defined by the user in this mode. + */ + other, + }; + + IfdBaseKind() : value(), initialized(false) {} + IfdBaseKind(IfdBaseKind_ENUM value) : value(value), initialized(true) {} + + IfdBaseKind& operator=(IfdBaseKind_ENUM rop); + operator IfdBaseKind_ENUM() const; + + IfdBaseKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, IfdBaseKind& rop); + friend std::ostream& operator<<(std::ostream& os, const IfdBaseKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::IfdBaseKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/Inductance.cpp b/CGMES_2.4.15_27JAN2020/Inductance.cpp index 3fca7421a..8a13c71fe 100644 --- a/CGMES_2.4.15_27JAN2020/Inductance.cpp +++ b/CGMES_2.4.15_27JAN2020/Inductance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Inductance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Inductance::Inductance() {} -Inductance::~Inductance(){} +#include -Inductance::Inductance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Inductance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Inductance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Inductance& Inductance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Inductance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Inductance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Inductance::debugName[] = "Inductance"; -const char* Inductance::debugString() { +const char* Inductance::debugString() const +{ return Inductance::debugName; } - -const BaseClassDefiner Inductance::declare() { - return BaseClassDefiner(Inductance::addConstructToMap, Inductance::addPrimitiveAssignFnsToMap, Inductance::addClassAssignFnsToMap, Inductance::debugName); +Inductance& Inductance::operator+=(const Inductance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Inductance& Inductance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Inductance& Inductance::operator-=(const Inductance& rhs) { - value -= rhs.value; - return *this; - } - - Inductance& Inductance::operator*=(const Inductance& rhs) { - value *= rhs.value; - return *this; - } - - Inductance& Inductance::operator/=(const Inductance& rhs) { - value /= rhs.value; - return *this; - } +Inductance& Inductance::operator-=(const Inductance& rhs) +{ + value -= rhs.value; + return *this; +} - Inductance& Inductance::operator+=(const Inductance& rhs) { - value += rhs.value; - return *this; - } +Inductance& Inductance::operator*=(const Inductance& rhs) +{ + value *= rhs.value; + return *this; +} - Inductance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Inductance& Inductance::operator/=(const Inductance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Inductance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Inductance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Inductance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Inductance.hpp b/CGMES_2.4.15_27JAN2020/Inductance.hpp index 3634234ce..9d5005915 100644 --- a/CGMES_2.4.15_27JAN2020/Inductance.hpp +++ b/CGMES_2.4.15_27JAN2020/Inductance.hpp @@ -1,38 +1,39 @@ #ifndef Inductance_H #define Inductance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Inductance : public BaseClass + /* + Inductive part of reactance (imaginary part of impedance), at rated frequency. + */ + class Inductance { - public: - Inductance(); - virtual ~Inductance(); - Inductance(long double value); - static const BaseClassDefiner declare(); - Inductance& operator=(long double &rop); + Inductance() : value(0.0), initialized(false) {} + Inductance(long double value) : value(value), initialized(true) {} + + Inductance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Inductance& operator+=(const Inductance& rhs); Inductance& operator-=(const Inductance& rhs); Inductance& operator*=(const Inductance& rhs); Inductance& operator/=(const Inductance& rhs); + friend std::istream& operator>>(std::istream& lop, Inductance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Inductance& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/InductancePerLength.cpp b/CGMES_2.4.15_27JAN2020/InductancePerLength.cpp index da27f78df..b655d1e70 100644 --- a/CGMES_2.4.15_27JAN2020/InductancePerLength.cpp +++ b/CGMES_2.4.15_27JAN2020/InductancePerLength.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "InductancePerLength.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -InductancePerLength::InductancePerLength(): value(nullptr) {}; - -InductancePerLength::~InductancePerLength() {}; - - -bool assign_InductancePerLength_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_InductancePerLength_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_InductancePerLength_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_InductancePerLength_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_InductancePerLength_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(InductancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +InductancePerLength& InductancePerLength::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* InductancePerLength_factory() { - return new InductancePerLength; +InductancePerLength::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void InductancePerLength::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:InductancePerLength"), &InductancePerLength_factory)); +const char InductancePerLength::debugName[] = "InductancePerLength"; +const char* InductancePerLength::debugString() const +{ + return InductancePerLength::debugName; } -void InductancePerLength::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.unit"), &assign_InductancePerLength_unit)); - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.multiplier"), &assign_InductancePerLength_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.denominatorUnit"), &assign_InductancePerLength_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.denominatorMultiplier"), &assign_InductancePerLength_denominatorMultiplier)); +InductancePerLength& InductancePerLength::operator+=(const InductancePerLength& rhs) +{ + value += rhs.value; + return *this; } -void InductancePerLength::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:InductancePerLength.value"), &assign_InductancePerLength_value)); - } +InductancePerLength& InductancePerLength::operator-=(const InductancePerLength& rhs) +{ + value -= rhs.value; + return *this; +} -const char InductancePerLength::debugName[] = "InductancePerLength"; -const char* InductancePerLength::debugString() +InductancePerLength& InductancePerLength::operator*=(const InductancePerLength& rhs) { - return InductancePerLength::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner InductancePerLength::declare() +InductancePerLength& InductancePerLength::operator/=(const InductancePerLength& rhs) { - return BaseClassDefiner(InductancePerLength::addConstructToMap, InductancePerLength::addPrimitiveAssignFnsToMap, InductancePerLength::addClassAssignFnsToMap, InductancePerLength::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, InductancePerLength& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const InductancePerLength& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/InductancePerLength.hpp b/CGMES_2.4.15_27JAN2020/InductancePerLength.hpp index f29b9fcc9..8ede31f20 100644 --- a/CGMES_2.4.15_27JAN2020/InductancePerLength.hpp +++ b/CGMES_2.4.15_27JAN2020/InductancePerLength.hpp @@ -1,46 +1,39 @@ #ifndef InductancePerLength_H #define InductancePerLength_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Inductance per unit of length. */ - class InductancePerLength: public BaseClass + class InductancePerLength { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + InductancePerLength() : value(0.0), initialized(false) {} + InductancePerLength(long double value) : value(value), initialized(true) {} + + InductancePerLength& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - InductancePerLength(); - virtual ~InductancePerLength(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + InductancePerLength& operator+=(const InductancePerLength& rhs); + InductancePerLength& operator-=(const InductancePerLength& rhs); + InductancePerLength& operator*=(const InductancePerLength& rhs); + InductancePerLength& operator/=(const InductancePerLength& rhs); - BaseClass* InductancePerLength_factory(); + friend std::istream& operator>>(std::istream& lop, InductancePerLength& rop); + friend std::ostream& operator<<(std::ostream& os, const InductancePerLength& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/InputSignalKind.cpp b/CGMES_2.4.15_27JAN2020/InputSignalKind.cpp index 482cf1713..fc207f2f1 100644 --- a/CGMES_2.4.15_27JAN2020/InputSignalKind.cpp +++ b/CGMES_2.4.15_27JAN2020/InputSignalKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "InputSignalKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::InputSignalKind& rop) +InputSignalKind& InputSignalKind::operator=(InputSignalKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +InputSignalKind::operator InputSignalKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char InputSignalKind::debugName[] = "InputSignalKind"; +const char* InputSignalKind::debugString() const +{ + return InputSignalKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, InputSignalKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -73,5 +104,59 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const InputSignalKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == InputSignalKind::rotorSpeed) + { + EnumSymbol = "rotorSpeed"; + } + if (obj.value == InputSignalKind::rotorAngularFrequencyDeviation) + { + EnumSymbol = "rotorAngularFrequencyDeviation"; + } + if (obj.value == InputSignalKind::busFrequency) + { + EnumSymbol = "busFrequency"; + } + if (obj.value == InputSignalKind::busFrequencyDeviation) + { + EnumSymbol = "busFrequencyDeviation"; + } + if (obj.value == InputSignalKind::generatorElectricalPower) + { + EnumSymbol = "generatorElectricalPower"; + } + if (obj.value == InputSignalKind::generatorAcceleratingPower) + { + EnumSymbol = "generatorAcceleratingPower"; + } + if (obj.value == InputSignalKind::busVoltage) + { + EnumSymbol = "busVoltage"; + } + if (obj.value == InputSignalKind::busVoltageDerivative) + { + EnumSymbol = "busVoltageDerivative"; + } + if (obj.value == InputSignalKind::branchCurrent) + { + EnumSymbol = "branchCurrent"; + } + if (obj.value == InputSignalKind::fieldCurrent) + { + EnumSymbol = "fieldCurrent"; + } + + if (!EnumSymbol.empty()) + { + os << "InputSignalKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/InputSignalKind.hpp b/CGMES_2.4.15_27JAN2020/InputSignalKind.hpp index cc11f6f94..98b85d1f8 100644 --- a/CGMES_2.4.15_27JAN2020/InputSignalKind.hpp +++ b/CGMES_2.4.15_27JAN2020/InputSignalKind.hpp @@ -1,53 +1,78 @@ #ifndef InputSignalKind_H #define InputSignalKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Input signal type. In Dynamics modelling, commonly represented by j parameter. */ - enum class InputSignalKind + class InputSignalKind { - /** - * Input signal is rotor or shaft speed (angular frequency). - */ - rotorSpeed, - /** - * Input signal is rotor or shaft angular frequency deviation. - */ - rotorAngularFrequencyDeviation, - /** - * Input signal is bus voltage fr - */ - busFrequency, - /** - * Input signal is deviation of bus voltage frequ - */ - busFrequencyDeviation, - /** - * Input signal is generator electrical power on rated S. - */ - generatorElectricalPower, - /** - * Input signal is generating accelerating power. - */ - generatorAcceleratingPower, - /** - * Input signal - */ - busVoltage, - /** - * Input signal is derivative of bus voltag - */ - busVoltageDerivative, - /** - * Input signal is amplitude of remote branch current. - */ - branchCurrent, - /** - * Input signal is generator field current. - */ - fieldCurrent, + public: + enum InputSignalKind_ENUM + { + /** + * Input signal is rotor or shaft speed (angular frequency). + */ + rotorSpeed, + /** + * Input signal is rotor or shaft angular frequency deviation. + */ + rotorAngularFrequencyDeviation, + /** + * Input signal is bus voltage fr + */ + busFrequency, + /** + * Input signal is deviation of bus voltage frequ + */ + busFrequencyDeviation, + /** + * Input signal is generator electrical power on rated S. + */ + generatorElectricalPower, + /** + * Input signal is generating accelerating power. + */ + generatorAcceleratingPower, + /** + * Input signal + */ + busVoltage, + /** + * Input signal is derivative of bus voltag + */ + busVoltageDerivative, + /** + * Input signal is amplitude of remote branch current. + */ + branchCurrent, + /** + * Input signal is generator field current. + */ + fieldCurrent, + }; + + InputSignalKind() : value(), initialized(false) {} + InputSignalKind(InputSignalKind_ENUM value) : value(value), initialized(true) {} + + InputSignalKind& operator=(InputSignalKind_ENUM rop); + operator InputSignalKind_ENUM() const; + + InputSignalKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, InputSignalKind& rop); + friend std::ostream& operator<<(std::ostream& os, const InputSignalKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::InputSignalKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/Junction.cpp b/CGMES_2.4.15_27JAN2020/Junction.cpp index f8ffd734b..0ffba7325 100644 --- a/CGMES_2.4.15_27JAN2020/Junction.cpp +++ b/CGMES_2.4.15_27JAN2020/Junction.cpp @@ -1,36 +1,36 @@ -#include -#include "Connector.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Junction.hpp" +#include +#include + using namespace CIMPP; Junction::Junction() {}; - Junction::~Junction() {}; -namespace CIMPP { - BaseClass* Junction_factory() { - return new Junction; - } +const char Junction::debugName[] = "Junction"; +const char* Junction::debugString() const +{ + return Junction::debugName; } -void Junction::addConstructToMap(std::unordered_map& factory_map) { +void Junction::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Junction"), &Junction_factory)); } -void Junction::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Junction::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Junction::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Junction::debugName[] = "Junction"; -const char* Junction::debugString() +void Junction::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Junction::debugName; } const BaseClassDefiner Junction::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Junction::declare() return BaseClassDefiner(Junction::addConstructToMap, Junction::addPrimitiveAssignFnsToMap, Junction::addClassAssignFnsToMap, Junction::debugName); } - +namespace CIMPP +{ + BaseClass* Junction_factory() + { + return new Junction; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Junction.hpp b/CGMES_2.4.15_27JAN2020/Junction.hpp index 9d390733d..bf1c7f41e 100644 --- a/CGMES_2.4.15_27JAN2020/Junction.hpp +++ b/CGMES_2.4.15_27JAN2020/Junction.hpp @@ -1,36 +1,37 @@ #ifndef Junction_H #define Junction_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Connector.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Connector.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A point where one or more conducting equipments are connected with zero resistance. */ - class Junction: public Connector + class Junction : public Connector { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Junction(); - virtual ~Junction(); - + ~Junction() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Junction_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Length.cpp b/CGMES_2.4.15_27JAN2020/Length.cpp index 59e68bac1..2c089f847 100644 --- a/CGMES_2.4.15_27JAN2020/Length.cpp +++ b/CGMES_2.4.15_27JAN2020/Length.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Length.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Length::Length() {} -Length::~Length(){} +#include -Length::Length(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Length::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Length::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Length& Length::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Length::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Length::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Length::debugName[] = "Length"; -const char* Length::debugString() { +const char* Length::debugString() const +{ return Length::debugName; } - -const BaseClassDefiner Length::declare() { - return BaseClassDefiner(Length::addConstructToMap, Length::addPrimitiveAssignFnsToMap, Length::addClassAssignFnsToMap, Length::debugName); +Length& Length::operator+=(const Length& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Length& Length::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Length& Length::operator-=(const Length& rhs) { - value -= rhs.value; - return *this; - } - - Length& Length::operator*=(const Length& rhs) { - value *= rhs.value; - return *this; - } - - Length& Length::operator/=(const Length& rhs) { - value /= rhs.value; - return *this; - } +Length& Length::operator-=(const Length& rhs) +{ + value -= rhs.value; + return *this; +} - Length& Length::operator+=(const Length& rhs) { - value += rhs.value; - return *this; - } +Length& Length::operator*=(const Length& rhs) +{ + value *= rhs.value; + return *this; +} - Length::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Length& Length::operator/=(const Length& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Length& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Length& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Length& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Length.hpp b/CGMES_2.4.15_27JAN2020/Length.hpp index 999a55e3b..f3f5c9403 100644 --- a/CGMES_2.4.15_27JAN2020/Length.hpp +++ b/CGMES_2.4.15_27JAN2020/Length.hpp @@ -1,38 +1,39 @@ #ifndef Length_H #define Length_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Length : public BaseClass + /* + Unit of length. Never negative. + */ + class Length { - public: - Length(); - virtual ~Length(); - Length(long double value); - static const BaseClassDefiner declare(); - Length& operator=(long double &rop); + Length() : value(0.0), initialized(false) {} + Length(long double value) : value(value), initialized(true) {} + + Length& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Length& operator+=(const Length& rhs); Length& operator-=(const Length& rhs); Length& operator*=(const Length& rhs); Length& operator/=(const Length& rhs); + friend std::istream& operator>>(std::istream& lop, Length& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Length& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/Limit.cpp b/CGMES_2.4.15_27JAN2020/Limit.cpp index baebfa177..487b4c6c8 100644 --- a/CGMES_2.4.15_27JAN2020/Limit.cpp +++ b/CGMES_2.4.15_27JAN2020/Limit.cpp @@ -1,36 +1,36 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Limit.hpp" +#include +#include + using namespace CIMPP; Limit::Limit() {}; - Limit::~Limit() {}; -namespace CIMPP { - BaseClass* Limit_factory() { - return new Limit; - } +const char Limit::debugName[] = "Limit"; +const char* Limit::debugString() const +{ + return Limit::debugName; } -void Limit::addConstructToMap(std::unordered_map& factory_map) { +void Limit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Limit"), &Limit_factory)); } -void Limit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void Limit::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Limit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Limit::debugName[] = "Limit"; -const char* Limit::debugString() +void Limit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Limit::debugName; } const BaseClassDefiner Limit::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner Limit::declare() return BaseClassDefiner(Limit::addConstructToMap, Limit::addPrimitiveAssignFnsToMap, Limit::addClassAssignFnsToMap, Limit::debugName); } - +namespace CIMPP +{ + BaseClass* Limit_factory() + { + return new Limit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Limit.hpp b/CGMES_2.4.15_27JAN2020/Limit.hpp index 0bfa855f1..47dda3684 100644 --- a/CGMES_2.4.15_27JAN2020/Limit.hpp +++ b/CGMES_2.4.15_27JAN2020/Limit.hpp @@ -1,36 +1,37 @@ #ifndef Limit_H #define Limit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Specifies one limit value for a Measurement. A Measurement typically has several limits that are kept together by the LimitSet class. The actual meaning and use of a Limit instance (i.e., if it is an alarm or warning limit or if it is a high or low limit) is not captured in the Limit class. However the name of a Limit instance may indicate both meaning and use. */ - class Limit: public IdentifiedObject + class Limit : public IdentifiedObject { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Limit(); - virtual ~Limit(); - + ~Limit() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Limit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LimitSet.cpp b/CGMES_2.4.15_27JAN2020/LimitSet.cpp index de59edc72..0622bd81f 100644 --- a/CGMES_2.4.15_27JAN2020/LimitSet.cpp +++ b/CGMES_2.4.15_27JAN2020/LimitSet.cpp @@ -1,51 +1,52 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LimitSet.hpp" +#include +#include + #include "Boolean.hpp" using namespace CIMPP; LimitSet::LimitSet() {}; - LimitSet::~LimitSet() {}; +bool assign_LimitSet_isPercentageLimits(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LimitSet* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isPercentageLimits; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LimitSet_isPercentageLimits(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LimitSet* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isPercentageLimits; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LimitSet_factory() { - return new LimitSet; - } +const char LimitSet::debugName[] = "LimitSet"; +const char* LimitSet::debugString() const +{ + return LimitSet::debugName; } -void LimitSet::addConstructToMap(std::unordered_map& factory_map) { +void LimitSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LimitSet"), &LimitSet_factory)); } -void LimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LimitSet.isPercentageLimits"), &assign_LimitSet_isPercentageLimits)); } -void LimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LimitSet::debugName[] = "LimitSet"; -const char* LimitSet::debugString() +void LimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LimitSet::debugName; } const BaseClassDefiner LimitSet::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner LimitSet::declare() return BaseClassDefiner(LimitSet::addConstructToMap, LimitSet::addPrimitiveAssignFnsToMap, LimitSet::addClassAssignFnsToMap, LimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* LimitSet_factory() + { + return new LimitSet; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LimitSet.hpp b/CGMES_2.4.15_27JAN2020/LimitSet.hpp index 5321da963..553b70ef6 100644 --- a/CGMES_2.4.15_27JAN2020/LimitSet.hpp +++ b/CGMES_2.4.15_27JAN2020/LimitSet.hpp @@ -1,38 +1,39 @@ #ifndef LimitSet_H #define LimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Specifies a set of Limits that are associated with a Measurement. A Measurement may have several LimitSets corresponding to seasonal or other changing conditions. The condition is captured in the name and description attributes. The same LimitSet may be used for several Measurements. In particular percentage limits are used this way. */ - class LimitSet: public IdentifiedObject + class LimitSet : public IdentifiedObject { - public: - CIMPP::Boolean isPercentageLimits; /* Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LimitSet(); - virtual ~LimitSet(); - + ~LimitSet() override; + + CIMPP::Boolean isPercentageLimits; /* Tells if the limit values are in percentage of normalValue or the specified Unit for Measurements and Controls. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LimitSet_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LimitTypeKind.cpp b/CGMES_2.4.15_27JAN2020/LimitTypeKind.cpp index 52efaf862..d6bf93a42 100644 --- a/CGMES_2.4.15_27JAN2020/LimitTypeKind.cpp +++ b/CGMES_2.4.15_27JAN2020/LimitTypeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LimitTypeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::LimitTypeKind& rop) +LimitTypeKind& LimitTypeKind::operator=(LimitTypeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +LimitTypeKind::operator LimitTypeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char LimitTypeKind::debugName[] = "LimitTypeKind"; +const char* LimitTypeKind::debugString() const +{ + return LimitTypeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, LimitTypeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -58,5 +89,47 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const LimitTypeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == LimitTypeKind::patl) + { + EnumSymbol = "patl"; + } + if (obj.value == LimitTypeKind::patlt) + { + EnumSymbol = "patlt"; + } + if (obj.value == LimitTypeKind::tatl) + { + EnumSymbol = "tatl"; + } + if (obj.value == LimitTypeKind::tc) + { + EnumSymbol = "tc"; + } + if (obj.value == LimitTypeKind::tct) + { + EnumSymbol = "tct"; + } + if (obj.value == LimitTypeKind::highVoltage) + { + EnumSymbol = "highVoltage"; + } + if (obj.value == LimitTypeKind::lowVoltage) + { + EnumSymbol = "lowVoltage"; + } + + if (!EnumSymbol.empty()) + { + os << "LimitTypeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LimitTypeKind.hpp b/CGMES_2.4.15_27JAN2020/LimitTypeKind.hpp index 8e674ccd5..3d95bd4ec 100644 --- a/CGMES_2.4.15_27JAN2020/LimitTypeKind.hpp +++ b/CGMES_2.4.15_27JAN2020/LimitTypeKind.hpp @@ -1,41 +1,66 @@ #ifndef LimitTypeKind_H #define LimitTypeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The enumeration defines the kinds of the limit types. */ - enum class LimitTypeKind + class LimitTypeKind { - /** - * The Permanent Admissible Transmission Loading (PATL) is the loading in Amps, MVA or MW that can be accepted by a network branch for an unlimited duration without any risk for the material. The duration attribute is not used and shall be excluded for the PATL limit type. Hence only one limit value exists for the PATL type. - */ - patl, - /** - * Permanent Admissible Transmission Loading Threshold (PATLT) is a value in engineering units defined for PATL and calculated using percentage less than 100 of the PATL type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. - */ - patlt, - /** - * Temporarily Admissible Transmission Loading (TATL) which is the loading in Amps, MVA or MW that can be accepted by a branch for a certain limited duration. The TATL can be defined in different ways: Such a definition of TATL can depend on the initial operating conditions of the network element (sag situation of a line). The duration attribute can be used define several TATL limit types. Hence multiple TATL limit values may exist having different durations. - */ - tatl, - /** - * Tripping Current (TC) is the ultimate intensity without any delay. It is defined as the threshold the line will trip without any possible remedial actions. The tripping of the network element is ordered by protections against short circuits or by overload protections, but in any case, the activation delay of these protections is not compatible with the reaction delay of an operator (less than one minute). The duration is always zero and the duration attribute may be left out. Hence only one limit value exists for the TC type. - */ - tc, - /** - * Tripping Current Threshold (TCT) is a value in engineering units defined for TC and calculated using percentage less than 100 of the TC type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. - */ - tct, - /** - * Referring to the rating of the equipments, a voltage too high can lead to accelerated ageing or the destruction of the equipment. This limit type may or may not have duration. - */ - highVoltage, - /** - * A too low voltage can disturb the normal operation of some protections and transformer equipped with on-load tap changers, electronic power devices or can affect the behaviour of the auxiliaries of generation units. This limit type may or may not have duration. - */ - lowVoltage, + public: + enum LimitTypeKind_ENUM + { + /** + * The Permanent Admissible Transmission Loading (PATL) is the loading in Amps, MVA or MW that can be accepted by a network branch for an unlimited duration without any risk for the material. The duration attribute is not used and shall be excluded for the PATL limit type. Hence only one limit value exists for the PATL type. + */ + patl, + /** + * Permanent Admissible Transmission Loading Threshold (PATLT) is a value in engineering units defined for PATL and calculated using percentage less than 100 of the PATL type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. + */ + patlt, + /** + * Temporarily Admissible Transmission Loading (TATL) which is the loading in Amps, MVA or MW that can be accepted by a branch for a certain limited duration. The TATL can be defined in different ways: Such a definition of TATL can depend on the initial operating conditions of the network element (sag situation of a line). The duration attribute can be used define several TATL limit types. Hence multiple TATL limit values may exist having different durations. + */ + tatl, + /** + * Tripping Current (TC) is the ultimate intensity without any delay. It is defined as the threshold the line will trip without any possible remedial actions. The tripping of the network element is ordered by protections against short circuits or by overload protections, but in any case, the activation delay of these protections is not compatible with the reaction delay of an operator (less than one minute). The duration is always zero and the duration attribute may be left out. Hence only one limit value exists for the TC type. + */ + tc, + /** + * Tripping Current Threshold (TCT) is a value in engineering units defined for TC and calculated using percentage less than 100 of the TC type intended to alert operators of an arising condition. The percentage should be given in the name of the OperationalLimitSet. The aceptableDuration is another way to express the severity of the limit. + */ + tct, + /** + * Referring to the rating of the equipments, a voltage too high can lead to accelerated ageing or the destruction of the equipment. This limit type may or may not have duration. + */ + highVoltage, + /** + * A too low voltage can disturb the normal operation of some protections and transformer equipped with on-load tap changers, electronic power devices or can affect the behaviour of the auxiliaries of generation units. This limit type may or may not have duration. + */ + lowVoltage, + }; + + LimitTypeKind() : value(), initialized(false) {} + LimitTypeKind(LimitTypeKind_ENUM value) : value(value), initialized(true) {} + + LimitTypeKind& operator=(LimitTypeKind_ENUM rop); + operator LimitTypeKind_ENUM() const; + + LimitTypeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, LimitTypeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const LimitTypeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::LimitTypeKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/Line.cpp b/CGMES_2.4.15_27JAN2020/Line.cpp index 5cd36f03c..d115a5496 100644 --- a/CGMES_2.4.15_27JAN2020/Line.cpp +++ b/CGMES_2.4.15_27JAN2020/Line.cpp @@ -1,49 +1,56 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Line.hpp" +#include +#include + #include "SubGeographicalRegion.hpp" using namespace CIMPP; -Line::Line(): Region(nullptr) {}; - +Line::Line() : Region(nullptr) {}; Line::~Line() {}; -bool assign_SubGeographicalRegion_Lines(BaseClass*, BaseClass*); -bool assign_Line_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Line* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_SubGeographicalRegion_Lines(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* Line_factory() { - return new Line; +bool assign_SubGeographicalRegion_Lines(BaseClass*, BaseClass*); +bool assign_Line_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Line* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_SubGeographicalRegion_Lines(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void Line::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:Line"), &Line_factory)); +const char Line::debugName[] = "Line"; +const char* Line::debugString() const +{ + return Line::debugName; } -void Line::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void Line::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:Line"), &Line_factory)); +} -void Line::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Line.Region"), &assign_Line_Region)); +void Line::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Line::debugName[] = "Line"; -const char* Line::debugString() +void Line::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Line::debugName; + assign_map.insert(std::make_pair(std::string("cim:Line.Region"), &assign_Line_Region)); } const BaseClassDefiner Line::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner Line::declare() return BaseClassDefiner(Line::addConstructToMap, Line::addPrimitiveAssignFnsToMap, Line::addClassAssignFnsToMap, Line::debugName); } - +namespace CIMPP +{ + BaseClass* Line_factory() + { + return new Line; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Line.hpp b/CGMES_2.4.15_27JAN2020/Line.hpp index 191586170..1ebd15ab8 100644 --- a/CGMES_2.4.15_27JAN2020/Line.hpp +++ b/CGMES_2.4.15_27JAN2020/Line.hpp @@ -1,38 +1,39 @@ #ifndef Line_H #define Line_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubGeographicalRegion; -class SubGeographicalRegion; /* Contains equipment beyond a substation belonging to a power transmission line. */ - class Line: public EquipmentContainer + class Line : public EquipmentContainer { - public: - CIMPP::SubGeographicalRegion* Region; /* The sub-geographical region of the line. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Line(); - virtual ~Line(); - + ~Line() override; + + CIMPP::SubGeographicalRegion* Region; /* The lines within the sub-geographical region. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Line_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.cpp b/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.cpp index 8f593eb90..06b73e6ad 100644 --- a/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.cpp +++ b/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.cpp @@ -1,96 +1,100 @@ -#include -#include "ShuntCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LinearShuntCompensator.hpp" +#include +#include + #include "Susceptance.hpp" -#include "Conductance.hpp" #include "Susceptance.hpp" #include "Conductance.hpp" +#include "Conductance.hpp" using namespace CIMPP; LinearShuntCompensator::LinearShuntCompensator() {}; - LinearShuntCompensator::~LinearShuntCompensator() {}; +bool assign_LinearShuntCompensator_b0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0PerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LinearShuntCompensator_bPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bPerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LinearShuntCompensator_g0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0PerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LinearShuntCompensator_gPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->gPerSection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LinearShuntCompensator_bPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bPerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LinearShuntCompensator_gPerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->gPerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LinearShuntCompensator_b0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0PerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LinearShuntCompensator_g0PerSection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0PerSection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LinearShuntCompensator_factory() { - return new LinearShuntCompensator; - } +const char LinearShuntCompensator::debugName[] = "LinearShuntCompensator"; +const char* LinearShuntCompensator::debugString() const +{ + return LinearShuntCompensator::debugName; } -void LinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) { +void LinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator"), &LinearShuntCompensator_factory)); } -void LinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.bPerSection"), &assign_LinearShuntCompensator_bPerSection)); - assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.gPerSection"), &assign_LinearShuntCompensator_gPerSection)); +void LinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.b0PerSection"), &assign_LinearShuntCompensator_b0PerSection)); + assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.bPerSection"), &assign_LinearShuntCompensator_bPerSection)); assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.g0PerSection"), &assign_LinearShuntCompensator_g0PerSection)); + assign_map.insert(std::make_pair(std::string("cim:LinearShuntCompensator.gPerSection"), &assign_LinearShuntCompensator_gPerSection)); } -void LinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LinearShuntCompensator::debugName[] = "LinearShuntCompensator"; -const char* LinearShuntCompensator::debugString() +void LinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LinearShuntCompensator::debugName; } const BaseClassDefiner LinearShuntCompensator::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner LinearShuntCompensator::declare() return BaseClassDefiner(LinearShuntCompensator::addConstructToMap, LinearShuntCompensator::addPrimitiveAssignFnsToMap, LinearShuntCompensator::addClassAssignFnsToMap, LinearShuntCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* LinearShuntCompensator_factory() + { + return new LinearShuntCompensator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.hpp b/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.hpp index b8a26902a..38c19002d 100644 --- a/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.hpp +++ b/CGMES_2.4.15_27JAN2020/LinearShuntCompensator.hpp @@ -1,42 +1,43 @@ #ifndef LinearShuntCompensator_H #define LinearShuntCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ShuntCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "ShuntCompensator.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A linear shunt compensator has banks or sections with equal admittance values. */ - class LinearShuntCompensator: public ShuntCompensator + class LinearShuntCompensator : public ShuntCompensator { - public: - CIMPP::Susceptance bPerSection; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance gPerSection; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ - CIMPP::Susceptance b0PerSection; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance g0PerSection; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LinearShuntCompensator(); - virtual ~LinearShuntCompensator(); - + ~LinearShuntCompensator() override; + + CIMPP::Susceptance b0PerSection; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Susceptance bPerSection; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Conductance g0PerSection; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ + CIMPP::Conductance gPerSection; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LinearShuntCompensator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadAggregate.cpp b/CGMES_2.4.15_27JAN2020/LoadAggregate.cpp index 04785e416..d6a367b9d 100644 --- a/CGMES_2.4.15_27JAN2020/LoadAggregate.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadAggregate.cpp @@ -1,60 +1,76 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadAggregate.hpp" -#include "LoadStatic.hpp" +#include +#include + #include "LoadMotor.hpp" +#include "LoadStatic.hpp" using namespace CIMPP; -LoadAggregate::LoadAggregate(): LoadStatic(nullptr), LoadMotor(nullptr) {}; - +LoadAggregate::LoadAggregate() : LoadMotor(nullptr), LoadStatic(nullptr) {}; LoadAggregate::~LoadAggregate() {}; -bool assign_LoadAggregate_LoadStatic(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadAggregate* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadStatic = dynamic_cast(BaseClass_ptr2); - if(element->LoadStatic != nullptr) - return true; - } - return false; -} - -bool assign_LoadAggregate_LoadMotor(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadAggregate* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadMotor = dynamic_cast(BaseClass_ptr2); - if(element->LoadMotor != nullptr) - return true; - } - return false; -} +bool assign_LoadMotor_LoadAggregate(BaseClass*, BaseClass*); +bool assign_LoadAggregate_LoadMotor(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadAggregate* element = dynamic_cast(BaseClass_ptr1); + LoadMotor* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadMotor != element2) + { + element->LoadMotor = element2; + return assign_LoadMotor_LoadAggregate(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* LoadAggregate_factory() { - return new LoadAggregate; +bool assign_LoadStatic_LoadAggregate(BaseClass*, BaseClass*); +bool assign_LoadAggregate_LoadStatic(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadAggregate* element = dynamic_cast(BaseClass_ptr1); + LoadStatic* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadStatic != element2) + { + element->LoadStatic = element2; + return assign_LoadStatic_LoadAggregate(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void LoadAggregate::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:LoadAggregate"), &LoadAggregate_factory)); +const char LoadAggregate::debugName[] = "LoadAggregate"; +const char* LoadAggregate::debugString() const +{ + return LoadAggregate::debugName; } -void LoadAggregate::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void LoadAggregate::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:LoadAggregate"), &LoadAggregate_factory)); +} -void LoadAggregate::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadStatic"), &assign_LoadAggregate_LoadStatic)); - assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadMotor"), &assign_LoadAggregate_LoadMotor)); +void LoadAggregate::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadAggregate::debugName[] = "LoadAggregate"; -const char* LoadAggregate::debugString() +void LoadAggregate::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadAggregate::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadMotor"), &assign_LoadAggregate_LoadMotor)); + assign_map.insert(std::make_pair(std::string("cim:LoadAggregate.LoadStatic"), &assign_LoadAggregate_LoadStatic)); } const BaseClassDefiner LoadAggregate::declare() @@ -62,4 +78,10 @@ const BaseClassDefiner LoadAggregate::declare() return BaseClassDefiner(LoadAggregate::addConstructToMap, LoadAggregate::addPrimitiveAssignFnsToMap, LoadAggregate::addClassAssignFnsToMap, LoadAggregate::debugName); } - +namespace CIMPP +{ + BaseClass* LoadAggregate_factory() + { + return new LoadAggregate; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadAggregate.hpp b/CGMES_2.4.15_27JAN2020/LoadAggregate.hpp index 0e138c16d..86ba44d00 100644 --- a/CGMES_2.4.15_27JAN2020/LoadAggregate.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadAggregate.hpp @@ -1,40 +1,41 @@ #ifndef LoadAggregate_H #define LoadAggregate_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class LoadMotor; + class LoadStatic; -class LoadStatic; -class LoadMotor; /* Standard aggregate load model comprised of static and/or dynamic components. A static load model represents the sensitivity of the real and reactive power consumed by the load to the amplitude and frequency of the bus voltage. A dynamic load model can used to represent the aggregate response of the motor components of the load. */ - class LoadAggregate: public LoadDynamics + class LoadAggregate : public LoadDynamics { - public: - CIMPP::LoadStatic* LoadStatic; /* Aggregate static load associated with this aggregate load. Default: 0 */ - CIMPP::LoadMotor* LoadMotor; /* Aggregate motor (dynamic) load associated with this aggregate load. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadAggregate(); - virtual ~LoadAggregate(); - + ~LoadAggregate() override; + + CIMPP::LoadMotor* LoadMotor; /* Aggregate motor (dynamic) load associated with this aggregate load. Default: 0 */ + CIMPP::LoadStatic* LoadStatic; /* Aggregate static load associated with this aggregate load. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadAggregate_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadArea.cpp b/CGMES_2.4.15_27JAN2020/LoadArea.cpp index a698a730f..ed24626bc 100644 --- a/CGMES_2.4.15_27JAN2020/LoadArea.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadArea.cpp @@ -1,49 +1,56 @@ -#include -#include "EnergyArea.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadArea.hpp" +#include +#include + #include "SubLoadArea.hpp" using namespace CIMPP; LoadArea::LoadArea() {}; - LoadArea::~LoadArea() {}; -bool assign_LoadArea_SubLoadAreas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SubLoadAreas.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_SubLoadArea_LoadArea(BaseClass*, BaseClass*); +bool assign_LoadArea_SubLoadAreas(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadArea* element = dynamic_cast(BaseClass_ptr1); + SubLoadArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SubLoadAreas.begin(), element->SubLoadAreas.end(), element2) == element->SubLoadAreas.end()) + { + element->SubLoadAreas.push_back(element2); + return assign_SubLoadArea_LoadArea(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* LoadArea_factory() { - return new LoadArea; - } +const char LoadArea::debugName[] = "LoadArea"; +const char* LoadArea::debugString() const +{ + return LoadArea::debugName; } -void LoadArea::addConstructToMap(std::unordered_map& factory_map) { +void LoadArea::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadArea"), &LoadArea_factory)); } -void LoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void LoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadArea.SubLoadAreas"), &assign_LoadArea_SubLoadAreas)); +void LoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadArea::debugName[] = "LoadArea"; -const char* LoadArea::debugString() +void LoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadArea.SubLoadAreas"), &assign_LoadArea_SubLoadAreas)); } const BaseClassDefiner LoadArea::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner LoadArea::declare() return BaseClassDefiner(LoadArea::addConstructToMap, LoadArea::addPrimitiveAssignFnsToMap, LoadArea::addClassAssignFnsToMap, LoadArea::debugName); } - +namespace CIMPP +{ + BaseClass* LoadArea_factory() + { + return new LoadArea; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadArea.hpp b/CGMES_2.4.15_27JAN2020/LoadArea.hpp index 8e65aa6fe..c4bd5f831 100644 --- a/CGMES_2.4.15_27JAN2020/LoadArea.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadArea.hpp @@ -1,38 +1,39 @@ #ifndef LoadArea_H #define LoadArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyArea.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyArea.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubLoadArea; -class SubLoadArea; /* The class is the root or first level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. */ - class LoadArea: public EnergyArea + class LoadArea : public EnergyArea { - public: - std::list SubLoadAreas; /* The SubLoadAreas in the LoadArea. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadArea(); - virtual ~LoadArea(); - + ~LoadArea() override; + + std::list SubLoadAreas; /* The SubLoadAreas in the LoadArea. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadArea_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.cpp b/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.cpp index 48d70a647..bc2238810 100644 --- a/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.cpp @@ -1,36 +1,36 @@ -#include -#include "ProtectedSwitch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadBreakSwitch.hpp" +#include +#include + using namespace CIMPP; LoadBreakSwitch::LoadBreakSwitch() {}; - LoadBreakSwitch::~LoadBreakSwitch() {}; -namespace CIMPP { - BaseClass* LoadBreakSwitch_factory() { - return new LoadBreakSwitch; - } +const char LoadBreakSwitch::debugName[] = "LoadBreakSwitch"; +const char* LoadBreakSwitch::debugString() const +{ + return LoadBreakSwitch::debugName; } -void LoadBreakSwitch::addConstructToMap(std::unordered_map& factory_map) { +void LoadBreakSwitch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadBreakSwitch"), &LoadBreakSwitch_factory)); } -void LoadBreakSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void LoadBreakSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void LoadBreakSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadBreakSwitch::debugName[] = "LoadBreakSwitch"; -const char* LoadBreakSwitch::debugString() +void LoadBreakSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadBreakSwitch::debugName; } const BaseClassDefiner LoadBreakSwitch::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner LoadBreakSwitch::declare() return BaseClassDefiner(LoadBreakSwitch::addConstructToMap, LoadBreakSwitch::addPrimitiveAssignFnsToMap, LoadBreakSwitch::addClassAssignFnsToMap, LoadBreakSwitch::debugName); } - +namespace CIMPP +{ + BaseClass* LoadBreakSwitch_factory() + { + return new LoadBreakSwitch; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.hpp b/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.hpp index fd0dfbd1c..843b54d07 100644 --- a/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadBreakSwitch.hpp @@ -1,36 +1,37 @@ #ifndef LoadBreakSwitch_H #define LoadBreakSwitch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ProtectedSwitch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ProtectedSwitch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A mechanical switching device capable of making, carrying, and breaking currents under normal operating conditions. */ - class LoadBreakSwitch: public ProtectedSwitch + class LoadBreakSwitch : public ProtectedSwitch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadBreakSwitch(); - virtual ~LoadBreakSwitch(); - + ~LoadBreakSwitch() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadBreakSwitch_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadComposite.cpp b/CGMES_2.4.15_27JAN2020/LoadComposite.cpp index 98b340ca4..5fe50b8fc 100644 --- a/CGMES_2.4.15_27JAN2020/LoadComposite.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadComposite.cpp @@ -1,8 +1,11 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadComposite.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -13,189 +16,197 @@ #include "Simple_Float.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; LoadComposite::LoadComposite() {}; - LoadComposite::~LoadComposite() {}; +bool assign_LoadComposite_epfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_epfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epfs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_epvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_epvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->epvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqfs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqvd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_eqvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eqvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_lfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lfrac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadComposite_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadComposite* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfrac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadComposite_epvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadComposite_epfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epfs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadComposite_eqvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_eqfs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqfs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_epvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_epfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->epfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_eqvd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqvd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_eqfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eqfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_lfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lfrac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadComposite_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadComposite* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfrac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* LoadComposite_factory() { - return new LoadComposite; - } + + + + + + + + + +const char LoadComposite::debugName[] = "LoadComposite"; +const char* LoadComposite::debugString() const +{ + return LoadComposite::debugName; } -void LoadComposite::addConstructToMap(std::unordered_map& factory_map) { +void LoadComposite::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadComposite"), &LoadComposite_factory)); } -void LoadComposite::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epvs"), &assign_LoadComposite_epvs)); +void LoadComposite::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epfd"), &assign_LoadComposite_epfd)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epfs"), &assign_LoadComposite_epfs)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvs"), &assign_LoadComposite_eqvs)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqfs"), &assign_LoadComposite_eqfs)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epvd"), &assign_LoadComposite_epvd)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epfd"), &assign_LoadComposite_epfd)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvd"), &assign_LoadComposite_eqvd)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.epvs"), &assign_LoadComposite_epvs)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqfd"), &assign_LoadComposite_eqfd)); - assign_map.insert(std::make_pair(std::string("cim:LoadComposite.lfrac"), &assign_LoadComposite_lfrac)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqfs"), &assign_LoadComposite_eqfs)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvd"), &assign_LoadComposite_eqvd)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.eqvs"), &assign_LoadComposite_eqvs)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.h"), &assign_LoadComposite_h)); + assign_map.insert(std::make_pair(std::string("cim:LoadComposite.lfrac"), &assign_LoadComposite_lfrac)); assign_map.insert(std::make_pair(std::string("cim:LoadComposite.pfrac"), &assign_LoadComposite_pfrac)); } -void LoadComposite::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LoadComposite::debugName[] = "LoadComposite"; -const char* LoadComposite::debugString() +void LoadComposite::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadComposite::debugName; } const BaseClassDefiner LoadComposite::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner LoadComposite::declare() return BaseClassDefiner(LoadComposite::addConstructToMap, LoadComposite::addPrimitiveAssignFnsToMap, LoadComposite::addClassAssignFnsToMap, LoadComposite::debugName); } - +namespace CIMPP +{ + BaseClass* LoadComposite_factory() + { + return new LoadComposite; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadComposite.hpp b/CGMES_2.4.15_27JAN2020/LoadComposite.hpp index 410ffb8c9..389aaceae 100644 --- a/CGMES_2.4.15_27JAN2020/LoadComposite.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadComposite.hpp @@ -1,49 +1,50 @@ #ifndef LoadComposite_H #define LoadComposite_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* This models combines static load and induction motor load effects. The dynamics of the motor are simplified by linearizing the induction machine equations. */ - class LoadComposite: public LoadDynamics + class LoadComposite : public LoadDynamics { - public: - CIMPP::Simple_Float epvs; /* Active load-voltage dependence index (static) (Epvs). Typical Value = 0.7. Default: nullptr */ - CIMPP::Simple_Float epfs; /* Active load-frequency dependence index (static) (Epfs). Typical Value = 1.5. Default: nullptr */ - CIMPP::Simple_Float eqvs; /* Reactive load-voltage dependence index (static) (Eqvs). Typical Value = 2. Default: nullptr */ - CIMPP::Simple_Float eqfs; /* Reactive load-frequency dependence index (static) (Eqfs). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float epvd; /* Active load-voltage dependence index (dynamic) (Epvd). Typical Value = 0.7. Default: nullptr */ - CIMPP::Simple_Float epfd; /* Active load-frequency dependence index (dynamic) (Epfd). Typical Value = 1.5. Default: nullptr */ - CIMPP::Simple_Float eqvd; /* Reactive load-voltage dependence index (dynamic) (Eqvd). Typical Value = 2. Default: nullptr */ - CIMPP::Simple_Float eqfd; /* Reactive load-frequency dependence index (dynamic) (Eqfd). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float lfrac; /* Loading factor - ratio of initial P to motor MVA base (Lfrac). Typical Value = 0.8. Default: nullptr */ - CIMPP::Seconds h; /* Inertia constant (H). Typical Value = 2.5. Default: nullptr */ - CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadComposite(); - virtual ~LoadComposite(); - + ~LoadComposite() override; + + CIMPP::Simple_Float epfd; /* Active load-frequency dependence index (dynamic) (Epfd). Typical Value = 1.5. Default: nullptr */ + CIMPP::Simple_Float epfs; /* Active load-frequency dependence index (static) (Epfs). Typical Value = 1.5. Default: nullptr */ + CIMPP::Simple_Float epvd; /* Active load-voltage dependence index (dynamic) (Epvd). Typical Value = 0.7. Default: nullptr */ + CIMPP::Simple_Float epvs; /* Active load-voltage dependence index (static) (Epvs). Typical Value = 0.7. Default: nullptr */ + CIMPP::Simple_Float eqfd; /* Reactive load-frequency dependence index (dynamic) (Eqfd). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float eqfs; /* Reactive load-frequency dependence index (static) (Eqfs). Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float eqvd; /* Reactive load-voltage dependence index (dynamic) (Eqvd). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float eqvs; /* Reactive load-voltage dependence index (static) (Eqvs). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds h; /* Inertia constant (H). Typical Value = 2.5. Default: nullptr */ + CIMPP::Simple_Float lfrac; /* Loading factor - ratio of initial P to motor MVA base (Lfrac). Typical Value = 0.8. Default: nullptr */ + CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.5. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadComposite_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadDynamics.cpp b/CGMES_2.4.15_27JAN2020/LoadDynamics.cpp index 47cafda7f..2dc9c9f3e 100644 --- a/CGMES_2.4.15_27JAN2020/LoadDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadDynamics.hpp" +#include +#include + #include "EnergyConsumer.hpp" using namespace CIMPP; LoadDynamics::LoadDynamics() {}; - LoadDynamics::~LoadDynamics() {}; -bool assign_LoadDynamics_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumer.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_EnergyConsumer_LoadDynamics(BaseClass*, BaseClass*); +bool assign_LoadDynamics_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadDynamics* element = dynamic_cast(BaseClass_ptr1); + EnergyConsumer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumer.begin(), element->EnergyConsumer.end(), element2) == element->EnergyConsumer.end()) + { + element->EnergyConsumer.push_back(element2); + return assign_EnergyConsumer_LoadDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* LoadDynamics_factory() { - return new LoadDynamics; - } +const char LoadDynamics::debugName[] = "LoadDynamics"; +const char* LoadDynamics::debugString() const +{ + return LoadDynamics::debugName; } -void LoadDynamics::addConstructToMap(std::unordered_map& factory_map) { +void LoadDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadDynamics"), &LoadDynamics_factory)); } -void LoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void LoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadDynamics.EnergyConsumer"), &assign_LoadDynamics_EnergyConsumer)); +void LoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadDynamics::debugName[] = "LoadDynamics"; -const char* LoadDynamics::debugString() +void LoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadDynamics.EnergyConsumer"), &assign_LoadDynamics_EnergyConsumer)); } const BaseClassDefiner LoadDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner LoadDynamics::declare() return BaseClassDefiner(LoadDynamics::addConstructToMap, LoadDynamics::addPrimitiveAssignFnsToMap, LoadDynamics::addClassAssignFnsToMap, LoadDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* LoadDynamics_factory() + { + return new LoadDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadDynamics.hpp b/CGMES_2.4.15_27JAN2020/LoadDynamics.hpp index d6693e71f..d21cef390 100644 --- a/CGMES_2.4.15_27JAN2020/LoadDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadDynamics.hpp @@ -1,38 +1,39 @@ #ifndef LoadDynamics_H #define LoadDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EnergyConsumer; -class EnergyConsumer; /* Load whose behaviour is described by reference to a standard model A standard feature of dynamic load behaviour modelling is the ability to associate the same behaviour to multiple energy consumers by means of a single aggregate load definition. Aggregate loads are used to represent all or part of the real and reactive load from one or more loads in the static (power flow) data. This load is usually the aggregation of many individual load devices and the load model is approximate representation of the aggregate response of the load devices to system disturbances. The load model is always applied to individual bus loads (energy consumers) but a single set of load model parameters can used for all loads in the grouping. */ - class LoadDynamics: public IdentifiedObject + class LoadDynamics : public IdentifiedObject { - public: - std::list EnergyConsumer; /* Energy consumer to which this dynamics load model applies. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadDynamics(); - virtual ~LoadDynamics(); - + ~LoadDynamics() override; + + std::list EnergyConsumer; /* Energy consumer to which this dynamics load model applies. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.cpp b/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.cpp index 6ed0a1bbd..71b3161cc 100644 --- a/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.cpp @@ -1,171 +1,180 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadGenericNonLinear.hpp" -#include "GenericNonLinearLoadModelKind.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include "GenericNonLinearLoadModelKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; LoadGenericNonLinear::LoadGenericNonLinear() {}; - LoadGenericNonLinear::~LoadGenericNonLinear() {}; +bool assign_LoadGenericNonLinear_bs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_bt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_genericNonLinearLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->genericNonLinearLoadModelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ls; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_lt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_pt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_qt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadGenericNonLinear_tq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadGenericNonLinear_genericNonLinearLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->genericNonLinearLoadModelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_pt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_qt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_tq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ls; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_lt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_bs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadGenericNonLinear_bt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadGenericNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LoadGenericNonLinear_factory() { - return new LoadGenericNonLinear; - } +const char LoadGenericNonLinear::debugName[] = "LoadGenericNonLinear"; +const char* LoadGenericNonLinear::debugString() const +{ + return LoadGenericNonLinear::debugName; } -void LoadGenericNonLinear::addConstructToMap(std::unordered_map& factory_map) { +void LoadGenericNonLinear::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear"), &LoadGenericNonLinear_factory)); } -void LoadGenericNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LoadGenericNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bs"), &assign_LoadGenericNonLinear_bs)); + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bt"), &assign_LoadGenericNonLinear_bt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.genericNonLinearLoadModelType"), &assign_LoadGenericNonLinear_genericNonLinearLoadModelType)); + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.ls"), &assign_LoadGenericNonLinear_ls)); + assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.lt"), &assign_LoadGenericNonLinear_lt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.pt"), &assign_LoadGenericNonLinear_pt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.qt"), &assign_LoadGenericNonLinear_qt)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.tp"), &assign_LoadGenericNonLinear_tp)); assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.tq"), &assign_LoadGenericNonLinear_tq)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.ls"), &assign_LoadGenericNonLinear_ls)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.lt"), &assign_LoadGenericNonLinear_lt)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bs"), &assign_LoadGenericNonLinear_bs)); - assign_map.insert(std::make_pair(std::string("cim:LoadGenericNonLinear.bt"), &assign_LoadGenericNonLinear_bt)); } -void LoadGenericNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char LoadGenericNonLinear::debugName[] = "LoadGenericNonLinear"; -const char* LoadGenericNonLinear::debugString() +void LoadGenericNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadGenericNonLinear::debugName; } const BaseClassDefiner LoadGenericNonLinear::declare() @@ -173,4 +182,10 @@ const BaseClassDefiner LoadGenericNonLinear::declare() return BaseClassDefiner(LoadGenericNonLinear::addConstructToMap, LoadGenericNonLinear::addPrimitiveAssignFnsToMap, LoadGenericNonLinear::addClassAssignFnsToMap, LoadGenericNonLinear::debugName); } - +namespace CIMPP +{ + BaseClass* LoadGenericNonLinear_factory() + { + return new LoadGenericNonLinear; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.hpp b/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.hpp index bcb4a2cce..a5ffacb16 100644 --- a/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadGenericNonLinear.hpp @@ -1,48 +1,49 @@ #ifndef LoadGenericNonLinear_H #define LoadGenericNonLinear_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "GenericNonLinearLoadModelKind.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* These load models (known also as generic non-linear dynamic (GNLD) load models) can be used in mid-term and long-term voltage stability simulations (i.e., to study voltage collapse), as they can replace a more detailed representation of aggregate load, including induction motors, thermostatically controlled and static loads. */ - class LoadGenericNonLinear: public LoadDynamics + class LoadGenericNonLinear : public LoadDynamics { - public: - CIMPP::GenericNonLinearLoadModelKind genericNonLinearLoadModelType; /* Type of generic non-linear load model. Default: 0 */ - CIMPP::Simple_Float pt; /* Dynamic portion of active load (P). Default: nullptr */ - CIMPP::Simple_Float qt; /* Dynamic portion of reactive load (Q). Default: nullptr */ - CIMPP::Seconds tp; /* Time constant of lag function of active power (T). Default: nullptr */ - CIMPP::Seconds tq; /* Time constant of lag function of reactive power (T). Default: nullptr */ - CIMPP::Simple_Float ls; /* Steady state voltage index for active power (LS). Default: nullptr */ - CIMPP::Simple_Float lt; /* Transient voltage index for active power (LT). Default: nullptr */ - CIMPP::Simple_Float bs; /* Steady state voltage index for reactive power (BS). Default: nullptr */ - CIMPP::Simple_Float bt; /* Transient voltage index for reactive power (BT). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadGenericNonLinear(); - virtual ~LoadGenericNonLinear(); - + ~LoadGenericNonLinear() override; + + CIMPP::Simple_Float bs; /* Steady state voltage index for reactive power (BS). Default: nullptr */ + CIMPP::Simple_Float bt; /* Transient voltage index for reactive power (BT). Default: nullptr */ + CIMPP::GenericNonLinearLoadModelKind genericNonLinearLoadModelType; /* Type of generic non-linear load model. Default: 0 */ + CIMPP::Simple_Float ls; /* Steady state voltage index for active power (LS). Default: nullptr */ + CIMPP::Simple_Float lt; /* Transient voltage index for active power (LT). Default: nullptr */ + CIMPP::Simple_Float pt; /* Dynamic portion of active load (P). Default: nullptr */ + CIMPP::Simple_Float qt; /* Dynamic portion of reactive load (Q). Default: nullptr */ + CIMPP::Seconds tp; /* Time constant of lag function of active power (T). Default: nullptr */ + CIMPP::Seconds tq; /* Time constant of lag function of reactive power (T). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadGenericNonLinear_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadGroup.cpp b/CGMES_2.4.15_27JAN2020/LoadGroup.cpp index 83b54e687..4dce2a407 100644 --- a/CGMES_2.4.15_27JAN2020/LoadGroup.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadGroup.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadGroup.hpp" +#include +#include + #include "SubLoadArea.hpp" using namespace CIMPP; -LoadGroup::LoadGroup(): SubLoadArea(nullptr) {}; - +LoadGroup::LoadGroup() : SubLoadArea(nullptr) {}; LoadGroup::~LoadGroup() {}; -bool assign_SubLoadArea_LoadGroups(BaseClass*, BaseClass*); -bool assign_LoadGroup_SubLoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - element->SubLoadArea = dynamic_cast(BaseClass_ptr2); - if(element->SubLoadArea != nullptr) - return assign_SubLoadArea_LoadGroups(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* LoadGroup_factory() { - return new LoadGroup; +bool assign_SubLoadArea_LoadGroups(BaseClass*, BaseClass*); +bool assign_LoadGroup_SubLoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadGroup* element = dynamic_cast(BaseClass_ptr1); + SubLoadArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SubLoadArea != element2) + { + element->SubLoadArea = element2; + return assign_SubLoadArea_LoadGroups(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void LoadGroup::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:LoadGroup"), &LoadGroup_factory)); +const char LoadGroup::debugName[] = "LoadGroup"; +const char* LoadGroup::debugString() const +{ + return LoadGroup::debugName; } -void LoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void LoadGroup::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:LoadGroup"), &LoadGroup_factory)); +} -void LoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadGroup.SubLoadArea"), &assign_LoadGroup_SubLoadArea)); +void LoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char LoadGroup::debugName[] = "LoadGroup"; -const char* LoadGroup::debugString() +void LoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadGroup.SubLoadArea"), &assign_LoadGroup_SubLoadArea)); } const BaseClassDefiner LoadGroup::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner LoadGroup::declare() return BaseClassDefiner(LoadGroup::addConstructToMap, LoadGroup::addPrimitiveAssignFnsToMap, LoadGroup::addClassAssignFnsToMap, LoadGroup::debugName); } - +namespace CIMPP +{ + BaseClass* LoadGroup_factory() + { + return new LoadGroup; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadGroup.hpp b/CGMES_2.4.15_27JAN2020/LoadGroup.hpp index 648d54b00..768f27c0c 100644 --- a/CGMES_2.4.15_27JAN2020/LoadGroup.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadGroup.hpp @@ -1,38 +1,39 @@ #ifndef LoadGroup_H #define LoadGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class SubLoadArea; -class SubLoadArea; /* The class is the third level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. */ - class LoadGroup: public IdentifiedObject + class LoadGroup : public IdentifiedObject { - public: - CIMPP::SubLoadArea* SubLoadArea; /* The SubLoadArea where the Loadgroup belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadGroup(); - virtual ~LoadGroup(); - + ~LoadGroup() override; + + CIMPP::SubLoadArea* SubLoadArea; /* The SubLoadArea where the Loadgroup belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadGroup_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadMotor.cpp b/CGMES_2.4.15_27JAN2020/LoadMotor.cpp index ac2df6f92..b7fa7d89f 100644 --- a/CGMES_2.4.15_27JAN2020/LoadMotor.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadMotor.cpp @@ -1,244 +1,264 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadMotor.hpp" +#include +#include + #include "LoadAggregate.hpp" #include "Simple_Float.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Simple_Float.hpp" -#include "PU.hpp" -#include "Seconds.hpp" #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; -LoadMotor::LoadMotor(): LoadAggregate(nullptr) {}; - +LoadMotor::LoadMotor() : LoadAggregate(nullptr) {}; LoadMotor::~LoadMotor() {}; -bool assign_LoadAggregate_LoadMotor(BaseClass*, BaseClass*); -bool assign_LoadMotor_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadAggregate = dynamic_cast(BaseClass_ptr2); - if(element->LoadAggregate != nullptr) - return assign_LoadAggregate_LoadMotor(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + +bool assign_LoadMotor_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_LoadMotor_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->h; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_lfac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lfac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_lpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ls; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfrac; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_ra(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ra; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tbkr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tbkr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadMotor_vt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadMotor* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadAggregate_LoadMotor(BaseClass*, BaseClass*); +bool assign_LoadMotor_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadMotor* element = dynamic_cast(BaseClass_ptr1); + LoadAggregate* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadAggregate != element2) + { + element->LoadAggregate = element2; + return assign_LoadAggregate_LoadMotor(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_LoadMotor_pfrac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfrac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadMotor_lfac(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lfac; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadMotor_ls(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ls; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_lp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_lpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_ra(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ra; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_tpo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadMotor_tppo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_h(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->h; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_vt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_tv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadMotor_tbkr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadMotor* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tbkr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* LoadMotor_factory() { - return new LoadMotor; - } + + + + + + + + + +const char LoadMotor::debugName[] = "LoadMotor"; +const char* LoadMotor::debugString() const +{ + return LoadMotor::debugName; } -void LoadMotor::addConstructToMap(std::unordered_map& factory_map) { +void LoadMotor::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadMotor"), &LoadMotor_factory)); } -void LoadMotor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.pfrac"), &assign_LoadMotor_pfrac)); +void LoadMotor::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.d"), &assign_LoadMotor_d)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.h"), &assign_LoadMotor_h)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.lfac"), &assign_LoadMotor_lfac)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.ls"), &assign_LoadMotor_ls)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.lp"), &assign_LoadMotor_lp)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.lpp"), &assign_LoadMotor_lpp)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.ls"), &assign_LoadMotor_ls)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.pfrac"), &assign_LoadMotor_pfrac)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.ra"), &assign_LoadMotor_ra)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tbkr"), &assign_LoadMotor_tbkr)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tpo"), &assign_LoadMotor_tpo)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tppo"), &assign_LoadMotor_tppo)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.h"), &assign_LoadMotor_h)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.d"), &assign_LoadMotor_d)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.vt"), &assign_LoadMotor_vt)); assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tv"), &assign_LoadMotor_tv)); - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.tbkr"), &assign_LoadMotor_tbkr)); + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.vt"), &assign_LoadMotor_vt)); } -void LoadMotor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadMotor.LoadAggregate"), &assign_LoadMotor_LoadAggregate)); - } - -const char LoadMotor::debugName[] = "LoadMotor"; -const char* LoadMotor::debugString() +void LoadMotor::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadMotor::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadMotor.LoadAggregate"), &assign_LoadMotor_LoadAggregate)); } const BaseClassDefiner LoadMotor::declare() @@ -246,4 +266,10 @@ const BaseClassDefiner LoadMotor::declare() return BaseClassDefiner(LoadMotor::addConstructToMap, LoadMotor::addPrimitiveAssignFnsToMap, LoadMotor::addClassAssignFnsToMap, LoadMotor::debugName); } - +namespace CIMPP +{ + BaseClass* LoadMotor_factory() + { + return new LoadMotor; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadMotor.hpp b/CGMES_2.4.15_27JAN2020/LoadMotor.hpp index cb15d6517..570ff0286 100644 --- a/CGMES_2.4.15_27JAN2020/LoadMotor.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadMotor.hpp @@ -1,54 +1,55 @@ #ifndef LoadMotor_H #define LoadMotor_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class LoadAggregate; -class LoadAggregate; /* Aggregate induction motor load. This model is used to represent a fraction of an ordinary load as "induction motor load". It allows load that is treated as ordinary constant power in power flow analysis to be represented by an induction motor in dynamic simulation. If = 0. or = , or = 0., only one cage is represented. Magnetic saturation is not modelled. Either a "one-cage" or "two-cage" model of the induction machine can be modelled. Magnetic saturation is not modelled. This model is intended for representation of aggregations of many motors dispersed through a load represented at a high voltage bus but where there is no information on the characteristics of individual motors. This model treats a fraction of the constant power part of a load as a motor. During initialisation, the initial power drawn by the motor is set equal to times the constant part of the static load. The remainder of the load is left as static load. The reactive power demand of the motor is calculated during initialisation as a function of voltage at the load bus. This reactive power demand may be less than or greater than the constant component of the load. If the motor's reactive demand is greater than the constant component of the load, the model inserts a shunt capacitor at the terminal of the motor to bring its reactive demand down to equal the constant reactive load. If a motor model and a static load model are both present for a load, the motor is assumed to be subtracted from the power flow constant load before the static load model is applied. The remainder of the load, if any, is then represented by the static load model. */ - class LoadMotor: public IdentifiedObject + class LoadMotor : public IdentifiedObject { - public: - CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate motor (dynamic) load belongs. Default: 0 */ - CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float lfac; /* Loading factor - ratio of initial P to motor MVA base (Lfac). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU ls; /* Synchronous reactance (Ls). Typical Value = 3.2. Default: nullptr */ - CIMPP::PU lp; /* Transient reactance (Lp). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU lpp; /* Subtransient reactance (Lpp). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU ra; /* Stator resistance (Ra). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tpo; /* Transient rotor time constant (Tpo) (not=0). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds tppo; /* Subtransient rotor time constant (Tppo). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds h; /* Inertia constant (H) (not=0). Typical Value = 0.4. Default: nullptr */ - CIMPP::Simple_Float d; /* Damping factor (D). Unit = delta P/delta speed. Typical Value = 2. Default: nullptr */ - CIMPP::PU vt; /* Voltage threshold for tripping (Vt). Typical Value = 0.7. Default: nullptr */ - CIMPP::Seconds tv; /* Voltage trip pickup time (Tv). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tbkr; /* Circuit breaker operating time (Tbkr). Typical Value = 0.08. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadMotor(); - virtual ~LoadMotor(); - + ~LoadMotor() override; + + CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate motor (dynamic) load belongs. Default: 0 */ + CIMPP::Simple_Float d; /* Damping factor (D). Unit = delta P/delta speed. Typical Value = 2. Default: nullptr */ + CIMPP::Seconds h; /* Inertia constant (H) (not=0). Typical Value = 0.4. Default: nullptr */ + CIMPP::Simple_Float lfac; /* Loading factor - ratio of initial P to motor MVA base (Lfac). Typical Value = 0.8. Default: nullptr */ + CIMPP::PU lp; /* Transient reactance (Lp). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU lpp; /* Subtransient reactance (Lpp). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU ls; /* Synchronous reactance (Ls). Typical Value = 3.2. Default: nullptr */ + CIMPP::Simple_Float pfrac; /* Fraction of constant-power load to be represented by this motor model (Pfrac) (>=0.0 and <=1.0). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU ra; /* Stator resistance (Ra). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tbkr; /* Circuit breaker operating time (Tbkr). Typical Value = 0.08. Default: nullptr */ + CIMPP::Seconds tpo; /* Transient rotor time constant (Tpo) (not=0). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds tppo; /* Subtransient rotor time constant (Tppo). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds tv; /* Voltage trip pickup time (Tv). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vt; /* Voltage threshold for tripping (Vt). Typical Value = 0.7. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadMotor_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.cpp b/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.cpp index 4c0c8b6e9..bca018da6 100644 --- a/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadResponseCharacteristic.hpp" +#include +#include + #include "EnergyConsumer.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" @@ -18,177 +22,196 @@ using namespace CIMPP; LoadResponseCharacteristic::LoadResponseCharacteristic() {}; - LoadResponseCharacteristic::~LoadResponseCharacteristic() {}; -bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumer.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_LoadResponseCharacteristic_exponentModel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exponentModel; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_LoadResponseCharacteristic_pConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pConstantCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pConstantImpedance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pConstantPower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pFrequencyExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_pVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pVoltageExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qConstantCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qConstantImpedance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qConstantPower; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qFrequencyExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadResponseCharacteristic_qVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qVoltageExponent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_EnergyConsumer_LoadResponse(BaseClass*, BaseClass*); +bool assign_LoadResponseCharacteristic_EnergyConsumer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1); + EnergyConsumer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumer.begin(), element->EnergyConsumer.end(), element2) == element->EnergyConsumer.end()) + { + element->EnergyConsumer.push_back(element2); + return assign_EnergyConsumer_LoadResponse(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_LoadResponseCharacteristic_exponentModel(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exponentModel; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_pConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pConstantCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_pConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pConstantImpedance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_pConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pConstantPower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_pFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pFrequencyExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_pVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pVoltageExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_qConstantCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qConstantCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadResponseCharacteristic_qConstantImpedance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qConstantImpedance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qConstantPower(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qConstantPower; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qFrequencyExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qFrequencyExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_LoadResponseCharacteristic_qVoltageExponent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadResponseCharacteristic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qVoltageExponent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* LoadResponseCharacteristic_factory() { - return new LoadResponseCharacteristic; - } + + + +const char LoadResponseCharacteristic::debugName[] = "LoadResponseCharacteristic"; +const char* LoadResponseCharacteristic::debugString() const +{ + return LoadResponseCharacteristic::debugName; } -void LoadResponseCharacteristic::addConstructToMap(std::unordered_map& factory_map) { +void LoadResponseCharacteristic::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic"), &LoadResponseCharacteristic_factory)); } -void LoadResponseCharacteristic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.exponentModel"), &assign_LoadResponseCharacteristic_exponentModel)); +void LoadResponseCharacteristic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.exponentModel"), &assign_LoadResponseCharacteristic_exponentModel)); assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.pConstantCurrent"), &assign_LoadResponseCharacteristic_pConstantCurrent)); assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.pConstantImpedance"), &assign_LoadResponseCharacteristic_pConstantImpedance)); assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.pConstantPower"), &assign_LoadResponseCharacteristic_pConstantPower)); @@ -201,14 +224,9 @@ void LoadResponseCharacteristic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.EnergyConsumer"), &assign_LoadResponseCharacteristic_EnergyConsumer)); - } - -const char LoadResponseCharacteristic::debugName[] = "LoadResponseCharacteristic"; -const char* LoadResponseCharacteristic::debugString() +void LoadResponseCharacteristic::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadResponseCharacteristic::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadResponseCharacteristic.EnergyConsumer"), &assign_LoadResponseCharacteristic_EnergyConsumer)); } const BaseClassDefiner LoadResponseCharacteristic::declare() @@ -216,4 +234,10 @@ const BaseClassDefiner LoadResponseCharacteristic::declare() return BaseClassDefiner(LoadResponseCharacteristic::addConstructToMap, LoadResponseCharacteristic::addPrimitiveAssignFnsToMap, LoadResponseCharacteristic::addClassAssignFnsToMap, LoadResponseCharacteristic::debugName); } - +namespace CIMPP +{ + BaseClass* LoadResponseCharacteristic_factory() + { + return new LoadResponseCharacteristic; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.hpp b/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.hpp index 7cadd7573..5a7e07e60 100644 --- a/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadResponseCharacteristic.hpp @@ -1,51 +1,52 @@ #ifndef LoadResponseCharacteristic_H #define LoadResponseCharacteristic_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class EnergyConsumer; -class EnergyConsumer; /* Models the characteristic response of the load demand due to changes in system conditions such as voltage and frequency. This is not related to demand response. If LoadResponseCharacteristic.exponentModel is True, the voltage exponents are specified and used as to calculate: Active power component = Pnominal * (Voltage/cim:BaseVoltage.nominalVoltage) ** cim:LoadResponseCharacteristic.pVoltageExponent Reactive power component = Qnominal * (Voltage/cim:BaseVoltage.nominalVoltage)** cim:LoadResponseCharacteristic.qVoltageExponent Where * means "multiply" and ** is "raised to power of". */ - class LoadResponseCharacteristic: public IdentifiedObject + class LoadResponseCharacteristic : public IdentifiedObject { - public: - std::list EnergyConsumer; /* The set of loads that have the response characteristics. Default: 0 */ - CIMPP::Boolean exponentModel; /* Indicates the exponential voltage dependency model is to be used. If false, the coefficient model is to be used. The exponential voltage dependency model consist of the attributes - pVoltageExponent - qVoltageExponent. The coefficient model consist of the attributes - pConstantImpedance - pConstantCurrent - pConstantPower - qConstantImpedance - qConstantCurrent - qConstantPower. The sum of pConstantImpedance, pConstantCurrent and pConstantPower shall equal 1. The sum of qConstantImpedance, qConstantCurrent and qConstantPower shall equal 1. Default: false */ - CIMPP::Simple_Float pConstantCurrent; /* Portion of active power load modeled as constant current. Default: nullptr */ - CIMPP::Simple_Float pConstantImpedance; /* Portion of active power load modeled as constant impedance. Default: nullptr */ - CIMPP::Simple_Float pConstantPower; /* Portion of active power load modeled as constant power. Default: nullptr */ - CIMPP::Simple_Float pFrequencyExponent; /* Exponent of per unit frequency effecting active power. Default: nullptr */ - CIMPP::Simple_Float pVoltageExponent; /* Exponent of per unit voltage effecting real power. Default: nullptr */ - CIMPP::Simple_Float qConstantCurrent; /* Portion of reactive power load modeled as constant current. Default: nullptr */ - CIMPP::Simple_Float qConstantImpedance; /* Portion of reactive power load modeled as constant impedance. Default: nullptr */ - CIMPP::Simple_Float qConstantPower; /* Portion of reactive power load modeled as constant power. Default: nullptr */ - CIMPP::Simple_Float qFrequencyExponent; /* Exponent of per unit frequency effecting reactive power. Default: nullptr */ - CIMPP::Simple_Float qVoltageExponent; /* Exponent of per unit voltage effecting reactive power. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadResponseCharacteristic(); - virtual ~LoadResponseCharacteristic(); - + ~LoadResponseCharacteristic() override; + + std::list EnergyConsumer; /* The set of loads that have the response characteristics. Default: 0 */ + CIMPP::Boolean exponentModel; /* Indicates the exponential voltage dependency model is to be used. If false, the coefficient model is to be used. The exponential voltage dependency model consist of the attributes - pVoltageExponent - qVoltageExponent. The coefficient model consist of the attributes - pConstantImpedance - pConstantCurrent - pConstantPower - qConstantImpedance - qConstantCurrent - qConstantPower. The sum of pConstantImpedance, pConstantCurrent and pConstantPower shall equal 1. The sum of qConstantImpedance, qConstantCurrent and qConstantPower shall equal 1. Default: false */ + CIMPP::Simple_Float pConstantCurrent; /* Portion of active power load modeled as constant current. Default: nullptr */ + CIMPP::Simple_Float pConstantImpedance; /* Portion of active power load modeled as constant impedance. Default: nullptr */ + CIMPP::Simple_Float pConstantPower; /* Portion of active power load modeled as constant power. Default: nullptr */ + CIMPP::Simple_Float pFrequencyExponent; /* Exponent of per unit frequency effecting active power. Default: nullptr */ + CIMPP::Simple_Float pVoltageExponent; /* Exponent of per unit voltage effecting real power. Default: nullptr */ + CIMPP::Simple_Float qConstantCurrent; /* Portion of reactive power load modeled as constant current. Default: nullptr */ + CIMPP::Simple_Float qConstantImpedance; /* Portion of reactive power load modeled as constant impedance. Default: nullptr */ + CIMPP::Simple_Float qConstantPower; /* Portion of reactive power load modeled as constant power. Default: nullptr */ + CIMPP::Simple_Float qFrequencyExponent; /* Exponent of per unit frequency effecting reactive power. Default: nullptr */ + CIMPP::Simple_Float qVoltageExponent; /* Exponent of per unit voltage effecting reactive power. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadResponseCharacteristic_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadStatic.cpp b/CGMES_2.4.15_27JAN2020/LoadStatic.cpp index aab0f5ccd..f73a0f201 100644 --- a/CGMES_2.4.15_27JAN2020/LoadStatic.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadStatic.cpp @@ -1,9 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadStatic.hpp" +#include +#include + #include "LoadAggregate.hpp" -#include "StaticLoadModelKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -20,285 +23,306 @@ #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "StaticLoadModelKind.hpp" using namespace CIMPP; -LoadStatic::LoadStatic(): LoadAggregate(nullptr) {}; - +LoadStatic::LoadStatic() : LoadAggregate(nullptr) {}; LoadStatic::~LoadStatic() {}; -bool assign_LoadAggregate_LoadStatic(BaseClass*, BaseClass*); -bool assign_LoadStatic_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadAggregate = dynamic_cast(BaseClass_ptr2); - if(element->LoadAggregate != nullptr) - return assign_LoadAggregate_LoadStatic(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_LoadStatic_ep1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ep1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_ep2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ep2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_ep3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ep3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_eq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eq1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_eq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eq2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_eq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->eq3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kq4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kq4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_kqf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_LoadStatic_staticLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadStatic* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->staticLoadModelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_LoadStatic_staticLoadModelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->staticLoadModelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_LoadAggregate_LoadStatic(BaseClass*, BaseClass*); +bool assign_LoadStatic_LoadAggregate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadStatic* element = dynamic_cast(BaseClass_ptr1); + LoadAggregate* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadAggregate != element2) + { + element->LoadAggregate = element2; + return assign_LoadAggregate_LoadStatic(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_LoadStatic_kp1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kp2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kp3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kp4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_ep1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ep1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_ep2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ep2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_ep3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ep3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kq4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kq4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_eq1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eq1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_eq2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eq2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_eq3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->eq3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_LoadStatic_kqf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadStatic* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* LoadStatic_factory() { - return new LoadStatic; - } + +const char LoadStatic::debugName[] = "LoadStatic"; +const char* LoadStatic::debugString() const +{ + return LoadStatic::debugName; } -void LoadStatic::addConstructToMap(std::unordered_map& factory_map) { +void LoadStatic::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadStatic"), &LoadStatic_factory)); } -void LoadStatic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.staticLoadModelType"), &assign_LoadStatic_staticLoadModelType)); +void LoadStatic::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep1"), &assign_LoadStatic_ep1)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep2"), &assign_LoadStatic_ep2)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep3"), &assign_LoadStatic_ep3)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq1"), &assign_LoadStatic_eq1)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq2"), &assign_LoadStatic_eq2)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq3"), &assign_LoadStatic_eq3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp1"), &assign_LoadStatic_kp1)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp2"), &assign_LoadStatic_kp2)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp3"), &assign_LoadStatic_kp3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kp4"), &assign_LoadStatic_kp4)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep1"), &assign_LoadStatic_ep1)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep2"), &assign_LoadStatic_ep2)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.ep3"), &assign_LoadStatic_ep3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kpf"), &assign_LoadStatic_kpf)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq1"), &assign_LoadStatic_kq1)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq2"), &assign_LoadStatic_kq2)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq3"), &assign_LoadStatic_kq3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kq4"), &assign_LoadStatic_kq4)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq1"), &assign_LoadStatic_eq1)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq2"), &assign_LoadStatic_eq2)); - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.eq3"), &assign_LoadStatic_eq3)); assign_map.insert(std::make_pair(std::string("cim:LoadStatic.kqf"), &assign_LoadStatic_kqf)); + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.staticLoadModelType"), &assign_LoadStatic_staticLoadModelType)); } -void LoadStatic::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadStatic.LoadAggregate"), &assign_LoadStatic_LoadAggregate)); - } - -const char LoadStatic::debugName[] = "LoadStatic"; -const char* LoadStatic::debugString() +void LoadStatic::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadStatic::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadStatic.LoadAggregate"), &assign_LoadStatic_LoadAggregate)); } const BaseClassDefiner LoadStatic::declare() @@ -306,4 +330,10 @@ const BaseClassDefiner LoadStatic::declare() return BaseClassDefiner(LoadStatic::addConstructToMap, LoadStatic::addPrimitiveAssignFnsToMap, LoadStatic::addClassAssignFnsToMap, LoadStatic::debugName); } - +namespace CIMPP +{ + BaseClass* LoadStatic_factory() + { + return new LoadStatic; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadStatic.hpp b/CGMES_2.4.15_27JAN2020/LoadStatic.hpp index 6e23b6fbb..20d2f697c 100644 --- a/CGMES_2.4.15_27JAN2020/LoadStatic.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadStatic.hpp @@ -1,57 +1,58 @@ #ifndef LoadStatic_H #define LoadStatic_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "StaticLoadModelKind.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" +#include "StaticLoadModelKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class LoadAggregate; -class LoadAggregate; /* General static load model representing the sensitivity of the real and reactive power consumed by the load to the amplitude and frequency of the bus voltage. */ - class LoadStatic: public IdentifiedObject + class LoadStatic : public IdentifiedObject { - public: - CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate static load belongs. Default: 0 */ - CIMPP::StaticLoadModelKind staticLoadModelType; /* Type of static load model. Typical Value = constantZ. Default: 0 */ - CIMPP::Simple_Float kp1; /* First term voltage coefficient for active power (Kp1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kp2; /* Second term voltage coefficient for active power (Kp2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kp3; /* Third term voltage coefficient for active power (Kp3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kp4; /* Frequency coefficient for active power (Kp4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ - CIMPP::Simple_Float ep1; /* First term voltage exponent for active power (Ep1). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float ep2; /* Second term voltage exponent for active power (Ep2). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float ep3; /* Third term voltage exponent for active power (Ep3). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float kpf; /* Frequency deviation coefficient for active power (Kpf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq1; /* First term voltage coefficient for reactive power (Kq1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq2; /* Second term voltage coefficient for reactive power (Kq2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq3; /* Third term voltage coefficient for reactive power (Kq3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - CIMPP::Simple_Float kq4; /* Frequency coefficient for reactive power (Kq4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ - CIMPP::Simple_Float eq1; /* First term voltage exponent for reactive power (Eq1). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float eq2; /* Second term voltage exponent for reactive power (Eq2). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float eq3; /* Third term voltage exponent for reactive power (Eq3). Used only when .staticLoadModelType = exponential. Default: nullptr */ - CIMPP::Simple_Float kqf; /* Frequency deviation coefficient for reactive power (Kqf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadStatic(); - virtual ~LoadStatic(); - + ~LoadStatic() override; + + CIMPP::LoadAggregate* LoadAggregate; /* Aggregate load to which this aggregate static load belongs. Default: 0 */ + CIMPP::Simple_Float ep1; /* First term voltage exponent for active power (Ep1). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float ep2; /* Second term voltage exponent for active power (Ep2). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float ep3; /* Third term voltage exponent for active power (Ep3). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float eq1; /* First term voltage exponent for reactive power (Eq1). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float eq2; /* Second term voltage exponent for reactive power (Eq2). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float eq3; /* Third term voltage exponent for reactive power (Eq3). Used only when .staticLoadModelType = exponential. Default: nullptr */ + CIMPP::Simple_Float kp1; /* First term voltage coefficient for active power (Kp1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kp2; /* Second term voltage coefficient for active power (Kp2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kp3; /* Third term voltage coefficient for active power (Kp3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kp4; /* Frequency coefficient for active power (Kp4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ + CIMPP::Simple_Float kpf; /* Frequency deviation coefficient for active power (Kpf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq1; /* First term voltage coefficient for reactive power (Kq1). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq2; /* Second term voltage coefficient for reactive power (Kq2). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq3; /* Third term voltage coefficient for reactive power (Kq3). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::Simple_Float kq4; /* Frequency coefficient for reactive power (Kq4). Must be non-zero when .staticLoadModelType = ZIP2. Not used for all other values of .staticLoadModelType. Default: nullptr */ + CIMPP::Simple_Float kqf; /* Frequency deviation coefficient for reactive power (Kqf). Not used when .staticLoadModelType = constantZ. Default: nullptr */ + CIMPP::StaticLoadModelKind staticLoadModelType; /* Type of static load model. Typical Value = constantZ. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadStatic_factory(); diff --git a/CGMES_2.4.15_27JAN2020/LoadUserDefined.cpp b/CGMES_2.4.15_27JAN2020/LoadUserDefined.cpp index ba2ad4b40..e183a2407 100644 --- a/CGMES_2.4.15_27JAN2020/LoadUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/LoadUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "LoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "LoadUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; LoadUserDefined::LoadUserDefined() {}; - LoadUserDefined::~LoadUserDefined() {}; -bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(LoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_LoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (LoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_LoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(LoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass*, BaseClass*); +bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + LoadUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* LoadUserDefined_factory() { - return new LoadUserDefined; - } +const char LoadUserDefined::debugName[] = "LoadUserDefined"; +const char* LoadUserDefined::debugString() const +{ + return LoadUserDefined::debugName; } -void LoadUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void LoadUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:LoadUserDefined"), &LoadUserDefined_factory)); } -void LoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void LoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:LoadUserDefined.proprietary"), &assign_LoadUserDefined_proprietary)); - } - -void LoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:LoadUserDefined.ProprietaryParameterDynamics"), &assign_LoadUserDefined_ProprietaryParameterDynamics)); } -const char LoadUserDefined::debugName[] = "LoadUserDefined"; -const char* LoadUserDefined::debugString() +void LoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return LoadUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:LoadUserDefined.ProprietaryParameterDynamics"), &assign_LoadUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner LoadUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner LoadUserDefined::declare() return BaseClassDefiner(LoadUserDefined::addConstructToMap, LoadUserDefined::addPrimitiveAssignFnsToMap, LoadUserDefined::addClassAssignFnsToMap, LoadUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* LoadUserDefined_factory() + { + return new LoadUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/LoadUserDefined.hpp b/CGMES_2.4.15_27JAN2020/LoadUserDefined.hpp index 37d3c3a78..552ad477f 100644 --- a/CGMES_2.4.15_27JAN2020/LoadUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/LoadUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef LoadUserDefined_H #define LoadUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "LoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Load whose dynamic behaviour is described by a user-defined model. */ - class LoadUserDefined: public LoadDynamics + class LoadUserDefined : public LoadDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ LoadUserDefined(); - virtual ~LoadUserDefined(); - + ~LoadUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* LoadUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Location.cpp b/CGMES_2.4.15_27JAN2020/Location.cpp index 51552b401..324a13705 100644 --- a/CGMES_2.4.15_27JAN2020/Location.cpp +++ b/CGMES_2.4.15_27JAN2020/Location.cpp @@ -1,75 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Location.hpp" +#include +#include + #include "CoordinateSystem.hpp" -#include "PowerSystemResource.hpp" #include "PositionPoint.hpp" +#include "PowerSystemResource.hpp" using namespace CIMPP; -Location::Location(): CoordinateSystem(nullptr), PowerSystemResources(nullptr) {}; - +Location::Location() : CoordinateSystem(nullptr), PowerSystemResources(nullptr) {}; Location::~Location() {}; + + + + bool assign_CoordinateSystem_Location(BaseClass*, BaseClass*); -bool assign_Location_CoordinateSystem(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Location* element = dynamic_cast(BaseClass_ptr1)) { - element->CoordinateSystem = dynamic_cast(BaseClass_ptr2); - if(element->CoordinateSystem != nullptr) - return assign_CoordinateSystem_Location(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Location_CoordinateSystem(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Location* element = dynamic_cast(BaseClass_ptr1); + CoordinateSystem* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->CoordinateSystem != element2) + { + element->CoordinateSystem = element2; + return assign_CoordinateSystem_Location(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PowerSystemResource_Location(BaseClass*, BaseClass*); -bool assign_Location_PowerSystemResources(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Location* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemResources = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemResources != nullptr) - return assign_PowerSystemResource_Location(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PositionPoint_Location(BaseClass*, BaseClass*); +bool assign_Location_PositionPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Location* element = dynamic_cast(BaseClass_ptr1); + PositionPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PositionPoints.begin(), element->PositionPoints.end(), element2) == element->PositionPoints.end()) + { + element->PositionPoints.push_back(element2); + return assign_PositionPoint_Location(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Location_PositionPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Location* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PositionPoints.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_PowerSystemResource_Location(BaseClass*, BaseClass*); +bool assign_Location_PowerSystemResources(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Location* element = dynamic_cast(BaseClass_ptr1); + PowerSystemResource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemResources != element2) + { + element->PowerSystemResources = element2; + return assign_PowerSystemResource_Location(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - -namespace CIMPP { - BaseClass* Location_factory() { - return new Location; - } +const char Location::debugName[] = "Location"; +const char* Location::debugString() const +{ + return Location::debugName; } -void Location::addConstructToMap(std::unordered_map& factory_map) { +void Location::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Location"), &Location_factory)); } -void Location::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Location::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Location.CoordinateSystem"), &assign_Location_CoordinateSystem)); - assign_map.insert(std::make_pair(std::string("cim:Location.PowerSystemResources"), &assign_Location_PowerSystemResources)); - assign_map.insert(std::make_pair(std::string("cim:Location.PositionPoints"), &assign_Location_PositionPoints)); +void Location::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char Location::debugName[] = "Location"; -const char* Location::debugString() +void Location::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Location::debugName; + assign_map.insert(std::make_pair(std::string("cim:Location.CoordinateSystem"), &assign_Location_CoordinateSystem)); + assign_map.insert(std::make_pair(std::string("cim:Location.PositionPoints"), &assign_Location_PositionPoints)); + assign_map.insert(std::make_pair(std::string("cim:Location.PowerSystemResources"), &assign_Location_PowerSystemResources)); } const BaseClassDefiner Location::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner Location::declare() return BaseClassDefiner(Location::addConstructToMap, Location::addPrimitiveAssignFnsToMap, Location::addClassAssignFnsToMap, Location::debugName); } - +namespace CIMPP +{ + BaseClass* Location_factory() + { + return new Location; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Location.hpp b/CGMES_2.4.15_27JAN2020/Location.hpp index 4f1e5df0e..717a070ff 100644 --- a/CGMES_2.4.15_27JAN2020/Location.hpp +++ b/CGMES_2.4.15_27JAN2020/Location.hpp @@ -1,42 +1,43 @@ #ifndef Location_H #define Location_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class CoordinateSystem; + class PositionPoint; + class PowerSystemResource; -class CoordinateSystem; -class PowerSystemResource; -class PositionPoint; /* The place, scene, or point of something where someone or something has been, is, and/or will be at a given moment in time. It can be defined with one or more postition points (coordinates) in a given coordinate system. */ - class Location: public IdentifiedObject + class Location : public IdentifiedObject { - public: - CIMPP::CoordinateSystem* CoordinateSystem; /* Coordinate system used to describe position points of this location. Default: 0 */ - CIMPP::PowerSystemResource* PowerSystemResources; /* All power system resources at this location. Default: 0 */ - std::list PositionPoints; /* Sequence of position points describing this location, expressed in coordinate system `Location.CoordinateSystem`. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Location(); - virtual ~Location(); - + ~Location() override; + + CIMPP::CoordinateSystem* CoordinateSystem; /* Coordinate system used to describe position points of this location. Default: 0 */ + std::list PositionPoints; /* Sequence of position points describing this location, expressed in coordinate system `Location.CoordinateSystem`. Default: 0 */ + CIMPP::PowerSystemResource* PowerSystemResources; /* All power system resources at this location. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Location_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Measurement.cpp b/CGMES_2.4.15_27JAN2020/Measurement.cpp index 5e00ecfee..fb5a3137e 100644 --- a/CGMES_2.4.15_27JAN2020/Measurement.cpp +++ b/CGMES_2.4.15_27JAN2020/Measurement.cpp @@ -1,50 +1,58 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Measurement.hpp" +#include +#include + +#include "PowerSystemResource.hpp" +#include "ACDCTerminal.hpp" #include "String.hpp" #include "PhaseCode.hpp" -#include "UnitSymbol.hpp" #include "UnitMultiplier.hpp" -#include "ACDCTerminal.hpp" -#include "PowerSystemResource.hpp" +#include "UnitSymbol.hpp" using namespace CIMPP; -Measurement::Measurement(): Terminal(nullptr), PowerSystemResource(nullptr) {}; - +Measurement::Measurement() : PowerSystemResource(nullptr), Terminal(nullptr) {}; Measurement::~Measurement() {}; - - -bool assign_ACDCTerminal_Measurements(BaseClass*, BaseClass*); -bool assign_Measurement_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_ACDCTerminal_Measurements(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Measurement_measurementType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + element->measurementType = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PowerSystemResource_Measurements(BaseClass*, BaseClass*); -bool assign_Measurement_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemResource = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemResource != nullptr) - return assign_PowerSystemResource_Measurements(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Measurement_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->phases; + if (buffer.fail()) + return false; + else + return true; + } + return false; } - -bool assign_Measurement_measurementType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - element->measurementType = buffer.str(); - if(buffer.fail()) +bool assign_Measurement_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitMultiplier; + if (buffer.fail()) return false; else return true; @@ -52,70 +60,81 @@ bool assign_Measurement_measurementType(std::stringstream &buffer, BaseClass* Ba return false; } -bool assign_Measurement_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->phases; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Measurement_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Measurement* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->unitSymbol; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Measurement_unitSymbol(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitSymbol; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; + +bool assign_PowerSystemResource_Measurements(BaseClass*, BaseClass*); +bool assign_Measurement_PowerSystemResource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Measurement* element = dynamic_cast(BaseClass_ptr1); + PowerSystemResource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemResource != element2) + { + element->PowerSystemResource = element2; + return assign_PowerSystemResource_Measurements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Measurement_unitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Measurement* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unitMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ACDCTerminal_Measurements(BaseClass*, BaseClass*); +bool assign_Measurement_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Measurement* element = dynamic_cast(BaseClass_ptr1); + ACDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_ACDCTerminal_Measurements(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* Measurement_factory() { - return new Measurement; - } + + +const char Measurement::debugName[] = "Measurement"; +const char* Measurement::debugString() const +{ + return Measurement::debugName; } -void Measurement::addConstructToMap(std::unordered_map& factory_map) { +void Measurement::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Measurement"), &Measurement_factory)); } -void Measurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Measurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Measurement.measurementType"), &assign_Measurement_measurementType)); assign_map.insert(std::make_pair(std::string("cim:Measurement.phases"), &assign_Measurement_phases)); - assign_map.insert(std::make_pair(std::string("cim:Measurement.unitSymbol"), &assign_Measurement_unitSymbol)); assign_map.insert(std::make_pair(std::string("cim:Measurement.unitMultiplier"), &assign_Measurement_unitMultiplier)); - } - -void Measurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Measurement.Terminal"), &assign_Measurement_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:Measurement.PowerSystemResource"), &assign_Measurement_PowerSystemResource)); + assign_map.insert(std::make_pair(std::string("cim:Measurement.unitSymbol"), &assign_Measurement_unitSymbol)); } -const char Measurement::debugName[] = "Measurement"; -const char* Measurement::debugString() +void Measurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Measurement::debugName; + assign_map.insert(std::make_pair(std::string("cim:Measurement.PowerSystemResource"), &assign_Measurement_PowerSystemResource)); + assign_map.insert(std::make_pair(std::string("cim:Measurement.Terminal"), &assign_Measurement_Terminal)); } const BaseClassDefiner Measurement::declare() @@ -123,4 +142,10 @@ const BaseClassDefiner Measurement::declare() return BaseClassDefiner(Measurement::addConstructToMap, Measurement::addPrimitiveAssignFnsToMap, Measurement::addClassAssignFnsToMap, Measurement::debugName); } - +namespace CIMPP +{ + BaseClass* Measurement_factory() + { + return new Measurement; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Measurement.hpp b/CGMES_2.4.15_27JAN2020/Measurement.hpp index 9e7f2f064..bd320f912 100644 --- a/CGMES_2.4.15_27JAN2020/Measurement.hpp +++ b/CGMES_2.4.15_27JAN2020/Measurement.hpp @@ -1,48 +1,49 @@ #ifndef Measurement_H #define Measurement_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "String.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PhaseCode.hpp" -#include "UnitSymbol.hpp" +#include "String.hpp" #include "UnitMultiplier.hpp" +#include "UnitSymbol.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ACDCTerminal; + class PowerSystemResource; -class ACDCTerminal; -class PowerSystemResource; /* A Measurement represents any measured, calculated or non-measured non-calculated quantity. Any piece of equipment may contain Measurements, e.g. a substation may have temperature measurements and door open indications, a transformer may have oil temperature and tank pressure measurements, a bay may contain a number of power flow measurements and a Breaker may contain a switch status measurement. The PSR - Measurement association is intended to capture this use of Measurement and is included in the naming hierarchy based on EquipmentContainer. The naming hierarchy typically has Measurements as leafs, e.g. Substation-VoltageLevel-Bay-Switch-Measurement. Some Measurements represent quantities related to a particular sensor location in the network, e.g. a voltage transformer (PT) at a busbar or a current transformer (CT) at the bar between a breaker and an isolator. The sensing position is not captured in the PSR - Measurement association. Instead it is captured by the Measurement - Terminal association that is used to define the sensing location in the network topology. The location is defined by the connection of the Terminal to ConductingEquipment. If both a Terminal and PSR are associated, and the PSR is of type ConductingEquipment, the associated Terminal should belong to that ConductingEquipment instance. When the sensor location is needed both Measurement-PSR and Measurement-Terminal are used. The Measurement-Terminal association is never used alone. */ - class Measurement: public IdentifiedObject + class Measurement : public IdentifiedObject { - public: - CIMPP::String measurementType; /* Specifies the type of measurement. For example, this specifies if the measurement represents an indoor temperature, outdoor temperature, bus voltage, line flow, etc. Default: '' */ - CIMPP::PhaseCode phases; /* Indicates to which phases the measurement applies and avoids the need to use `measurementType` to also encode phase information (which would explode the types). The phase information in Measurement, along with `measurementType` and `phases` uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. If the attribute is missing three phases (ABC) shall be assumed. Default: 0 */ - CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the measured quantity. Default: 0 */ - CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the measured quantity. Default: 0 */ - CIMPP::ACDCTerminal* Terminal; /* One or more measurements may be associated with a terminal in the network. Default: 0 */ - CIMPP::PowerSystemResource* PowerSystemResource; /* The measurements associated with this power system resource. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Measurement(); - virtual ~Measurement(); - + ~Measurement() override; + + CIMPP::PowerSystemResource* PowerSystemResource; /* The measurements associated with this power system resource. Default: 0 */ + CIMPP::ACDCTerminal* Terminal; /* One or more measurements may be associated with a terminal in the network. Default: 0 */ + CIMPP::String measurementType; /* Specifies the type of measurement. For example, this specifies if the measurement represents an indoor temperature, outdoor temperature, bus voltage, line flow, etc. Default: '' */ + CIMPP::PhaseCode phases; /* Indicates to which phases the measurement applies and avoids the need to use `measurementType` to also encode phase information (which would explode the types). The phase information in Measurement, along with `measurementType` and `phases` uniquely defines a Measurement for a device, based on normal network phase. Their meaning will not change when the computed energizing phasing is changed due to jumpers or other reasons. If the attribute is missing three phases (ABC) shall be assumed. Default: 0 */ + CIMPP::UnitMultiplier unitMultiplier; /* The unit multiplier of the measured quantity. Default: 0 */ + CIMPP::UnitSymbol unitSymbol; /* The unit of measure of the measured quantity. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Measurement_factory(); diff --git a/CGMES_2.4.15_27JAN2020/MeasurementValue.cpp b/CGMES_2.4.15_27JAN2020/MeasurementValue.cpp index 63d4b71c8..84231fa0a 100644 --- a/CGMES_2.4.15_27JAN2020/MeasurementValue.cpp +++ b/CGMES_2.4.15_27JAN2020/MeasurementValue.cpp @@ -1,88 +1,108 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MeasurementValue.hpp" -#include "DateTime.hpp" -#include "PerCent.hpp" +#include +#include + #include "MeasurementValueQuality.hpp" #include "MeasurementValueSource.hpp" +#include "PerCent.hpp" +#include "DateTime.hpp" using namespace CIMPP; -MeasurementValue::MeasurementValue(): timeStamp(nullptr), MeasurementValueQuality(nullptr), MeasurementValueSource(nullptr) {}; - +MeasurementValue::MeasurementValue() : MeasurementValueQuality(nullptr), MeasurementValueSource(nullptr) {}; MeasurementValue::~MeasurementValue() {}; -bool assign_MeasurementValue_timeStamp(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->timeStamp = dynamic_cast(BaseClass_ptr2); - if(element->timeStamp != nullptr) - return true; - } - return false; -} -bool assign_MeasurementValue_MeasurementValueQuality(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->MeasurementValueQuality = dynamic_cast(BaseClass_ptr2); - if(element->MeasurementValueQuality != nullptr) - return true; - } - return false; +bool assign_MeasurementValue_sensorAccuracy(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sensorAccuracy; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_MeasurementValueSource_MeasurementValues(BaseClass*, BaseClass*); -bool assign_MeasurementValue_MeasurementValueSource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->MeasurementValueSource = dynamic_cast(BaseClass_ptr2); - if(element->MeasurementValueSource != nullptr) - return assign_MeasurementValueSource_MeasurementValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_MeasurementValue_timeStamp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) + { + element->timeStamp = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_MeasurementValueQuality_MeasurementValue(BaseClass*, BaseClass*); +bool assign_MeasurementValue_MeasurementValueQuality(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValue* element = dynamic_cast(BaseClass_ptr1); + MeasurementValueQuality* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MeasurementValueQuality != element2) + { + element->MeasurementValueQuality = element2; + return assign_MeasurementValueQuality_MeasurementValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_MeasurementValue_sensorAccuracy(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sensorAccuracy; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_MeasurementValueSource_MeasurementValues(BaseClass*, BaseClass*); +bool assign_MeasurementValue_MeasurementValueSource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValue* element = dynamic_cast(BaseClass_ptr1); + MeasurementValueSource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MeasurementValueSource != element2) + { + element->MeasurementValueSource = element2; + return assign_MeasurementValueSource_MeasurementValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* MeasurementValue_factory() { - return new MeasurementValue; - } +const char MeasurementValue::debugName[] = "MeasurementValue"; +const char* MeasurementValue::debugString() const +{ + return MeasurementValue::debugName; } -void MeasurementValue::addConstructToMap(std::unordered_map& factory_map) { +void MeasurementValue::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MeasurementValue"), &MeasurementValue_factory)); } -void MeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.sensorAccuracy"), &assign_MeasurementValue_sensorAccuracy)); - } - -void MeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void MeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.sensorAccuracy"), &assign_MeasurementValue_sensorAccuracy)); assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.timeStamp"), &assign_MeasurementValue_timeStamp)); - assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueQuality"), &assign_MeasurementValue_MeasurementValueQuality)); - assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueSource"), &assign_MeasurementValue_MeasurementValueSource)); } -const char MeasurementValue::debugName[] = "MeasurementValue"; -const char* MeasurementValue::debugString() +void MeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MeasurementValue::debugName; + assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueQuality"), &assign_MeasurementValue_MeasurementValueQuality)); + assign_map.insert(std::make_pair(std::string("cim:MeasurementValue.MeasurementValueSource"), &assign_MeasurementValue_MeasurementValueSource)); } const BaseClassDefiner MeasurementValue::declare() @@ -90,4 +110,10 @@ const BaseClassDefiner MeasurementValue::declare() return BaseClassDefiner(MeasurementValue::addConstructToMap, MeasurementValue::addPrimitiveAssignFnsToMap, MeasurementValue::addClassAssignFnsToMap, MeasurementValue::debugName); } - +namespace CIMPP +{ + BaseClass* MeasurementValue_factory() + { + return new MeasurementValue; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MeasurementValue.hpp b/CGMES_2.4.15_27JAN2020/MeasurementValue.hpp index fa2681e76..c24d7f7bd 100644 --- a/CGMES_2.4.15_27JAN2020/MeasurementValue.hpp +++ b/CGMES_2.4.15_27JAN2020/MeasurementValue.hpp @@ -1,44 +1,45 @@ #ifndef MeasurementValue_H #define MeasurementValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "DateTime.hpp" #include "PerCent.hpp" -namespace CIMPP { +namespace CIMPP +{ + class MeasurementValueQuality; + class MeasurementValueSource; - -class DateTime; -class MeasurementValueQuality; -class MeasurementValueSource; /* The current state for a measurement. A state value is an instance of a measurement from a specific source. Measurements can be associated with many state values, each representing a different source for the measurement. */ - class MeasurementValue: public IdentifiedObject + class MeasurementValue : public IdentifiedObject { - public: - CIMPP::DateTime* timeStamp; /* The time when the value was last updated Default: '' */ - CIMPP::PerCent sensorAccuracy; /* The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. Default: nullptr */ - CIMPP::MeasurementValueQuality* MeasurementValueQuality; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ - CIMPP::MeasurementValueSource* MeasurementValueSource; /* The MeasurementValues updated by the source. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MeasurementValue(); - virtual ~MeasurementValue(); - + ~MeasurementValue() override; + + CIMPP::MeasurementValueQuality* MeasurementValueQuality; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ + CIMPP::MeasurementValueSource* MeasurementValueSource; /* The MeasurementValues updated by the source. Default: 0 */ + CIMPP::PerCent sensorAccuracy; /* The limit, expressed as a percentage of the sensor maximum, that errors will not exceed when the sensor is used under reference conditions. Default: nullptr */ + CIMPP::DateTime timeStamp; /* The time when the value was last updated Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MeasurementValue_factory(); diff --git a/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.cpp b/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.cpp index 714a78c7f..4200ee1df 100644 --- a/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.cpp +++ b/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.cpp @@ -1,49 +1,56 @@ -#include -#include "Quality61850.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MeasurementValueQuality.hpp" +#include +#include + #include "MeasurementValue.hpp" using namespace CIMPP; -MeasurementValueQuality::MeasurementValueQuality(): MeasurementValue(nullptr) {}; - +MeasurementValueQuality::MeasurementValueQuality() : MeasurementValue(nullptr) {}; MeasurementValueQuality::~MeasurementValueQuality() {}; -bool assign_MeasurementValue_MeasurementValueQuality(BaseClass*, BaseClass*); -bool assign_MeasurementValueQuality_MeasurementValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValueQuality* element = dynamic_cast(BaseClass_ptr1)) { - element->MeasurementValue = dynamic_cast(BaseClass_ptr2); - if(element->MeasurementValue != nullptr) - return assign_MeasurementValue_MeasurementValueQuality(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* MeasurementValueQuality_factory() { - return new MeasurementValueQuality; +bool assign_MeasurementValue_MeasurementValueQuality(BaseClass*, BaseClass*); +bool assign_MeasurementValueQuality_MeasurementValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValueQuality* element = dynamic_cast(BaseClass_ptr1); + MeasurementValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MeasurementValue != element2) + { + element->MeasurementValue = element2; + return assign_MeasurementValue_MeasurementValueQuality(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void MeasurementValueQuality::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality"), &MeasurementValueQuality_factory)); +const char MeasurementValueQuality::debugName[] = "MeasurementValueQuality"; +const char* MeasurementValueQuality::debugString() const +{ + return MeasurementValueQuality::debugName; } -void MeasurementValueQuality::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void MeasurementValueQuality::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality"), &MeasurementValueQuality_factory)); +} -void MeasurementValueQuality::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality.MeasurementValue"), &assign_MeasurementValueQuality_MeasurementValue)); +void MeasurementValueQuality::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char MeasurementValueQuality::debugName[] = "MeasurementValueQuality"; -const char* MeasurementValueQuality::debugString() +void MeasurementValueQuality::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MeasurementValueQuality::debugName; + assign_map.insert(std::make_pair(std::string("cim:MeasurementValueQuality.MeasurementValue"), &assign_MeasurementValueQuality_MeasurementValue)); } const BaseClassDefiner MeasurementValueQuality::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner MeasurementValueQuality::declare() return BaseClassDefiner(MeasurementValueQuality::addConstructToMap, MeasurementValueQuality::addPrimitiveAssignFnsToMap, MeasurementValueQuality::addClassAssignFnsToMap, MeasurementValueQuality::debugName); } - +namespace CIMPP +{ + BaseClass* MeasurementValueQuality_factory() + { + return new MeasurementValueQuality; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.hpp b/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.hpp index ea2ba6681..a03b9d52f 100644 --- a/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.hpp +++ b/CGMES_2.4.15_27JAN2020/MeasurementValueQuality.hpp @@ -1,38 +1,39 @@ #ifndef MeasurementValueQuality_H #define MeasurementValueQuality_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Quality61850.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Quality61850.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class MeasurementValue; -class MeasurementValue; /* Measurement quality flags. Bits 0-10 are defined for substation automation in draft IEC 61850 part 7-3. Bits 11-15 are reserved for future expansion by that document. Bits 16-31 are reserved for EMS applications. */ - class MeasurementValueQuality: public Quality61850 + class MeasurementValueQuality : public Quality61850 { - public: - CIMPP::MeasurementValue* MeasurementValue; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MeasurementValueQuality(); - virtual ~MeasurementValueQuality(); - + ~MeasurementValueQuality() override; + + CIMPP::MeasurementValue* MeasurementValue; /* A MeasurementValue has a MeasurementValueQuality associated with it. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MeasurementValueQuality_factory(); diff --git a/CGMES_2.4.15_27JAN2020/MeasurementValueSource.cpp b/CGMES_2.4.15_27JAN2020/MeasurementValueSource.cpp index e4b009712..6c8c10f30 100644 --- a/CGMES_2.4.15_27JAN2020/MeasurementValueSource.cpp +++ b/CGMES_2.4.15_27JAN2020/MeasurementValueSource.cpp @@ -1,49 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MeasurementValueSource.hpp" +#include +#include + #include "MeasurementValue.hpp" using namespace CIMPP; MeasurementValueSource::MeasurementValueSource() {}; - MeasurementValueSource::~MeasurementValueSource() {}; -bool assign_MeasurementValueSource_MeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MeasurementValueSource* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->MeasurementValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_MeasurementValue_MeasurementValueSource(BaseClass*, BaseClass*); +bool assign_MeasurementValueSource_MeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MeasurementValueSource* element = dynamic_cast(BaseClass_ptr1); + MeasurementValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->MeasurementValues.begin(), element->MeasurementValues.end(), element2) == element->MeasurementValues.end()) + { + element->MeasurementValues.push_back(element2); + return assign_MeasurementValue_MeasurementValueSource(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* MeasurementValueSource_factory() { - return new MeasurementValueSource; - } +const char MeasurementValueSource::debugName[] = "MeasurementValueSource"; +const char* MeasurementValueSource::debugString() const +{ + return MeasurementValueSource::debugName; } -void MeasurementValueSource::addConstructToMap(std::unordered_map& factory_map) { +void MeasurementValueSource::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MeasurementValueSource"), &MeasurementValueSource_factory)); } -void MeasurementValueSource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void MeasurementValueSource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MeasurementValueSource.MeasurementValues"), &assign_MeasurementValueSource_MeasurementValues)); +void MeasurementValueSource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char MeasurementValueSource::debugName[] = "MeasurementValueSource"; -const char* MeasurementValueSource::debugString() +void MeasurementValueSource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MeasurementValueSource::debugName; + assign_map.insert(std::make_pair(std::string("cim:MeasurementValueSource.MeasurementValues"), &assign_MeasurementValueSource_MeasurementValues)); } const BaseClassDefiner MeasurementValueSource::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner MeasurementValueSource::declare() return BaseClassDefiner(MeasurementValueSource::addConstructToMap, MeasurementValueSource::addPrimitiveAssignFnsToMap, MeasurementValueSource::addClassAssignFnsToMap, MeasurementValueSource::debugName); } - +namespace CIMPP +{ + BaseClass* MeasurementValueSource_factory() + { + return new MeasurementValueSource; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MeasurementValueSource.hpp b/CGMES_2.4.15_27JAN2020/MeasurementValueSource.hpp index 5f4e60a0c..2a591a510 100644 --- a/CGMES_2.4.15_27JAN2020/MeasurementValueSource.hpp +++ b/CGMES_2.4.15_27JAN2020/MeasurementValueSource.hpp @@ -1,38 +1,39 @@ #ifndef MeasurementValueSource_H #define MeasurementValueSource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class MeasurementValue; -class MeasurementValue; /* MeasurementValueSource describes the alternative sources updating a MeasurementValue. User conventions for how to use the MeasurementValueSource attributes are described in the introduction to IEC 61970-301. */ - class MeasurementValueSource: public IdentifiedObject + class MeasurementValueSource : public IdentifiedObject { - public: - std::list MeasurementValues; /* A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MeasurementValueSource(); - virtual ~MeasurementValueSource(); - + ~MeasurementValueSource() override; + + std::list MeasurementValues; /* A reference to the type of source that updates the MeasurementValue, e.g. SCADA, CCLink, manual, etc. User conventions for the names of sources are contained in the introduction to IEC 61970-301. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MeasurementValueSource_factory(); diff --git a/CGMES_2.4.15_27JAN2020/MechLoad1.cpp b/CGMES_2.4.15_27JAN2020/MechLoad1.cpp index 4c23dd381..dcb3efe20 100644 --- a/CGMES_2.4.15_27JAN2020/MechLoad1.cpp +++ b/CGMES_2.4.15_27JAN2020/MechLoad1.cpp @@ -1,7 +1,11 @@ -#include -#include "MechanicalLoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MechLoad1.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -10,87 +14,87 @@ using namespace CIMPP; MechLoad1::MechLoad1() {}; - MechLoad1::~MechLoad1() {}; +bool assign_MechLoad1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MechLoad1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MechLoad1_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MechLoad1_e(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechLoad1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->e; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_MechLoad1_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MechLoad1_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MechLoad1_d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MechLoad1_e(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechLoad1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->e; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* MechLoad1_factory() { - return new MechLoad1; - } +const char MechLoad1::debugName[] = "MechLoad1"; +const char* MechLoad1::debugString() const +{ + return MechLoad1::debugName; } -void MechLoad1::addConstructToMap(std::unordered_map& factory_map) { +void MechLoad1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MechLoad1"), &MechLoad1_factory)); } -void MechLoad1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void MechLoad1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:MechLoad1.a"), &assign_MechLoad1_a)); assign_map.insert(std::make_pair(std::string("cim:MechLoad1.b"), &assign_MechLoad1_b)); assign_map.insert(std::make_pair(std::string("cim:MechLoad1.d"), &assign_MechLoad1_d)); assign_map.insert(std::make_pair(std::string("cim:MechLoad1.e"), &assign_MechLoad1_e)); } -void MechLoad1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char MechLoad1::debugName[] = "MechLoad1"; -const char* MechLoad1::debugString() +void MechLoad1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MechLoad1::debugName; } const BaseClassDefiner MechLoad1::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner MechLoad1::declare() return BaseClassDefiner(MechLoad1::addConstructToMap, MechLoad1::addPrimitiveAssignFnsToMap, MechLoad1::addClassAssignFnsToMap, MechLoad1::debugName); } - +namespace CIMPP +{ + BaseClass* MechLoad1_factory() + { + return new MechLoad1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MechLoad1.hpp b/CGMES_2.4.15_27JAN2020/MechLoad1.hpp index 6d8c10200..92b49f819 100644 --- a/CGMES_2.4.15_27JAN2020/MechLoad1.hpp +++ b/CGMES_2.4.15_27JAN2020/MechLoad1.hpp @@ -1,41 +1,42 @@ #ifndef MechLoad1_H #define MechLoad1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MechanicalLoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MechanicalLoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Mechanical load model type 1. */ - class MechLoad1: public MechanicalLoadDynamics + class MechLoad1 : public MechanicalLoadDynamics { - public: - CIMPP::Simple_Float a; /* Speed squared coefficient (a). Default: nullptr */ - CIMPP::Simple_Float b; /* Speed coefficient (b). Default: nullptr */ - CIMPP::Simple_Float d; /* Speed to the exponent coefficient (d). Default: nullptr */ - CIMPP::Simple_Float e; /* Exponent (e). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MechLoad1(); - virtual ~MechLoad1(); - + ~MechLoad1() override; + + CIMPP::Simple_Float a; /* Speed squared coefficient (a). Default: nullptr */ + CIMPP::Simple_Float b; /* Speed coefficient (b). Default: nullptr */ + CIMPP::Simple_Float d; /* Speed to the exponent coefficient (d). Default: nullptr */ + CIMPP::Simple_Float e; /* Exponent (e). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MechLoad1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.cpp b/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.cpp index 740a75944..1309e97f3 100644 --- a/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MechanicalLoadDynamics.hpp" -#include "SynchronousMachineDynamics.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" +#include "SynchronousMachineDynamics.hpp" using namespace CIMPP; -MechanicalLoadDynamics::MechanicalLoadDynamics(): SynchronousMachineDynamics(nullptr), AsynchronousMachineDynamics(nullptr) {}; - +MechanicalLoadDynamics::MechanicalLoadDynamics() : AsynchronousMachineDynamics(nullptr), SynchronousMachineDynamics(nullptr) {}; MechanicalLoadDynamics::~MechanicalLoadDynamics() {}; -bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); -bool assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); -bool assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); +bool assign_MechanicalLoadDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* MechanicalLoadDynamics_factory() { - return new MechanicalLoadDynamics; +bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass*, BaseClass*); +bool assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MechanicalLoadDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void MechanicalLoadDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics"), &MechanicalLoadDynamics_factory)); +const char MechanicalLoadDynamics::debugName[] = "MechanicalLoadDynamics"; +const char* MechanicalLoadDynamics::debugString() const +{ + return MechanicalLoadDynamics::debugName; } -void MechanicalLoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void MechanicalLoadDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics"), &MechanicalLoadDynamics_factory)); +} -void MechanicalLoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.SynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.AsynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_AsynchronousMachineDynamics)); +void MechanicalLoadDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char MechanicalLoadDynamics::debugName[] = "MechanicalLoadDynamics"; -const char* MechanicalLoadDynamics::debugString() +void MechanicalLoadDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MechanicalLoadDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.AsynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_AsynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadDynamics.SynchronousMachineDynamics"), &assign_MechanicalLoadDynamics_SynchronousMachineDynamics)); } const BaseClassDefiner MechanicalLoadDynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner MechanicalLoadDynamics::declare() return BaseClassDefiner(MechanicalLoadDynamics::addConstructToMap, MechanicalLoadDynamics::addPrimitiveAssignFnsToMap, MechanicalLoadDynamics::addClassAssignFnsToMap, MechanicalLoadDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* MechanicalLoadDynamics_factory() + { + return new MechanicalLoadDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.hpp b/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.hpp index c938e9201..a6b7f7952 100644 --- a/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/MechanicalLoadDynamics.hpp @@ -1,40 +1,41 @@ #ifndef MechanicalLoadDynamics_H #define MechanicalLoadDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachineDynamics; + class SynchronousMachineDynamics; -class SynchronousMachineDynamics; -class AsynchronousMachineDynamics; /* Mechanical load function block whose behavior is described by reference to a standard model */ - class MechanicalLoadDynamics: public DynamicsFunctionBlock + class MechanicalLoadDynamics : public DynamicsFunctionBlock { - public: - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this mechanical load model is associated. Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this mechanical load model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MechanicalLoadDynamics(); - virtual ~MechanicalLoadDynamics(); - + ~MechanicalLoadDynamics() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this mechanical load model is associated. Default: 0 */ + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine model with which this mechanical load model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MechanicalLoadDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.cpp b/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.cpp index 9640a0bb3..64c23efdf 100644 --- a/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "MechanicalLoadDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MechanicalLoadUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; MechanicalLoadUserDefined::MechanicalLoadUserDefined() {}; - MechanicalLoadUserDefined::~MechanicalLoadUserDefined() {}; -bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_MechanicalLoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_MechanicalLoadUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass*, BaseClass*); +bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MechanicalLoadUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* MechanicalLoadUserDefined_factory() { - return new MechanicalLoadUserDefined; - } +const char MechanicalLoadUserDefined::debugName[] = "MechanicalLoadUserDefined"; +const char* MechanicalLoadUserDefined::debugString() const +{ + return MechanicalLoadUserDefined::debugName; } -void MechanicalLoadUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void MechanicalLoadUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined"), &MechanicalLoadUserDefined_factory)); } -void MechanicalLoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void MechanicalLoadUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined.proprietary"), &assign_MechanicalLoadUserDefined_proprietary)); - } - -void MechanicalLoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined.ProprietaryParameterDynamics"), &assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics)); } -const char MechanicalLoadUserDefined::debugName[] = "MechanicalLoadUserDefined"; -const char* MechanicalLoadUserDefined::debugString() +void MechanicalLoadUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return MechanicalLoadUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:MechanicalLoadUserDefined.ProprietaryParameterDynamics"), &assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner MechanicalLoadUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner MechanicalLoadUserDefined::declare() return BaseClassDefiner(MechanicalLoadUserDefined::addConstructToMap, MechanicalLoadUserDefined::addPrimitiveAssignFnsToMap, MechanicalLoadUserDefined::addClassAssignFnsToMap, MechanicalLoadUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* MechanicalLoadUserDefined_factory() + { + return new MechanicalLoadUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.hpp b/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.hpp index 6a21617a5..5e61ad69b 100644 --- a/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/MechanicalLoadUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef MechanicalLoadUserDefined_H #define MechanicalLoadUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MechanicalLoadDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MechanicalLoadDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Mechanical load function block whose dynamic behaviour is described by */ - class MechanicalLoadUserDefined: public MechanicalLoadDynamics + class MechanicalLoadUserDefined : public MechanicalLoadDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MechanicalLoadUserDefined(); - virtual ~MechanicalLoadUserDefined(); - + ~MechanicalLoadUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MechanicalLoadUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Money.cpp b/CGMES_2.4.15_27JAN2020/Money.cpp index 5080a7dc9..89e8271c2 100644 --- a/CGMES_2.4.15_27JAN2020/Money.cpp +++ b/CGMES_2.4.15_27JAN2020/Money.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Money.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Money::Money() {} -Money::~Money(){} +#include -Money::Money(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Money::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Money::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Money& Money::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Money::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Money::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Money::debugName[] = "Money"; -const char* Money::debugString() { +const char* Money::debugString() const +{ return Money::debugName; } - -const BaseClassDefiner Money::declare() { - return BaseClassDefiner(Money::addConstructToMap, Money::addPrimitiveAssignFnsToMap, Money::addClassAssignFnsToMap, Money::debugName); +Money& Money::operator+=(const Money& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Money& Money::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Money& Money::operator-=(const Money& rhs) { - value -= rhs.value; - return *this; - } - - Money& Money::operator*=(const Money& rhs) { - value *= rhs.value; - return *this; - } - - Money& Money::operator/=(const Money& rhs) { - value /= rhs.value; - return *this; - } +Money& Money::operator-=(const Money& rhs) +{ + value -= rhs.value; + return *this; +} - Money& Money::operator+=(const Money& rhs) { - value += rhs.value; - return *this; - } +Money& Money::operator*=(const Money& rhs) +{ + value *= rhs.value; + return *this; +} - Money::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Money& Money::operator/=(const Money& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Money& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Money& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Money& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Money.hpp b/CGMES_2.4.15_27JAN2020/Money.hpp index 0de1c0f1d..b6c47f743 100644 --- a/CGMES_2.4.15_27JAN2020/Money.hpp +++ b/CGMES_2.4.15_27JAN2020/Money.hpp @@ -1,38 +1,39 @@ #ifndef Money_H #define Money_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Money : public BaseClass + /* + Amount of money. + */ + class Money { - public: - Money(); - virtual ~Money(); - Money(long double value); - static const BaseClassDefiner declare(); - Money& operator=(long double &rop); + Money() : value(0.0), initialized(false) {} + Money(long double value) : value(value), initialized(true) {} + + Money& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Money& operator+=(const Money& rhs); Money& operator-=(const Money& rhs); Money& operator*=(const Money& rhs); Money& operator/=(const Money& rhs); + friend std::istream& operator>>(std::istream& lop, Money& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Money& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/MonthDay.cpp b/CGMES_2.4.15_27JAN2020/MonthDay.cpp index 7e9be476a..2ef4c8b7e 100644 --- a/CGMES_2.4.15_27JAN2020/MonthDay.cpp +++ b/CGMES_2.4.15_27JAN2020/MonthDay.cpp @@ -1,41 +1,49 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MonthDay.hpp" +#include "../src/CIMExceptions.hpp" using namespace CIMPP; -MonthDay::MonthDay() {}; - -MonthDay::~MonthDay() {}; - - - -namespace CIMPP { - BaseClass* MonthDay_factory() { - return new MonthDay; - } -} - -void MonthDay::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:MonthDay"), &MonthDay_factory)); -} - -void MonthDay::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +MonthDay& MonthDay::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; } -void MonthDay::addClassAssignFnsToMap(std::unordered_map& assign_map) { +MonthDay::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; } const char MonthDay::debugName[] = "MonthDay"; -const char* MonthDay::debugString() +const char* MonthDay::debugString() const { return MonthDay::debugName; } -const BaseClassDefiner MonthDay::declare() +namespace CIMPP { - return BaseClassDefiner(MonthDay::addConstructToMap, MonthDay::addPrimitiveAssignFnsToMap, MonthDay::addClassAssignFnsToMap, MonthDay::debugName); -} - + std::istream& operator>>(std::istream& lop, MonthDay& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const MonthDay& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MonthDay.hpp b/CGMES_2.4.15_27JAN2020/MonthDay.hpp index 202cd4b4d..1669168fe 100644 --- a/CGMES_2.4.15_27JAN2020/MonthDay.hpp +++ b/CGMES_2.4.15_27JAN2020/MonthDay.hpp @@ -1,38 +1,35 @@ #ifndef MonthDay_H #define MonthDay_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" - - - -namespace CIMPP { - +#include +#include +#include +namespace CIMPP +{ /* MonthDay format as "--mm-dd", which conforms with XSD data type gMonthDay. */ - class MonthDay: public BaseClass + class MonthDay { - public: - + MonthDay() : initialized(false) {} + MonthDay(const std::string& value) : value(value), initialized(true) {} + + MonthDay& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - MonthDay(); - virtual ~MonthDay(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; + friend std::istream& operator>>(std::istream& lop, MonthDay& rop); + friend std::ostream& operator<<(std::ostream& os, const MonthDay& obj); }; - - BaseClass* MonthDay_factory(); } #endif diff --git a/CGMES_2.4.15_27JAN2020/MutualCoupling.cpp b/CGMES_2.4.15_27JAN2020/MutualCoupling.cpp index 32229dbc4..3d54c7cc1 100644 --- a/CGMES_2.4.15_27JAN2020/MutualCoupling.cpp +++ b/CGMES_2.4.15_27JAN2020/MutualCoupling.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "MutualCoupling.hpp" +#include +#include + #include "Terminal.hpp" #include "Terminal.hpp" #include "Susceptance.hpp" @@ -15,150 +19,173 @@ using namespace CIMPP; -MutualCoupling::MutualCoupling(): First_Terminal(nullptr), Second_Terminal(nullptr) {}; - +MutualCoupling::MutualCoupling() : First_Terminal(nullptr), Second_Terminal(nullptr) {}; MutualCoupling::~MutualCoupling() {}; -bool assign_Terminal_HasFirstMutualCoupling(BaseClass*, BaseClass*); -bool assign_MutualCoupling_First_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - element->First_Terminal = dynamic_cast(BaseClass_ptr2); - if(element->First_Terminal != nullptr) - return assign_Terminal_HasFirstMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_Terminal_HasSecondMutualCoupling(BaseClass*, BaseClass*); -bool assign_MutualCoupling_Second_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - element->Second_Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Second_Terminal != nullptr) - return assign_Terminal_HasSecondMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + +bool assign_MutualCoupling_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_MutualCoupling_distance11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_distance12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_distance21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance21; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_distance22(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->distance22; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0ch; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_MutualCoupling_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - - -bool assign_MutualCoupling_b0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_HasFirstMutualCoupling(BaseClass*, BaseClass*); +bool assign_MutualCoupling_First_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MutualCoupling* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->First_Terminal != element2) + { + element->First_Terminal = element2; + return assign_Terminal_HasFirstMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_MutualCoupling_distance11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_HasSecondMutualCoupling(BaseClass*, BaseClass*); +bool assign_MutualCoupling_Second_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + MutualCoupling* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Second_Terminal != element2) + { + element->Second_Terminal = element2; + return assign_Terminal_HasSecondMutualCoupling(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_MutualCoupling_distance12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_distance21(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance21; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_distance22(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->distance22; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_g0ch(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0ch; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_MutualCoupling_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(MutualCoupling* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* MutualCoupling_factory() { - return new MutualCoupling; - } + + + +const char MutualCoupling::debugName[] = "MutualCoupling"; +const char* MutualCoupling::debugString() const +{ + return MutualCoupling::debugName; } -void MutualCoupling::addConstructToMap(std::unordered_map& factory_map) { +void MutualCoupling::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:MutualCoupling"), &MutualCoupling_factory)); } -void MutualCoupling::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.b0ch"), &assign_MutualCoupling_b0ch)); +void MutualCoupling::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.b0ch"), &assign_MutualCoupling_b0ch)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.distance11"), &assign_MutualCoupling_distance11)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.distance12"), &assign_MutualCoupling_distance12)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.distance21"), &assign_MutualCoupling_distance21)); @@ -168,15 +195,10 @@ void MutualCoupling::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void MutualCoupling::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.First_Terminal"), &assign_MutualCoupling_First_Terminal)); assign_map.insert(std::make_pair(std::string("cim:MutualCoupling.Second_Terminal"), &assign_MutualCoupling_Second_Terminal)); - } - -const char MutualCoupling::debugName[] = "MutualCoupling"; -const char* MutualCoupling::debugString() -{ - return MutualCoupling::debugName; } const BaseClassDefiner MutualCoupling::declare() @@ -184,4 +206,10 @@ const BaseClassDefiner MutualCoupling::declare() return BaseClassDefiner(MutualCoupling::addConstructToMap, MutualCoupling::addPrimitiveAssignFnsToMap, MutualCoupling::addClassAssignFnsToMap, MutualCoupling::debugName); } - +namespace CIMPP +{ + BaseClass* MutualCoupling_factory() + { + return new MutualCoupling; + } +} diff --git a/CGMES_2.4.15_27JAN2020/MutualCoupling.hpp b/CGMES_2.4.15_27JAN2020/MutualCoupling.hpp index 5d7873232..7e9437378 100644 --- a/CGMES_2.4.15_27JAN2020/MutualCoupling.hpp +++ b/CGMES_2.4.15_27JAN2020/MutualCoupling.hpp @@ -1,52 +1,53 @@ #ifndef MutualCoupling_H #define MutualCoupling_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" -#include "Length.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" -#include "Resistance.hpp" +#include "Length.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class Terminal; -class Terminal; /* This class represents the zero sequence line mutual coupling. */ - class MutualCoupling: public IdentifiedObject + class MutualCoupling : public IdentifiedObject { - public: - CIMPP::Terminal* First_Terminal; /* The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments. Default: 0 */ - CIMPP::Terminal* Second_Terminal; /* The starting terminal for the calculation of distances along the second branch of the mutual coupling. Default: 0 */ - CIMPP::Susceptance b0ch; /* Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Length distance11; /* Distance to the start of the coupled region from the first line`s terminal having sequence number equal to 1. Default: nullptr */ - CIMPP::Length distance12; /* Distance to the end of the coupled region from the first line`s terminal with sequence number equal to 1. Default: nullptr */ - CIMPP::Length distance21; /* Distance to the start of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ - CIMPP::Length distance22; /* Distance to the end of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ - CIMPP::Conductance g0ch; /* Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence branch-to-branch mutual impedance coupling, resistance. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence branch-to-branch mutual impedance coupling, reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ MutualCoupling(); - virtual ~MutualCoupling(); - + ~MutualCoupling() override; + + CIMPP::Terminal* First_Terminal; /* The starting terminal for the calculation of distances along the first branch of the mutual coupling. Normally MutualCoupling would only be used for terminals of AC line segments. The first and second terminals of a mutual coupling should point to different AC line segments. Default: 0 */ + CIMPP::Terminal* Second_Terminal; /* The starting terminal for the calculation of distances along the second branch of the mutual coupling. Default: 0 */ + CIMPP::Susceptance b0ch; /* Zero sequence mutual coupling shunt (charging) susceptance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Length distance11; /* Distance to the start of the coupled region from the first line`s terminal having sequence number equal to 1. Default: nullptr */ + CIMPP::Length distance12; /* Distance to the end of the coupled region from the first line`s terminal with sequence number equal to 1. Default: nullptr */ + CIMPP::Length distance21; /* Distance to the start of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ + CIMPP::Length distance22; /* Distance to the end of coupled region from the second line`s terminal with sequence number equal to 1. Default: nullptr */ + CIMPP::Conductance g0ch; /* Zero sequence mutual coupling shunt (charging) conductance, uniformly distributed, of the entire line section. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence branch-to-branch mutual impedance coupling, resistance. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence branch-to-branch mutual impedance coupling, reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* MutualCoupling_factory(); diff --git a/CGMES_2.4.15_27JAN2020/NonConformLoad.cpp b/CGMES_2.4.15_27JAN2020/NonConformLoad.cpp index fa7e294e9..2ef76bf9b 100644 --- a/CGMES_2.4.15_27JAN2020/NonConformLoad.cpp +++ b/CGMES_2.4.15_27JAN2020/NonConformLoad.cpp @@ -1,49 +1,56 @@ -#include -#include "EnergyConsumer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonConformLoad.hpp" +#include +#include + #include "NonConformLoadGroup.hpp" using namespace CIMPP; -NonConformLoad::NonConformLoad(): LoadGroup(nullptr) {}; - +NonConformLoad::NonConformLoad() : LoadGroup(nullptr) {}; NonConformLoad::~NonConformLoad() {}; -bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); -bool assign_NonConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoad* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->LoadGroup != nullptr) - return assign_NonConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* NonConformLoad_factory() { - return new NonConformLoad; +bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass*, BaseClass*); +bool assign_NonConformLoad_LoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoad* element = dynamic_cast(BaseClass_ptr1); + NonConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadGroup != element2) + { + element->LoadGroup = element2; + return assign_NonConformLoadGroup_EnergyConsumers(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void NonConformLoad::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:NonConformLoad"), &NonConformLoad_factory)); +const char NonConformLoad::debugName[] = "NonConformLoad"; +const char* NonConformLoad::debugString() const +{ + return NonConformLoad::debugName; } -void NonConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void NonConformLoad::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:NonConformLoad"), &NonConformLoad_factory)); +} -void NonConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonConformLoad.LoadGroup"), &assign_NonConformLoad_LoadGroup)); +void NonConformLoad::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonConformLoad::debugName[] = "NonConformLoad"; -const char* NonConformLoad::debugString() +void NonConformLoad::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonConformLoad::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonConformLoad.LoadGroup"), &assign_NonConformLoad_LoadGroup)); } const BaseClassDefiner NonConformLoad::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner NonConformLoad::declare() return BaseClassDefiner(NonConformLoad::addConstructToMap, NonConformLoad::addPrimitiveAssignFnsToMap, NonConformLoad::addClassAssignFnsToMap, NonConformLoad::debugName); } - +namespace CIMPP +{ + BaseClass* NonConformLoad_factory() + { + return new NonConformLoad; + } +} diff --git a/CGMES_2.4.15_27JAN2020/NonConformLoad.hpp b/CGMES_2.4.15_27JAN2020/NonConformLoad.hpp index e53291a4f..d7e4bd9ca 100644 --- a/CGMES_2.4.15_27JAN2020/NonConformLoad.hpp +++ b/CGMES_2.4.15_27JAN2020/NonConformLoad.hpp @@ -1,38 +1,39 @@ #ifndef NonConformLoad_H #define NonConformLoad_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyConsumer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyConsumer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonConformLoadGroup; -class NonConformLoadGroup; /* NonConformLoad represent loads that do not follow a daily load change pattern and changes are not correlated with the daily load change pattern. */ - class NonConformLoad: public EnergyConsumer + class NonConformLoad : public EnergyConsumer { - public: - CIMPP::NonConformLoadGroup* LoadGroup; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonConformLoad(); - virtual ~NonConformLoad(); - + ~NonConformLoad() override; + + CIMPP::NonConformLoadGroup* LoadGroup; /* Conform loads assigned to this ConformLoadGroup. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonConformLoad_factory(); diff --git a/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.cpp b/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.cpp index 8897ca92e..6382d77c5 100644 --- a/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.cpp +++ b/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.cpp @@ -1,62 +1,76 @@ -#include -#include "LoadGroup.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonConformLoadGroup.hpp" +#include +#include + #include "NonConformLoad.hpp" #include "NonConformLoadSchedule.hpp" using namespace CIMPP; NonConformLoadGroup::NonConformLoadGroup() {}; - NonConformLoadGroup::~NonConformLoadGroup() {}; -bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EnergyConsumers.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_NonConformLoad_LoadGroup(BaseClass*, BaseClass*); +bool assign_NonConformLoadGroup_EnergyConsumers(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + NonConformLoad* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EnergyConsumers.begin(), element->EnergyConsumers.end(), element2) == element->EnergyConsumers.end()) + { + element->EnergyConsumers.push_back(element2); + return assign_NonConformLoad_LoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->NonConformLoadSchedules.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass*, BaseClass*); +bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoadGroup* element = dynamic_cast(BaseClass_ptr1); + NonConformLoadSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->NonConformLoadSchedules.begin(), element->NonConformLoadSchedules.end(), element2) == element->NonConformLoadSchedules.end()) + { + element->NonConformLoadSchedules.push_back(element2); + return assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* NonConformLoadGroup_factory() { - return new NonConformLoadGroup; - } +const char NonConformLoadGroup::debugName[] = "NonConformLoadGroup"; +const char* NonConformLoadGroup::debugString() const +{ + return NonConformLoadGroup::debugName; } -void NonConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) { +void NonConformLoadGroup::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup"), &NonConformLoadGroup_factory)); } -void NonConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void NonConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.EnergyConsumers"), &assign_NonConformLoadGroup_EnergyConsumers)); - assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.NonConformLoadSchedules"), &assign_NonConformLoadGroup_NonConformLoadSchedules)); +void NonConformLoadGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonConformLoadGroup::debugName[] = "NonConformLoadGroup"; -const char* NonConformLoadGroup::debugString() +void NonConformLoadGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonConformLoadGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.EnergyConsumers"), &assign_NonConformLoadGroup_EnergyConsumers)); + assign_map.insert(std::make_pair(std::string("cim:NonConformLoadGroup.NonConformLoadSchedules"), &assign_NonConformLoadGroup_NonConformLoadSchedules)); } const BaseClassDefiner NonConformLoadGroup::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner NonConformLoadGroup::declare() return BaseClassDefiner(NonConformLoadGroup::addConstructToMap, NonConformLoadGroup::addPrimitiveAssignFnsToMap, NonConformLoadGroup::addClassAssignFnsToMap, NonConformLoadGroup::debugName); } - +namespace CIMPP +{ + BaseClass* NonConformLoadGroup_factory() + { + return new NonConformLoadGroup; + } +} diff --git a/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.hpp b/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.hpp index 1685c6f84..86179d093 100644 --- a/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.hpp +++ b/CGMES_2.4.15_27JAN2020/NonConformLoadGroup.hpp @@ -1,40 +1,41 @@ #ifndef NonConformLoadGroup_H #define NonConformLoadGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "LoadGroup.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "LoadGroup.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonConformLoad; + class NonConformLoadSchedule; -class NonConformLoad; -class NonConformLoadSchedule; /* Loads that do not follow a daily and seasonal load variation pattern. */ - class NonConformLoadGroup: public LoadGroup + class NonConformLoadGroup : public LoadGroup { - public: - std::list EnergyConsumers; /* Group of this ConformLoad. Default: 0 */ - std::list NonConformLoadSchedules; /* The NonConformLoadSchedules in the NonConformLoadGroup. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonConformLoadGroup(); - virtual ~NonConformLoadGroup(); - + ~NonConformLoadGroup() override; + + std::list EnergyConsumers; /* Group of this ConformLoad. Default: 0 */ + std::list NonConformLoadSchedules; /* The NonConformLoadSchedules in the NonConformLoadGroup. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonConformLoadGroup_factory(); diff --git a/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.cpp b/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.cpp index bc30e5194..aaf9d0641 100644 --- a/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonConformLoadSchedule.hpp" +#include +#include + #include "NonConformLoadGroup.hpp" using namespace CIMPP; -NonConformLoadSchedule::NonConformLoadSchedule(): NonConformLoadGroup(nullptr) {}; - +NonConformLoadSchedule::NonConformLoadSchedule() : NonConformLoadGroup(nullptr) {}; NonConformLoadSchedule::~NonConformLoadSchedule() {}; -bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass*, BaseClass*); -bool assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->NonConformLoadGroup = dynamic_cast(BaseClass_ptr2); - if(element->NonConformLoadGroup != nullptr) - return assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* NonConformLoadSchedule_factory() { - return new NonConformLoadSchedule; +bool assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass*, BaseClass*); +bool assign_NonConformLoadSchedule_NonConformLoadGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonConformLoadSchedule* element = dynamic_cast(BaseClass_ptr1); + NonConformLoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->NonConformLoadGroup != element2) + { + element->NonConformLoadGroup = element2; + return assign_NonConformLoadGroup_NonConformLoadSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void NonConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule"), &NonConformLoadSchedule_factory)); +const char NonConformLoadSchedule::debugName[] = "NonConformLoadSchedule"; +const char* NonConformLoadSchedule::debugString() const +{ + return NonConformLoadSchedule::debugName; } -void NonConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void NonConformLoadSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule"), &NonConformLoadSchedule_factory)); +} -void NonConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule.NonConformLoadGroup"), &assign_NonConformLoadSchedule_NonConformLoadGroup)); +void NonConformLoadSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonConformLoadSchedule::debugName[] = "NonConformLoadSchedule"; -const char* NonConformLoadSchedule::debugString() +void NonConformLoadSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonConformLoadSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonConformLoadSchedule.NonConformLoadGroup"), &assign_NonConformLoadSchedule_NonConformLoadGroup)); } const BaseClassDefiner NonConformLoadSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner NonConformLoadSchedule::declare() return BaseClassDefiner(NonConformLoadSchedule::addConstructToMap, NonConformLoadSchedule::addPrimitiveAssignFnsToMap, NonConformLoadSchedule::addClassAssignFnsToMap, NonConformLoadSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* NonConformLoadSchedule_factory() + { + return new NonConformLoadSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.hpp b/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.hpp index 7bdfe2c9b..66e28f843 100644 --- a/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/NonConformLoadSchedule.hpp @@ -1,38 +1,39 @@ #ifndef NonConformLoadSchedule_H #define NonConformLoadSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonConformLoadGroup; -class NonConformLoadGroup; /* An active power (Y1-axis) and reactive power (Y2-axis) schedule (curves) versus time (X-axis) for non-conforming loads, e.g., large industrial load or power station service (where modeled). */ - class NonConformLoadSchedule: public SeasonDayTypeSchedule + class NonConformLoadSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::NonConformLoadGroup* NonConformLoadGroup; /* The NonConformLoadGroup where the NonConformLoadSchedule belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonConformLoadSchedule(); - virtual ~NonConformLoadSchedule(); - + ~NonConformLoadSchedule() override; + + CIMPP::NonConformLoadGroup* NonConformLoadGroup; /* The NonConformLoadGroup where the NonConformLoadSchedule belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonConformLoadSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.cpp b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.cpp index a8af57fd0..99a0ef8cc 100644 --- a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.cpp +++ b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.cpp @@ -1,49 +1,56 @@ -#include -#include "ShuntCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonlinearShuntCompensator.hpp" +#include +#include + #include "NonlinearShuntCompensatorPoint.hpp" using namespace CIMPP; NonlinearShuntCompensator::NonlinearShuntCompensator() {}; - NonlinearShuntCompensator::~NonlinearShuntCompensator() {}; -bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonlinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->NonlinearShuntCompensatorPoints.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass*, BaseClass*); +bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonlinearShuntCompensator* element = dynamic_cast(BaseClass_ptr1); + NonlinearShuntCompensatorPoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->NonlinearShuntCompensatorPoints.begin(), element->NonlinearShuntCompensatorPoints.end(), element2) == element->NonlinearShuntCompensatorPoints.end()) + { + element->NonlinearShuntCompensatorPoints.push_back(element2); + return assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* NonlinearShuntCompensator_factory() { - return new NonlinearShuntCompensator; - } +const char NonlinearShuntCompensator::debugName[] = "NonlinearShuntCompensator"; +const char* NonlinearShuntCompensator::debugString() const +{ + return NonlinearShuntCompensator::debugName; } -void NonlinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) { +void NonlinearShuntCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensator"), &NonlinearShuntCompensator_factory)); } -void NonlinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void NonlinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensator.NonlinearShuntCompensatorPoints"), &assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints)); +void NonlinearShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NonlinearShuntCompensator::debugName[] = "NonlinearShuntCompensator"; -const char* NonlinearShuntCompensator::debugString() +void NonlinearShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonlinearShuntCompensator::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensator.NonlinearShuntCompensatorPoints"), &assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints)); } const BaseClassDefiner NonlinearShuntCompensator::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner NonlinearShuntCompensator::declare() return BaseClassDefiner(NonlinearShuntCompensator::addConstructToMap, NonlinearShuntCompensator::addPrimitiveAssignFnsToMap, NonlinearShuntCompensator::addClassAssignFnsToMap, NonlinearShuntCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* NonlinearShuntCompensator_factory() + { + return new NonlinearShuntCompensator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.hpp b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.hpp index f771f72cf..a42b0d6c7 100644 --- a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.hpp +++ b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensator.hpp @@ -1,38 +1,39 @@ #ifndef NonlinearShuntCompensator_H #define NonlinearShuntCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ShuntCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "ShuntCompensator.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class NonlinearShuntCompensatorPoint; -class NonlinearShuntCompensatorPoint; /* A non linear shunt compensator has bank or section admittance values that differs. */ - class NonlinearShuntCompensator: public ShuntCompensator + class NonlinearShuntCompensator : public ShuntCompensator { - public: - std::list NonlinearShuntCompensatorPoints; /* All points of the non-linear shunt compensator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonlinearShuntCompensator(); - virtual ~NonlinearShuntCompensator(); - + ~NonlinearShuntCompensator() override; + + std::list NonlinearShuntCompensatorPoints; /* All points of the non-linear shunt compensator. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonlinearShuntCompensator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.cpp b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.cpp index e887e7fb5..41ee84d9c 100644 --- a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.cpp +++ b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.cpp @@ -1,124 +1,136 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NonlinearShuntCompensatorPoint.hpp" +#include +#include + #include "NonlinearShuntCompensator.hpp" #include "Susceptance.hpp" -#include "Conductance.hpp" -#include "Integer.hpp" #include "Susceptance.hpp" #include "Conductance.hpp" +#include "Conductance.hpp" +#include "Integer.hpp" using namespace CIMPP; -NonlinearShuntCompensatorPoint::NonlinearShuntCompensatorPoint(): NonlinearShuntCompensator(nullptr) {}; - +NonlinearShuntCompensatorPoint::NonlinearShuntCompensatorPoint() : NonlinearShuntCompensator(nullptr) {}; NonlinearShuntCompensatorPoint::~NonlinearShuntCompensatorPoint() {}; -bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass*, BaseClass*); -bool assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->NonlinearShuntCompensator = dynamic_cast(BaseClass_ptr2); - if(element->NonlinearShuntCompensator != nullptr) - return assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_NonlinearShuntCompensatorPoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_NonlinearShuntCompensatorPoint_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_NonlinearShuntCompensatorPoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_NonlinearShuntCompensatorPoint_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_NonlinearShuntCompensatorPoint_sectionNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sectionNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_NonlinearShuntCompensatorPoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass*, BaseClass*); +bool assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1); + NonlinearShuntCompensator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->NonlinearShuntCompensator != element2) + { + element->NonlinearShuntCompensator = element2; + return assign_NonlinearShuntCompensator_NonlinearShuntCompensatorPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_NonlinearShuntCompensatorPoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_NonlinearShuntCompensatorPoint_sectionNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sectionNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_NonlinearShuntCompensatorPoint_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_NonlinearShuntCompensatorPoint_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(NonlinearShuntCompensatorPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* NonlinearShuntCompensatorPoint_factory() { - return new NonlinearShuntCompensatorPoint; - } + +const char NonlinearShuntCompensatorPoint::debugName[] = "NonlinearShuntCompensatorPoint"; +const char* NonlinearShuntCompensatorPoint::debugString() const +{ + return NonlinearShuntCompensatorPoint::debugName; } -void NonlinearShuntCompensatorPoint::addConstructToMap(std::unordered_map& factory_map) { +void NonlinearShuntCompensatorPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint"), &NonlinearShuntCompensatorPoint_factory)); } -void NonlinearShuntCompensatorPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.b"), &assign_NonlinearShuntCompensatorPoint_b)); - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.g"), &assign_NonlinearShuntCompensatorPoint_g)); - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.sectionNumber"), &assign_NonlinearShuntCompensatorPoint_sectionNumber)); +void NonlinearShuntCompensatorPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.b"), &assign_NonlinearShuntCompensatorPoint_b)); assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.b0"), &assign_NonlinearShuntCompensatorPoint_b0)); + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.g"), &assign_NonlinearShuntCompensatorPoint_g)); assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.g0"), &assign_NonlinearShuntCompensatorPoint_g0)); + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.sectionNumber"), &assign_NonlinearShuntCompensatorPoint_sectionNumber)); } -void NonlinearShuntCompensatorPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.NonlinearShuntCompensator"), &assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator)); - } - -const char NonlinearShuntCompensatorPoint::debugName[] = "NonlinearShuntCompensatorPoint"; -const char* NonlinearShuntCompensatorPoint::debugString() +void NonlinearShuntCompensatorPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NonlinearShuntCompensatorPoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:NonlinearShuntCompensatorPoint.NonlinearShuntCompensator"), &assign_NonlinearShuntCompensatorPoint_NonlinearShuntCompensator)); } const BaseClassDefiner NonlinearShuntCompensatorPoint::declare() @@ -126,4 +138,10 @@ const BaseClassDefiner NonlinearShuntCompensatorPoint::declare() return BaseClassDefiner(NonlinearShuntCompensatorPoint::addConstructToMap, NonlinearShuntCompensatorPoint::addPrimitiveAssignFnsToMap, NonlinearShuntCompensatorPoint::addClassAssignFnsToMap, NonlinearShuntCompensatorPoint::debugName); } - +namespace CIMPP +{ + BaseClass* NonlinearShuntCompensatorPoint_factory() + { + return new NonlinearShuntCompensatorPoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.hpp b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.hpp index e68fbc34b..73982a75e 100644 --- a/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.hpp +++ b/CGMES_2.4.15_27JAN2020/NonlinearShuntCompensatorPoint.hpp @@ -1,46 +1,47 @@ #ifndef NonlinearShuntCompensatorPoint_H #define NonlinearShuntCompensatorPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Conductance.hpp" #include "Integer.hpp" +#include "Susceptance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class NonlinearShuntCompensator; -class NonlinearShuntCompensator; /* A non linear shunt compensator bank or section admittance value. */ - class NonlinearShuntCompensatorPoint: public BaseClass + class NonlinearShuntCompensatorPoint : public BaseClass { - public: - CIMPP::NonlinearShuntCompensator* NonlinearShuntCompensator; /* Non-linear shunt compensator owning this point. Default: 0 */ - CIMPP::Susceptance b; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance g; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ - CIMPP::Integer sectionNumber; /* The number of the section. Default: 0 */ - CIMPP::Susceptance b0; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ - CIMPP::Conductance g0; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NonlinearShuntCompensatorPoint(); - virtual ~NonlinearShuntCompensatorPoint(); - + ~NonlinearShuntCompensatorPoint() override; + + CIMPP::NonlinearShuntCompensator* NonlinearShuntCompensator; /* Non-linear shunt compensator owning this point. Default: 0 */ + CIMPP::Susceptance b; /* Positive sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Susceptance b0; /* Zero sequence shunt (charging) susceptance per section Default: nullptr */ + CIMPP::Conductance g; /* Positive sequence shunt (charging) conductance per section Default: nullptr */ + CIMPP::Conductance g0; /* Zero sequence shunt (charging) conductance per section Default: nullptr */ + CIMPP::Integer sectionNumber; /* The number of the section. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NonlinearShuntCompensatorPoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.cpp index 63a9c7e15..98d7415bb 100644 --- a/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.cpp @@ -1,36 +1,36 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "NuclearGeneratingUnit.hpp" +#include +#include + using namespace CIMPP; NuclearGeneratingUnit::NuclearGeneratingUnit() {}; - NuclearGeneratingUnit::~NuclearGeneratingUnit() {}; -namespace CIMPP { - BaseClass* NuclearGeneratingUnit_factory() { - return new NuclearGeneratingUnit; - } +const char NuclearGeneratingUnit::debugName[] = "NuclearGeneratingUnit"; +const char* NuclearGeneratingUnit::debugString() const +{ + return NuclearGeneratingUnit::debugName; } -void NuclearGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void NuclearGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:NuclearGeneratingUnit"), &NuclearGeneratingUnit_factory)); } -void NuclearGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void NuclearGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void NuclearGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char NuclearGeneratingUnit::debugName[] = "NuclearGeneratingUnit"; -const char* NuclearGeneratingUnit::debugString() +void NuclearGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return NuclearGeneratingUnit::debugName; } const BaseClassDefiner NuclearGeneratingUnit::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner NuclearGeneratingUnit::declare() return BaseClassDefiner(NuclearGeneratingUnit::addConstructToMap, NuclearGeneratingUnit::addPrimitiveAssignFnsToMap, NuclearGeneratingUnit::addClassAssignFnsToMap, NuclearGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* NuclearGeneratingUnit_factory() + { + return new NuclearGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.hpp index eb359a1e0..81f68a25f 100644 --- a/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/NuclearGeneratingUnit.hpp @@ -1,36 +1,37 @@ #ifndef NuclearGeneratingUnit_H #define NuclearGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A nuclear generating unit. */ - class NuclearGeneratingUnit: public GeneratingUnit + class NuclearGeneratingUnit : public GeneratingUnit { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ NuclearGeneratingUnit(); - virtual ~NuclearGeneratingUnit(); - + ~NuclearGeneratingUnit() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* NuclearGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimit.cpp b/CGMES_2.4.15_27JAN2020/OperationalLimit.cpp index cf3a675ea..469d42fdc 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimit.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimit.hpp" +#include +#include + #include "OperationalLimitSet.hpp" #include "OperationalLimitType.hpp" using namespace CIMPP; -OperationalLimit::OperationalLimit(): OperationalLimitSet(nullptr), OperationalLimitType(nullptr) {}; - +OperationalLimit::OperationalLimit() : OperationalLimitSet(nullptr), OperationalLimitType(nullptr) {}; OperationalLimit::~OperationalLimit() {}; + + + bool assign_OperationalLimitSet_OperationalLimitValue(BaseClass*, BaseClass*); -bool assign_OperationalLimit_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->OperationalLimitSet = dynamic_cast(BaseClass_ptr2); - if(element->OperationalLimitSet != nullptr) - return assign_OperationalLimitSet_OperationalLimitValue(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_OperationalLimit_OperationalLimitSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimit* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OperationalLimitSet != element2) + { + element->OperationalLimitSet = element2; + return assign_OperationalLimitSet_OperationalLimitValue(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_OperationalLimitType_OperationalLimit(BaseClass*, BaseClass*); -bool assign_OperationalLimit_OperationalLimitType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimit* element = dynamic_cast(BaseClass_ptr1)) { - element->OperationalLimitType = dynamic_cast(BaseClass_ptr2); - if(element->OperationalLimitType != nullptr) - return assign_OperationalLimitType_OperationalLimit(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_OperationalLimit_OperationalLimitType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimit* element = dynamic_cast(BaseClass_ptr1); + OperationalLimitType* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OperationalLimitType != element2) + { + element->OperationalLimitType = element2; + return assign_OperationalLimitType_OperationalLimit(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* OperationalLimit_factory() { - return new OperationalLimit; - } +const char OperationalLimit::debugName[] = "OperationalLimit"; +const char* OperationalLimit::debugString() const +{ + return OperationalLimit::debugName; } -void OperationalLimit::addConstructToMap(std::unordered_map& factory_map) { +void OperationalLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OperationalLimit"), &OperationalLimit_factory)); } -void OperationalLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void OperationalLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitSet"), &assign_OperationalLimit_OperationalLimitSet)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitType"), &assign_OperationalLimit_OperationalLimitType)); +void OperationalLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char OperationalLimit::debugName[] = "OperationalLimit"; -const char* OperationalLimit::debugString() +void OperationalLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OperationalLimit::debugName; + assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitSet"), &assign_OperationalLimit_OperationalLimitSet)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimit.OperationalLimitType"), &assign_OperationalLimit_OperationalLimitType)); } const BaseClassDefiner OperationalLimit::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner OperationalLimit::declare() return BaseClassDefiner(OperationalLimit::addConstructToMap, OperationalLimit::addPrimitiveAssignFnsToMap, OperationalLimit::addClassAssignFnsToMap, OperationalLimit::debugName); } - +namespace CIMPP +{ + BaseClass* OperationalLimit_factory() + { + return new OperationalLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimit.hpp b/CGMES_2.4.15_27JAN2020/OperationalLimit.hpp index 9db66a379..42c59f9fc 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimit.hpp @@ -1,40 +1,41 @@ #ifndef OperationalLimit_H #define OperationalLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class OperationalLimitSet; + class OperationalLimitType; -class OperationalLimitSet; -class OperationalLimitType; /* A value associated with a specific kind of limit. The sub class value attribute shall be positive. The sub class value attribute is inversely proportional to OperationalLimitType.acceptableDuration (acceptableDuration for short). A pair of value_x and acceptableDuration_x are related to each other as follows: if value_1 > value_2 > value_3 >... then acceptableDuration_1 < acceptableDuration_2 < acceptableDuration_3 < ... A value_x with direction="high" shall be greater than a value_y with direction="low". */ - class OperationalLimit: public IdentifiedObject + class OperationalLimit : public IdentifiedObject { - public: - CIMPP::OperationalLimitSet* OperationalLimitSet; /* Values of equipment limits. Default: 0 */ - CIMPP::OperationalLimitType* OperationalLimitType; /* The limit type associated with this limit. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OperationalLimit(); - virtual ~OperationalLimit(); - + ~OperationalLimit() override; + + CIMPP::OperationalLimitSet* OperationalLimitSet; /* Values of equipment limits. Default: 0 */ + CIMPP::OperationalLimitType* OperationalLimitType; /* The limit type associated with this limit. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OperationalLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.cpp b/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.cpp index 9cb5f80b9..4aeb56e6d 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.cpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimitDirectionKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::OperationalLimitDirectionKind& rop) +OperationalLimitDirectionKind& OperationalLimitDirectionKind::operator=(OperationalLimitDirectionKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +OperationalLimitDirectionKind::operator OperationalLimitDirectionKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char OperationalLimitDirectionKind::debugName[] = "OperationalLimitDirectionKind"; +const char* OperationalLimitDirectionKind::debugString() const +{ + return OperationalLimitDirectionKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, OperationalLimitDirectionKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const OperationalLimitDirectionKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == OperationalLimitDirectionKind::high) + { + EnumSymbol = "high"; + } + if (obj.value == OperationalLimitDirectionKind::low) + { + EnumSymbol = "low"; + } + if (obj.value == OperationalLimitDirectionKind::absoluteValue) + { + EnumSymbol = "absoluteValue"; + } + + if (!EnumSymbol.empty()) + { + os << "OperationalLimitDirectionKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.hpp b/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.hpp index ce1461f83..33d23f39a 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.hpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimitDirectionKind.hpp @@ -1,25 +1,50 @@ #ifndef OperationalLimitDirectionKind_H #define OperationalLimitDirectionKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The direction attribute describes the side of a limit that is a violation. */ - enum class OperationalLimitDirectionKind + class OperationalLimitDirectionKind { - /** - * High means that a monitored value above the limit value is a violation. If applied to a terminal flow, the positive direction is into the terminal. - */ - high, - /** - * Low means a monitored value below the limit is a violation. If applied to a terminal flow, the positive direction is into the terminal. - */ - low, - /** - * An absoluteValue limit means that a monitored absolute value above the limit value is a violation. - */ - absoluteValue, + public: + enum OperationalLimitDirectionKind_ENUM + { + /** + * High means that a monitored value above the limit value is a violation. If applied to a terminal flow, the positive direction is into the terminal. + */ + high, + /** + * Low means a monitored value below the limit is a violation. If applied to a terminal flow, the positive direction is into the terminal. + */ + low, + /** + * An absoluteValue limit means that a monitored absolute value above the limit value is a violation. + */ + absoluteValue, + }; + + OperationalLimitDirectionKind() : value(), initialized(false) {} + OperationalLimitDirectionKind(OperationalLimitDirectionKind_ENUM value) : value(value), initialized(true) {} + + OperationalLimitDirectionKind& operator=(OperationalLimitDirectionKind_ENUM rop); + operator OperationalLimitDirectionKind_ENUM() const; + + OperationalLimitDirectionKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, OperationalLimitDirectionKind& rop); + friend std::ostream& operator<<(std::ostream& os, const OperationalLimitDirectionKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::OperationalLimitDirectionKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimitSet.cpp b/CGMES_2.4.15_27JAN2020/OperationalLimitSet.cpp index 6b820c844..65fd3559f 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimitSet.cpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimitSet.cpp @@ -1,75 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimitSet.hpp" -#include "ACDCTerminal.hpp" +#include +#include + #include "Equipment.hpp" #include "OperationalLimit.hpp" +#include "ACDCTerminal.hpp" using namespace CIMPP; -OperationalLimitSet::OperationalLimitSet(): Terminal(nullptr), Equipment(nullptr) {}; - +OperationalLimitSet::OperationalLimitSet() : Equipment(nullptr), Terminal(nullptr) {}; OperationalLimitSet::~OperationalLimitSet() {}; -bool assign_ACDCTerminal_OperationalLimitSet(BaseClass*, BaseClass*); -bool assign_OperationalLimitSet_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_ACDCTerminal_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} + + + bool assign_Equipment_OperationalLimitSet(BaseClass*, BaseClass*); -bool assign_OperationalLimitSet_Equipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - element->Equipment = dynamic_cast(BaseClass_ptr2); - if(element->Equipment != nullptr) - return assign_Equipment_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_OperationalLimitSet_Equipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1); + Equipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Equipment != element2) + { + element->Equipment = element2; + return assign_Equipment_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_OperationalLimitSet_OperationalLimitValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimitValue.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_OperationalLimit_OperationalLimitSet(BaseClass*, BaseClass*); +bool assign_OperationalLimitSet_OperationalLimitValue(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1); + OperationalLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimitValue.begin(), element->OperationalLimitValue.end(), element2) == element->OperationalLimitValue.end()) + { + element->OperationalLimitValue.push_back(element2); + return assign_OperationalLimit_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - -namespace CIMPP { - BaseClass* OperationalLimitSet_factory() { - return new OperationalLimitSet; +bool assign_ACDCTerminal_OperationalLimitSet(BaseClass*, BaseClass*); +bool assign_OperationalLimitSet_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitSet* element = dynamic_cast(BaseClass_ptr1); + ACDCTerminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_ACDCTerminal_OperationalLimitSet(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void OperationalLimitSet::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:OperationalLimitSet"), &OperationalLimitSet_factory)); +const char OperationalLimitSet::debugName[] = "OperationalLimitSet"; +const char* OperationalLimitSet::debugString() const +{ + return OperationalLimitSet::debugName; } -void OperationalLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void OperationalLimitSet::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:OperationalLimitSet"), &OperationalLimitSet_factory)); +} -void OperationalLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Terminal"), &assign_OperationalLimitSet_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Equipment"), &assign_OperationalLimitSet_Equipment)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.OperationalLimitValue"), &assign_OperationalLimitSet_OperationalLimitValue)); +void OperationalLimitSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char OperationalLimitSet::debugName[] = "OperationalLimitSet"; -const char* OperationalLimitSet::debugString() +void OperationalLimitSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OperationalLimitSet::debugName; + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Equipment"), &assign_OperationalLimitSet_Equipment)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.OperationalLimitValue"), &assign_OperationalLimitSet_OperationalLimitValue)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitSet.Terminal"), &assign_OperationalLimitSet_Terminal)); } const BaseClassDefiner OperationalLimitSet::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner OperationalLimitSet::declare() return BaseClassDefiner(OperationalLimitSet::addConstructToMap, OperationalLimitSet::addPrimitiveAssignFnsToMap, OperationalLimitSet::addClassAssignFnsToMap, OperationalLimitSet::debugName); } - +namespace CIMPP +{ + BaseClass* OperationalLimitSet_factory() + { + return new OperationalLimitSet; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimitSet.hpp b/CGMES_2.4.15_27JAN2020/OperationalLimitSet.hpp index 3fd1e4ba2..a6a94680b 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimitSet.hpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimitSet.hpp @@ -1,42 +1,43 @@ #ifndef OperationalLimitSet_H #define OperationalLimitSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ACDCTerminal; + class Equipment; + class OperationalLimit; -class ACDCTerminal; -class Equipment; -class OperationalLimit; /* A set of limits associated with equipment. Sets of limits might apply to a specific temperature, or season for example. A set of limits may contain different severities of limit levels that would apply to the same equipment. The set may contain limits of different types such as apparent power and current limits or high and low voltage limits that are logically applied together as a set. */ - class OperationalLimitSet: public IdentifiedObject + class OperationalLimitSet : public IdentifiedObject { - public: - CIMPP::ACDCTerminal* Terminal; /* Default: 0 */ - CIMPP::Equipment* Equipment; /* The equipment to which the limit set applies. Default: 0 */ - std::list OperationalLimitValue; /* The limit set to which the limit values belong. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OperationalLimitSet(); - virtual ~OperationalLimitSet(); - + ~OperationalLimitSet() override; + + CIMPP::Equipment* Equipment; /* The equipment to which the limit set applies. Default: 0 */ + std::list OperationalLimitValue; /* The limit set to which the limit values belong. Default: 0 */ + CIMPP::ACDCTerminal* Terminal; /* Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OperationalLimitSet_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimitType.cpp b/CGMES_2.4.15_27JAN2020/OperationalLimitType.cpp index 106a78f84..29ea706ae 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimitType.cpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimitType.cpp @@ -1,94 +1,104 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OperationalLimitType.hpp" +#include +#include + #include "OperationalLimit.hpp" #include "Seconds.hpp" -#include "LimitTypeKind.hpp" #include "OperationalLimitDirectionKind.hpp" +#include "LimitTypeKind.hpp" using namespace CIMPP; OperationalLimitType::OperationalLimitType() {}; - OperationalLimitType::~OperationalLimitType() {}; -bool assign_OperationalLimitType_OperationalLimit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->OperationalLimit.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_OperationalLimitType_acceptableDuration(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->acceptableDuration; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_OperationalLimitType_direction(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->direction; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OperationalLimitType_limitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->limitType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - -bool assign_OperationalLimitType_acceptableDuration(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->acceptableDuration; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_OperationalLimit_OperationalLimitType(BaseClass*, BaseClass*); +bool assign_OperationalLimitType_OperationalLimit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OperationalLimitType* element = dynamic_cast(BaseClass_ptr1); + OperationalLimit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->OperationalLimit.begin(), element->OperationalLimit.end(), element2) == element->OperationalLimit.end()) + { + element->OperationalLimit.push_back(element2); + return assign_OperationalLimit_OperationalLimitType(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_OperationalLimitType_limitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->limitType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OperationalLimitType_direction(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OperationalLimitType* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->direction; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* OperationalLimitType_factory() { - return new OperationalLimitType; - } + +const char OperationalLimitType::debugName[] = "OperationalLimitType"; +const char* OperationalLimitType::debugString() const +{ + return OperationalLimitType::debugName; } -void OperationalLimitType::addConstructToMap(std::unordered_map& factory_map) { +void OperationalLimitType::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OperationalLimitType"), &OperationalLimitType_factory)); } -void OperationalLimitType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.acceptableDuration"), &assign_OperationalLimitType_acceptableDuration)); - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.limitType"), &assign_OperationalLimitType_limitType)); +void OperationalLimitType::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.acceptableDuration"), &assign_OperationalLimitType_acceptableDuration)); assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.direction"), &assign_OperationalLimitType_direction)); + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.limitType"), &assign_OperationalLimitType_limitType)); } -void OperationalLimitType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.OperationalLimit"), &assign_OperationalLimitType_OperationalLimit)); - } - -const char OperationalLimitType::debugName[] = "OperationalLimitType"; -const char* OperationalLimitType::debugString() +void OperationalLimitType::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OperationalLimitType::debugName; + assign_map.insert(std::make_pair(std::string("cim:OperationalLimitType.OperationalLimit"), &assign_OperationalLimitType_OperationalLimit)); } const BaseClassDefiner OperationalLimitType::declare() @@ -96,4 +106,10 @@ const BaseClassDefiner OperationalLimitType::declare() return BaseClassDefiner(OperationalLimitType::addConstructToMap, OperationalLimitType::addPrimitiveAssignFnsToMap, OperationalLimitType::addClassAssignFnsToMap, OperationalLimitType::debugName); } - +namespace CIMPP +{ + BaseClass* OperationalLimitType_factory() + { + return new OperationalLimitType; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OperationalLimitType.hpp b/CGMES_2.4.15_27JAN2020/OperationalLimitType.hpp index 8bf2c4462..6de5044fe 100644 --- a/CGMES_2.4.15_27JAN2020/OperationalLimitType.hpp +++ b/CGMES_2.4.15_27JAN2020/OperationalLimitType.hpp @@ -1,44 +1,45 @@ #ifndef OperationalLimitType_H #define OperationalLimitType_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "LimitTypeKind.hpp" #include "OperationalLimitDirectionKind.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class OperationalLimit; -class OperationalLimit; /* The operational meaning of a category of limits. */ - class OperationalLimitType: public IdentifiedObject + class OperationalLimitType : public IdentifiedObject { - public: - std::list OperationalLimit; /* The operational limits associated with this type of limit. Default: 0 */ - CIMPP::Seconds acceptableDuration; /* The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed. Default: nullptr */ - CIMPP::LimitTypeKind limitType; /* Types of limits defined in the ENTSO-E Operational Handbook Policy 3. Default: 0 */ - CIMPP::OperationalLimitDirectionKind direction; /* The direction of the limit. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OperationalLimitType(); - virtual ~OperationalLimitType(); - + ~OperationalLimitType() override; + + std::list OperationalLimit; /* The operational limits associated with this type of limit. Default: 0 */ + CIMPP::Seconds acceptableDuration; /* The nominal acceptable duration of the limit. Limits are commonly expressed in terms of the a time limit for which the limit is normally acceptable. The actual acceptable duration of a specific limit may depend on other local factors such as temperature or wind speed. Default: nullptr */ + CIMPP::OperationalLimitDirectionKind direction; /* The direction of the limit. Default: 0 */ + CIMPP::LimitTypeKind limitType; /* Types of limits defined in the ENTSO-E Operational Handbook Policy 3. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OperationalLimitType_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OrientationKind.cpp b/CGMES_2.4.15_27JAN2020/OrientationKind.cpp index d9eae1669..e02a50057 100644 --- a/CGMES_2.4.15_27JAN2020/OrientationKind.cpp +++ b/CGMES_2.4.15_27JAN2020/OrientationKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OrientationKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::OrientationKind& rop) +OrientationKind& OrientationKind::operator=(OrientationKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +OrientationKind::operator OrientationKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char OrientationKind::debugName[] = "OrientationKind"; +const char* OrientationKind::debugString() const +{ + return OrientationKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, OrientationKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -28,5 +59,23 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const OrientationKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == OrientationKind::negative) + { + EnumSymbol = "negative"; + } + + if (!EnumSymbol.empty()) + { + os << "OrientationKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OrientationKind.hpp b/CGMES_2.4.15_27JAN2020/OrientationKind.hpp index 203bcf91a..0ab661444 100644 --- a/CGMES_2.4.15_27JAN2020/OrientationKind.hpp +++ b/CGMES_2.4.15_27JAN2020/OrientationKind.hpp @@ -1,17 +1,42 @@ #ifndef OrientationKind_H #define OrientationKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The orientation of the coordinate system with respect to top, left, and the coordinate number system. */ - enum class OrientationKind + class OrientationKind { - /** - * For 2D diagrams, a negative orientation gives the left-hand orientation (favoured by computer graphics displays) with X values increasing from left to right and Y values increasing from top to bottom. This is also known as a left hand orientation. - */ - negative, + public: + enum OrientationKind_ENUM + { + /** + * For 2D diagrams, a negative orientation gives the left-hand orientation (favoured by computer graphics displays) with X values increasing from left to right and Y values increasing from top to bottom. This is also known as a left hand orientation. + */ + negative, + }; + + OrientationKind() : value(), initialized(false) {} + OrientationKind(OrientationKind_ENUM value) : value(value), initialized(true) {} + + OrientationKind& operator=(OrientationKind_ENUM rop); + operator OrientationKind_ENUM() const; + + OrientationKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, OrientationKind& rop); + friend std::ostream& operator<<(std::ostream& os, const OrientationKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::OrientationKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/OverexcLim2.cpp b/CGMES_2.4.15_27JAN2020/OverexcLim2.cpp index fdaa8c396..4b41edb94 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLim2.cpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLim2.cpp @@ -1,7 +1,11 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLim2.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -10,87 +14,87 @@ using namespace CIMPP; OverexcLim2::OverexcLim2() {}; - OverexcLim2::~OverexcLim2() {}; +bool assign_OverexcLim2_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLim2_koi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->koi; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLim2_voimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLim2_voimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLim2_koi(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->koi; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLim2_voimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLim2_voimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLim2_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLim2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* OverexcLim2_factory() { - return new OverexcLim2; - } +const char OverexcLim2::debugName[] = "OverexcLim2"; +const char* OverexcLim2::debugString() const +{ + return OverexcLim2::debugName; } -void OverexcLim2::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLim2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLim2"), &OverexcLim2_factory)); } -void OverexcLim2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void OverexcLim2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.ifdlim"), &assign_OverexcLim2_ifdlim)); assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.koi"), &assign_OverexcLim2_koi)); assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.voimax"), &assign_OverexcLim2_voimax)); assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.voimin"), &assign_OverexcLim2_voimin)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLim2.ifdlim"), &assign_OverexcLim2_ifdlim)); } -void OverexcLim2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLim2::debugName[] = "OverexcLim2"; -const char* OverexcLim2::debugString() +void OverexcLim2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLim2::debugName; } const BaseClassDefiner OverexcLim2::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner OverexcLim2::declare() return BaseClassDefiner(OverexcLim2::addConstructToMap, OverexcLim2::addPrimitiveAssignFnsToMap, OverexcLim2::addClassAssignFnsToMap, OverexcLim2::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLim2_factory() + { + return new OverexcLim2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OverexcLim2.hpp b/CGMES_2.4.15_27JAN2020/OverexcLim2.hpp index 453fef17c..5ee4319c4 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLim2.hpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLim2.hpp @@ -1,41 +1,42 @@ #ifndef OverexcLim2_H #define OverexcLim2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Different from LimIEEEOEL, LimOEL2 has a fixed pickup threshold and reduces the excitation set-point by mean of non-windup integral regulator. Irated is the rated machine excitation current (calculated from nameplate conditions: V, P, CosPhi). */ - class OverexcLim2: public OverexcitationLimiterDynamics + class OverexcLim2 : public OverexcitationLimiterDynamics { - public: - CIMPP::PU koi; /* Gain Over excitation limiter (K). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU voimax; /* Maximum error signal (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU voimin; /* Minimum error signal (V). Typical Value = -9999. Default: nullptr */ - CIMPP::PU ifdlim; /* Limit value of rated field current (I). Typical Value = 1.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLim2(); - virtual ~OverexcLim2(); - + ~OverexcLim2() override; + + CIMPP::PU ifdlim; /* Limit value of rated field current (I). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU koi; /* Gain Over excitation limiter (K). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU voimax; /* Maximum error signal (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU voimin; /* Minimum error signal (V). Typical Value = -9999. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLim2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.cpp b/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.cpp index d2180b520..10157d970 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.cpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.cpp @@ -1,7 +1,11 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLimIEEE.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -12,115 +16,117 @@ using namespace CIMPP; OverexcLimIEEE::OverexcLimIEEE() {}; - OverexcLimIEEE::~OverexcLimIEEE() {}; +bool assign_OverexcLimIEEE_hyst(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hyst; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdlim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_ifdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_itfpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->itfpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_kcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kcd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimIEEE_kramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kramp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLimIEEE_itfpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->itfpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_ifdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_ifdlim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdlim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_hyst(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hyst; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_kcd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kcd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimIEEE_kramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kramp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* OverexcLimIEEE_factory() { - return new OverexcLimIEEE; - } +const char OverexcLimIEEE::debugName[] = "OverexcLimIEEE"; +const char* OverexcLimIEEE::debugString() const +{ + return OverexcLimIEEE::debugName; } -void OverexcLimIEEE::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLimIEEE::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE"), &OverexcLimIEEE_factory)); } -void OverexcLimIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.itfpu"), &assign_OverexcLimIEEE_itfpu)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdmax"), &assign_OverexcLimIEEE_ifdmax)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdlim"), &assign_OverexcLimIEEE_ifdlim)); +void OverexcLimIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.hyst"), &assign_OverexcLimIEEE_hyst)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdlim"), &assign_OverexcLimIEEE_ifdlim)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.ifdmax"), &assign_OverexcLimIEEE_ifdmax)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.itfpu"), &assign_OverexcLimIEEE_itfpu)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.kcd"), &assign_OverexcLimIEEE_kcd)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimIEEE.kramp"), &assign_OverexcLimIEEE_kramp)); } -void OverexcLimIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLimIEEE::debugName[] = "OverexcLimIEEE"; -const char* OverexcLimIEEE::debugString() +void OverexcLimIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLimIEEE::debugName; } const BaseClassDefiner OverexcLimIEEE::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner OverexcLimIEEE::declare() return BaseClassDefiner(OverexcLimIEEE::addConstructToMap, OverexcLimIEEE::addPrimitiveAssignFnsToMap, OverexcLimIEEE::addClassAssignFnsToMap, OverexcLimIEEE::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLimIEEE_factory() + { + return new OverexcLimIEEE; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.hpp b/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.hpp index e5f8cc28f..8c66e3475 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.hpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLimIEEE.hpp @@ -1,44 +1,45 @@ #ifndef OverexcLimIEEE_H #define OverexcLimIEEE_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The over excitation limiter model is intended to represent the significant features of OELs necessary for some large-scale system studies. It is the result of a pragmatic approach to obtain a model that can be widely applied with attainable data from generator owners. An attempt to include all variations in the functionality of OELs and duplicate how they interact with the rest of the excitation systems would likely result in a level of application insufficient for the studies for which they are intended. Reference: IEEE OEL 421.5-2005 Section 9. */ - class OverexcLimIEEE: public OverexcitationLimiterDynamics + class OverexcLimIEEE : public OverexcitationLimiterDynamics { - public: - CIMPP::PU itfpu; /* OEL timed field current limiter pickup level (I). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU ifdmax; /* OEL instantaneous field current limit (I). Typical Value = 1.5. Default: nullptr */ - CIMPP::PU ifdlim; /* OEL timed field current limit (I). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU hyst; /* OEL pickup/drop-out hysteresis (HYST). Typical Value = 0.03. Default: nullptr */ - CIMPP::PU kcd; /* OEL cooldown gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float kramp; /* OEL ramped limit rate (K). Unit = PU/sec. Typical Value = 10. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLimIEEE(); - virtual ~OverexcLimIEEE(); - + ~OverexcLimIEEE() override; + + CIMPP::PU hyst; /* OEL pickup/drop-out hysteresis (HYST). Typical Value = 0.03. Default: nullptr */ + CIMPP::PU ifdlim; /* OEL timed field current limit (I). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU ifdmax; /* OEL instantaneous field current limit (I). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU itfpu; /* OEL timed field current limiter pickup level (I). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU kcd; /* OEL cooldown gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float kramp; /* OEL ramped limit rate (K). Unit = PU/sec. Typical Value = 10. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLimIEEE_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OverexcLimX1.cpp b/CGMES_2.4.15_27JAN2020/OverexcLimX1.cpp index 486d368dc..ab18dfe51 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLimX1.cpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLimX1.cpp @@ -1,186 +1,196 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLimX1.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" using namespace CIMPP; OverexcLimX1::OverexcLimX1() {}; - OverexcLimX1::~OverexcLimX1() {}; +bool assign_OverexcLimX1_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efddes; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdrated; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX1_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlow; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLimX1_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdrated; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX1_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efddes; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX1_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX1_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlow; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* OverexcLimX1_factory() { - return new OverexcLimX1; - } + + + +const char OverexcLimX1::debugName[] = "OverexcLimX1"; +const char* OverexcLimX1::debugString() const +{ + return OverexcLimX1::debugName; } -void OverexcLimX1::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLimX1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLimX1"), &OverexcLimX1_factory)); } -void OverexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efdrated"), &assign_OverexcLimX1_efdrated)); +void OverexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efd1"), &assign_OverexcLimX1_efd1)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t1"), &assign_OverexcLimX1_t1)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efd2"), &assign_OverexcLimX1_efd2)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t2"), &assign_OverexcLimX1_t2)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efd3"), &assign_OverexcLimX1_efd3)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t3"), &assign_OverexcLimX1_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efddes"), &assign_OverexcLimX1_efddes)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.efdrated"), &assign_OverexcLimX1_efdrated)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.kmx"), &assign_OverexcLimX1_kmx)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t1"), &assign_OverexcLimX1_t1)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t2"), &assign_OverexcLimX1_t2)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.t3"), &assign_OverexcLimX1_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX1.vlow"), &assign_OverexcLimX1_vlow)); } -void OverexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLimX1::debugName[] = "OverexcLimX1"; -const char* OverexcLimX1::debugString() +void OverexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLimX1::debugName; } const BaseClassDefiner OverexcLimX1::declare() @@ -188,4 +198,10 @@ const BaseClassDefiner OverexcLimX1::declare() return BaseClassDefiner(OverexcLimX1::addConstructToMap, OverexcLimX1::addPrimitiveAssignFnsToMap, OverexcLimX1::addClassAssignFnsToMap, OverexcLimX1::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLimX1_factory() + { + return new OverexcLimX1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OverexcLimX1.hpp b/CGMES_2.4.15_27JAN2020/OverexcLimX1.hpp index 7fdc27e45..02fe918e3 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLimX1.hpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLimX1.hpp @@ -1,48 +1,49 @@ #ifndef OverexcLimX1_H #define OverexcLimX1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Field voltage over excitation limiter. */ - class OverexcLimX1: public OverexcitationLimiterDynamics + class OverexcLimX1 : public OverexcitationLimiterDynamics { - public: - CIMPP::PU efdrated; /* Rated field voltage (EFD). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU efd1; /* Low voltage point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ - CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ - CIMPP::PU efd2; /* Mid voltage point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ - CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ - CIMPP::PU efd3; /* High voltage point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ - CIMPP::PU efddes; /* Desired field voltage (EFD). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU kmx; /* Gain (K). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLimX1(); - virtual ~OverexcLimX1(); - + ~OverexcLimX1() override; + + CIMPP::PU efd1; /* Low voltage point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU efd2; /* Mid voltage point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU efd3; /* High voltage point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU efddes; /* Desired field voltage (EFD). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU efdrated; /* Rated field voltage (EFD). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU kmx; /* Gain (K). Typical Value = 0.01. Default: nullptr */ + CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ + CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ + CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ + CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLimX1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OverexcLimX2.cpp b/CGMES_2.4.15_27JAN2020/OverexcLimX2.cpp index 896cac502..88677bf5f 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLimX2.cpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLimX2.cpp @@ -1,201 +1,212 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcLimX2.hpp" -#include "Boolean.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" using namespace CIMPP; OverexcLimX2::OverexcLimX2() {}; - OverexcLimX2::~OverexcLimX2() {}; +bool assign_OverexcLimX2_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efd3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efddes; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdrated; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_OverexcLimX2_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlow; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_OverexcLimX2_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX2_efdrated(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdrated; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_OverexcLimX2_efd1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_efd2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_efd3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efd3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_efddes(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efddes; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_kmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_OverexcLimX2_vlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlow; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* OverexcLimX2_factory() { - return new OverexcLimX2; - } + + + + + + + + + +const char OverexcLimX2::debugName[] = "OverexcLimX2"; +const char* OverexcLimX2::debugString() const +{ + return OverexcLimX2::debugName; } -void OverexcLimX2::addConstructToMap(std::unordered_map& factory_map) { +void OverexcLimX2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcLimX2"), &OverexcLimX2_factory)); } -void OverexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.m"), &assign_OverexcLimX2_m)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efdrated"), &assign_OverexcLimX2_efdrated)); +void OverexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efd1"), &assign_OverexcLimX2_efd1)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t1"), &assign_OverexcLimX2_t1)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efd2"), &assign_OverexcLimX2_efd2)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t2"), &assign_OverexcLimX2_t2)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efd3"), &assign_OverexcLimX2_efd3)); - assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t3"), &assign_OverexcLimX2_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efddes"), &assign_OverexcLimX2_efddes)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.efdrated"), &assign_OverexcLimX2_efdrated)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.kmx"), &assign_OverexcLimX2_kmx)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.m"), &assign_OverexcLimX2_m)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t1"), &assign_OverexcLimX2_t1)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t2"), &assign_OverexcLimX2_t2)); + assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.t3"), &assign_OverexcLimX2_t3)); assign_map.insert(std::make_pair(std::string("cim:OverexcLimX2.vlow"), &assign_OverexcLimX2_vlow)); } -void OverexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char OverexcLimX2::debugName[] = "OverexcLimX2"; -const char* OverexcLimX2::debugString() +void OverexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcLimX2::debugName; } const BaseClassDefiner OverexcLimX2::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner OverexcLimX2::declare() return BaseClassDefiner(OverexcLimX2::addConstructToMap, OverexcLimX2::addPrimitiveAssignFnsToMap, OverexcLimX2::addClassAssignFnsToMap, OverexcLimX2::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcLimX2_factory() + { + return new OverexcLimX2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OverexcLimX2.hpp b/CGMES_2.4.15_27JAN2020/OverexcLimX2.hpp index 7dd09d678..2b733c272 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcLimX2.hpp +++ b/CGMES_2.4.15_27JAN2020/OverexcLimX2.hpp @@ -1,50 +1,51 @@ #ifndef OverexcLimX2_H #define OverexcLimX2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Field Voltage or Current overexcitation limiter designed to protect the generator field of an AC machine with automatic excitation control from overheating due to prolonged overexcitation. */ - class OverexcLimX2: public OverexcitationLimiterDynamics + class OverexcLimX2 : public OverexcitationLimiterDynamics { - public: - CIMPP::Boolean m; /* (m). true = IFD limiting false = EFD limiting. Default: false */ - CIMPP::PU efdrated; /* Rated field voltage if m=F or field current if m=T (EFD). Typical Value = 1.05. Default: nullptr */ - CIMPP::PU efd1; /* Low voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ - CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage or current point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ - CIMPP::PU efd2; /* Mid voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ - CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage or current point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ - CIMPP::PU efd3; /* High voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ - CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage or current point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ - CIMPP::PU efddes; /* Desired field voltage if m=F or field current if m=T (EFD). Typical Value = 1. Default: nullptr */ - CIMPP::PU kmx; /* Gain (K). Typical Value = 0.002. Default: nullptr */ - CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcLimX2(); - virtual ~OverexcLimX2(); - + ~OverexcLimX2() override; + + CIMPP::PU efd1; /* Low voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU efd2; /* Mid voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.2. Default: nullptr */ + CIMPP::PU efd3; /* High voltage or current point on the inverse time characteristic (EFD). Typical Value = 1.5. Default: nullptr */ + CIMPP::PU efddes; /* Desired field voltage if m=F or field current if m=T (EFD). Typical Value = 1. Default: nullptr */ + CIMPP::PU efdrated; /* Rated field voltage if m=F or field current if m=T (EFD). Typical Value = 1.05. Default: nullptr */ + CIMPP::PU kmx; /* Gain (K). Typical Value = 0.002. Default: nullptr */ + CIMPP::Boolean m; /* (m). true = IFD limiting false = EFD limiting. Default: false */ + CIMPP::Seconds t1; /* Time to trip the exciter at the low voltage or current point on the inverse time characteristic (TIME). Typical Value = 120. Default: nullptr */ + CIMPP::Seconds t2; /* Time to trip the exciter at the mid voltage or current point on the inverse time characteristic (TIME). Typical Value = 40. Default: nullptr */ + CIMPP::Seconds t3; /* Time to trip the exciter at the high voltage or current point on the inverse time characteristic (TIME). Typical Value = 15. Default: nullptr */ + CIMPP::PU vlow; /* Low voltage limit (V) (>0). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcLimX2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.cpp b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.cpp index 443cc045e..a1adf0088 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcitationLimiterDynamics.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" using namespace CIMPP; -OverexcitationLimiterDynamics::OverexcitationLimiterDynamics(): ExcitationSystemDynamics(nullptr) {}; - +OverexcitationLimiterDynamics::OverexcitationLimiterDynamics() : ExcitationSystemDynamics(nullptr) {}; OverexcitationLimiterDynamics::~OverexcitationLimiterDynamics() {}; -bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass*, BaseClass*); -bool assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OverexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* OverexcitationLimiterDynamics_factory() { - return new OverexcitationLimiterDynamics; +bool assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass*, BaseClass*); +bool assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OverexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_OverexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void OverexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics"), &OverexcitationLimiterDynamics_factory)); +const char OverexcitationLimiterDynamics::debugName[] = "OverexcitationLimiterDynamics"; +const char* OverexcitationLimiterDynamics::debugString() const +{ + return OverexcitationLimiterDynamics::debugName; } -void OverexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void OverexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics"), &OverexcitationLimiterDynamics_factory)); +} -void OverexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics)); +void OverexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char OverexcitationLimiterDynamics::debugName[] = "OverexcitationLimiterDynamics"; -const char* OverexcitationLimiterDynamics::debugString() +void OverexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcitationLimiterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_OverexcitationLimiterDynamics_ExcitationSystemDynamics)); } const BaseClassDefiner OverexcitationLimiterDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner OverexcitationLimiterDynamics::declare() return BaseClassDefiner(OverexcitationLimiterDynamics::addConstructToMap, OverexcitationLimiterDynamics::addPrimitiveAssignFnsToMap, OverexcitationLimiterDynamics::addClassAssignFnsToMap, OverexcitationLimiterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcitationLimiterDynamics_factory() + { + return new OverexcitationLimiterDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.hpp b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.hpp index 1564df6a9..5fe95ae21 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterDynamics.hpp @@ -1,38 +1,39 @@ #ifndef OverexcitationLimiterDynamics_H #define OverexcitationLimiterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; -class ExcitationSystemDynamics; /* Overexcitation limiter function block whose behaviour is described by reference to a standard model */ - class OverexcitationLimiterDynamics: public DynamicsFunctionBlock + class OverexcitationLimiterDynamics : public DynamicsFunctionBlock { - public: - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this overexcitation limiter model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcitationLimiterDynamics(); - virtual ~OverexcitationLimiterDynamics(); - + ~OverexcitationLimiterDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this overexcitation limiter model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcitationLimiterDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.cpp b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.cpp index aa3169f18..bd8419785 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "OverexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "OverexcitationLimiterUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; OverexcitationLimiterUserDefined::OverexcitationLimiterUserDefined() {}; - OverexcitationLimiterUserDefined::~OverexcitationLimiterUserDefined() {}; -bool assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_OverexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_OverexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass*, BaseClass*); +bool assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + OverexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* OverexcitationLimiterUserDefined_factory() { - return new OverexcitationLimiterUserDefined; - } +const char OverexcitationLimiterUserDefined::debugName[] = "OverexcitationLimiterUserDefined"; +const char* OverexcitationLimiterUserDefined::debugString() const +{ + return OverexcitationLimiterUserDefined::debugName; } -void OverexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void OverexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined"), &OverexcitationLimiterUserDefined_factory)); } -void OverexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void OverexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined.proprietary"), &assign_OverexcitationLimiterUserDefined_proprietary)); - } - -void OverexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } -const char OverexcitationLimiterUserDefined::debugName[] = "OverexcitationLimiterUserDefined"; -const char* OverexcitationLimiterUserDefined::debugString() +void OverexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return OverexcitationLimiterUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:OverexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner OverexcitationLimiterUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner OverexcitationLimiterUserDefined::declare() return BaseClassDefiner(OverexcitationLimiterUserDefined::addConstructToMap, OverexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap, OverexcitationLimiterUserDefined::addClassAssignFnsToMap, OverexcitationLimiterUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* OverexcitationLimiterUserDefined_factory() + { + return new OverexcitationLimiterUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.hpp b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.hpp index 6bb76fbdf..b86dd5aa0 100644 --- a/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/OverexcitationLimiterUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef OverexcitationLimiterUserDefined_H #define OverexcitationLimiterUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OverexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OverexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Overexcitation limiter system function block whose dynamic behaviour is described by */ - class OverexcitationLimiterUserDefined: public OverexcitationLimiterDynamics + class OverexcitationLimiterUserDefined : public OverexcitationLimiterDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ OverexcitationLimiterUserDefined(); - virtual ~OverexcitationLimiterUserDefined(); - + ~OverexcitationLimiterUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* OverexcitationLimiterUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.cpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.cpp index 2d290b767..72bd784f3 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.cpp @@ -1,73 +1,96 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType1Dynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" #include "VoltageAdjusterDynamics.hpp" using namespace CIMPP; -PFVArControllerType1Dynamics::PFVArControllerType1Dynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr), VoltageAdjusterDynamics(nullptr) {}; - +PFVArControllerType1Dynamics::PFVArControllerType1Dynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr), VoltageAdjusterDynamics(nullptr) {}; PFVArControllerType1Dynamics::~PFVArControllerType1Dynamics() {}; -bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} -bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); -bool assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageAdjusterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->VoltageAdjusterDynamics != nullptr) - return true; - } - return false; -} +bool assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* PFVArControllerType1Dynamics_factory() { - return new PFVArControllerType1Dynamics; +bool assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1Dynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageAdjusterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageAdjusterDynamics != element2) + { + element->VoltageAdjusterDynamics = element2; + return assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PFVArControllerType1Dynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics"), &PFVArControllerType1Dynamics_factory)); +const char PFVArControllerType1Dynamics::debugName[] = "PFVArControllerType1Dynamics"; +const char* PFVArControllerType1Dynamics::debugString() const +{ + return PFVArControllerType1Dynamics::debugName; } -void PFVArControllerType1Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PFVArControllerType1Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics"), &PFVArControllerType1Dynamics_factory)); +} -void PFVArControllerType1Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.RemoteInputSignal"), &assign_PFVArControllerType1Dynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics)); - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.VoltageAdjusterDynamics"), &assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics)); +void PFVArControllerType1Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PFVArControllerType1Dynamics::debugName[] = "PFVArControllerType1Dynamics"; -const char* PFVArControllerType1Dynamics::debugString() +void PFVArControllerType1Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType1Dynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType1Dynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.RemoteInputSignal"), &assign_PFVArControllerType1Dynamics_RemoteInputSignal)); + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1Dynamics.VoltageAdjusterDynamics"), &assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics)); } const BaseClassDefiner PFVArControllerType1Dynamics::declare() @@ -75,4 +98,10 @@ const BaseClassDefiner PFVArControllerType1Dynamics::declare() return BaseClassDefiner(PFVArControllerType1Dynamics::addConstructToMap, PFVArControllerType1Dynamics::addPrimitiveAssignFnsToMap, PFVArControllerType1Dynamics::addClassAssignFnsToMap, PFVArControllerType1Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType1Dynamics_factory() + { + return new PFVArControllerType1Dynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.hpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.hpp index 76edafcd4..2332e70d4 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType1Dynamics.hpp @@ -1,42 +1,43 @@ #ifndef PFVArControllerType1Dynamics_H #define PFVArControllerType1Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; + class VoltageAdjusterDynamics; -class RemoteInputSignal; -class ExcitationSystemDynamics; -class VoltageAdjusterDynamics; /* Power Factor or VAr controller Type I function block whose behaviour is described by reference to a standard model */ - class PFVArControllerType1Dynamics: public DynamicsFunctionBlock + class PFVArControllerType1Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this Power Factor or VAr controller Type I model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type I model is associated. Default: 0 */ - CIMPP::VoltageAdjusterDynamics* VoltageAdjusterDynamics; /* Voltage adjuster model associated with this Power Factor or VA controller Type I model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType1Dynamics(); - virtual ~PFVArControllerType1Dynamics(); - + ~PFVArControllerType1Dynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type I model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this Power Factor or VAr controller Type I model. Default: 0 */ + CIMPP::VoltageAdjusterDynamics* VoltageAdjusterDynamics; /* Voltage adjuster model associated with this Power Factor or VA controller Type I model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType1Dynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.cpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.cpp index 966ff6b9b..f58a6b228 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "PFVArControllerType1Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType1UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; PFVArControllerType1UserDefined::PFVArControllerType1UserDefined() {}; - PFVArControllerType1UserDefined::~PFVArControllerType1UserDefined() {}; -bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PFVArControllerType1UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PFVArControllerType1UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass*, BaseClass*); +bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType1UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PFVArControllerType1UserDefined_factory() { - return new PFVArControllerType1UserDefined; - } +const char PFVArControllerType1UserDefined::debugName[] = "PFVArControllerType1UserDefined"; +const char* PFVArControllerType1UserDefined::debugString() const +{ + return PFVArControllerType1UserDefined::debugName; } -void PFVArControllerType1UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void PFVArControllerType1UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined"), &PFVArControllerType1UserDefined_factory)); } -void PFVArControllerType1UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArControllerType1UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined.proprietary"), &assign_PFVArControllerType1UserDefined_proprietary)); - } - -void PFVArControllerType1UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics)); } -const char PFVArControllerType1UserDefined::debugName[] = "PFVArControllerType1UserDefined"; -const char* PFVArControllerType1UserDefined::debugString() +void PFVArControllerType1UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType1UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType1UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner PFVArControllerType1UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PFVArControllerType1UserDefined::declare() return BaseClassDefiner(PFVArControllerType1UserDefined::addConstructToMap, PFVArControllerType1UserDefined::addPrimitiveAssignFnsToMap, PFVArControllerType1UserDefined::addClassAssignFnsToMap, PFVArControllerType1UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType1UserDefined_factory() + { + return new PFVArControllerType1UserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.hpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.hpp index 81be06182..29fcc7aa6 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType1UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef PFVArControllerType1UserDefined_H #define PFVArControllerType1UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType1Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType1Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Power Factor or VAr controller Type I function block whose dynamic behaviour is described by */ - class PFVArControllerType1UserDefined: public PFVArControllerType1Dynamics + class PFVArControllerType1UserDefined : public PFVArControllerType1Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType1UserDefined(); - virtual ~PFVArControllerType1UserDefined(); - + ~PFVArControllerType1UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType1UserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.cpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.cpp index 013e188fa..2c2640a53 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType2Dynamics.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" using namespace CIMPP; -PFVArControllerType2Dynamics::PFVArControllerType2Dynamics(): ExcitationSystemDynamics(nullptr) {}; - +PFVArControllerType2Dynamics::PFVArControllerType2Dynamics() : ExcitationSystemDynamics(nullptr) {}; PFVArControllerType2Dynamics::~PFVArControllerType2Dynamics() {}; -bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass*, BaseClass*); -bool assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType2Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* PFVArControllerType2Dynamics_factory() { - return new PFVArControllerType2Dynamics; +bool assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass*, BaseClass*); +bool assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType2Dynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_PFVArControllerType2Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PFVArControllerType2Dynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics"), &PFVArControllerType2Dynamics_factory)); +const char PFVArControllerType2Dynamics::debugName[] = "PFVArControllerType2Dynamics"; +const char* PFVArControllerType2Dynamics::debugString() const +{ + return PFVArControllerType2Dynamics::debugName; } -void PFVArControllerType2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PFVArControllerType2Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics"), &PFVArControllerType2Dynamics_factory)); +} -void PFVArControllerType2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics)); +void PFVArControllerType2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PFVArControllerType2Dynamics::debugName[] = "PFVArControllerType2Dynamics"; -const char* PFVArControllerType2Dynamics::debugString() +void PFVArControllerType2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType2Dynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2Dynamics.ExcitationSystemDynamics"), &assign_PFVArControllerType2Dynamics_ExcitationSystemDynamics)); } const BaseClassDefiner PFVArControllerType2Dynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner PFVArControllerType2Dynamics::declare() return BaseClassDefiner(PFVArControllerType2Dynamics::addConstructToMap, PFVArControllerType2Dynamics::addPrimitiveAssignFnsToMap, PFVArControllerType2Dynamics::addClassAssignFnsToMap, PFVArControllerType2Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType2Dynamics_factory() + { + return new PFVArControllerType2Dynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.hpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.hpp index 4cd383163..9554f466d 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType2Dynamics.hpp @@ -1,38 +1,39 @@ #ifndef PFVArControllerType2Dynamics_H #define PFVArControllerType2Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; -class ExcitationSystemDynamics; /* Power Factor or VAr controller Type II function block whose behaviour is described by reference to a standard model */ - class PFVArControllerType2Dynamics: public DynamicsFunctionBlock + class PFVArControllerType2Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type II is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType2Dynamics(); - virtual ~PFVArControllerType2Dynamics(); - + ~PFVArControllerType2Dynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this Power Factor or VAr controller Type II is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType2Dynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.cpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.cpp index eb576916d..527718fc6 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArControllerType2UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; PFVArControllerType2UserDefined::PFVArControllerType2UserDefined() {}; - PFVArControllerType2UserDefined::~PFVArControllerType2UserDefined() {}; -bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PFVArControllerType2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PFVArControllerType2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass*, BaseClass*); +bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PFVArControllerType2UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PFVArControllerType2UserDefined_factory() { - return new PFVArControllerType2UserDefined; - } +const char PFVArControllerType2UserDefined::debugName[] = "PFVArControllerType2UserDefined"; +const char* PFVArControllerType2UserDefined::debugString() const +{ + return PFVArControllerType2UserDefined::debugName; } -void PFVArControllerType2UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void PFVArControllerType2UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined"), &PFVArControllerType2UserDefined_factory)); } -void PFVArControllerType2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArControllerType2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined.proprietary"), &assign_PFVArControllerType2UserDefined_proprietary)); - } - -void PFVArControllerType2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics)); } -const char PFVArControllerType2UserDefined::debugName[] = "PFVArControllerType2UserDefined"; -const char* PFVArControllerType2UserDefined::debugString() +void PFVArControllerType2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArControllerType2UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:PFVArControllerType2UserDefined.ProprietaryParameterDynamics"), &assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner PFVArControllerType2UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PFVArControllerType2UserDefined::declare() return BaseClassDefiner(PFVArControllerType2UserDefined::addConstructToMap, PFVArControllerType2UserDefined::addPrimitiveAssignFnsToMap, PFVArControllerType2UserDefined::addClassAssignFnsToMap, PFVArControllerType2UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArControllerType2UserDefined_factory() + { + return new PFVArControllerType2UserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.hpp b/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.hpp index d4cdbd153..9069946a5 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArControllerType2UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef PFVArControllerType2UserDefined_H #define PFVArControllerType2UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Power Factor or VAr controller Type II function block whose dynamic behaviour is described by */ - class PFVArControllerType2UserDefined: public PFVArControllerType2Dynamics + class PFVArControllerType2UserDefined : public PFVArControllerType2Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArControllerType2UserDefined(); - virtual ~PFVArControllerType2UserDefined(); - + ~PFVArControllerType2UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArControllerType2UserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.cpp b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.cpp index bc2548157..99455cb7d 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.cpp @@ -1,7 +1,11 @@ -#include -#include "PFVArControllerType1Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType1IEEEPFController.hpp" +#include +#include + #include "Boolean.hpp" #include "Seconds.hpp" #include "PU.hpp" @@ -14,126 +18,135 @@ using namespace CIMPP; PFVArType1IEEEPFController::PFVArType1IEEEPFController() {}; - PFVArType1IEEEPFController::~PFVArType1IEEEPFController() {}; +bool assign_PFVArType1IEEEPFController_ovex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ovex; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_tpfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vitmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vitmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vpfcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpfcbw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vpfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vpfref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEPFController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType1IEEEPFController_ovex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ovex; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_tpfc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vitmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vitmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vpf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vpfcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpfcbw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vpfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vpfref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEPFController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType1IEEEPFController_factory() { - return new PFVArType1IEEEPFController; - } +const char PFVArType1IEEEPFController::debugName[] = "PFVArType1IEEEPFController"; +const char* PFVArType1IEEEPFController::debugString() const +{ + return PFVArType1IEEEPFController::debugName; } -void PFVArType1IEEEPFController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType1IEEEPFController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController"), &PFVArType1IEEEPFController_factory)); } -void PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController.ovex"), &assign_PFVArType1IEEEPFController_ovex)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController.tpfc"), &assign_PFVArType1IEEEPFController_tpfc)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEPFController.vitmin"), &assign_PFVArType1IEEEPFController_vitmin)); @@ -144,13 +157,8 @@ void PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType1IEEEPFController::debugName[] = "PFVArType1IEEEPFController"; -const char* PFVArType1IEEEPFController::debugString() +void PFVArType1IEEEPFController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType1IEEEPFController::debugName; } const BaseClassDefiner PFVArType1IEEEPFController::declare() @@ -158,4 +166,10 @@ const BaseClassDefiner PFVArType1IEEEPFController::declare() return BaseClassDefiner(PFVArType1IEEEPFController::addConstructToMap, PFVArType1IEEEPFController::addPrimitiveAssignFnsToMap, PFVArType1IEEEPFController::addClassAssignFnsToMap, PFVArType1IEEEPFController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType1IEEEPFController_factory() + { + return new PFVArType1IEEEPFController; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.hpp b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.hpp index e9e3af601..20f16d338 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEPFController.hpp @@ -1,48 +1,49 @@ #ifndef PFVArType1IEEEPFController_H #define PFVArType1IEEEPFController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType1Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType1Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE PF Controller Type 1 which operates by moving the voltage reference directly. Reference: IEEE Standard 421.5-2005 Section 11.2. */ - class PFVArType1IEEEPFController: public PFVArControllerType1Dynamics + class PFVArType1IEEEPFController : public PFVArControllerType1Dynamics { - public: - CIMPP::Boolean ovex; /* Overexcitation Flag () true = overexcited false = underexcited. Default: false */ - CIMPP::Seconds tpfc; /* PF controller time delay (). Typical Value = 5. Default: nullptr */ - CIMPP::PU vitmin; /* Minimum machine terminal current needed to enable pf/var controller (). Default: nullptr */ - CIMPP::PU vpf; /* Synchronous machine power factor (). Default: nullptr */ - CIMPP::Simple_Float vpfcbw; /* PF controller dead band (). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vpfref; /* PF controller reference (). Default: nullptr */ - CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ - CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType1IEEEPFController(); - virtual ~PFVArType1IEEEPFController(); - + ~PFVArType1IEEEPFController() override; + + CIMPP::Boolean ovex; /* Overexcitation Flag () true = overexcited false = underexcited. Default: false */ + CIMPP::Seconds tpfc; /* PF controller time delay (). Typical Value = 5. Default: nullptr */ + CIMPP::PU vitmin; /* Minimum machine terminal current needed to enable pf/var controller (). Default: nullptr */ + CIMPP::PU vpf; /* Synchronous machine power factor (). Default: nullptr */ + CIMPP::Simple_Float vpfcbw; /* PF controller dead band (). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU vpfref; /* PF controller reference (). Default: nullptr */ + CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ + CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType1IEEEPFController_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.cpp b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.cpp index 7e752901e..c45005674 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.cpp @@ -1,7 +1,11 @@ -#include -#include "PFVArControllerType1Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType1IEEEVArController.hpp" +#include +#include + #include "Seconds.hpp" #include "PU.hpp" #include "Simple_Float.hpp" @@ -12,100 +16,107 @@ using namespace CIMPP; PFVArType1IEEEVArController::PFVArType1IEEEVArController() {}; - PFVArType1IEEEVArController::~PFVArType1IEEEVArController() {}; +bool assign_PFVArType1IEEEVArController_tvarc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tvarc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvar(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvar; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvarcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvarcbw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvarref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvarref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType1IEEEVArController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vvtmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType1IEEEVArController_tvarc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tvarc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvar(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvar; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvarcbw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvarcbw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvarref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvarref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvtmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType1IEEEVArController_vvtmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType1IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vvtmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType1IEEEVArController_factory() { - return new PFVArType1IEEEVArController; - } +const char PFVArType1IEEEVArController::debugName[] = "PFVArType1IEEEVArController"; +const char* PFVArType1IEEEVArController::debugString() const +{ + return PFVArType1IEEEVArController::debugName; } -void PFVArType1IEEEVArController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType1IEEEVArController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController"), &PFVArType1IEEEVArController_factory)); } -void PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.tvarc"), &assign_PFVArType1IEEEVArController_tvarc)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.vvar"), &assign_PFVArType1IEEEVArController_vvar)); assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.vvarcbw"), &assign_PFVArType1IEEEVArController_vvarcbw)); @@ -114,13 +125,8 @@ void PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map< assign_map.insert(std::make_pair(std::string("cim:PFVArType1IEEEVArController.vvtmin"), &assign_PFVArType1IEEEVArController_vvtmin)); } -void PFVArType1IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType1IEEEVArController::debugName[] = "PFVArType1IEEEVArController"; -const char* PFVArType1IEEEVArController::debugString() +void PFVArType1IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType1IEEEVArController::debugName; } const BaseClassDefiner PFVArType1IEEEVArController::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner PFVArType1IEEEVArController::declare() return BaseClassDefiner(PFVArType1IEEEVArController::addConstructToMap, PFVArType1IEEEVArController::addPrimitiveAssignFnsToMap, PFVArType1IEEEVArController::addClassAssignFnsToMap, PFVArType1IEEEVArController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType1IEEEVArController_factory() + { + return new PFVArType1IEEEVArController; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.hpp b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.hpp index 2f852e844..9b7e852ff 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType1IEEEVArController.hpp @@ -1,45 +1,46 @@ #ifndef PFVArType1IEEEVArController_H #define PFVArType1IEEEVArController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType1Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "PFVArControllerType1Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE VAR Controller Type 1 which operates by moving the voltage reference directly. Reference: IEEE Standard 421.5-2005 Section 11.3. */ - class PFVArType1IEEEVArController: public PFVArControllerType1Dynamics + class PFVArType1IEEEVArController : public PFVArControllerType1Dynamics { - public: - CIMPP::Seconds tvarc; /* Var controller time delay (). Typical Value = 5. Default: nullptr */ - CIMPP::PU vvar; /* Synchronous machine power factor (). Default: nullptr */ - CIMPP::Simple_Float vvarcbw; /* Var controller dead band (). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vvarref; /* Var controller reference (). Default: nullptr */ - CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ - CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType1IEEEVArController(); - virtual ~PFVArType1IEEEVArController(); - + ~PFVArType1IEEEVArController() override; + + CIMPP::Seconds tvarc; /* Var controller time delay (). Typical Value = 5. Default: nullptr */ + CIMPP::PU vvar; /* Synchronous machine power factor (). Default: nullptr */ + CIMPP::Simple_Float vvarcbw; /* Var controller dead band (). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU vvarref; /* Var controller reference (). Default: nullptr */ + CIMPP::PU vvtmax; /* Maximum machine terminal voltage needed for pf/var controller to be enabled (). Default: nullptr */ + CIMPP::PU vvtmin; /* Minimum machine terminal voltage needed to enable pf/var controller (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType1IEEEVArController_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArType2Common1.cpp b/CGMES_2.4.15_27JAN2020/PFVArType2Common1.cpp index 69789ab36..706c30675 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType2Common1.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType2Common1.cpp @@ -1,7 +1,11 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType2Common1.hpp" +#include +#include + #include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" @@ -11,101 +15,102 @@ using namespace CIMPP; PFVArType2Common1::PFVArType2Common1() {}; - PFVArType2Common1::~PFVArType2Common1() {}; +bool assign_PFVArType2Common1_j(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->j; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2Common1_ref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType2Common1_j(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->j; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2Common1_ref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2Common1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType2Common1_factory() { - return new PFVArType2Common1; - } +const char PFVArType2Common1::debugName[] = "PFVArType2Common1"; +const char* PFVArType2Common1::debugString() const +{ + return PFVArType2Common1::debugName; } -void PFVArType2Common1::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType2Common1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType2Common1"), &PFVArType2Common1_factory)); } -void PFVArType2Common1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType2Common1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.j"), &assign_PFVArType2Common1_j)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.kp"), &assign_PFVArType2Common1_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.ki"), &assign_PFVArType2Common1_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.kp"), &assign_PFVArType2Common1_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.max"), &assign_PFVArType2Common1_max)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2Common1.ref"), &assign_PFVArType2Common1_ref)); } -void PFVArType2Common1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType2Common1::debugName[] = "PFVArType2Common1"; -const char* PFVArType2Common1::debugString() +void PFVArType2Common1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType2Common1::debugName; } const BaseClassDefiner PFVArType2Common1::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner PFVArType2Common1::declare() return BaseClassDefiner(PFVArType2Common1::addConstructToMap, PFVArType2Common1::addPrimitiveAssignFnsToMap, PFVArType2Common1::addClassAssignFnsToMap, PFVArType2Common1::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType2Common1_factory() + { + return new PFVArType2Common1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArType2Common1.hpp b/CGMES_2.4.15_27JAN2020/PFVArType2Common1.hpp index ad830a145..0f0520b9e 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType2Common1.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType2Common1.hpp @@ -1,43 +1,44 @@ #ifndef PFVArType2Common1_H #define PFVArType2Common1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Power factor / Reactive power regulator. This model represents the power factor or reactive power controller such as the Basler SCP-250. The controller measures power factor or reactive power (PU on generator rated power) and compares it with the operator's set point. */ - class PFVArType2Common1: public PFVArControllerType2Dynamics + class PFVArType2Common1 : public PFVArControllerType2Dynamics { - public: - CIMPP::Boolean j; /* Selector (J). true = control mode for reactive power false = control mode for power factor. Default: false */ - CIMPP::PU kp; /* Proportional gain (Kp). Default: nullptr */ - CIMPP::PU ki; /* Reset gain (Ki). Default: nullptr */ - CIMPP::PU max; /* Output limit (max). Default: nullptr */ - CIMPP::PU ref; /* Reference value of reactive power or power factor (Ref). The reference value is initialised by this model. This initialisation may override the value exchanged by this attribute to represent a plant operator`s change of the reference setting. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType2Common1(); - virtual ~PFVArType2Common1(); - + ~PFVArType2Common1() override; + + CIMPP::Boolean j; /* Selector (J). true = control mode for reactive power false = control mode for power factor. Default: false */ + CIMPP::PU ki; /* Reset gain (Ki). Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Default: nullptr */ + CIMPP::PU max; /* Output limit (max). Default: nullptr */ + CIMPP::PU ref; /* Reference value of reactive power or power factor (Ref). The reference value is initialised by this model. This initialisation may override the value exchanged by this attribute to represent a plant operator`s change of the reference setting. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType2Common1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.cpp b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.cpp index 7e058f07a..7310bf23c 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.cpp @@ -1,141 +1,148 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType2IEEEPFController.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" using namespace CIMPP; PFVArType2IEEEPFController::PFVArType2IEEEPFController() {}; - PFVArType2IEEEPFController::~PFVArType2IEEEPFController() {}; +bool assign_PFVArType2IEEEPFController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exlon; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_pfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pfref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vclmt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEPFController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType2IEEEPFController_pfref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pfref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vclmt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEPFController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEPFController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exlon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType2IEEEPFController_factory() { - return new PFVArType2IEEEPFController; - } +const char PFVArType2IEEEPFController::debugName[] = "PFVArType2IEEEPFController"; +const char* PFVArType2IEEEPFController::debugString() const +{ + return PFVArType2IEEEPFController::debugName; } -void PFVArType2IEEEPFController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType2IEEEPFController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController"), &PFVArType2IEEEPFController_factory)); } -void PFVArType2IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType2IEEEPFController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.exlon"), &assign_PFVArType2IEEEPFController_exlon)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.ki"), &assign_PFVArType2IEEEPFController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.kp"), &assign_PFVArType2IEEEPFController_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.pfref"), &assign_PFVArType2IEEEPFController_pfref)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vref"), &assign_PFVArType2IEEEPFController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vclmt"), &assign_PFVArType2IEEEPFController_vclmt)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.kp"), &assign_PFVArType2IEEEPFController_kp)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.ki"), &assign_PFVArType2IEEEPFController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vref"), &assign_PFVArType2IEEEPFController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.vs"), &assign_PFVArType2IEEEPFController_vs)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEPFController.exlon"), &assign_PFVArType2IEEEPFController_exlon)); } -void PFVArType2IEEEPFController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType2IEEEPFController::debugName[] = "PFVArType2IEEEPFController"; -const char* PFVArType2IEEEPFController::debugString() +void PFVArType2IEEEPFController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType2IEEEPFController::debugName; } const BaseClassDefiner PFVArType2IEEEPFController::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner PFVArType2IEEEPFController::declare() return BaseClassDefiner(PFVArType2IEEEPFController::addConstructToMap, PFVArType2IEEEPFController::addPrimitiveAssignFnsToMap, PFVArType2IEEEPFController::addClassAssignFnsToMap, PFVArType2IEEEPFController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType2IEEEPFController_factory() + { + return new PFVArType2IEEEPFController; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.hpp b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.hpp index 480d6c0b9..515a7648c 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEPFController.hpp @@ -1,46 +1,47 @@ #ifndef PFVArType2IEEEPFController_H #define PFVArType2IEEEPFController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE PF Controller Type 2 which is a summing point type controller and makes up the outside loop of a two-loop system. This controller is implemented as a slow PI type controller. The voltage regulator forms the inner loop and is implemented as a fast controller. Reference: IEEE Standard 421.5-2005 Section 11.4. */ - class PFVArType2IEEEPFController: public PFVArControllerType2Dynamics + class PFVArType2IEEEPFController : public PFVArControllerType2Dynamics { - public: - CIMPP::PU pfref; /* Power factor reference (). Default: nullptr */ - CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ - CIMPP::PU vclmt; /* Maximum output of the pf controller (). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain of the pf controller (). Typical Value = 1. Default: nullptr */ - CIMPP::PU ki; /* Integral gain of the pf controller (). Typical Value = 1. Default: nullptr */ - CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ - CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType2IEEEPFController(); - virtual ~PFVArType2IEEEPFController(); - + ~PFVArType2IEEEPFController() override; + + CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ + CIMPP::PU ki; /* Integral gain of the pf controller (). Typical Value = 1. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain of the pf controller (). Typical Value = 1. Default: nullptr */ + CIMPP::PU pfref; /* Power factor reference (). Default: nullptr */ + CIMPP::PU vclmt; /* Maximum output of the pf controller (). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ + CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType2IEEEPFController_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.cpp b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.cpp index f5d150ecb..eaf3b23a8 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.cpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.cpp @@ -1,141 +1,148 @@ -#include -#include "PFVArControllerType2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PFVArType2IEEEVArController.hpp" +#include +#include + +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" using namespace CIMPP; PFVArType2IEEEVArController::PFVArType2IEEEVArController() {}; - PFVArType2IEEEVArController::~PFVArType2IEEEVArController() {}; +bool assign_PFVArType2IEEEVArController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->exlon; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_qref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vclmt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PFVArType2IEEEVArController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PFVArType2IEEEVArController_qref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_vref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_vclmt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vclmt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_vs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PFVArType2IEEEVArController_exlon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PFVArType2IEEEVArController* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->exlon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PFVArType2IEEEVArController_factory() { - return new PFVArType2IEEEVArController; - } +const char PFVArType2IEEEVArController::debugName[] = "PFVArType2IEEEVArController"; +const char* PFVArType2IEEEVArController::debugString() const +{ + return PFVArType2IEEEVArController::debugName; } -void PFVArType2IEEEVArController::addConstructToMap(std::unordered_map& factory_map) { +void PFVArType2IEEEVArController::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController"), &PFVArType2IEEEVArController_factory)); } -void PFVArType2IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PFVArType2IEEEVArController::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.exlon"), &assign_PFVArType2IEEEVArController_exlon)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.ki"), &assign_PFVArType2IEEEVArController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.kp"), &assign_PFVArType2IEEEVArController_kp)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.qref"), &assign_PFVArType2IEEEVArController_qref)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vref"), &assign_PFVArType2IEEEVArController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vclmt"), &assign_PFVArType2IEEEVArController_vclmt)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.kp"), &assign_PFVArType2IEEEVArController_kp)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.ki"), &assign_PFVArType2IEEEVArController_ki)); + assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vref"), &assign_PFVArType2IEEEVArController_vref)); assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.vs"), &assign_PFVArType2IEEEVArController_vs)); - assign_map.insert(std::make_pair(std::string("cim:PFVArType2IEEEVArController.exlon"), &assign_PFVArType2IEEEVArController_exlon)); } -void PFVArType2IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PFVArType2IEEEVArController::debugName[] = "PFVArType2IEEEVArController"; -const char* PFVArType2IEEEVArController::debugString() +void PFVArType2IEEEVArController::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PFVArType2IEEEVArController::debugName; } const BaseClassDefiner PFVArType2IEEEVArController::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner PFVArType2IEEEVArController::declare() return BaseClassDefiner(PFVArType2IEEEVArController::addConstructToMap, PFVArType2IEEEVArController::addPrimitiveAssignFnsToMap, PFVArType2IEEEVArController::addClassAssignFnsToMap, PFVArType2IEEEVArController::debugName); } - +namespace CIMPP +{ + BaseClass* PFVArType2IEEEVArController_factory() + { + return new PFVArType2IEEEVArController; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.hpp b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.hpp index 6cd94b6b8..2a1d21455 100644 --- a/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.hpp +++ b/CGMES_2.4.15_27JAN2020/PFVArType2IEEEVArController.hpp @@ -1,46 +1,47 @@ #ifndef PFVArType2IEEEVArController_H #define PFVArType2IEEEVArController_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PFVArControllerType2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PFVArControllerType2Dynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE VAR Controller Type 2 which is a summing point type controller. It makes up the outside loop of a two-loop system. This controller is implemented as a slow PI type controller, and the voltage regulator forms the inner loop and is implemented as a fast controller. Reference: IEEE Standard 421.5-2005 Section 11.5. */ - class PFVArType2IEEEVArController: public PFVArControllerType2Dynamics + class PFVArType2IEEEVArController : public PFVArControllerType2Dynamics { - public: - CIMPP::PU qref; /* Reactive power reference (). Default: nullptr */ - CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ - CIMPP::PU vclmt; /* Maximum output of the pf controller (). Default: nullptr */ - CIMPP::PU kp; /* Proportional gain of the pf controller (). Default: nullptr */ - CIMPP::PU ki; /* Integral gain of the pf controller (). Default: nullptr */ - CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ - CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PFVArType2IEEEVArController(); - virtual ~PFVArType2IEEEVArController(); - + ~PFVArType2IEEEVArController() override; + + CIMPP::Boolean exlon; /* Overexcitation or under excitation flag () true = 1 (not in the overexcitation or underexcitation state, integral action is active) false = 0 (in the overexcitation or underexcitation state, so integral action is disabled to allow the limiter to play its role). Default: false */ + CIMPP::PU ki; /* Integral gain of the pf controller (). Default: nullptr */ + CIMPP::PU kp; /* Proportional gain of the pf controller (). Default: nullptr */ + CIMPP::PU qref; /* Reactive power reference (). Default: nullptr */ + CIMPP::PU vclmt; /* Maximum output of the pf controller (). Default: nullptr */ + CIMPP::PU vref; /* Voltage regulator reference (). Default: nullptr */ + CIMPP::Simple_Float vs; /* Generator sensing voltage (). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PFVArType2IEEEVArController_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PU.cpp b/CGMES_2.4.15_27JAN2020/PU.cpp index 61bf98728..2c17173ca 100644 --- a/CGMES_2.4.15_27JAN2020/PU.cpp +++ b/CGMES_2.4.15_27JAN2020/PU.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PU.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -PU::PU() {} -PU::~PU(){} +#include -PU::PU(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void PU::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void PU::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +PU& PU::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void PU::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +PU::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char PU::debugName[] = "PU"; -const char* PU::debugString() { +const char* PU::debugString() const +{ return PU::debugName; } - -const BaseClassDefiner PU::declare() { - return BaseClassDefiner(PU::addConstructToMap, PU::addPrimitiveAssignFnsToMap, PU::addClassAssignFnsToMap, PU::debugName); +PU& PU::operator+=(const PU& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - PU& PU::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - PU& PU::operator-=(const PU& rhs) { - value -= rhs.value; - return *this; - } - - PU& PU::operator*=(const PU& rhs) { - value *= rhs.value; - return *this; - } - - PU& PU::operator/=(const PU& rhs) { - value /= rhs.value; - return *this; - } +PU& PU::operator-=(const PU& rhs) +{ + value -= rhs.value; + return *this; +} - PU& PU::operator+=(const PU& rhs) { - value += rhs.value; - return *this; - } +PU& PU::operator*=(const PU& rhs) +{ + value *= rhs.value; + return *this; +} - PU::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +PU& PU::operator/=(const PU& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, PU& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PU& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const PU& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/PU.hpp b/CGMES_2.4.15_27JAN2020/PU.hpp index a83305ca5..51a1d1117 100644 --- a/CGMES_2.4.15_27JAN2020/PU.hpp +++ b/CGMES_2.4.15_27JAN2020/PU.hpp @@ -1,38 +1,39 @@ #ifndef PU_H #define PU_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class PU : public BaseClass + /* + Per Unit - a positive or negative value referred to a defined base. Values typically range from -10 to +10. + */ + class PU { - public: - PU(); - virtual ~PU(); - PU(long double value); - static const BaseClassDefiner declare(); - PU& operator=(long double &rop); + PU() : value(0.0), initialized(false) {} + PU(long double value) : value(value), initialized(true) {} + + PU& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + PU& operator+=(const PU& rhs); PU& operator-=(const PU& rhs); PU& operator*=(const PU& rhs); PU& operator/=(const PU& rhs); + friend std::istream& operator>>(std::istream& lop, PU& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const PU& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/PerCent.cpp b/CGMES_2.4.15_27JAN2020/PerCent.cpp index 057b28165..34fe37067 100644 --- a/CGMES_2.4.15_27JAN2020/PerCent.cpp +++ b/CGMES_2.4.15_27JAN2020/PerCent.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PerCent.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -PerCent::PerCent() {} -PerCent::~PerCent(){} +#include -PerCent::PerCent(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void PerCent::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void PerCent::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +PerCent& PerCent::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void PerCent::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +PerCent::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char PerCent::debugName[] = "PerCent"; -const char* PerCent::debugString() { +const char* PerCent::debugString() const +{ return PerCent::debugName; } - -const BaseClassDefiner PerCent::declare() { - return BaseClassDefiner(PerCent::addConstructToMap, PerCent::addPrimitiveAssignFnsToMap, PerCent::addClassAssignFnsToMap, PerCent::debugName); +PerCent& PerCent::operator+=(const PerCent& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - PerCent& PerCent::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - PerCent& PerCent::operator-=(const PerCent& rhs) { - value -= rhs.value; - return *this; - } - - PerCent& PerCent::operator*=(const PerCent& rhs) { - value *= rhs.value; - return *this; - } - - PerCent& PerCent::operator/=(const PerCent& rhs) { - value /= rhs.value; - return *this; - } +PerCent& PerCent::operator-=(const PerCent& rhs) +{ + value -= rhs.value; + return *this; +} - PerCent& PerCent::operator+=(const PerCent& rhs) { - value += rhs.value; - return *this; - } +PerCent& PerCent::operator*=(const PerCent& rhs) +{ + value *= rhs.value; + return *this; +} - PerCent::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +PerCent& PerCent::operator/=(const PerCent& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, PerCent& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PerCent& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const PerCent& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/PerCent.hpp b/CGMES_2.4.15_27JAN2020/PerCent.hpp index 065ec60f1..67bb36e78 100644 --- a/CGMES_2.4.15_27JAN2020/PerCent.hpp +++ b/CGMES_2.4.15_27JAN2020/PerCent.hpp @@ -1,38 +1,39 @@ #ifndef PerCent_H #define PerCent_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class PerCent : public BaseClass + /* + Percentage on a defined base. For example, specify as 100 to indicate at the defined base. + */ + class PerCent { - public: - PerCent(); - virtual ~PerCent(); - PerCent(long double value); - static const BaseClassDefiner declare(); - PerCent& operator=(long double &rop); + PerCent() : value(0.0), initialized(false) {} + PerCent(long double value) : value(value), initialized(true) {} + + PerCent& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + PerCent& operator+=(const PerCent& rhs); PerCent& operator-=(const PerCent& rhs); PerCent& operator*=(const PerCent& rhs); PerCent& operator/=(const PerCent& rhs); + friend std::istream& operator>>(std::istream& lop, PerCent& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const PerCent& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.cpp b/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.cpp index 94b9d639b..f9a4b4015 100644 --- a/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.cpp +++ b/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PerLengthDCLineParameter.hpp" +#include +#include + #include "DCLineSegment.hpp" #include "CapacitancePerLength.hpp" #include "InductancePerLength.hpp" @@ -9,77 +13,92 @@ using namespace CIMPP; -PerLengthDCLineParameter::PerLengthDCLineParameter(): capacitance(nullptr), inductance(nullptr), resistance(nullptr) {}; - +PerLengthDCLineParameter::PerLengthDCLineParameter() {}; PerLengthDCLineParameter::~PerLengthDCLineParameter() {}; -bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCLineSegments.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_PerLengthDCLineParameter_capacitance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitance; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PerLengthDCLineParameter_capacitance(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - element->capacitance = dynamic_cast(BaseClass_ptr2); - if(element->capacitance != nullptr) - return true; - } - return false; -} - -bool assign_PerLengthDCLineParameter_inductance(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - element->inductance = dynamic_cast(BaseClass_ptr2); - if(element->inductance != nullptr) - return true; - } - return false; +bool assign_PerLengthDCLineParameter_inductance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductance; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PerLengthDCLineParameter_resistance(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) { - element->resistance = dynamic_cast(BaseClass_ptr2); - if(element->resistance != nullptr) - return true; - } - return false; +bool assign_PerLengthDCLineParameter_resistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->resistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_DCLineSegment_PerLengthParameter(BaseClass*, BaseClass*); +bool assign_PerLengthDCLineParameter_DCLineSegments(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PerLengthDCLineParameter* element = dynamic_cast(BaseClass_ptr1); + DCLineSegment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCLineSegments.begin(), element->DCLineSegments.end(), element2) == element->DCLineSegments.end()) + { + element->DCLineSegments.push_back(element2); + return assign_DCLineSegment_PerLengthParameter(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* PerLengthDCLineParameter_factory() { - return new PerLengthDCLineParameter; - } +const char PerLengthDCLineParameter::debugName[] = "PerLengthDCLineParameter"; +const char* PerLengthDCLineParameter::debugString() const +{ + return PerLengthDCLineParameter::debugName; } -void PerLengthDCLineParameter::addConstructToMap(std::unordered_map& factory_map) { +void PerLengthDCLineParameter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter"), &PerLengthDCLineParameter_factory)); } -void PerLengthDCLineParameter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PerLengthDCLineParameter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.DCLineSegments"), &assign_PerLengthDCLineParameter_DCLineSegments)); +void PerLengthDCLineParameter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.capacitance"), &assign_PerLengthDCLineParameter_capacitance)); assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.inductance"), &assign_PerLengthDCLineParameter_inductance)); assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.resistance"), &assign_PerLengthDCLineParameter_resistance)); } -const char PerLengthDCLineParameter::debugName[] = "PerLengthDCLineParameter"; -const char* PerLengthDCLineParameter::debugString() +void PerLengthDCLineParameter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PerLengthDCLineParameter::debugName; + assign_map.insert(std::make_pair(std::string("cim:PerLengthDCLineParameter.DCLineSegments"), &assign_PerLengthDCLineParameter_DCLineSegments)); } const BaseClassDefiner PerLengthDCLineParameter::declare() @@ -87,4 +106,10 @@ const BaseClassDefiner PerLengthDCLineParameter::declare() return BaseClassDefiner(PerLengthDCLineParameter::addConstructToMap, PerLengthDCLineParameter::addPrimitiveAssignFnsToMap, PerLengthDCLineParameter::addClassAssignFnsToMap, PerLengthDCLineParameter::debugName); } - +namespace CIMPP +{ + BaseClass* PerLengthDCLineParameter_factory() + { + return new PerLengthDCLineParameter; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.hpp b/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.hpp index b72e976cd..4f194a716 100644 --- a/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.hpp +++ b/CGMES_2.4.15_27JAN2020/PerLengthDCLineParameter.hpp @@ -1,44 +1,42 @@ #ifndef PerLengthDCLineParameter_H #define PerLengthDCLineParameter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "CapacitancePerLength.hpp" +#include "InductancePerLength.hpp" +#include "ResistancePerLength.hpp" +namespace CIMPP +{ + class DCLineSegment; -class DCLineSegment; -class CapacitancePerLength; -class InductancePerLength; -class ResistancePerLength; - /* - - */ - class PerLengthDCLineParameter: public BaseClass + class PerLengthDCLineParameter : public BaseClass { - public: - std::list DCLineSegments; /* All line segments described by this set of per-length parameters. Default: 0 */ - CIMPP::CapacitancePerLength* capacitance; /* Capacitance per unit of length of the DC line segment; significant for cables only. Default: nullptr */ - CIMPP::InductancePerLength* inductance; /* Inductance per unit of length of the DC line segment. Default: nullptr */ - CIMPP::ResistancePerLength* resistance; /* Resistance per length of the DC line segment. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PerLengthDCLineParameter(); - virtual ~PerLengthDCLineParameter(); - + ~PerLengthDCLineParameter() override; + + std::list DCLineSegments; /* All line segments described by this set of per-length parameters. Default: 0 */ + CIMPP::CapacitancePerLength capacitance; /* Capacitance per unit of length of the DC line segment; significant for cables only. Default: nullptr */ + CIMPP::InductancePerLength inductance; /* Inductance per unit of length of the DC line segment. Default: nullptr */ + CIMPP::ResistancePerLength resistance; /* Resistance per length of the DC line segment. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PerLengthDCLineParameter_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PetersenCoil.cpp b/CGMES_2.4.15_27JAN2020/PetersenCoil.cpp index 0026ba8bc..d0ab8eb1d 100644 --- a/CGMES_2.4.15_27JAN2020/PetersenCoil.cpp +++ b/CGMES_2.4.15_27JAN2020/PetersenCoil.cpp @@ -1,7 +1,11 @@ -#include -#include "EarthFaultCompensator.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PetersenCoil.hpp" +#include +#include + #include "PetersenCoilModeKind.hpp" #include "Voltage.hpp" #include "CurrentFlow.hpp" @@ -13,113 +17,121 @@ using namespace CIMPP; PetersenCoil::PetersenCoil() {}; - PetersenCoil::~PetersenCoil() {}; +bool assign_PetersenCoil_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_nominalU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nominalU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_offsetCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->offsetCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_positionCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positionCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_xGroundMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xGroundMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_xGroundMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xGroundMin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PetersenCoil_xGroundNominal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xGroundNominal; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PetersenCoil_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_nominalU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nominalU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_offsetCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->offsetCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_positionCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positionCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_xGroundMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xGroundMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_xGroundMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xGroundMin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PetersenCoil_xGroundNominal(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PetersenCoil* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xGroundNominal; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PetersenCoil_factory() { - return new PetersenCoil; - } +const char PetersenCoil::debugName[] = "PetersenCoil"; +const char* PetersenCoil::debugString() const +{ + return PetersenCoil::debugName; } -void PetersenCoil::addConstructToMap(std::unordered_map& factory_map) { +void PetersenCoil::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PetersenCoil"), &PetersenCoil_factory)); } -void PetersenCoil::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PetersenCoil::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PetersenCoil.mode"), &assign_PetersenCoil_mode)); assign_map.insert(std::make_pair(std::string("cim:PetersenCoil.nominalU"), &assign_PetersenCoil_nominalU)); assign_map.insert(std::make_pair(std::string("cim:PetersenCoil.offsetCurrent"), &assign_PetersenCoil_offsetCurrent)); @@ -129,13 +141,8 @@ void PetersenCoil::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PetersenCoil::debugName[] = "PetersenCoil"; -const char* PetersenCoil::debugString() +void PetersenCoil::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PetersenCoil::debugName; } const BaseClassDefiner PetersenCoil::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner PetersenCoil::declare() return BaseClassDefiner(PetersenCoil::addConstructToMap, PetersenCoil::addPrimitiveAssignFnsToMap, PetersenCoil::addClassAssignFnsToMap, PetersenCoil::debugName); } - +namespace CIMPP +{ + BaseClass* PetersenCoil_factory() + { + return new PetersenCoil; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PetersenCoil.hpp b/CGMES_2.4.15_27JAN2020/PetersenCoil.hpp index 4c22351bc..e4a3b7040 100644 --- a/CGMES_2.4.15_27JAN2020/PetersenCoil.hpp +++ b/CGMES_2.4.15_27JAN2020/PetersenCoil.hpp @@ -1,47 +1,48 @@ #ifndef PetersenCoil_H #define PetersenCoil_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EarthFaultCompensator.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PetersenCoilModeKind.hpp" -#include "Voltage.hpp" +#include "EarthFaultCompensator.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" +#include "PetersenCoilModeKind.hpp" #include "Reactance.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A tunable impedance device normally used to offset line charging during single line faults in an ungrounded section of network. */ - class PetersenCoil: public EarthFaultCompensator + class PetersenCoil : public EarthFaultCompensator { - public: - CIMPP::PetersenCoilModeKind mode; /* The mode of operation of the Petersen coil. Default: 0 */ - CIMPP::Voltage nominalU; /* The nominal voltage for which the coil is designed. Default: nullptr */ - CIMPP::CurrentFlow offsetCurrent; /* The offset current that the Petersen coil controller is operating from the resonant point. This is normally a fixed amount for which the controller is configured and could be positive or negative. Typically 0 to 60 Amperes depending on voltage and resonance conditions. Default: nullptr */ - CIMPP::CurrentFlow positionCurrent; /* The control current used to control the Petersen coil also known as the position current. Typically in the range of 20-200mA. Default: nullptr */ - CIMPP::Reactance xGroundMax; /* The maximum reactance. Default: nullptr */ - CIMPP::Reactance xGroundMin; /* The minimum reactance. Default: nullptr */ - CIMPP::Reactance xGroundNominal; /* The nominal reactance. This is the operating point (normally over compensation) that is defined based on the resonance point in the healthy network condition. The impedance is calculated based on nominal voltage divided by position current. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PetersenCoil(); - virtual ~PetersenCoil(); - + ~PetersenCoil() override; + + CIMPP::PetersenCoilModeKind mode; /* The mode of operation of the Petersen coil. Default: 0 */ + CIMPP::Voltage nominalU; /* The nominal voltage for which the coil is designed. Default: nullptr */ + CIMPP::CurrentFlow offsetCurrent; /* The offset current that the Petersen coil controller is operating from the resonant point. This is normally a fixed amount for which the controller is configured and could be positive or negative. Typically 0 to 60 Amperes depending on voltage and resonance conditions. Default: nullptr */ + CIMPP::CurrentFlow positionCurrent; /* The control current used to control the Petersen coil also known as the position current. Typically in the range of 20-200mA. Default: nullptr */ + CIMPP::Reactance xGroundMax; /* The maximum reactance. Default: nullptr */ + CIMPP::Reactance xGroundMin; /* The minimum reactance. Default: nullptr */ + CIMPP::Reactance xGroundNominal; /* The nominal reactance. This is the operating point (normally over compensation) that is defined based on the resonance point in the healthy network condition. The impedance is calculated based on nominal voltage divided by position current. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PetersenCoil_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.cpp b/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.cpp index 8f8096909..a2e6dcbf7 100644 --- a/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.cpp +++ b/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PetersenCoilModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::PetersenCoilModeKind& rop) +PetersenCoilModeKind& PetersenCoilModeKind::operator=(PetersenCoilModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +PetersenCoilModeKind::operator PetersenCoilModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char PetersenCoilModeKind::debugName[] = "PetersenCoilModeKind"; +const char* PetersenCoilModeKind::debugString() const +{ + return PetersenCoilModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PetersenCoilModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const PetersenCoilModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == PetersenCoilModeKind::fixed) + { + EnumSymbol = "fixed"; + } + if (obj.value == PetersenCoilModeKind::manual) + { + EnumSymbol = "manual"; + } + if (obj.value == PetersenCoilModeKind::automaticPositioning) + { + EnumSymbol = "automaticPositioning"; + } + + if (!EnumSymbol.empty()) + { + os << "PetersenCoilModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.hpp b/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.hpp index f1aac46cf..6bfff0ea0 100644 --- a/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.hpp +++ b/CGMES_2.4.15_27JAN2020/PetersenCoilModeKind.hpp @@ -1,25 +1,50 @@ #ifndef PetersenCoilModeKind_H #define PetersenCoilModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The mode of operation for a Petersen coil. */ - enum class PetersenCoilModeKind + class PetersenCoilModeKind { - /** - * Fixed position. - */ - fixed, - /** - * Manual positioning. - */ - manual, - /** - * Automatic positioning. - */ - automaticPositioning, + public: + enum PetersenCoilModeKind_ENUM + { + /** + * Fixed position. + */ + fixed, + /** + * Manual positioning. + */ + manual, + /** + * Automatic positioning. + */ + automaticPositioning, + }; + + PetersenCoilModeKind() : value(), initialized(false) {} + PetersenCoilModeKind(PetersenCoilModeKind_ENUM value) : value(value), initialized(true) {} + + PetersenCoilModeKind& operator=(PetersenCoilModeKind_ENUM rop); + operator PetersenCoilModeKind_ENUM() const; + + PetersenCoilModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, PetersenCoilModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const PetersenCoilModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::PetersenCoilModeKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/PhaseCode.cpp b/CGMES_2.4.15_27JAN2020/PhaseCode.cpp index b493c0a41..49aa040c7 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseCode.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseCode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseCode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::PhaseCode& rop) +PhaseCode& PhaseCode::operator=(PhaseCode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +PhaseCode::operator PhaseCode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char PhaseCode::debugName[] = "PhaseCode"; +const char* PhaseCode::debugString() const +{ + return PhaseCode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, PhaseCode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -128,5 +159,103 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const PhaseCode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == PhaseCode::ABCN) + { + EnumSymbol = "ABCN"; + } + if (obj.value == PhaseCode::ABC) + { + EnumSymbol = "ABC"; + } + if (obj.value == PhaseCode::ABN) + { + EnumSymbol = "ABN"; + } + if (obj.value == PhaseCode::ACN) + { + EnumSymbol = "ACN"; + } + if (obj.value == PhaseCode::BCN) + { + EnumSymbol = "BCN"; + } + if (obj.value == PhaseCode::AB) + { + EnumSymbol = "AB"; + } + if (obj.value == PhaseCode::AC) + { + EnumSymbol = "AC"; + } + if (obj.value == PhaseCode::BC) + { + EnumSymbol = "BC"; + } + if (obj.value == PhaseCode::AN) + { + EnumSymbol = "AN"; + } + if (obj.value == PhaseCode::BN) + { + EnumSymbol = "BN"; + } + if (obj.value == PhaseCode::CN) + { + EnumSymbol = "CN"; + } + if (obj.value == PhaseCode::A) + { + EnumSymbol = "A"; + } + if (obj.value == PhaseCode::B) + { + EnumSymbol = "B"; + } + if (obj.value == PhaseCode::C) + { + EnumSymbol = "C"; + } + if (obj.value == PhaseCode::N) + { + EnumSymbol = "N"; + } + if (obj.value == PhaseCode::s1N) + { + EnumSymbol = "s1N"; + } + if (obj.value == PhaseCode::s2N) + { + EnumSymbol = "s2N"; + } + if (obj.value == PhaseCode::s12N) + { + EnumSymbol = "s12N"; + } + if (obj.value == PhaseCode::s1) + { + EnumSymbol = "s1"; + } + if (obj.value == PhaseCode::s2) + { + EnumSymbol = "s2"; + } + if (obj.value == PhaseCode::s12) + { + EnumSymbol = "s12"; + } + + if (!EnumSymbol.empty()) + { + os << "PhaseCode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseCode.hpp b/CGMES_2.4.15_27JAN2020/PhaseCode.hpp index 383677709..37a523ed2 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseCode.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseCode.hpp @@ -1,97 +1,122 @@ #ifndef PhaseCode_H #define PhaseCode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Enumeration of phase identifiers. Allows designation of phases for both transmission and distribution equipment, circuits and loads. Residential and small commercial loads are often served from single-phase, or split-phase, secondary circuits. For example of s12N, phases 1 and 2 refer to hot wires that are 180 degrees out of phase, while N refers to the neutral wire. Through single-phase transformer connections, these secondary circuits may be served from one or two of the primary phases A, B, and C. For three-phase loads, use the A, B, C phase codes instead of s12N. */ - enum class PhaseCode + class PhaseCode { - /** - * Phases A, B, C, and N. - */ - ABCN, - /** - * Phases A, B, and C. - */ - ABC, - /** - * Phases A, B, and neutral. - */ - ABN, - /** - * Phases A, C and neutral. - */ - ACN, - /** - * Phases B, C, and neutral. - */ - BCN, - /** - * Phases A and B. - */ - AB, - /** - * Phases A and C. - */ - AC, - /** - * Phases B and C. - */ - BC, - /** - * Phases A and neutral. - */ - AN, - /** - * Phases B and neutral. - */ - BN, - /** - * Phases C and neutral. - */ - CN, - /** - * Phase A. - */ - A, - /** - * Phase B. - */ - B, - /** - * Phase C. - */ - C, - /** - * Neutral phase. - */ - N, - /** - * Secondary phase 1 and neutral. - */ - s1N, - /** - * Secondary phase 2 and neutral. - */ - s2N, - /** - * Secondary phases 1, 2, and neutral. - */ - s12N, - /** - * Secondary phase 1. - */ - s1, - /** - * Secondary phase 2. - */ - s2, - /** - * Secondary phase 1 and 2. - */ - s12, + public: + enum PhaseCode_ENUM + { + /** + * Phases A, B, C, and N. + */ + ABCN, + /** + * Phases A, B, and C. + */ + ABC, + /** + * Phases A, B, and neutral. + */ + ABN, + /** + * Phases A, C and neutral. + */ + ACN, + /** + * Phases B, C, and neutral. + */ + BCN, + /** + * Phases A and B. + */ + AB, + /** + * Phases A and C. + */ + AC, + /** + * Phases B and C. + */ + BC, + /** + * Phases A and neutral. + */ + AN, + /** + * Phases B and neutral. + */ + BN, + /** + * Phases C and neutral. + */ + CN, + /** + * Phase A. + */ + A, + /** + * Phase B. + */ + B, + /** + * Phase C. + */ + C, + /** + * Neutral phase. + */ + N, + /** + * Secondary phase 1 and neutral. + */ + s1N, + /** + * Secondary phase 2 and neutral. + */ + s2N, + /** + * Secondary phases 1, 2, and neutral. + */ + s12N, + /** + * Secondary phase 1. + */ + s1, + /** + * Secondary phase 2. + */ + s2, + /** + * Secondary phase 1 and 2. + */ + s12, + }; + + PhaseCode() : value(), initialized(false) {} + PhaseCode(PhaseCode_ENUM value) : value(value), initialized(true) {} + + PhaseCode& operator=(PhaseCode_ENUM rop); + operator PhaseCode_ENUM() const; + + PhaseCode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, PhaseCode& rop); + friend std::ostream& operator<<(std::ostream& os, const PhaseCode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::PhaseCode& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChanger.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChanger.cpp index cbfac61df..709d1c4c2 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChanger.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChanger.cpp @@ -1,49 +1,56 @@ -#include -#include "TapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChanger.hpp" +#include +#include + #include "TransformerEnd.hpp" using namespace CIMPP; -PhaseTapChanger::PhaseTapChanger(): TransformerEnd(nullptr) {}; - +PhaseTapChanger::PhaseTapChanger() : TransformerEnd(nullptr) {}; PhaseTapChanger::~PhaseTapChanger() {}; -bool assign_TransformerEnd_PhaseTapChanger(BaseClass*, BaseClass*); -bool assign_PhaseTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->TransformerEnd = dynamic_cast(BaseClass_ptr2); - if(element->TransformerEnd != nullptr) - return assign_TransformerEnd_PhaseTapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* PhaseTapChanger_factory() { - return new PhaseTapChanger; +bool assign_TransformerEnd_PhaseTapChanger(BaseClass*, BaseClass*); +bool assign_PhaseTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChanger* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TransformerEnd != element2) + { + element->TransformerEnd = element2; + return assign_TransformerEnd_PhaseTapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PhaseTapChanger::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PhaseTapChanger"), &PhaseTapChanger_factory)); +const char PhaseTapChanger::debugName[] = "PhaseTapChanger"; +const char* PhaseTapChanger::debugString() const +{ + return PhaseTapChanger::debugName; } -void PhaseTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PhaseTapChanger::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PhaseTapChanger"), &PhaseTapChanger_factory)); +} -void PhaseTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChanger.TransformerEnd"), &assign_PhaseTapChanger_TransformerEnd)); +void PhaseTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChanger::debugName[] = "PhaseTapChanger"; -const char* PhaseTapChanger::debugString() +void PhaseTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChanger::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChanger.TransformerEnd"), &assign_PhaseTapChanger_TransformerEnd)); } const BaseClassDefiner PhaseTapChanger::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner PhaseTapChanger::declare() return BaseClassDefiner(PhaseTapChanger::addConstructToMap, PhaseTapChanger::addPrimitiveAssignFnsToMap, PhaseTapChanger::addClassAssignFnsToMap, PhaseTapChanger::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChanger_factory() + { + return new PhaseTapChanger; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChanger.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChanger.hpp index 5d806868e..0fef3584e 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChanger.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChanger.hpp @@ -1,38 +1,39 @@ #ifndef PhaseTapChanger_H #define PhaseTapChanger_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "TapChanger.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TransformerEnd; -class TransformerEnd; /* A transformer phase shifting tap model that controls the phase angle difference across the power transformer and potentially the active power flow through the power transformer. This phase tap model may also impact the voltage magnitude. */ - class PhaseTapChanger: public TapChanger + class PhaseTapChanger : public TapChanger { - public: - CIMPP::TransformerEnd* TransformerEnd; /* Phase tap changer associated with this transformer end. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChanger(); - virtual ~PhaseTapChanger(); - + ~PhaseTapChanger() override; + + CIMPP::TransformerEnd* TransformerEnd; /* Phase tap changer associated with this transformer end. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChanger_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.cpp index ef9f2ab24..d56507fe1 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.cpp @@ -1,51 +1,52 @@ -#include -#include "PhaseTapChangerNonLinear.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerAsymmetrical.hpp" +#include +#include + #include "AngleDegrees.hpp" using namespace CIMPP; PhaseTapChangerAsymmetrical::PhaseTapChangerAsymmetrical() {}; - PhaseTapChangerAsymmetrical::~PhaseTapChangerAsymmetrical() {}; +bool assign_PhaseTapChangerAsymmetrical_windingConnectionAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerAsymmetrical* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windingConnectionAngle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerAsymmetrical_windingConnectionAngle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerAsymmetrical* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windingConnectionAngle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PhaseTapChangerAsymmetrical_factory() { - return new PhaseTapChangerAsymmetrical; - } +const char PhaseTapChangerAsymmetrical::debugName[] = "PhaseTapChangerAsymmetrical"; +const char* PhaseTapChangerAsymmetrical::debugString() const +{ + return PhaseTapChangerAsymmetrical::debugName; } -void PhaseTapChangerAsymmetrical::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerAsymmetrical::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerAsymmetrical"), &PhaseTapChangerAsymmetrical_factory)); } -void PhaseTapChangerAsymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerAsymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerAsymmetrical.windingConnectionAngle"), &assign_PhaseTapChangerAsymmetrical_windingConnectionAngle)); } -void PhaseTapChangerAsymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PhaseTapChangerAsymmetrical::debugName[] = "PhaseTapChangerAsymmetrical"; -const char* PhaseTapChangerAsymmetrical::debugString() +void PhaseTapChangerAsymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerAsymmetrical::debugName; } const BaseClassDefiner PhaseTapChangerAsymmetrical::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner PhaseTapChangerAsymmetrical::declare() return BaseClassDefiner(PhaseTapChangerAsymmetrical::addConstructToMap, PhaseTapChangerAsymmetrical::addPrimitiveAssignFnsToMap, PhaseTapChangerAsymmetrical::addClassAssignFnsToMap, PhaseTapChangerAsymmetrical::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerAsymmetrical_factory() + { + return new PhaseTapChangerAsymmetrical; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.hpp index 6e2cbfdff..1b341e379 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerAsymmetrical.hpp @@ -1,38 +1,39 @@ #ifndef PhaseTapChangerAsymmetrical_H #define PhaseTapChangerAsymmetrical_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChangerNonLinear.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PhaseTapChangerNonLinear.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Describes the tap model for an asymmetrical phase shifting transformer in which the difference voltage vector adds to the primary side voltage. The angle between the primary side voltage and the difference voltage is named the winding connection angle. The phase shift depends on both the difference voltage magnitude and the winding connection angle. */ - class PhaseTapChangerAsymmetrical: public PhaseTapChangerNonLinear + class PhaseTapChangerAsymmetrical : public PhaseTapChangerNonLinear { - public: - CIMPP::AngleDegrees windingConnectionAngle; /* The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. The out-of-phase winding produces what is known as the difference voltage. Setting this angle to 90 degrees is not the same as a symmemtrical transformer. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerAsymmetrical(); - virtual ~PhaseTapChangerAsymmetrical(); - + ~PhaseTapChangerAsymmetrical() override; + + CIMPP::AngleDegrees windingConnectionAngle; /* The phase angle between the in-phase winding and the out-of -phase winding used for creating phase shift. The out-of-phase winding produces what is known as the difference voltage. Setting this angle to 90 degrees is not the same as a symmemtrical transformer. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerAsymmetrical_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.cpp index e098e2fbf..aebc14b4b 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.cpp @@ -1,7 +1,11 @@ -#include -#include "PhaseTapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerLinear.hpp" +#include +#include + #include "AngleDegrees.hpp" #include "Reactance.hpp" #include "Reactance.hpp" @@ -9,73 +13,72 @@ using namespace CIMPP; PhaseTapChangerLinear::PhaseTapChangerLinear() {}; - PhaseTapChangerLinear::~PhaseTapChangerLinear() {}; +bool assign_PhaseTapChangerLinear_stepPhaseShiftIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->stepPhaseShiftIncrement; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerLinear_stepPhaseShiftIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->stepPhaseShiftIncrement; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PhaseTapChangerLinear_factory() { - return new PhaseTapChangerLinear; - } +const char PhaseTapChangerLinear::debugName[] = "PhaseTapChangerLinear"; +const char* PhaseTapChangerLinear::debugString() const +{ + return PhaseTapChangerLinear::debugName; } -void PhaseTapChangerLinear::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerLinear::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear"), &PhaseTapChangerLinear_factory)); } -void PhaseTapChangerLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear.stepPhaseShiftIncrement"), &assign_PhaseTapChangerLinear_stepPhaseShiftIncrement)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear.xMax"), &assign_PhaseTapChangerLinear_xMax)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerLinear.xMin"), &assign_PhaseTapChangerLinear_xMin)); } -void PhaseTapChangerLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PhaseTapChangerLinear::debugName[] = "PhaseTapChangerLinear"; -const char* PhaseTapChangerLinear::debugString() +void PhaseTapChangerLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerLinear::debugName; } const BaseClassDefiner PhaseTapChangerLinear::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner PhaseTapChangerLinear::declare() return BaseClassDefiner(PhaseTapChangerLinear::addConstructToMap, PhaseTapChangerLinear::addPrimitiveAssignFnsToMap, PhaseTapChangerLinear::addClassAssignFnsToMap, PhaseTapChangerLinear::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerLinear_factory() + { + return new PhaseTapChangerLinear; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.hpp index f53e2f1dc..8efa03f19 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerLinear.hpp @@ -1,41 +1,42 @@ #ifndef PhaseTapChangerLinear_H #define PhaseTapChangerLinear_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PhaseTapChanger.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Reactance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Describes a tap changer with a linear relation between the tap step and the phase angle difference across the transformer. This is a mathematical model that is an approximation of a real phase tap changer. The phase angle is computed as stepPhaseShitfIncrement times the tap position. The secondary side voltage magnitude is the same as at the primary side. */ - class PhaseTapChangerLinear: public PhaseTapChanger + class PhaseTapChangerLinear : public PhaseTapChanger { - public: - CIMPP::AngleDegrees stepPhaseShiftIncrement; /* Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. Default: nullptr */ - CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ - CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerLinear(); - virtual ~PhaseTapChangerLinear(); - + ~PhaseTapChangerLinear() override; + + CIMPP::AngleDegrees stepPhaseShiftIncrement; /* Phase shift per step position. A positive value indicates a positive phase shift from the winding where the tap is located to the other winding (for a two-winding transformer). The actual phase shift increment might be more accurately computed from the symmetrical or asymmetrical models or a tap step table lookup if those are available. Default: nullptr */ + CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ + CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerLinear_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.cpp index 321bcc079..10a2c21f0 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.cpp @@ -1,7 +1,11 @@ -#include -#include "PhaseTapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerNonLinear.hpp" +#include +#include + #include "PerCent.hpp" #include "Reactance.hpp" #include "Reactance.hpp" @@ -9,73 +13,72 @@ using namespace CIMPP; PhaseTapChangerNonLinear::PhaseTapChangerNonLinear() {}; - PhaseTapChangerNonLinear::~PhaseTapChangerNonLinear() {}; +bool assign_PhaseTapChangerNonLinear_voltageStepIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageStepIncrement; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerNonLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PhaseTapChangerNonLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xMin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerNonLinear_voltageStepIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageStepIncrement; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerNonLinear_xMax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PhaseTapChangerNonLinear_xMin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerNonLinear* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xMin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PhaseTapChangerNonLinear_factory() { - return new PhaseTapChangerNonLinear; - } +const char PhaseTapChangerNonLinear::debugName[] = "PhaseTapChangerNonLinear"; +const char* PhaseTapChangerNonLinear::debugString() const +{ + return PhaseTapChangerNonLinear::debugName; } -void PhaseTapChangerNonLinear::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerNonLinear::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear"), &PhaseTapChangerNonLinear_factory)); } -void PhaseTapChangerNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerNonLinear::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear.voltageStepIncrement"), &assign_PhaseTapChangerNonLinear_voltageStepIncrement)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear.xMax"), &assign_PhaseTapChangerNonLinear_xMax)); assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerNonLinear.xMin"), &assign_PhaseTapChangerNonLinear_xMin)); } -void PhaseTapChangerNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PhaseTapChangerNonLinear::debugName[] = "PhaseTapChangerNonLinear"; -const char* PhaseTapChangerNonLinear::debugString() +void PhaseTapChangerNonLinear::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerNonLinear::debugName; } const BaseClassDefiner PhaseTapChangerNonLinear::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner PhaseTapChangerNonLinear::declare() return BaseClassDefiner(PhaseTapChangerNonLinear::addConstructToMap, PhaseTapChangerNonLinear::addPrimitiveAssignFnsToMap, PhaseTapChangerNonLinear::addClassAssignFnsToMap, PhaseTapChangerNonLinear::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerNonLinear_factory() + { + return new PhaseTapChangerNonLinear; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.hpp index 49fd4efa1..6b220652b 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerNonLinear.hpp @@ -1,41 +1,42 @@ #ifndef PhaseTapChangerNonLinear_H #define PhaseTapChangerNonLinear_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PhaseTapChanger.hpp" +#include "BaseClassDefiner.hpp" #include "PerCent.hpp" #include "Reactance.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The non-linear phase tap changer describes the non-linear behavior of a phase tap changer. This is a base class for the symmetrical and asymmetrical phase tap changer models. The details of these models can be found in the IEC 61970-301 document. */ - class PhaseTapChangerNonLinear: public PhaseTapChanger + class PhaseTapChangerNonLinear : public PhaseTapChanger { - public: - CIMPP::PerCent voltageStepIncrement; /* The voltage step increment on the out of phase winding specified in percent of nominal voltage of the transformer end. Default: nullptr */ - CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ - CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerNonLinear(); - virtual ~PhaseTapChangerNonLinear(); - + ~PhaseTapChangerNonLinear() override; + + CIMPP::PerCent voltageStepIncrement; /* The voltage step increment on the out of phase winding specified in percent of nominal voltage of the transformer end. Default: nullptr */ + CIMPP::Reactance xMax; /* The reactance depend on the tap position according to a `u` shaped curve. The maximum reactance (xMax) appear at the low and high tap positions. Default: nullptr */ + CIMPP::Reactance xMin; /* The reactance depend on the tap position according to a `u` shaped curve. The minimum reactance (xMin) appear at the mid tap position. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerNonLinear_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.cpp index 28464b003..349239582 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.cpp @@ -1,36 +1,36 @@ -#include -#include "PhaseTapChangerNonLinear.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerSymmetrical.hpp" +#include +#include + using namespace CIMPP; PhaseTapChangerSymmetrical::PhaseTapChangerSymmetrical() {}; - PhaseTapChangerSymmetrical::~PhaseTapChangerSymmetrical() {}; -namespace CIMPP { - BaseClass* PhaseTapChangerSymmetrical_factory() { - return new PhaseTapChangerSymmetrical; - } +const char PhaseTapChangerSymmetrical::debugName[] = "PhaseTapChangerSymmetrical"; +const char* PhaseTapChangerSymmetrical::debugString() const +{ + return PhaseTapChangerSymmetrical::debugName; } -void PhaseTapChangerSymmetrical::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerSymmetrical::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerSymmetrical"), &PhaseTapChangerSymmetrical_factory)); } -void PhaseTapChangerSymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void PhaseTapChangerSymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void PhaseTapChangerSymmetrical::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChangerSymmetrical::debugName[] = "PhaseTapChangerSymmetrical"; -const char* PhaseTapChangerSymmetrical::debugString() +void PhaseTapChangerSymmetrical::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerSymmetrical::debugName; } const BaseClassDefiner PhaseTapChangerSymmetrical::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner PhaseTapChangerSymmetrical::declare() return BaseClassDefiner(PhaseTapChangerSymmetrical::addConstructToMap, PhaseTapChangerSymmetrical::addPrimitiveAssignFnsToMap, PhaseTapChangerSymmetrical::addClassAssignFnsToMap, PhaseTapChangerSymmetrical::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerSymmetrical_factory() + { + return new PhaseTapChangerSymmetrical; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.hpp index 91be9c6f2..613a8040d 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerSymmetrical.hpp @@ -1,36 +1,37 @@ #ifndef PhaseTapChangerSymmetrical_H #define PhaseTapChangerSymmetrical_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChangerNonLinear.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "PhaseTapChangerNonLinear.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Describes a symmetrical phase shifting transformer tap model in which the secondary side voltage magnitude is the same as at the primary side. The difference voltage magnitude is the base in an equal-sided triangle where the sides corresponds to the primary and secondary voltages. The phase angle difference corresponds to the top angle and can be expressed as twice the arctangent of half the total difference voltage. */ - class PhaseTapChangerSymmetrical: public PhaseTapChangerNonLinear + class PhaseTapChangerSymmetrical : public PhaseTapChangerNonLinear { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerSymmetrical(); - virtual ~PhaseTapChangerSymmetrical(); - + ~PhaseTapChangerSymmetrical() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerSymmetrical_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.cpp index 178b12a8d..e47a0b148 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerTable.hpp" +#include +#include + #include "PhaseTapChangerTablePoint.hpp" #include "PhaseTapChangerTabular.hpp" using namespace CIMPP; PhaseTapChangerTable::PhaseTapChangerTable() {}; - PhaseTapChangerTable::~PhaseTapChangerTable() {}; -bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PhaseTapChangerTablePoint.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTablePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PhaseTapChangerTablePoint.begin(), element->PhaseTapChangerTablePoint.end(), element2) == element->PhaseTapChangerTablePoint.end()) + { + element->PhaseTapChangerTablePoint.push_back(element2); + return assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PhaseTapChangerTabular.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTabular* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PhaseTapChangerTabular.begin(), element->PhaseTapChangerTabular.end(), element2) == element->PhaseTapChangerTabular.end()) + { + element->PhaseTapChangerTabular.push_back(element2); + return assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* PhaseTapChangerTable_factory() { - return new PhaseTapChangerTable; - } +const char PhaseTapChangerTable::debugName[] = "PhaseTapChangerTable"; +const char* PhaseTapChangerTable::debugString() const +{ + return PhaseTapChangerTable::debugName; } -void PhaseTapChangerTable::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerTable::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable"), &PhaseTapChangerTable_factory)); } -void PhaseTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PhaseTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTablePoint"), &assign_PhaseTapChangerTable_PhaseTapChangerTablePoint)); - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTabular"), &assign_PhaseTapChangerTable_PhaseTapChangerTabular)); +void PhaseTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChangerTable::debugName[] = "PhaseTapChangerTable"; -const char* PhaseTapChangerTable::debugString() +void PhaseTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerTable::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTablePoint"), &assign_PhaseTapChangerTable_PhaseTapChangerTablePoint)); + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTable.PhaseTapChangerTabular"), &assign_PhaseTapChangerTable_PhaseTapChangerTabular)); } const BaseClassDefiner PhaseTapChangerTable::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner PhaseTapChangerTable::declare() return BaseClassDefiner(PhaseTapChangerTable::addConstructToMap, PhaseTapChangerTable::addPrimitiveAssignFnsToMap, PhaseTapChangerTable::addClassAssignFnsToMap, PhaseTapChangerTable::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerTable_factory() + { + return new PhaseTapChangerTable; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.hpp index 32dc55135..7db6e7ccd 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTable.hpp @@ -1,40 +1,41 @@ #ifndef PhaseTapChangerTable_H #define PhaseTapChangerTable_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class PhaseTapChangerTablePoint; + class PhaseTapChangerTabular; -class PhaseTapChangerTablePoint; -class PhaseTapChangerTabular; /* Describes a tabular curve for how the phase angle difference and impedance varies with the tap step. */ - class PhaseTapChangerTable: public IdentifiedObject + class PhaseTapChangerTable : public IdentifiedObject { - public: - std::list PhaseTapChangerTablePoint; /* The points of this table. Default: 0 */ - std::list PhaseTapChangerTabular; /* The phase tap changers to which this phase tap table applies. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerTable(); - virtual ~PhaseTapChangerTable(); - + ~PhaseTapChangerTable() override; + + std::list PhaseTapChangerTablePoint; /* The points of this table. Default: 0 */ + std::list PhaseTapChangerTabular; /* The phase tap changers to which this phase tap table applies. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerTable_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.cpp index b0fefe1eb..ac94e617a 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.cpp @@ -1,64 +1,72 @@ -#include -#include "TapChangerTablePoint.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerTablePoint.hpp" +#include +#include + #include "PhaseTapChangerTable.hpp" #include "AngleDegrees.hpp" using namespace CIMPP; -PhaseTapChangerTablePoint::PhaseTapChangerTablePoint(): PhaseTapChangerTable(nullptr) {}; - +PhaseTapChangerTablePoint::PhaseTapChangerTablePoint() : PhaseTapChangerTable(nullptr) {}; PhaseTapChangerTablePoint::~PhaseTapChangerTablePoint() {}; -bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass*, BaseClass*); -bool assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->PhaseTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->PhaseTapChangerTable != nullptr) - return assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_PhaseTapChangerTablePoint_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->angle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PhaseTapChangerTablePoint_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->angle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTablePoint_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PhaseTapChangerTable != element2) + { + element->PhaseTapChangerTable = element2; + return assign_PhaseTapChangerTable_PhaseTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PhaseTapChangerTablePoint_factory() { - return new PhaseTapChangerTablePoint; - } + +const char PhaseTapChangerTablePoint::debugName[] = "PhaseTapChangerTablePoint"; +const char* PhaseTapChangerTablePoint::debugString() const +{ + return PhaseTapChangerTablePoint::debugName; } -void PhaseTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) { +void PhaseTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint"), &PhaseTapChangerTablePoint_factory)); } -void PhaseTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.angle"), &assign_PhaseTapChangerTablePoint_angle)); +void PhaseTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.angle"), &assign_PhaseTapChangerTablePoint_angle)); } -void PhaseTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.PhaseTapChangerTable"), &assign_PhaseTapChangerTablePoint_PhaseTapChangerTable)); - } - -const char PhaseTapChangerTablePoint::debugName[] = "PhaseTapChangerTablePoint"; -const char* PhaseTapChangerTablePoint::debugString() +void PhaseTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerTablePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTablePoint.PhaseTapChangerTable"), &assign_PhaseTapChangerTablePoint_PhaseTapChangerTable)); } const BaseClassDefiner PhaseTapChangerTablePoint::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PhaseTapChangerTablePoint::declare() return BaseClassDefiner(PhaseTapChangerTablePoint::addConstructToMap, PhaseTapChangerTablePoint::addPrimitiveAssignFnsToMap, PhaseTapChangerTablePoint::addClassAssignFnsToMap, PhaseTapChangerTablePoint::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerTablePoint_factory() + { + return new PhaseTapChangerTablePoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.hpp index 89d74043a..1b17e183c 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTablePoint.hpp @@ -1,40 +1,41 @@ #ifndef PhaseTapChangerTablePoint_H #define PhaseTapChangerTablePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChangerTablePoint.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TapChangerTablePoint.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" -namespace CIMPP { +namespace CIMPP +{ + class PhaseTapChangerTable; - -class PhaseTapChangerTable; /* Describes each tap step in the phase tap changer tabular curve. */ - class PhaseTapChangerTablePoint: public TapChangerTablePoint + class PhaseTapChangerTablePoint : public TapChangerTablePoint { - public: - CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The table of this point. Default: 0 */ - CIMPP::AngleDegrees angle; /* The angle difference in degrees. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerTablePoint(); - virtual ~PhaseTapChangerTablePoint(); - + ~PhaseTapChangerTablePoint() override; + + CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The table of this point. Default: 0 */ + CIMPP::AngleDegrees angle; /* The angle difference in degrees. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerTablePoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.cpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.cpp index af16ab19d..a270307cc 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.cpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.cpp @@ -1,49 +1,56 @@ -#include -#include "PhaseTapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PhaseTapChangerTabular.hpp" +#include +#include + #include "PhaseTapChangerTable.hpp" using namespace CIMPP; -PhaseTapChangerTabular::PhaseTapChangerTabular(): PhaseTapChangerTable(nullptr) {}; - +PhaseTapChangerTabular::PhaseTapChangerTabular() : PhaseTapChangerTable(nullptr) {}; PhaseTapChangerTabular::~PhaseTapChangerTabular() {}; -bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass*, BaseClass*); -bool assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PhaseTapChangerTabular* element = dynamic_cast(BaseClass_ptr1)) { - element->PhaseTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->PhaseTapChangerTable != nullptr) - return assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* PhaseTapChangerTabular_factory() { - return new PhaseTapChangerTabular; +bool assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass*, BaseClass*); +bool assign_PhaseTapChangerTabular_PhaseTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PhaseTapChangerTabular* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PhaseTapChangerTable != element2) + { + element->PhaseTapChangerTable = element2; + return assign_PhaseTapChangerTable_PhaseTapChangerTabular(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void PhaseTapChangerTabular::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular"), &PhaseTapChangerTabular_factory)); +const char PhaseTapChangerTabular::debugName[] = "PhaseTapChangerTabular"; +const char* PhaseTapChangerTabular::debugString() const +{ + return PhaseTapChangerTabular::debugName; } -void PhaseTapChangerTabular::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void PhaseTapChangerTabular::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular"), &PhaseTapChangerTabular_factory)); +} -void PhaseTapChangerTabular::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular.PhaseTapChangerTable"), &assign_PhaseTapChangerTabular_PhaseTapChangerTable)); +void PhaseTapChangerTabular::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PhaseTapChangerTabular::debugName[] = "PhaseTapChangerTabular"; -const char* PhaseTapChangerTabular::debugString() +void PhaseTapChangerTabular::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PhaseTapChangerTabular::debugName; + assign_map.insert(std::make_pair(std::string("cim:PhaseTapChangerTabular.PhaseTapChangerTable"), &assign_PhaseTapChangerTabular_PhaseTapChangerTable)); } const BaseClassDefiner PhaseTapChangerTabular::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner PhaseTapChangerTabular::declare() return BaseClassDefiner(PhaseTapChangerTabular::addConstructToMap, PhaseTapChangerTabular::addPrimitiveAssignFnsToMap, PhaseTapChangerTabular::addClassAssignFnsToMap, PhaseTapChangerTabular::debugName); } - +namespace CIMPP +{ + BaseClass* PhaseTapChangerTabular_factory() + { + return new PhaseTapChangerTabular; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.hpp b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.hpp index 8fe254b92..cbcc23f91 100644 --- a/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.hpp +++ b/CGMES_2.4.15_27JAN2020/PhaseTapChangerTabular.hpp @@ -1,38 +1,36 @@ #ifndef PhaseTapChangerTabular_H #define PhaseTapChangerTabular_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PhaseTapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "PhaseTapChanger.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class PhaseTapChangerTable; -class PhaseTapChangerTable; - /* - - */ - class PhaseTapChangerTabular: public PhaseTapChanger + class PhaseTapChangerTabular : public PhaseTapChanger { - public: - CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The phase tap changer table for this phase tap changer. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PhaseTapChangerTabular(); - virtual ~PhaseTapChangerTabular(); - + ~PhaseTapChangerTabular() override; + + CIMPP::PhaseTapChangerTable* PhaseTapChangerTable; /* The phase tap changer table for this phase tap changer. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PhaseTapChangerTabular_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PositionPoint.cpp b/CGMES_2.4.15_27JAN2020/PositionPoint.cpp index 5bf0de0ad..541093398 100644 --- a/CGMES_2.4.15_27JAN2020/PositionPoint.cpp +++ b/CGMES_2.4.15_27JAN2020/PositionPoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PositionPoint.hpp" +#include +#include + #include "Location.hpp" #include "Integer.hpp" #include "String.hpp" @@ -10,43 +14,30 @@ using namespace CIMPP; -PositionPoint::PositionPoint(): Location(nullptr) {}; - +PositionPoint::PositionPoint() : Location(nullptr) {}; PositionPoint::~PositionPoint() {}; -bool assign_Location_PositionPoints(BaseClass*, BaseClass*); -bool assign_PositionPoint_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { - element->Location = dynamic_cast(BaseClass_ptr2); - if(element->Location != nullptr) - return assign_Location_PositionPoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - - - - -bool assign_PositionPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PositionPoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_PositionPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_PositionPoint_xPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { element->xPosition = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -54,10 +45,12 @@ bool assign_PositionPoint_xPosition(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_PositionPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_PositionPoint_yPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { element->yPosition = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -65,10 +58,12 @@ bool assign_PositionPoint_yPosition(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_PositionPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PositionPoint* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_PositionPoint_zPosition(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PositionPoint* element = dynamic_cast(BaseClass_ptr1)) + { element->zPosition = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -76,31 +71,50 @@ bool assign_PositionPoint_zPosition(std::stringstream &buffer, BaseClass* BaseCl return false; } -namespace CIMPP { - BaseClass* PositionPoint_factory() { - return new PositionPoint; + +bool assign_Location_PositionPoints(BaseClass*, BaseClass*); +bool assign_PositionPoint_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PositionPoint* element = dynamic_cast(BaseClass_ptr1); + Location* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Location != element2) + { + element->Location = element2; + return assign_Location_PositionPoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + +const char PositionPoint::debugName[] = "PositionPoint"; +const char* PositionPoint::debugString() const +{ + return PositionPoint::debugName; } -void PositionPoint::addConstructToMap(std::unordered_map& factory_map) { +void PositionPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PositionPoint"), &PositionPoint_factory)); } -void PositionPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PositionPoint.sequenceNumber"), &assign_PositionPoint_sequenceNumber)); +void PositionPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PositionPoint.sequenceNumber"), &assign_PositionPoint_sequenceNumber)); assign_map.insert(std::make_pair(std::string("cim:PositionPoint.xPosition"), &assign_PositionPoint_xPosition)); assign_map.insert(std::make_pair(std::string("cim:PositionPoint.yPosition"), &assign_PositionPoint_yPosition)); assign_map.insert(std::make_pair(std::string("cim:PositionPoint.zPosition"), &assign_PositionPoint_zPosition)); } -void PositionPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PositionPoint.Location"), &assign_PositionPoint_Location)); - } - -const char PositionPoint::debugName[] = "PositionPoint"; -const char* PositionPoint::debugString() +void PositionPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PositionPoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:PositionPoint.Location"), &assign_PositionPoint_Location)); } const BaseClassDefiner PositionPoint::declare() @@ -108,4 +122,10 @@ const BaseClassDefiner PositionPoint::declare() return BaseClassDefiner(PositionPoint::addConstructToMap, PositionPoint::addPrimitiveAssignFnsToMap, PositionPoint::addClassAssignFnsToMap, PositionPoint::debugName); } - +namespace CIMPP +{ + BaseClass* PositionPoint_factory() + { + return new PositionPoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PositionPoint.hpp b/CGMES_2.4.15_27JAN2020/PositionPoint.hpp index f21450531..47dcc5897 100644 --- a/CGMES_2.4.15_27JAN2020/PositionPoint.hpp +++ b/CGMES_2.4.15_27JAN2020/PositionPoint.hpp @@ -1,44 +1,45 @@ #ifndef PositionPoint_H #define PositionPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Location; - -class Location; /* Set of spatial coordinates that determine a point, defined in the coordinate system specified in 'Location.CoordinateSystem'. Use a single position point instance to desribe a point-oriented location. Use a sequence of position points to describe a line-oriented object (physical location of non-point oriented objects like cables or lines), or area of an object (like a substation or a geographical zone - in this case, have first and last position point with the same values). */ - class PositionPoint: public BaseClass + class PositionPoint : public BaseClass { - public: - CIMPP::Location* Location; /* Location described by this position point. Default: 0 */ - CIMPP::Integer sequenceNumber; /* Zero-relative sequence number of this point within a series of points. Default: 0 */ - CIMPP::String xPosition; /* X axis position. Default: '' */ - CIMPP::String yPosition; /* Y axis position. Default: '' */ - CIMPP::String zPosition; /* (if applicable) Z axis position. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PositionPoint(); - virtual ~PositionPoint(); - + ~PositionPoint() override; + + CIMPP::Location* Location; /* Location described by this position point. Default: 0 */ + CIMPP::Integer sequenceNumber; /* Zero-relative sequence number of this point within a series of points. Default: 0 */ + CIMPP::String xPosition; /* X axis position. Default: '' */ + CIMPP::String yPosition; /* Y axis position. Default: '' */ + CIMPP::String zPosition; /* (if applicable) Z axis position. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PositionPoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PowerSystemResource.cpp b/CGMES_2.4.15_27JAN2020/PowerSystemResource.cpp index 7813a9ce7..26147d3d1 100644 --- a/CGMES_2.4.15_27JAN2020/PowerSystemResource.cpp +++ b/CGMES_2.4.15_27JAN2020/PowerSystemResource.cpp @@ -1,74 +1,96 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerSystemResource.hpp" +#include +#include + #include "Control.hpp" -#include "Measurement.hpp" #include "Location.hpp" +#include "Measurement.hpp" using namespace CIMPP; -PowerSystemResource::PowerSystemResource(): Location(nullptr) {}; - +PowerSystemResource::PowerSystemResource() : Location(nullptr) {}; PowerSystemResource::~PowerSystemResource() {}; -bool assign_PowerSystemResource_Controls(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemResource* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Controls.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_Control_PowerSystemResource(BaseClass*, BaseClass*); +bool assign_PowerSystemResource_Controls(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemResource* element = dynamic_cast(BaseClass_ptr1); + Control* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Controls.begin(), element->Controls.end(), element2) == element->Controls.end()) + { + element->Controls.push_back(element2); + return assign_Control_PowerSystemResource(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_PowerSystemResource_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemResource* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Measurements.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Location_PowerSystemResources(BaseClass*, BaseClass*); +bool assign_PowerSystemResource_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemResource* element = dynamic_cast(BaseClass_ptr1); + Location* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Location != element2) + { + element->Location = element2; + return assign_Location_PowerSystemResources(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_PowerSystemResource_Location(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemResource* element = dynamic_cast(BaseClass_ptr1)) { - element->Location = dynamic_cast(BaseClass_ptr2); - if(element->Location != nullptr) - return true; - } - return false; +bool assign_Measurement_PowerSystemResource(BaseClass*, BaseClass*); +bool assign_PowerSystemResource_Measurements(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemResource* element = dynamic_cast(BaseClass_ptr1); + Measurement* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Measurements.begin(), element->Measurements.end(), element2) == element->Measurements.end()) + { + element->Measurements.push_back(element2); + return assign_Measurement_PowerSystemResource(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* PowerSystemResource_factory() { - return new PowerSystemResource; - } +const char PowerSystemResource::debugName[] = "PowerSystemResource"; +const char* PowerSystemResource::debugString() const +{ + return PowerSystemResource::debugName; } -void PowerSystemResource::addConstructToMap(std::unordered_map& factory_map) { +void PowerSystemResource::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerSystemResource"), &PowerSystemResource_factory)); } -void PowerSystemResource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PowerSystemResource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Controls"), &assign_PowerSystemResource_Controls)); - assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Measurements"), &assign_PowerSystemResource_Measurements)); - assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Location"), &assign_PowerSystemResource_Location)); +void PowerSystemResource::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PowerSystemResource::debugName[] = "PowerSystemResource"; -const char* PowerSystemResource::debugString() +void PowerSystemResource::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerSystemResource::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Controls"), &assign_PowerSystemResource_Controls)); + assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Location"), &assign_PowerSystemResource_Location)); + assign_map.insert(std::make_pair(std::string("cim:PowerSystemResource.Measurements"), &assign_PowerSystemResource_Measurements)); } const BaseClassDefiner PowerSystemResource::declare() @@ -76,4 +98,10 @@ const BaseClassDefiner PowerSystemResource::declare() return BaseClassDefiner(PowerSystemResource::addConstructToMap, PowerSystemResource::addPrimitiveAssignFnsToMap, PowerSystemResource::addClassAssignFnsToMap, PowerSystemResource::debugName); } - +namespace CIMPP +{ + BaseClass* PowerSystemResource_factory() + { + return new PowerSystemResource; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PowerSystemResource.hpp b/CGMES_2.4.15_27JAN2020/PowerSystemResource.hpp index 68db537eb..2982f8905 100644 --- a/CGMES_2.4.15_27JAN2020/PowerSystemResource.hpp +++ b/CGMES_2.4.15_27JAN2020/PowerSystemResource.hpp @@ -1,42 +1,43 @@ #ifndef PowerSystemResource_H #define PowerSystemResource_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Control; + class Location; + class Measurement; -class Control; -class Measurement; -class Location; /* A power system resource can be an item of equipment such as a switch, an equipment container containing many individual items of equipment such as a substation, or an organisational entity such as sub-control area. Power system resources can have measurements associated. */ - class PowerSystemResource: public IdentifiedObject + class PowerSystemResource : public IdentifiedObject { - public: - std::list Controls; /* Regulating device governed by this control output. Default: 0 */ - std::list Measurements; /* The power system resource that contains the measurement. Default: 0 */ - CIMPP::Location* Location; /* Location of this power system resource. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerSystemResource(); - virtual ~PowerSystemResource(); - + ~PowerSystemResource() override; + + std::list Controls; /* Regulating device governed by this control output. Default: 0 */ + CIMPP::Location* Location; /* Location of this power system resource. Default: 0 */ + std::list Measurements; /* The power system resource that contains the measurement. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerSystemResource_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.cpp b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.cpp index 50a9bce48..11444bd4f 100644 --- a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerSystemStabilizerDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -PowerSystemStabilizerDynamics::PowerSystemStabilizerDynamics(): ExcitationSystemDynamics(nullptr) {}; - +PowerSystemStabilizerDynamics::PowerSystemStabilizerDynamics() : ExcitationSystemDynamics(nullptr) {}; PowerSystemStabilizerDynamics::~PowerSystemStabilizerDynamics() {}; -bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RemoteInputSignal.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass*, BaseClass*); +bool assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass*, BaseClass*); -bool assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_PowerSystemStabilizerDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass*, BaseClass*); +bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemStabilizerDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RemoteInputSignal.begin(), element->RemoteInputSignal.end(), element2) == element->RemoteInputSignal.end()) + { + element->RemoteInputSignal.push_back(element2); + return assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* PowerSystemStabilizerDynamics_factory() { - return new PowerSystemStabilizerDynamics; - } +const char PowerSystemStabilizerDynamics::debugName[] = "PowerSystemStabilizerDynamics"; +const char* PowerSystemStabilizerDynamics::debugString() const +{ + return PowerSystemStabilizerDynamics::debugName; } -void PowerSystemStabilizerDynamics::addConstructToMap(std::unordered_map& factory_map) { +void PowerSystemStabilizerDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics"), &PowerSystemStabilizerDynamics_factory)); } -void PowerSystemStabilizerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void PowerSystemStabilizerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.RemoteInputSignal"), &assign_PowerSystemStabilizerDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.ExcitationSystemDynamics"), &assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics)); +void PowerSystemStabilizerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char PowerSystemStabilizerDynamics::debugName[] = "PowerSystemStabilizerDynamics"; -const char* PowerSystemStabilizerDynamics::debugString() +void PowerSystemStabilizerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerSystemStabilizerDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.ExcitationSystemDynamics"), &assign_PowerSystemStabilizerDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerDynamics.RemoteInputSignal"), &assign_PowerSystemStabilizerDynamics_RemoteInputSignal)); } const BaseClassDefiner PowerSystemStabilizerDynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner PowerSystemStabilizerDynamics::declare() return BaseClassDefiner(PowerSystemStabilizerDynamics::addConstructToMap, PowerSystemStabilizerDynamics::addPrimitiveAssignFnsToMap, PowerSystemStabilizerDynamics::addClassAssignFnsToMap, PowerSystemStabilizerDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* PowerSystemStabilizerDynamics_factory() + { + return new PowerSystemStabilizerDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.hpp b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.hpp index f636ae567..c337743ac 100644 --- a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerDynamics.hpp @@ -1,40 +1,41 @@ #ifndef PowerSystemStabilizerDynamics_H #define PowerSystemStabilizerDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Power system stabilizer function block whose behaviour is described by reference to a standard model */ - class PowerSystemStabilizerDynamics: public DynamicsFunctionBlock + class PowerSystemStabilizerDynamics : public DynamicsFunctionBlock { - public: - std::list RemoteInputSignal; /* Remote input signal used by this power system stabilizer model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this power system stabilizer model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerSystemStabilizerDynamics(); - virtual ~PowerSystemStabilizerDynamics(); - + ~PowerSystemStabilizerDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this power system stabilizer model is associated. Default: 0 */ + std::list RemoteInputSignal; /* Remote input signal used by this power system stabilizer model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerSystemStabilizerDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.cpp b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.cpp index 9d56aa4ab..06d039cf4 100644 --- a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerSystemStabilizerUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; PowerSystemStabilizerUserDefined::PowerSystemStabilizerUserDefined() {}; - PowerSystemStabilizerUserDefined::~PowerSystemStabilizerUserDefined() {}; -bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_PowerSystemStabilizerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_PowerSystemStabilizerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass*, BaseClass*); +bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerSystemStabilizerUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* PowerSystemStabilizerUserDefined_factory() { - return new PowerSystemStabilizerUserDefined; - } +const char PowerSystemStabilizerUserDefined::debugName[] = "PowerSystemStabilizerUserDefined"; +const char* PowerSystemStabilizerUserDefined::debugString() const +{ + return PowerSystemStabilizerUserDefined::debugName; } -void PowerSystemStabilizerUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void PowerSystemStabilizerUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined"), &PowerSystemStabilizerUserDefined_factory)); } -void PowerSystemStabilizerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PowerSystemStabilizerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined.proprietary"), &assign_PowerSystemStabilizerUserDefined_proprietary)); - } - -void PowerSystemStabilizerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined.ProprietaryParameterDynamics"), &assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics)); } -const char PowerSystemStabilizerUserDefined::debugName[] = "PowerSystemStabilizerUserDefined"; -const char* PowerSystemStabilizerUserDefined::debugString() +void PowerSystemStabilizerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerSystemStabilizerUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerSystemStabilizerUserDefined.ProprietaryParameterDynamics"), &assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner PowerSystemStabilizerUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner PowerSystemStabilizerUserDefined::declare() return BaseClassDefiner(PowerSystemStabilizerUserDefined::addConstructToMap, PowerSystemStabilizerUserDefined::addPrimitiveAssignFnsToMap, PowerSystemStabilizerUserDefined::addClassAssignFnsToMap, PowerSystemStabilizerUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* PowerSystemStabilizerUserDefined_factory() + { + return new PowerSystemStabilizerUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.hpp b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.hpp index f2f48070f..2eec1b070 100644 --- a/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/PowerSystemStabilizerUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef PowerSystemStabilizerUserDefined_H #define PowerSystemStabilizerUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* function block whose dynamic behaviour is described by */ - class PowerSystemStabilizerUserDefined: public PowerSystemStabilizerDynamics + class PowerSystemStabilizerUserDefined : public PowerSystemStabilizerDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerSystemStabilizerUserDefined(); - virtual ~PowerSystemStabilizerUserDefined(); - + ~PowerSystemStabilizerUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerSystemStabilizerUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PowerTransformer.cpp b/CGMES_2.4.15_27JAN2020/PowerTransformer.cpp index 72e874b4e..1eda73bf1 100644 --- a/CGMES_2.4.15_27JAN2020/PowerTransformer.cpp +++ b/CGMES_2.4.15_27JAN2020/PowerTransformer.cpp @@ -1,7 +1,11 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerTransformer.hpp" +#include +#include + #include "PowerTransformerEnd.hpp" #include "CurrentFlow.hpp" #include "Voltage.hpp" @@ -13,112 +17,126 @@ using namespace CIMPP; PowerTransformer::PowerTransformer() {}; - PowerTransformer::~PowerTransformer() {}; -bool assign_PowerTransformer_PowerTransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->PowerTransformerEnd.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->beforeShCircuitHighestOperatingCurrent; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_PowerTransformer_beforeShCircuitHighestOperatingVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->beforeShCircuitHighestOperatingVoltage; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_beforeShortCircuitAnglePf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->beforeShortCircuitAnglePf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_highSideMinOperatingU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->highSideMinOperatingU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_isPartOfGeneratorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isPartOfGeneratorUnit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_operationalValuesConsidered(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operationalValuesConsidered; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} - - -bool assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->beforeShCircuitHighestOperatingCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PowerTransformerEnd_PowerTransformer(BaseClass*, BaseClass*); +bool assign_PowerTransformer_PowerTransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerTransformer* element = dynamic_cast(BaseClass_ptr1); + PowerTransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->PowerTransformerEnd.begin(), element->PowerTransformerEnd.end(), element2) == element->PowerTransformerEnd.end()) + { + element->PowerTransformerEnd.push_back(element2); + return assign_PowerTransformerEnd_PowerTransformer(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PowerTransformer_beforeShCircuitHighestOperatingVoltage(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->beforeShCircuitHighestOperatingVoltage; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_beforeShortCircuitAnglePf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->beforeShortCircuitAnglePf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_highSideMinOperatingU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->highSideMinOperatingU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_isPartOfGeneratorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isPartOfGeneratorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformer_operationalValuesConsidered(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operationalValuesConsidered; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PowerTransformer_factory() { - return new PowerTransformer; - } + +const char PowerTransformer::debugName[] = "PowerTransformer"; +const char* PowerTransformer::debugString() const +{ + return PowerTransformer::debugName; } -void PowerTransformer::addConstructToMap(std::unordered_map& factory_map) { +void PowerTransformer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerTransformer"), &PowerTransformer_factory)); } -void PowerTransformer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShCircuitHighestOperatingCurrent"), &assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent)); +void PowerTransformer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShCircuitHighestOperatingCurrent"), &assign_PowerTransformer_beforeShCircuitHighestOperatingCurrent)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShCircuitHighestOperatingVoltage"), &assign_PowerTransformer_beforeShCircuitHighestOperatingVoltage)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.beforeShortCircuitAnglePf"), &assign_PowerTransformer_beforeShortCircuitAnglePf)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.highSideMinOperatingU"), &assign_PowerTransformer_highSideMinOperatingU)); @@ -126,14 +144,9 @@ void PowerTransformer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.PowerTransformerEnd"), &assign_PowerTransformer_PowerTransformerEnd)); - } - -const char PowerTransformer::debugName[] = "PowerTransformer"; -const char* PowerTransformer::debugString() +void PowerTransformer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerTransformer::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerTransformer.PowerTransformerEnd"), &assign_PowerTransformer_PowerTransformerEnd)); } const BaseClassDefiner PowerTransformer::declare() @@ -141,4 +154,10 @@ const BaseClassDefiner PowerTransformer::declare() return BaseClassDefiner(PowerTransformer::addConstructToMap, PowerTransformer::addPrimitiveAssignFnsToMap, PowerTransformer::addClassAssignFnsToMap, PowerTransformer::debugName); } - +namespace CIMPP +{ + BaseClass* PowerTransformer_factory() + { + return new PowerTransformer; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PowerTransformer.hpp b/CGMES_2.4.15_27JAN2020/PowerTransformer.hpp index f42eff1d4..56bc0318e 100644 --- a/CGMES_2.4.15_27JAN2020/PowerTransformer.hpp +++ b/CGMES_2.4.15_27JAN2020/PowerTransformer.hpp @@ -1,48 +1,49 @@ #ifndef PowerTransformer_H #define PowerTransformer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "CurrentFlow.hpp" -#include "Voltage.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Boolean.hpp" +#include "CurrentFlow.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PowerTransformerEnd; -class PowerTransformerEnd; /* An electrical device consisting of two or more coupled windings, with or without a magnetic core, for introducing mutual coupling between electric circuits. Transformers can be used to control voltage and phase shift (active power flow). A power transformer may be composed of separate transformer tanks that need not be identical. A power transformer can be modeled with or without tanks and is intended for use in both balanced and unbalanced representations. A power transformer typically has two terminals, but may have one (grounding), three or more terminals. The inherited association ConductingEquipment.BaseVoltage should not be used. The association from TransformerEnd to BaseVoltage should be used instead. */ - class PowerTransformer: public ConductingEquipment + class PowerTransformer : public ConductingEquipment { - public: - std::list PowerTransformerEnd; /* The power transformer of this power transformer end. Default: 0 */ - CIMPP::CurrentFlow beforeShCircuitHighestOperatingCurrent; /* The highest operating current (Ib in the IEC 60909-0) before short circuit (depends on network configuration and relevant reliability philosophy). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. Default: nullptr */ - CIMPP::Voltage beforeShCircuitHighestOperatingVoltage; /* The highest operating voltage (Ub in the IEC 60909-0) before short circuit. It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is worst case voltage on the low side winding (Section 3.7.1 in the standard). Used to define operating conditions. Default: nullptr */ - CIMPP::AngleDegrees beforeShortCircuitAnglePf; /* The angle of power factor before short circuit (phib in the IEC 60909-0). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is the worst case power factor. Used to define operating conditions. Default: nullptr */ - CIMPP::Voltage highSideMinOperatingU; /* The minimum operating voltage (uQmin in the IEC 60909-0) at the high voltage side (Q side) of the unit transformer of the power station unit. A value well established from long-term operating experience of the system. It is used for calculation of the impedance correction factor KG defined in IEC 60909-0 Default: nullptr */ - CIMPP::Boolean isPartOfGeneratorUnit; /* Indicates whether the machine is part of a power station unit. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::Boolean operationalValuesConsidered; /* It is used to define if the data (other attributes related to short circuit data exchange) defines long term operational conditions or not. Used for short circuit data exchange according to IEC 60909. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerTransformer(); - virtual ~PowerTransformer(); - + ~PowerTransformer() override; + + std::list PowerTransformerEnd; /* The power transformer of this power transformer end. Default: 0 */ + CIMPP::CurrentFlow beforeShCircuitHighestOperatingCurrent; /* The highest operating current (Ib in the IEC 60909-0) before short circuit (depends on network configuration and relevant reliability philosophy). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. Default: nullptr */ + CIMPP::Voltage beforeShCircuitHighestOperatingVoltage; /* The highest operating voltage (Ub in the IEC 60909-0) before short circuit. It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is worst case voltage on the low side winding (Section 3.7.1 in the standard). Used to define operating conditions. Default: nullptr */ + CIMPP::AngleDegrees beforeShortCircuitAnglePf; /* The angle of power factor before short circuit (phib in the IEC 60909-0). It is used for calculation of the impedance correction factor KT defined in IEC 60909-0. This is the worst case power factor. Used to define operating conditions. Default: nullptr */ + CIMPP::Voltage highSideMinOperatingU; /* The minimum operating voltage (uQmin in the IEC 60909-0) at the high voltage side (Q side) of the unit transformer of the power station unit. A value well established from long-term operating experience of the system. It is used for calculation of the impedance correction factor KG defined in IEC 60909-0 Default: nullptr */ + CIMPP::Boolean isPartOfGeneratorUnit; /* Indicates whether the machine is part of a power station unit. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::Boolean operationalValuesConsidered; /* It is used to define if the data (other attributes related to short circuit data exchange) defines long term operational conditions or not. Used for short circuit data exchange according to IEC 60909. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerTransformer_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.cpp b/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.cpp index 038060939..e103ba044 100644 --- a/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.cpp +++ b/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.cpp @@ -1,42 +1,205 @@ -#include -#include "TransformerEnd.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PowerTransformerEnd.hpp" +#include +#include + #include "PowerTransformer.hpp" #include "Susceptance.hpp" +#include "Susceptance.hpp" #include "WindingConnection.hpp" -#include "ApparentPower.hpp" #include "Conductance.hpp" -#include "Voltage.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" -#include "Susceptance.hpp" -#include "Integer.hpp" #include "Conductance.hpp" +#include "Integer.hpp" +#include "Resistance.hpp" #include "Resistance.hpp" +#include "ApparentPower.hpp" +#include "Voltage.hpp" +#include "Reactance.hpp" #include "Reactance.hpp" using namespace CIMPP; -PowerTransformerEnd::PowerTransformerEnd(): PowerTransformer(nullptr) {}; - +PowerTransformerEnd::PowerTransformerEnd() : PowerTransformer(nullptr) {}; PowerTransformerEnd::~PowerTransformerEnd() {}; -bool assign_PowerTransformer_PowerTransformerEnd(BaseClass*, BaseClass*); -bool assign_PowerTransformerEnd_PowerTransformer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerTransformer = dynamic_cast(BaseClass_ptr2); - if(element->PowerTransformer != nullptr) - return assign_PowerTransformer_PowerTransformerEnd(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + +bool assign_PowerTransformerEnd_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_connectionKind(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->connectionKind; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_phaseAngleClock(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->phaseAngleClock; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_PowerTransformerEnd_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedS; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PowerTransformerEnd_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformerEnd_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformerEnd_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PowerTransformer_PowerTransformerEnd(BaseClass*, BaseClass*); +bool assign_PowerTransformerEnd_PowerTransformer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1); + PowerTransformer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerTransformer != element2) + { + element->PowerTransformer = element2; + return assign_PowerTransformer_PowerTransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} @@ -47,183 +210,39 @@ bool assign_PowerTransformerEnd_PowerTransformer(BaseClass* BaseClass_ptr1, Base -bool assign_PowerTransformerEnd_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformerEnd_connectionKind(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->connectionKind; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformerEnd_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedS; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PowerTransformerEnd_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_phaseAngleClock(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->phaseAngleClock; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_g0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PowerTransformerEnd_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PowerTransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PowerTransformerEnd_factory() { - return new PowerTransformerEnd; - } +const char PowerTransformerEnd::debugName[] = "PowerTransformerEnd"; +const char* PowerTransformerEnd::debugString() const +{ + return PowerTransformerEnd::debugName; } -void PowerTransformerEnd::addConstructToMap(std::unordered_map& factory_map) { +void PowerTransformerEnd::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd"), &PowerTransformerEnd_factory)); } -void PowerTransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b"), &assign_PowerTransformerEnd_b)); +void PowerTransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b"), &assign_PowerTransformerEnd_b)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b0"), &assign_PowerTransformerEnd_b0)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.connectionKind"), &assign_PowerTransformerEnd_connectionKind)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedS"), &assign_PowerTransformerEnd_ratedS)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.g"), &assign_PowerTransformerEnd_g)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedU"), &assign_PowerTransformerEnd_ratedU)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.r"), &assign_PowerTransformerEnd_r)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.x"), &assign_PowerTransformerEnd_x)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.b0"), &assign_PowerTransformerEnd_b0)); - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.phaseAngleClock"), &assign_PowerTransformerEnd_phaseAngleClock)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.g0"), &assign_PowerTransformerEnd_g0)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.phaseAngleClock"), &assign_PowerTransformerEnd_phaseAngleClock)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.r"), &assign_PowerTransformerEnd_r)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.r0"), &assign_PowerTransformerEnd_r0)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedS"), &assign_PowerTransformerEnd_ratedS)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.ratedU"), &assign_PowerTransformerEnd_ratedU)); + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.x"), &assign_PowerTransformerEnd_x)); assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.x0"), &assign_PowerTransformerEnd_x0)); } -void PowerTransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.PowerTransformer"), &assign_PowerTransformerEnd_PowerTransformer)); - } - -const char PowerTransformerEnd::debugName[] = "PowerTransformerEnd"; -const char* PowerTransformerEnd::debugString() +void PowerTransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PowerTransformerEnd::debugName; + assign_map.insert(std::make_pair(std::string("cim:PowerTransformerEnd.PowerTransformer"), &assign_PowerTransformerEnd_PowerTransformer)); } const BaseClassDefiner PowerTransformerEnd::declare() @@ -231,4 +250,10 @@ const BaseClassDefiner PowerTransformerEnd::declare() return BaseClassDefiner(PowerTransformerEnd::addConstructToMap, PowerTransformerEnd::addPrimitiveAssignFnsToMap, PowerTransformerEnd::addClassAssignFnsToMap, PowerTransformerEnd::debugName); } - +namespace CIMPP +{ + BaseClass* PowerTransformerEnd_factory() + { + return new PowerTransformerEnd; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.hpp b/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.hpp index c8539367f..916101b87 100644 --- a/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.hpp +++ b/CGMES_2.4.15_27JAN2020/PowerTransformerEnd.hpp @@ -1,58 +1,59 @@ #ifndef PowerTransformerEnd_H #define PowerTransformerEnd_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TransformerEnd.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Susceptance.hpp" -#include "WindingConnection.hpp" +#include "TransformerEnd.hpp" +#include "BaseClassDefiner.hpp" #include "ApparentPower.hpp" #include "Conductance.hpp" -#include "Voltage.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" #include "Integer.hpp" +#include "Reactance.hpp" +#include "Resistance.hpp" +#include "Susceptance.hpp" +#include "Voltage.hpp" +#include "WindingConnection.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class PowerTransformer; -class PowerTransformer; /* A PowerTransformerEnd is associated with each Terminal of a PowerTransformer. The impedance values r, r0, x, and x0 of a PowerTransformerEnd represents a star equivalent as follows 1) for a two Terminal PowerTransformer the high voltage PowerTransformerEnd has non zero values on r, r0, x, and x0 while the low voltage PowerTransformerEnd has zero values for r, r0, x, and x0. 2) for a three Terminal PowerTransformer the three PowerTransformerEnds represents a star equivalent with each leg in the star represented by r, r0, x, and x0 values. 3) for a PowerTransformer with more than three Terminals the PowerTransformerEnd impedance values cannot be used. Instead use the TransformerMeshImpedance or split the transformer into multiple PowerTransformers. */ - class PowerTransformerEnd: public TransformerEnd + class PowerTransformerEnd : public TransformerEnd { - public: - CIMPP::PowerTransformer* PowerTransformer; /* The ends of this power transformer. Default: 0 */ - CIMPP::Susceptance b; /* Magnetizing branch susceptance (B mag). The value can be positive or negative. Default: nullptr */ - CIMPP::WindingConnection connectionKind; /* Kind of connection. Default: 0 */ - CIMPP::ApparentPower ratedS; /* Normal apparent power rating. The attribute shall be a positive value. For a two-winding transformer the values for the high and low voltage sides shall be identical. Default: nullptr */ - CIMPP::Conductance g; /* Magnetizing branch conductance. Default: nullptr */ - CIMPP::Voltage ratedU; /* Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. A high voltage side, as given by TransformerEnd.endNumber, shall have a ratedU that is greater or equal than ratedU for the lower voltage sides. Default: nullptr */ - CIMPP::Resistance r; /* Resistance (star-model) of the transformer end. The attribute shall be equal or greater than zero for non-equivalent transformers. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence series reactance (star-model) of the transformer end. Default: nullptr */ - CIMPP::Susceptance b0; /* Zero sequence magnetizing branch susceptance. Default: nullptr */ - CIMPP::Integer phaseAngleClock; /* Terminal voltage phase angle displacement where 360 degrees are represented with clock hours. The valid values are 0 to 11. For example, for the secondary side end of a transformer with vector group code of `Dyn11`, specify the connection kind as wye with neutral and specify the phase angle of the clock as 11. The clock value of the transformer end number specified as 1, is assumed to be zero. Note the transformer end number is not assumed to be the same as the terminal sequence number. Default: 0 */ - CIMPP::Conductance g0; /* Zero sequence magnetizing branch conductance (star-model). Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence series resistance (star-model) of the transformer end. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence series reactance of the transformer end. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PowerTransformerEnd(); - virtual ~PowerTransformerEnd(); - + ~PowerTransformerEnd() override; + + CIMPP::PowerTransformer* PowerTransformer; /* The ends of this power transformer. Default: 0 */ + CIMPP::Susceptance b; /* Magnetizing branch susceptance (B mag). The value can be positive or negative. Default: nullptr */ + CIMPP::Susceptance b0; /* Zero sequence magnetizing branch susceptance. Default: nullptr */ + CIMPP::WindingConnection connectionKind; /* Kind of connection. Default: 0 */ + CIMPP::Conductance g; /* Magnetizing branch conductance. Default: nullptr */ + CIMPP::Conductance g0; /* Zero sequence magnetizing branch conductance (star-model). Default: nullptr */ + CIMPP::Integer phaseAngleClock; /* Terminal voltage phase angle displacement where 360 degrees are represented with clock hours. The valid values are 0 to 11. For example, for the secondary side end of a transformer with vector group code of `Dyn11`, specify the connection kind as wye with neutral and specify the phase angle of the clock as 11. The clock value of the transformer end number specified as 1, is assumed to be zero. Note the transformer end number is not assumed to be the same as the terminal sequence number. Default: 0 */ + CIMPP::Resistance r; /* Resistance (star-model) of the transformer end. The attribute shall be equal or greater than zero for non-equivalent transformers. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence series resistance (star-model) of the transformer end. Default: nullptr */ + CIMPP::ApparentPower ratedS; /* Normal apparent power rating. The attribute shall be a positive value. For a two-winding transformer the values for the high and low voltage sides shall be identical. Default: nullptr */ + CIMPP::Voltage ratedU; /* Rated voltage: phase-phase for three-phase windings, and either phase-phase or phase-neutral for single-phase windings. A high voltage side, as given by TransformerEnd.endNumber, shall have a ratedU that is greater or equal than ratedU for the lower voltage sides. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence series reactance (star-model) of the transformer end. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence series reactance of the transformer end. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PowerTransformerEnd_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.cpp b/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.cpp index 889206f83..26aa16fbd 100644 --- a/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.cpp @@ -1,330 +1,460 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ProprietaryParameterDynamics.hpp" -#include "WindPlantUserDefined.hpp" -#include "WindType1or2UserDefined.hpp" -#include "WindType3or4UserDefined.hpp" -#include "SynchronousMachineUserDefined.hpp" +#include +#include + #include "AsynchronousMachineUserDefined.hpp" -#include "TurbineGovernorUserDefined.hpp" -#include "TurbineLoadControllerUserDefined.hpp" -#include "MechanicalLoadUserDefined.hpp" +#include "DiscontinuousExcitationControlUserDefined.hpp" #include "ExcitationSystemUserDefined.hpp" +#include "LoadUserDefined.hpp" +#include "MechanicalLoadUserDefined.hpp" #include "OverexcitationLimiterUserDefined.hpp" -#include "UnderexcitationLimiterUserDefined.hpp" -#include "PowerSystemStabilizerUserDefined.hpp" -#include "DiscontinuousExcitationControlUserDefined.hpp" #include "PFVArControllerType1UserDefined.hpp" -#include "VoltageAdjusterUserDefined.hpp" #include "PFVArControllerType2UserDefined.hpp" +#include "PowerSystemStabilizerUserDefined.hpp" +#include "SynchronousMachineUserDefined.hpp" +#include "TurbineGovernorUserDefined.hpp" +#include "TurbineLoadControllerUserDefined.hpp" +#include "UnderexcitationLimiterUserDefined.hpp" +#include "VoltageAdjusterUserDefined.hpp" #include "VoltageCompensatorUserDefined.hpp" -#include "LoadUserDefined.hpp" -#include "Integer.hpp" +#include "WindPlantUserDefined.hpp" +#include "WindType1or2UserDefined.hpp" +#include "WindType3or4UserDefined.hpp" #include "Boolean.hpp" -#include "Integer.hpp" #include "Simple_Float.hpp" +#include "Integer.hpp" +#include "Integer.hpp" using namespace CIMPP; -ProprietaryParameterDynamics::ProprietaryParameterDynamics(): WindPlantUserDefined(nullptr), WindType1or2UserDefined(nullptr), WindType3or4UserDefined(nullptr), SynchronousMachineUserDefined(nullptr), AsynchronousMachineUserDefined(nullptr), TurbineGovernorUserDefined(nullptr), TurbineLoadControllerUserDefined(nullptr), MechanicalLoadUserDefined(nullptr), ExcitationSystemUserDefined(nullptr), OverexcitationLimiterUserDefined(nullptr), UnderexcitationLimiterUserDefined(nullptr), PowerSystemStabilizerUserDefined(nullptr), DiscontinuousExcitationControlUserDefined(nullptr), PFVArControllerType1UserDefined(nullptr), VoltageAdjusterUserDefined(nullptr), PFVArControllerType2UserDefined(nullptr), VoltageCompensatorUserDefined(nullptr), LoadUserDefined(nullptr) {}; - +ProprietaryParameterDynamics::ProprietaryParameterDynamics() : AsynchronousMachineUserDefined(nullptr), DiscontinuousExcitationControlUserDefined(nullptr), ExcitationSystemUserDefined(nullptr), LoadUserDefined(nullptr), MechanicalLoadUserDefined(nullptr), OverexcitationLimiterUserDefined(nullptr), PFVArControllerType1UserDefined(nullptr), PFVArControllerType2UserDefined(nullptr), PowerSystemStabilizerUserDefined(nullptr), SynchronousMachineUserDefined(nullptr), TurbineGovernorUserDefined(nullptr), TurbineLoadControllerUserDefined(nullptr), UnderexcitationLimiterUserDefined(nullptr), VoltageAdjusterUserDefined(nullptr), VoltageCompensatorUserDefined(nullptr), WindPlantUserDefined(nullptr), WindType1or2UserDefined(nullptr), WindType3or4UserDefined(nullptr) {}; ProprietaryParameterDynamics::~ProprietaryParameterDynamics() {}; -bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantUserDefined != nullptr) - return assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + + + + + + + + + + + + + + + + + + +bool assign_ProprietaryParameterDynamics_booleanParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->booleanParameterValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindType1or2UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->WindType1or2UserDefined != nullptr) - return assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_floatParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->floatParameterValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindType3or4UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->WindType3or4UserDefined != nullptr) - return assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_integerParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->integerParameterValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineUserDefined != nullptr) - return assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_parameterNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->parameterNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; } + bool assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineUserDefined != nullptr) - return assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineUserDefined != element2) + { + element->AsynchronousMachineUserDefined = element2; + return assign_AsynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineGovernorUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->TurbineGovernorUserDefined != nullptr) - return assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + DiscontinuousExcitationControlUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscontinuousExcitationControlUserDefined != element2) + { + element->DiscontinuousExcitationControlUserDefined = element2; + return assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineLoadControllerUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->TurbineLoadControllerUserDefined != nullptr) - return assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemUserDefined != element2) + { + element->ExcitationSystemUserDefined = element2; + return assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->MechanicalLoadUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->MechanicalLoadUserDefined != nullptr) - return assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + LoadUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadUserDefined != element2) + { + element->LoadUserDefined = element2; + return assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemUserDefined != nullptr) - return assign_ExcitationSystemUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + MechanicalLoadUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MechanicalLoadUserDefined != element2) + { + element->MechanicalLoadUserDefined = element2; + return assign_MechanicalLoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->OverexcitationLimiterUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->OverexcitationLimiterUserDefined != nullptr) - return assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + OverexcitationLimiterUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->OverexcitationLimiterUserDefined != element2) + { + element->OverexcitationLimiterUserDefined = element2; + return assign_OverexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->UnderexcitationLimiterUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->UnderexcitationLimiterUserDefined != nullptr) - return assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1UserDefined != element2) + { + element->PFVArControllerType1UserDefined = element2; + return assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemStabilizerUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemStabilizerUserDefined != nullptr) - return assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType2UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType2UserDefined != element2) + { + element->PFVArControllerType2UserDefined = element2; + return assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscontinuousExcitationControlUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->DiscontinuousExcitationControlUserDefined != nullptr) - return assign_DiscontinuousExcitationControlUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + PowerSystemStabilizerUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemStabilizerUserDefined != element2) + { + element->PowerSystemStabilizerUserDefined = element2; + return assign_PowerSystemStabilizerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1UserDefined != nullptr) - return assign_PFVArControllerType1UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineUserDefined != element2) + { + element->SynchronousMachineUserDefined = element2; + return assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageAdjusterUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->VoltageAdjusterUserDefined != nullptr) - return assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineGovernorUserDefined != element2) + { + element->TurbineGovernorUserDefined = element2; + return assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType2UserDefined = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType2UserDefined != nullptr) - return assign_PFVArControllerType2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineLoadControllerUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineLoadControllerUserDefined != element2) + { + element->TurbineLoadControllerUserDefined = element2; + return assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageCompensatorUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->VoltageCompensatorUserDefined != nullptr) - return assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + UnderexcitationLimiterUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->UnderexcitationLimiterUserDefined != element2) + { + element->UnderexcitationLimiterUserDefined = element2; + return assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); -bool assign_ProprietaryParameterDynamics_LoadUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadUserDefined = dynamic_cast(BaseClass_ptr2); - if(element->LoadUserDefined != nullptr) - return assign_LoadUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageAdjusterUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageAdjusterUserDefined != element2) + { + element->VoltageAdjusterUserDefined = element2; + return assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - - - - - - - - - - - - - - - - - - - - -bool assign_ProprietaryParameterDynamics_parameterNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->parameterNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + VoltageCompensatorUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageCompensatorUserDefined != element2) + { + element->VoltageCompensatorUserDefined = element2; + return assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ProprietaryParameterDynamics_booleanParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->booleanParameterValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + WindPlantUserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantUserDefined != element2) + { + element->WindPlantUserDefined = element2; + return assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ProprietaryParameterDynamics_integerParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->integerParameterValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + WindType1or2UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindType1or2UserDefined != element2) + { + element->WindType1or2UserDefined = element2; + return assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ProprietaryParameterDynamics_floatParameterValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->floatParameterValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass*, BaseClass*); +bool assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ProprietaryParameterDynamics* element = dynamic_cast(BaseClass_ptr1); + WindType3or4UserDefined* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindType3or4UserDefined != element2) + { + element->WindType3or4UserDefined = element2; + return assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ProprietaryParameterDynamics_factory() { - return new ProprietaryParameterDynamics; - } + + + + +const char ProprietaryParameterDynamics::debugName[] = "ProprietaryParameterDynamics"; +const char* ProprietaryParameterDynamics::debugString() const +{ + return ProprietaryParameterDynamics::debugName; } -void ProprietaryParameterDynamics::addConstructToMap(std::unordered_map& factory_map) { +void ProprietaryParameterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics"), &ProprietaryParameterDynamics_factory)); } -void ProprietaryParameterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.parameterNumber"), &assign_ProprietaryParameterDynamics_parameterNumber)); +void ProprietaryParameterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.booleanParameterValue"), &assign_ProprietaryParameterDynamics_booleanParameterValue)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.integerParameterValue"), &assign_ProprietaryParameterDynamics_integerParameterValue)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.floatParameterValue"), &assign_ProprietaryParameterDynamics_floatParameterValue)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.integerParameterValue"), &assign_ProprietaryParameterDynamics_integerParameterValue)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.parameterNumber"), &assign_ProprietaryParameterDynamics_parameterNumber)); } -void ProprietaryParameterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindPlantUserDefined"), &assign_ProprietaryParameterDynamics_WindPlantUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType1or2UserDefined"), &assign_ProprietaryParameterDynamics_WindType1or2UserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType3or4UserDefined"), &assign_ProprietaryParameterDynamics_WindType3or4UserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.SynchronousMachineUserDefined"), &assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined)); +void ProprietaryParameterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.AsynchronousMachineUserDefined"), &assign_ProprietaryParameterDynamics_AsynchronousMachineUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineGovernorUserDefined"), &assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineLoadControllerUserDefined"), &assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.MechanicalLoadUserDefined"), &assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.DiscontinuousExcitationControlUserDefined"), &assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.ExcitationSystemUserDefined"), &assign_ProprietaryParameterDynamics_ExcitationSystemUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.LoadUserDefined"), &assign_ProprietaryParameterDynamics_LoadUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.MechanicalLoadUserDefined"), &assign_ProprietaryParameterDynamics_MechanicalLoadUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.OverexcitationLimiterUserDefined"), &assign_ProprietaryParameterDynamics_OverexcitationLimiterUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.UnderexcitationLimiterUserDefined"), &assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PowerSystemStabilizerUserDefined"), &assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.DiscontinuousExcitationControlUserDefined"), &assign_ProprietaryParameterDynamics_DiscontinuousExcitationControlUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PFVArControllerType1UserDefined"), &assign_ProprietaryParameterDynamics_PFVArControllerType1UserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.VoltageAdjusterUserDefined"), &assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PFVArControllerType2UserDefined"), &assign_ProprietaryParameterDynamics_PFVArControllerType2UserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.PowerSystemStabilizerUserDefined"), &assign_ProprietaryParameterDynamics_PowerSystemStabilizerUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.SynchronousMachineUserDefined"), &assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineGovernorUserDefined"), &assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.TurbineLoadControllerUserDefined"), &assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.UnderexcitationLimiterUserDefined"), &assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.VoltageAdjusterUserDefined"), &assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined)); assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.VoltageCompensatorUserDefined"), &assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined)); - assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.LoadUserDefined"), &assign_ProprietaryParameterDynamics_LoadUserDefined)); - } - -const char ProprietaryParameterDynamics::debugName[] = "ProprietaryParameterDynamics"; -const char* ProprietaryParameterDynamics::debugString() -{ - return ProprietaryParameterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindPlantUserDefined"), &assign_ProprietaryParameterDynamics_WindPlantUserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType1or2UserDefined"), &assign_ProprietaryParameterDynamics_WindType1or2UserDefined)); + assign_map.insert(std::make_pair(std::string("cim:ProprietaryParameterDynamics.WindType3or4UserDefined"), &assign_ProprietaryParameterDynamics_WindType3or4UserDefined)); } const BaseClassDefiner ProprietaryParameterDynamics::declare() @@ -332,4 +462,10 @@ const BaseClassDefiner ProprietaryParameterDynamics::declare() return BaseClassDefiner(ProprietaryParameterDynamics::addConstructToMap, ProprietaryParameterDynamics::addPrimitiveAssignFnsToMap, ProprietaryParameterDynamics::addClassAssignFnsToMap, ProprietaryParameterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* ProprietaryParameterDynamics_factory() + { + return new ProprietaryParameterDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.hpp b/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.hpp index 74d1117d2..658832137 100644 --- a/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/ProprietaryParameterDynamics.hpp @@ -1,79 +1,80 @@ #ifndef ProprietaryParameterDynamics_H #define ProprietaryParameterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class AsynchronousMachineUserDefined; + class DiscontinuousExcitationControlUserDefined; + class ExcitationSystemUserDefined; + class LoadUserDefined; + class MechanicalLoadUserDefined; + class OverexcitationLimiterUserDefined; + class PFVArControllerType1UserDefined; + class PFVArControllerType2UserDefined; + class PowerSystemStabilizerUserDefined; + class SynchronousMachineUserDefined; + class TurbineGovernorUserDefined; + class TurbineLoadControllerUserDefined; + class UnderexcitationLimiterUserDefined; + class VoltageAdjusterUserDefined; + class VoltageCompensatorUserDefined; + class WindPlantUserDefined; + class WindType1or2UserDefined; + class WindType3or4UserDefined; -class WindPlantUserDefined; -class WindType1or2UserDefined; -class WindType3or4UserDefined; -class SynchronousMachineUserDefined; -class AsynchronousMachineUserDefined; -class TurbineGovernorUserDefined; -class TurbineLoadControllerUserDefined; -class MechanicalLoadUserDefined; -class ExcitationSystemUserDefined; -class OverexcitationLimiterUserDefined; -class UnderexcitationLimiterUserDefined; -class PowerSystemStabilizerUserDefined; -class DiscontinuousExcitationControlUserDefined; -class PFVArControllerType1UserDefined; -class VoltageAdjusterUserDefined; -class PFVArControllerType2UserDefined; -class VoltageCompensatorUserDefined; -class LoadUserDefined; /* Supports definition of one or more parameters of several different datatypes for use by proprietary user-defined models. NOTE: This class does not inherit from IdentifiedObject since it is not intended that a single instance of it be referenced by more than one proprietary user-defined model instance. */ - class ProprietaryParameterDynamics: public BaseClass + class ProprietaryParameterDynamics : public BaseClass { - public: - CIMPP::WindPlantUserDefined* WindPlantUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::WindType1or2UserDefined* WindType1or2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::WindType3or4UserDefined* WindType3or4UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::SynchronousMachineUserDefined* SynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::AsynchronousMachineUserDefined* AsynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::TurbineGovernorUserDefined* TurbineGovernorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::TurbineLoadControllerUserDefined* TurbineLoadControllerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::MechanicalLoadUserDefined* MechanicalLoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::ExcitationSystemUserDefined* ExcitationSystemUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::OverexcitationLimiterUserDefined* OverexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::UnderexcitationLimiterUserDefined* UnderexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::PowerSystemStabilizerUserDefined* PowerSystemStabilizerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::DiscontinuousExcitationControlUserDefined* DiscontinuousExcitationControlUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::PFVArControllerType1UserDefined* PFVArControllerType1UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::VoltageAdjusterUserDefined* VoltageAdjusterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::PFVArControllerType2UserDefined* PFVArControllerType2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::VoltageCompensatorUserDefined* VoltageCompensatorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::LoadUserDefined* LoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ - CIMPP::Integer parameterNumber; /* Sequence number of the parameter among the set of parameters associated with the related proprietary user-defined model. Default: 0 */ - CIMPP::Boolean booleanParameterValue; /* Used for boolean parameter value. If this attribute is populated, integerParameterValue and floatParameterValue will not be. Default: false */ - CIMPP::Integer integerParameterValue; /* Used for integer parameter value. If this attribute is populated, booleanParameterValue and floatParameterValue will not be. Default: 0 */ - CIMPP::Simple_Float floatParameterValue; /* Used for floating point parameter value. If this attribute is populated, booleanParameterValue and integerParameterValue will not be. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ProprietaryParameterDynamics(); - virtual ~ProprietaryParameterDynamics(); - + ~ProprietaryParameterDynamics() override; + + CIMPP::AsynchronousMachineUserDefined* AsynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::DiscontinuousExcitationControlUserDefined* DiscontinuousExcitationControlUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::ExcitationSystemUserDefined* ExcitationSystemUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::LoadUserDefined* LoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::MechanicalLoadUserDefined* MechanicalLoadUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::OverexcitationLimiterUserDefined* OverexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::PFVArControllerType1UserDefined* PFVArControllerType1UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::PFVArControllerType2UserDefined* PFVArControllerType2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::PowerSystemStabilizerUserDefined* PowerSystemStabilizerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::SynchronousMachineUserDefined* SynchronousMachineUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::TurbineGovernorUserDefined* TurbineGovernorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::TurbineLoadControllerUserDefined* TurbineLoadControllerUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::UnderexcitationLimiterUserDefined* UnderexcitationLimiterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::VoltageAdjusterUserDefined* VoltageAdjusterUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::VoltageCompensatorUserDefined* VoltageCompensatorUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::WindPlantUserDefined* WindPlantUserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::WindType1or2UserDefined* WindType1or2UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::WindType3or4UserDefined* WindType3or4UserDefined; /* Proprietary user-defined model with which this parameter is associated. Default: 0 */ + CIMPP::Boolean booleanParameterValue; /* Used for boolean parameter value. If this attribute is populated, integerParameterValue and floatParameterValue will not be. Default: false */ + CIMPP::Simple_Float floatParameterValue; /* Used for floating point parameter value. If this attribute is populated, booleanParameterValue and integerParameterValue will not be. Default: nullptr */ + CIMPP::Integer integerParameterValue; /* Used for integer parameter value. If this attribute is populated, booleanParameterValue and floatParameterValue will not be. Default: 0 */ + CIMPP::Integer parameterNumber; /* Sequence number of the parameter among the set of parameters associated with the related proprietary user-defined model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ProprietaryParameterDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ProtectedSwitch.cpp b/CGMES_2.4.15_27JAN2020/ProtectedSwitch.cpp index c7616980f..f95614e29 100644 --- a/CGMES_2.4.15_27JAN2020/ProtectedSwitch.cpp +++ b/CGMES_2.4.15_27JAN2020/ProtectedSwitch.cpp @@ -1,36 +1,36 @@ -#include -#include "Switch.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ProtectedSwitch.hpp" +#include +#include + using namespace CIMPP; ProtectedSwitch::ProtectedSwitch() {}; - ProtectedSwitch::~ProtectedSwitch() {}; -namespace CIMPP { - BaseClass* ProtectedSwitch_factory() { - return new ProtectedSwitch; - } +const char ProtectedSwitch::debugName[] = "ProtectedSwitch"; +const char* ProtectedSwitch::debugString() const +{ + return ProtectedSwitch::debugName; } -void ProtectedSwitch::addConstructToMap(std::unordered_map& factory_map) { +void ProtectedSwitch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ProtectedSwitch"), &ProtectedSwitch_factory)); } -void ProtectedSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void ProtectedSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void ProtectedSwitch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ProtectedSwitch::debugName[] = "ProtectedSwitch"; -const char* ProtectedSwitch::debugString() +void ProtectedSwitch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ProtectedSwitch::debugName; } const BaseClassDefiner ProtectedSwitch::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner ProtectedSwitch::declare() return BaseClassDefiner(ProtectedSwitch::addConstructToMap, ProtectedSwitch::addPrimitiveAssignFnsToMap, ProtectedSwitch::addClassAssignFnsToMap, ProtectedSwitch::debugName); } - +namespace CIMPP +{ + BaseClass* ProtectedSwitch_factory() + { + return new ProtectedSwitch; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ProtectedSwitch.hpp b/CGMES_2.4.15_27JAN2020/ProtectedSwitch.hpp index 0c869db06..8d2eaa266 100644 --- a/CGMES_2.4.15_27JAN2020/ProtectedSwitch.hpp +++ b/CGMES_2.4.15_27JAN2020/ProtectedSwitch.hpp @@ -1,36 +1,37 @@ #ifndef ProtectedSwitch_H #define ProtectedSwitch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Switch.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Switch.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A ProtectedSwitch is a switching device that can be operated by ProtectionEquipment. */ - class ProtectedSwitch: public Switch + class ProtectedSwitch : public Switch { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ProtectedSwitch(); - virtual ~ProtectedSwitch(); - + ~ProtectedSwitch() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ProtectedSwitch_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Pss1.cpp b/CGMES_2.4.15_27JAN2020/Pss1.cpp index 408478378..fa673e0a4 100644 --- a/CGMES_2.4.15_27JAN2020/Pss1.cpp +++ b/CGMES_2.4.15_27JAN2020/Pss1.cpp @@ -1,14 +1,16 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss1.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "PU.hpp" #include "Simple_Float.hpp" #include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -17,245 +19,258 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Boolean.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; Pss1::Pss1() {}; - Pss1::~Pss1() {}; +bool assign_Pss1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_kw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadat; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss1_kw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadat; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss1_factory() { - return new Pss1; - } +const char Pss1::debugName[] = "Pss1"; +const char* Pss1::debugString() const +{ + return Pss1::debugName; } -void Pss1::addConstructToMap(std::unordered_map& factory_map) { +void Pss1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss1"), &Pss1_factory)); } -void Pss1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Pss1.kw"), &assign_Pss1_kw)); +void Pss1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Pss1.kf"), &assign_Pss1_kf)); assign_map.insert(std::make_pair(std::string("cim:Pss1.kpe"), &assign_Pss1_kpe)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.pmin"), &assign_Pss1_pmin)); assign_map.insert(std::make_pair(std::string("cim:Pss1.ks"), &assign_Pss1_ks)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmn"), &assign_Pss1_vsmn)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmx"), &assign_Pss1_vsmx)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.tpe"), &assign_Pss1_tpe)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.kw"), &assign_Pss1_kw)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.pmin"), &assign_Pss1_pmin)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.t10"), &assign_Pss1_t10)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t5"), &assign_Pss1_t5)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t6"), &assign_Pss1_t6)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t7"), &assign_Pss1_t7)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t8"), &assign_Pss1_t8)); assign_map.insert(std::make_pair(std::string("cim:Pss1.t9"), &assign_Pss1_t9)); - assign_map.insert(std::make_pair(std::string("cim:Pss1.t10"), &assign_Pss1_t10)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.tpe"), &assign_Pss1_tpe)); assign_map.insert(std::make_pair(std::string("cim:Pss1.vadat"), &assign_Pss1_vadat)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmn"), &assign_Pss1_vsmn)); + assign_map.insert(std::make_pair(std::string("cim:Pss1.vsmx"), &assign_Pss1_vsmx)); } -void Pss1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss1::debugName[] = "Pss1"; -const char* Pss1::debugString() +void Pss1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss1::debugName; } const BaseClassDefiner Pss1::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner Pss1::declare() return BaseClassDefiner(Pss1::addConstructToMap, Pss1::addPrimitiveAssignFnsToMap, Pss1::addClassAssignFnsToMap, Pss1::debugName); } - +namespace CIMPP +{ + BaseClass* Pss1_factory() + { + return new Pss1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Pss1.hpp b/CGMES_2.4.15_27JAN2020/Pss1.hpp index 4d9ffbe22..a9ee1a7a2 100644 --- a/CGMES_2.4.15_27JAN2020/Pss1.hpp +++ b/CGMES_2.4.15_27JAN2020/Pss1.hpp @@ -1,55 +1,56 @@ #ifndef Pss1_H #define Pss1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +#include "Simple_Float.hpp" +namespace CIMPP +{ /* Italian PSS - three input PSS (speed, frequency, power). */ - class Pss1: public PowerSystemStabilizerDynamics + class Pss1 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Simple_Float kw; /* Shaft speed power input gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::Simple_Float kf; /* Frequency power input gain (K). Typical Value = 5. Default: nullptr */ - CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU pmin; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ - CIMPP::Simple_Float ks; /* PSS gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.06. Default: nullptr */ - CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.06. Default: nullptr */ - CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds t5; /* Washout (T). Typical Value = 3.5. Default: nullptr */ - CIMPP::Seconds t6; /* Filter time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t8; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t9; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t10; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean vadat; /* Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss1(); - virtual ~Pss1(); - + ~Pss1() override; + + CIMPP::Simple_Float kf; /* Frequency power input gain (K). Typical Value = 5. Default: nullptr */ + CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float ks; /* PSS gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::Simple_Float kw; /* Shaft speed power input gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU pmin; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ + CIMPP::Seconds t10; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t5; /* Washout (T). Typical Value = 3.5. Default: nullptr */ + CIMPP::Seconds t6; /* Filter time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t7; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t8; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t9; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Boolean vadat; /* Default: false */ + CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.06. Default: nullptr */ + CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.06. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Pss1A.cpp b/CGMES_2.4.15_27JAN2020/Pss1A.cpp index b78db3b02..ee79e3569 100644 --- a/CGMES_2.4.15_27JAN2020/Pss1A.cpp +++ b/CGMES_2.4.15_27JAN2020/Pss1A.cpp @@ -1,366 +1,388 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss1A.hpp" -#include "InputSignalKind.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "InputSignalKind.hpp" +#include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" -#include "Seconds.hpp" using namespace CIMPP; Pss1A::Pss1A() {}; - Pss1A::~Pss1A() {}; +bool assign_Pss1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignalType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_tdelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdelay; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignalType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_kd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss1A_tdelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdelay; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss1A_factory() { - return new Pss1A; - } +const char Pss1A::debugName[] = "Pss1A"; +const char* Pss1A::debugString() const +{ + return Pss1A::debugName; } -void Pss1A::addConstructToMap(std::unordered_map& factory_map) { +void Pss1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss1A"), &Pss1A_factory)); } -void Pss1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Pss1A.inputSignalType"), &assign_Pss1A_inputSignalType)); +void Pss1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Pss1A.a1"), &assign_Pss1A_a1)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a2"), &assign_Pss1A_a2)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t1"), &assign_Pss1A_t1)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t2"), &assign_Pss1A_t2)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t3"), &assign_Pss1A_t3)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t4"), &assign_Pss1A_t4)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t5"), &assign_Pss1A_t5)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.t6"), &assign_Pss1A_t6)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.ks"), &assign_Pss1A_ks)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmax"), &assign_Pss1A_vrmax)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmin"), &assign_Pss1A_vrmin)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcu"), &assign_Pss1A_vcu)); - assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcl"), &assign_Pss1A_vcl)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a3"), &assign_Pss1A_a3)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a4"), &assign_Pss1A_a4)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a5"), &assign_Pss1A_a5)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a6"), &assign_Pss1A_a6)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a7"), &assign_Pss1A_a7)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.a8"), &assign_Pss1A_a8)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.inputSignalType"), &assign_Pss1A_inputSignalType)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.kd"), &assign_Pss1A_kd)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.ks"), &assign_Pss1A_ks)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t1"), &assign_Pss1A_t1)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t2"), &assign_Pss1A_t2)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t3"), &assign_Pss1A_t3)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t4"), &assign_Pss1A_t4)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t5"), &assign_Pss1A_t5)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.t6"), &assign_Pss1A_t6)); assign_map.insert(std::make_pair(std::string("cim:Pss1A.tdelay"), &assign_Pss1A_tdelay)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcl"), &assign_Pss1A_vcl)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vcu"), &assign_Pss1A_vcu)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmax"), &assign_Pss1A_vrmax)); + assign_map.insert(std::make_pair(std::string("cim:Pss1A.vrmin"), &assign_Pss1A_vrmin)); } -void Pss1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss1A::debugName[] = "Pss1A"; -const char* Pss1A::debugString() +void Pss1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss1A::debugName; } const BaseClassDefiner Pss1A::declare() @@ -368,4 +390,10 @@ const BaseClassDefiner Pss1A::declare() return BaseClassDefiner(Pss1A::addConstructToMap, Pss1A::addPrimitiveAssignFnsToMap, Pss1A::addClassAssignFnsToMap, Pss1A::debugName); } - +namespace CIMPP +{ + BaseClass* Pss1A_factory() + { + return new Pss1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Pss1A.hpp b/CGMES_2.4.15_27JAN2020/Pss1A.hpp index 39477bd6b..721f252b4 100644 --- a/CGMES_2.4.15_27JAN2020/Pss1A.hpp +++ b/CGMES_2.4.15_27JAN2020/Pss1A.hpp @@ -1,62 +1,63 @@ #ifndef Pss1A_H #define Pss1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* Single input power system stabilizer. It is a modified version in order to allow representation of various vendors' implementations on PSS type 1A. */ - class Pss1A: public PowerSystemStabilizerDynamics + class Pss1A : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Default: 0 */ - CIMPP::PU a1; /* Notch filter parameter (A1). Default: nullptr */ - CIMPP::PU a2; /* Notch filter parameter (A2). Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Default: nullptr */ - CIMPP::Seconds t5; /* Washout time constant (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Transducer time constant (T6). Default: nullptr */ - CIMPP::PU ks; /* Stabilizer gain (Ks). Default: nullptr */ - CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Default: nullptr */ - CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Default: nullptr */ - CIMPP::PU vcu; /* Stabilizer input cutoff threshold (Vcu). Default: nullptr */ - CIMPP::PU vcl; /* Stabilizer input cutoff threshold (Vcl). Default: nullptr */ - CIMPP::PU a3; /* Notch filter parameter (A3). Default: nullptr */ - CIMPP::PU a4; /* Notch filter parameter (A4). Default: nullptr */ - CIMPP::PU a5; /* Notch filter parameter (A5). Default: nullptr */ - CIMPP::PU a6; /* Notch filter parameter (A6). Default: nullptr */ - CIMPP::PU a7; /* Notch filter parameter (A7). Default: nullptr */ - CIMPP::PU a8; /* Notch filter parameter (A8). Default: nullptr */ - CIMPP::Boolean kd; /* Selector (Kd). true = e used false = e not used. Default: false */ - CIMPP::Seconds tdelay; /* Time constant (Tdelay). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss1A(); - virtual ~Pss1A(); - + ~Pss1A() override; + + CIMPP::PU a1; /* Notch filter parameter (A1). Default: nullptr */ + CIMPP::PU a2; /* Notch filter parameter (A2). Default: nullptr */ + CIMPP::PU a3; /* Notch filter parameter (A3). Default: nullptr */ + CIMPP::PU a4; /* Notch filter parameter (A4). Default: nullptr */ + CIMPP::PU a5; /* Notch filter parameter (A5). Default: nullptr */ + CIMPP::PU a6; /* Notch filter parameter (A6). Default: nullptr */ + CIMPP::PU a7; /* Notch filter parameter (A7). Default: nullptr */ + CIMPP::PU a8; /* Notch filter parameter (A8). Default: nullptr */ + CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Default: 0 */ + CIMPP::Boolean kd; /* Selector (Kd). true = e used false = e not used. Default: false */ + CIMPP::PU ks; /* Stabilizer gain (Ks). Default: nullptr */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Washout time constant (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Transducer time constant (T6). Default: nullptr */ + CIMPP::Seconds tdelay; /* Time constant (Tdelay). Default: nullptr */ + CIMPP::PU vcl; /* Stabilizer input cutoff threshold (Vcl). Default: nullptr */ + CIMPP::PU vcu; /* Stabilizer input cutoff threshold (Vcu). Default: nullptr */ + CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Default: nullptr */ + CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Pss2B.cpp b/CGMES_2.4.15_27JAN2020/Pss2B.cpp index 9716156c5..33695f70a 100644 --- a/CGMES_2.4.15_27JAN2020/Pss2B.cpp +++ b/CGMES_2.4.15_27JAN2020/Pss2B.cpp @@ -1,15 +1,24 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss2B.hpp" +#include +#include + +#include "Simple_Float.hpp" #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Integer.hpp" +#include "Integer.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -26,447 +35,475 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Integer.hpp" -#include "Integer.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; Pss2B::Pss2B() {}; - Pss2B::~Pss2B() {}; +bool assign_Pss2B_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ks4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->n; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ks4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->n; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_a(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Pss2B_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* Pss2B_factory() { - return new Pss2B; - } + + + + + + + + + + + + + + + + + + + + + + + + + +const char Pss2B::debugName[] = "Pss2B"; +const char* Pss2B::debugString() const +{ + return Pss2B::debugName; } -void Pss2B::addConstructToMap(std::unordered_map& factory_map) { +void Pss2B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss2B"), &Pss2B_factory)); } -void Pss2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Pss2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Pss2B.a"), &assign_Pss2B_a)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.inputSignal1Type"), &assign_Pss2B_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.inputSignal2Type"), &assign_Pss2B_inputSignal2Type)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi1max"), &assign_Pss2B_vsi1max)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi1min"), &assign_Pss2B_vsi1min)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw1"), &assign_Pss2B_tw1)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw2"), &assign_Pss2B_tw2)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi2max"), &assign_Pss2B_vsi2max)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.vsi2min"), &assign_Pss2B_vsi2min)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw3"), &assign_Pss2B_tw3)); - assign_map.insert(std::make_pair(std::string("cim:Pss2B.tw4"), &assign_Pss2B_tw4)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks1"), &assign_Pss2B_ks1)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks2"), &assign_Pss2B_ks2)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks3"), &assign_Pss2B_ks3)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.ks4"), &assign_Pss2B_ks4)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.m"), &assign_Pss2B_m)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.n"), &assign_Pss2B_n)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t1"), &assign_Pss2B_t1)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.t10"), &assign_Pss2B_t10)); + assign_map.insert(std::make_pair(std::string("cim:Pss2B.t11"), &assign_Pss2B_t11)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t2"), &assign_Pss2B_t2)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t3"), &assign_Pss2B_t3)); assign_map.insert(std::make_pair(std::string("cim:Pss2B.t4"), &assign_Pss2B_t4)); @@ -474,28 +511,22 @@ void Pss2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss2B::debugName[] = "Pss2B"; -const char* Pss2B::debugString() +void Pss2B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss2B::debugName; } const BaseClassDefiner Pss2B::declare() @@ -503,4 +534,10 @@ const BaseClassDefiner Pss2B::declare() return BaseClassDefiner(Pss2B::addConstructToMap, Pss2B::addPrimitiveAssignFnsToMap, Pss2B::addClassAssignFnsToMap, Pss2B::debugName); } - +namespace CIMPP +{ + BaseClass* Pss2B_factory() + { + return new Pss2B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Pss2B.hpp b/CGMES_2.4.15_27JAN2020/Pss2B.hpp index af58a81df..f2ee1801e 100644 --- a/CGMES_2.4.15_27JAN2020/Pss2B.hpp +++ b/CGMES_2.4.15_27JAN2020/Pss2B.hpp @@ -1,72 +1,73 @@ #ifndef Pss2B_H #define Pss2B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" +#include "Integer.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Modified IEEE PSS2B Model. Extra lead/lag (or rate) block added at end (up to 4 lead/lags total). */ - class Pss2B: public PowerSystemStabilizerDynamics + class Pss2B : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ - CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks4; /* Gain on signal #2 input after ramp-tracking filter (Ks4). Typical Value = 1. Default: nullptr */ - CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ - CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ - CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ - CIMPP::Simple_Float a; /* Numerator constant (a). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ta; /* Lead constant (Ta). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tb; /* Lag time constant (Tb). Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss2B(); - virtual ~Pss2B(); - + ~Pss2B() override; + + CIMPP::Simple_Float a; /* Numerator constant (a). Typical Value = 1. Default: nullptr */ + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ + CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks4; /* Gain on signal #2 input after ramp-tracking filter (Ks4). Typical Value = 1. Default: nullptr */ + CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ + CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ + CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ta; /* Lead constant (Ta). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tb; /* Lag time constant (Tb). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ + CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss2B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Pss2ST.cpp b/CGMES_2.4.15_27JAN2020/Pss2ST.cpp index 27a8ff8a0..b29e480e2 100644 --- a/CGMES_2.4.15_27JAN2020/Pss2ST.cpp +++ b/CGMES_2.4.15_27JAN2020/Pss2ST.cpp @@ -1,11 +1,17 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss2ST.hpp" +#include +#include + #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -18,267 +24,287 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; Pss2ST::Pss2ST() {}; - Pss2ST::~Pss2ST() {}; +bool assign_Pss2ST_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_lsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_lsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss2ST_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss2ST* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss2ST_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_lsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_lsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss2ST_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss2ST* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss2ST_factory() { - return new Pss2ST; - } +const char Pss2ST::debugName[] = "Pss2ST"; +const char* Pss2ST::debugString() const +{ + return Pss2ST::debugName; } -void Pss2ST::addConstructToMap(std::unordered_map& factory_map) { +void Pss2ST::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss2ST"), &Pss2ST_factory)); } -void Pss2ST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Pss2ST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Pss2ST.inputSignal1Type"), &assign_Pss2ST_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.inputSignal2Type"), &assign_Pss2ST_inputSignal2Type)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.k1"), &assign_Pss2ST_k1)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.k2"), &assign_Pss2ST_k2)); + assign_map.insert(std::make_pair(std::string("cim:Pss2ST.lsmax"), &assign_Pss2ST_lsmax)); + assign_map.insert(std::make_pair(std::string("cim:Pss2ST.lsmin"), &assign_Pss2ST_lsmin)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t1"), &assign_Pss2ST_t1)); + assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t10"), &assign_Pss2ST_t10)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t2"), &assign_Pss2ST_t2)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t3"), &assign_Pss2ST_t3)); assign_map.insert(std::make_pair(std::string("cim:Pss2ST.t4"), &assign_Pss2ST_t4)); @@ -287,20 +313,12 @@ void Pss2ST::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss2ST::debugName[] = "Pss2ST"; -const char* Pss2ST::debugString() +void Pss2ST::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss2ST::debugName; } const BaseClassDefiner Pss2ST::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner Pss2ST::declare() return BaseClassDefiner(Pss2ST::addConstructToMap, Pss2ST::addPrimitiveAssignFnsToMap, Pss2ST::addClassAssignFnsToMap, Pss2ST::debugName); } - +namespace CIMPP +{ + BaseClass* Pss2ST_factory() + { + return new Pss2ST; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Pss2ST.hpp b/CGMES_2.4.15_27JAN2020/Pss2ST.hpp index 3ac8add11..56559ab5b 100644 --- a/CGMES_2.4.15_27JAN2020/Pss2ST.hpp +++ b/CGMES_2.4.15_27JAN2020/Pss2ST.hpp @@ -1,57 +1,58 @@ #ifndef Pss2ST_H #define Pss2ST_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PTI Microprocessor-Based Stabilizer type 1. */ - class Pss2ST: public PowerSystemStabilizerDynamics + class Pss2ST : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::PU k1; /* Gain (K1). Default: nullptr */ - CIMPP::PU k2; /* Gain (K2). Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T1). Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T2). Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T3). Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T4). Default: nullptr */ - CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ - CIMPP::Seconds t7; /* Time constant (T7). Default: nullptr */ - CIMPP::Seconds t8; /* Time constant (T8). Default: nullptr */ - CIMPP::Seconds t9; /* Time constant (T9). Default: nullptr */ - CIMPP::Seconds t10; /* Time constant (T10). Default: nullptr */ - CIMPP::PU lsmax; /* Limiter (Lsmax). Default: nullptr */ - CIMPP::PU lsmin; /* Limiter (Lsmin). Default: nullptr */ - CIMPP::PU vcu; /* Cutoff limiter (Vcu). Default: nullptr */ - CIMPP::PU vcl; /* Cutoff limiter (Vcl). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss2ST(); - virtual ~Pss2ST(); - + ~Pss2ST() override; + + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::PU k1; /* Gain (K1). Default: nullptr */ + CIMPP::PU k2; /* Gain (K2). Default: nullptr */ + CIMPP::PU lsmax; /* Limiter (Lsmax). Default: nullptr */ + CIMPP::PU lsmin; /* Limiter (Lsmin). Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T1). Default: nullptr */ + CIMPP::Seconds t10; /* Time constant (T10). Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T2). Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T3). Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T4). Default: nullptr */ + CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ + CIMPP::Seconds t7; /* Time constant (T7). Default: nullptr */ + CIMPP::Seconds t8; /* Time constant (T8). Default: nullptr */ + CIMPP::Seconds t9; /* Time constant (T9). Default: nullptr */ + CIMPP::PU vcl; /* Cutoff limiter (Vcl). Default: nullptr */ + CIMPP::PU vcu; /* Cutoff limiter (Vcu). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss2ST_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Pss5.cpp b/CGMES_2.4.15_27JAN2020/Pss5.cpp index 455cfab8e..370b2014f 100644 --- a/CGMES_2.4.15_27JAN2020/Pss5.cpp +++ b/CGMES_2.4.15_27JAN2020/Pss5.cpp @@ -1,291 +1,308 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Pss5.hpp" +#include +#include + +#include "Boolean.hpp" +#include "PU.hpp" +#include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -#include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" using namespace CIMPP; Pss5::Pss5() {}; - Pss5::~Pss5() {}; +bool assign_Pss5_ctw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ctw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_deadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->deadband; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_isfreq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isfreq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_kpss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_pmm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadat; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Pss5_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Pss5* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Pss5_kpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_kf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_isfreq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isfreq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_kpss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_ctw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ctw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_vsmn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_vsmx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_pmm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_deadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->deadband; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Pss5_vadat(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Pss5* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadat; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Pss5_factory() { - return new Pss5; - } +const char Pss5::debugName[] = "Pss5"; +const char* Pss5::debugString() const +{ + return Pss5::debugName; } -void Pss5::addConstructToMap(std::unordered_map& factory_map) { +void Pss5::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Pss5"), &Pss5_factory)); } -void Pss5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Pss5.kpe"), &assign_Pss5_kpe)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.kf"), &assign_Pss5_kf)); +void Pss5::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Pss5.ctw2"), &assign_Pss5_ctw2)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.deadband"), &assign_Pss5_deadband)); assign_map.insert(std::make_pair(std::string("cim:Pss5.isfreq"), &assign_Pss5_isfreq)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.kf"), &assign_Pss5_kf)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.kpe"), &assign_Pss5_kpe)); assign_map.insert(std::make_pair(std::string("cim:Pss5.kpss"), &assign_Pss5_kpss)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.ctw2"), &assign_Pss5_ctw2)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.tw1"), &assign_Pss5_tw1)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.tw2"), &assign_Pss5_tw2)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.pmm"), &assign_Pss5_pmm)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl1"), &assign_Pss5_tl1)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl2"), &assign_Pss5_tl2)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl3"), &assign_Pss5_tl3)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tl4"), &assign_Pss5_tl4)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmn"), &assign_Pss5_vsmn)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmx"), &assign_Pss5_vsmx)); assign_map.insert(std::make_pair(std::string("cim:Pss5.tpe"), &assign_Pss5_tpe)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.pmm"), &assign_Pss5_pmm)); - assign_map.insert(std::make_pair(std::string("cim:Pss5.deadband"), &assign_Pss5_deadband)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.tw1"), &assign_Pss5_tw1)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.tw2"), &assign_Pss5_tw2)); assign_map.insert(std::make_pair(std::string("cim:Pss5.vadat"), &assign_Pss5_vadat)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmn"), &assign_Pss5_vsmn)); + assign_map.insert(std::make_pair(std::string("cim:Pss5.vsmx"), &assign_Pss5_vsmx)); } -void Pss5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Pss5::debugName[] = "Pss5"; -const char* Pss5::debugString() +void Pss5::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Pss5::debugName; } const BaseClassDefiner Pss5::declare() @@ -293,4 +310,10 @@ const BaseClassDefiner Pss5::declare() return BaseClassDefiner(Pss5::addConstructToMap, Pss5::addPrimitiveAssignFnsToMap, Pss5::addClassAssignFnsToMap, Pss5::debugName); } - +namespace CIMPP +{ + BaseClass* Pss5_factory() + { + return new Pss5; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Pss5.hpp b/CGMES_2.4.15_27JAN2020/Pss5.hpp index 4c792ad77..e5bd96947 100644 --- a/CGMES_2.4.15_27JAN2020/Pss5.hpp +++ b/CGMES_2.4.15_27JAN2020/Pss5.hpp @@ -1,57 +1,58 @@ #ifndef Pss5_H #define Pss5_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Italian PSS - Detailed PSS. */ - class Pss5: public PowerSystemStabilizerDynamics + class Pss5 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ - CIMPP::Simple_Float kf; /* Frequency/shaft speed input gain (K). Typical Value = 5. Default: nullptr */ - CIMPP::Boolean isfreq; /* Selector for Frequency/shaft speed input (IsFreq). true = speed false = frequency. Typical Value = true. Default: false */ - CIMPP::Simple_Float kpss; /* PSS gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::Boolean ctw2; /* Selector for Second washout enabling (C). true = second washout filter is bypassed false = second washout filter in use. Typical Value = true. Default: false */ - CIMPP::Seconds tw1; /* First WashOut (T). Typical Value = 3.5. Default: nullptr */ - CIMPP::Seconds tw2; /* Second WashOut (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl1; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl2; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl3; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl4; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.1. Default: nullptr */ - CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU pmm; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU deadband; /* Stabilizer output dead band (DeadBand). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean vadat; /* Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Pss5(); - virtual ~Pss5(); - + ~Pss5() override; + + CIMPP::Boolean ctw2; /* Selector for Second washout enabling (C). true = second washout filter is bypassed false = second washout filter in use. Typical Value = true. Default: false */ + CIMPP::PU deadband; /* Stabilizer output dead band (DeadBand). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean isfreq; /* Selector for Frequency/shaft speed input (IsFreq). true = speed false = frequency. Typical Value = true. Default: false */ + CIMPP::Simple_Float kf; /* Frequency/shaft speed input gain (K). Typical Value = 5. Default: nullptr */ + CIMPP::Simple_Float kpe; /* Electric power input gain (K). Typical Value = 0.3. Default: nullptr */ + CIMPP::Simple_Float kpss; /* PSS gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU pmm; /* Minimum power PSS enabling (P). Typical Value = 0.25. Default: nullptr */ + CIMPP::Seconds tl1; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl2; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl3; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl4; /* Lead/lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tpe; /* Electric power filter time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tw1; /* First WashOut (T). Typical Value = 3.5. Default: nullptr */ + CIMPP::Seconds tw2; /* Second WashOut (T). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean vadat; /* Default: false */ + CIMPP::PU vsmn; /* Stabilizer output max limit (V). Typical Value = -0.1. Default: nullptr */ + CIMPP::PU vsmx; /* Stabilizer output min limit (V). Typical Value = 0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Pss5_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssELIN2.cpp b/CGMES_2.4.15_27JAN2020/PssELIN2.cpp index 703f07db6..0aa111da9 100644 --- a/CGMES_2.4.15_27JAN2020/PssELIN2.cpp +++ b/CGMES_2.4.15_27JAN2020/PssELIN2.cpp @@ -1,201 +1,212 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssELIN2.hpp" +#include +#include + +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; PssELIN2::PssELIN2() {}; - PssELIN2::~PssELIN2() {}; +bool assign_PssELIN2_apss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->apss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ppss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ppss; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_psslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->psslim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssELIN2_ts6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssELIN2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ts6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssELIN2_ts1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssELIN2_ts2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssELIN2_ts3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ts4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ts5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ts6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ts6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_ppss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ppss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_apss(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->apss; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssELIN2_psslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssELIN2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->psslim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssELIN2_factory() { - return new PssELIN2; - } + + + + + + + + + +const char PssELIN2::debugName[] = "PssELIN2"; +const char* PssELIN2::debugString() const +{ + return PssELIN2::debugName; } -void PssELIN2::addConstructToMap(std::unordered_map& factory_map) { +void PssELIN2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssELIN2"), &PssELIN2_factory)); } -void PssELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssELIN2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.apss"), &assign_PssELIN2_apss)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks1"), &assign_PssELIN2_ks1)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks2"), &assign_PssELIN2_ks2)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ppss"), &assign_PssELIN2_ppss)); + assign_map.insert(std::make_pair(std::string("cim:PssELIN2.psslim"), &assign_PssELIN2_psslim)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts1"), &assign_PssELIN2_ts1)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts2"), &assign_PssELIN2_ts2)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts3"), &assign_PssELIN2_ts3)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts4"), &assign_PssELIN2_ts4)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts5"), &assign_PssELIN2_ts5)); assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ts6"), &assign_PssELIN2_ts6)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks1"), &assign_PssELIN2_ks1)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ks2"), &assign_PssELIN2_ks2)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.ppss"), &assign_PssELIN2_ppss)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.apss"), &assign_PssELIN2_apss)); - assign_map.insert(std::make_pair(std::string("cim:PssELIN2.psslim"), &assign_PssELIN2_psslim)); } -void PssELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssELIN2::debugName[] = "PssELIN2"; -const char* PssELIN2::debugString() +void PssELIN2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssELIN2::debugName; } const BaseClassDefiner PssELIN2::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssELIN2::declare() return BaseClassDefiner(PssELIN2::addConstructToMap, PssELIN2::addPrimitiveAssignFnsToMap, PssELIN2::addClassAssignFnsToMap, PssELIN2::debugName); } - +namespace CIMPP +{ + BaseClass* PssELIN2_factory() + { + return new PssELIN2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssELIN2.hpp b/CGMES_2.4.15_27JAN2020/PssELIN2.hpp index ef2c9d869..7335abe02 100644 --- a/CGMES_2.4.15_27JAN2020/PssELIN2.hpp +++ b/CGMES_2.4.15_27JAN2020/PssELIN2.hpp @@ -1,49 +1,50 @@ #ifndef PssELIN2_H #define PssELIN2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Power system stabilizer typically associated with ExcELIN2 (though PssIEEE2B or Pss2B can also be used). */ - class PssELIN2: public PowerSystemStabilizerDynamics + class PssELIN2 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Seconds ts1; /* Time constant (Ts1). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ts2; /* Time constant (Ts2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ts3; /* Time constant (Ts3). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds ts4; /* Time constant (Ts4). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds ts5; /* Time constant (Ts5). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ts6; /* Time constant (Ts6). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks1; /* Gain (Ks1). Typical Value = 1. Default: nullptr */ - CIMPP::PU ks2; /* Gain (Ks2). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU ppss; /* Coefficient (p_PSS) (>=0 and <=4). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU apss; /* Coefficient (a_PSS). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU psslim; /* PSS limiter (psslim). Typical Value = 0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssELIN2(); - virtual ~PssELIN2(); - + ~PssELIN2() override; + + CIMPP::PU apss; /* Coefficient (a_PSS). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ks1; /* Gain (Ks1). Typical Value = 1. Default: nullptr */ + CIMPP::PU ks2; /* Gain (Ks2). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU ppss; /* Coefficient (p_PSS) (>=0 and <=4). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU psslim; /* PSS limiter (psslim). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ts1; /* Time constant (Ts1). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ts2; /* Time constant (Ts2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ts3; /* Time constant (Ts3). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds ts4; /* Time constant (Ts4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds ts5; /* Time constant (Ts5). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ts6; /* Time constant (Ts6). Typical Value = 1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssELIN2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE1A.cpp b/CGMES_2.4.15_27JAN2020/PssIEEE1A.cpp index ae260b910..7613a5c13 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE1A.cpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE1A.cpp @@ -1,9 +1,14 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE1A.hpp" -#include "InputSignalKind.hpp" +#include +#include + +#include "PU.hpp" #include "PU.hpp" +#include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -13,204 +18,211 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "PU.hpp" using namespace CIMPP; PssIEEE1A::PssIEEE1A() {}; - PssIEEE1A::~PssIEEE1A() {}; +bool assign_PssIEEE1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignalType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vrmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE1A_inputSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignalType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE1A_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE1A_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE1A_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_vrmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE1A_vrmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE1A* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vrmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssIEEE1A_factory() { - return new PssIEEE1A; - } + + + + + + + + + +const char PssIEEE1A::debugName[] = "PssIEEE1A"; +const char* PssIEEE1A::debugString() const +{ + return PssIEEE1A::debugName; } -void PssIEEE1A::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE1A::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE1A"), &PssIEEE1A_factory)); } -void PssIEEE1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.inputSignalType"), &assign_PssIEEE1A_inputSignalType)); +void PssIEEE1A::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.a1"), &assign_PssIEEE1A_a1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.a2"), &assign_PssIEEE1A_a2)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.inputSignalType"), &assign_PssIEEE1A_inputSignalType)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.ks"), &assign_PssIEEE1A_ks)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t1"), &assign_PssIEEE1A_t1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t2"), &assign_PssIEEE1A_t2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t3"), &assign_PssIEEE1A_t3)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t4"), &assign_PssIEEE1A_t4)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t5"), &assign_PssIEEE1A_t5)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.t6"), &assign_PssIEEE1A_t6)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.ks"), &assign_PssIEEE1A_ks)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.vrmax"), &assign_PssIEEE1A_vrmax)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE1A.vrmin"), &assign_PssIEEE1A_vrmin)); } -void PssIEEE1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE1A::debugName[] = "PssIEEE1A"; -const char* PssIEEE1A::debugString() +void PssIEEE1A::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE1A::debugName; } const BaseClassDefiner PssIEEE1A::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner PssIEEE1A::declare() return BaseClassDefiner(PssIEEE1A::addConstructToMap, PssIEEE1A::addPrimitiveAssignFnsToMap, PssIEEE1A::addClassAssignFnsToMap, PssIEEE1A::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE1A_factory() + { + return new PssIEEE1A; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE1A.hpp b/CGMES_2.4.15_27JAN2020/PssIEEE1A.hpp index b25b525b7..0d4b1471d 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE1A.hpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE1A.hpp @@ -1,51 +1,52 @@ #ifndef PssIEEE1A_H #define PssIEEE1A_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS1A power system stabilizer model. PSS1A is the generalized form of a PSS with a single input. Some common stabilizer input signals are speed, frequency, and power. Reference: IEEE 1A 421.5-2005 Section 8.1. */ - class PssIEEE1A: public PowerSystemStabilizerDynamics + class PssIEEE1A : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ - CIMPP::PU a1; /* PSS signal conditioning frequency filter constant (A1). Typical Value = 0.061. Default: nullptr */ - CIMPP::PU a2; /* PSS signal conditioning frequency filter constant (A2). Typical Value = 0.0017. Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds t5; /* Washout time constant (T5). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds t6; /* Transducer time constant (T6). Typical Value = 0.01. Default: nullptr */ - CIMPP::PU ks; /* Stabilizer gain (Ks). Typical Value = 5. Default: nullptr */ - CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Typical Value = -0.05. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE1A(); - virtual ~PssIEEE1A(); - + ~PssIEEE1A() override; + + CIMPP::PU a1; /* PSS signal conditioning frequency filter constant (A1). Typical Value = 0.061. Default: nullptr */ + CIMPP::PU a2; /* PSS signal conditioning frequency filter constant (A2). Typical Value = 0.0017. Default: nullptr */ + CIMPP::InputSignalKind inputSignalType; /* Type of input signal. Typical Value = rotorAngularFrequencyDeviation. Default: 0 */ + CIMPP::PU ks; /* Stabilizer gain (Ks). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds t5; /* Washout time constant (T5). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds t6; /* Transducer time constant (T6). Typical Value = 0.01. Default: nullptr */ + CIMPP::PU vrmax; /* Maximum stabilizer output (Vrmax). Typical Value = 0.05. Default: nullptr */ + CIMPP::PU vrmin; /* Minimum stabilizer output (Vrmin). Typical Value = -0.05. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE1A_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE2B.cpp b/CGMES_2.4.15_27JAN2020/PssIEEE2B.cpp index dc56df282..c896be757 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE2B.cpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE2B.cpp @@ -1,15 +1,20 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE2B.hpp" +#include +#include + #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "Integer.hpp" +#include "Integer.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -25,392 +30,418 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Integer.hpp" -#include "Integer.hpp" +#include "PU.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; PssIEEE2B::PssIEEE2B() {}; - PssIEEE2B::~PssIEEE2B() {}; +bool assign_PssIEEE2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->n; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi1min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2max; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsi2min; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE2B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_vsi1max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_vsi1min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi1min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE2B_vsi2max(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2max; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_vsi2min(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsi2min; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_tw4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_t11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_ks3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_n(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->n; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE2B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE2B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssIEEE2B_factory() { - return new PssIEEE2B; - } + + + + + + + + + + + + + + + + + + + + + +const char PssIEEE2B::debugName[] = "PssIEEE2B"; +const char* PssIEEE2B::debugString() const +{ + return PssIEEE2B::debugName; } -void PssIEEE2B::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE2B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE2B"), &PssIEEE2B_factory)); } -void PssIEEE2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssIEEE2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.inputSignal1Type"), &assign_PssIEEE2B_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.inputSignal2Type"), &assign_PssIEEE2B_inputSignal2Type)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi1max"), &assign_PssIEEE2B_vsi1max)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi1min"), &assign_PssIEEE2B_vsi1min)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw1"), &assign_PssIEEE2B_tw1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw2"), &assign_PssIEEE2B_tw2)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi2max"), &assign_PssIEEE2B_vsi2max)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.vsi2min"), &assign_PssIEEE2B_vsi2min)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw3"), &assign_PssIEEE2B_tw3)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.tw4"), &assign_PssIEEE2B_tw4)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.ks1"), &assign_PssIEEE2B_ks1)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.ks2"), &assign_PssIEEE2B_ks2)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.ks3"), &assign_PssIEEE2B_ks3)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.m"), &assign_PssIEEE2B_m)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.n"), &assign_PssIEEE2B_n)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t1"), &assign_PssIEEE2B_t1)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t10"), &assign_PssIEEE2B_t10)); + assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t11"), &assign_PssIEEE2B_t11)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t2"), &assign_PssIEEE2B_t2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t3"), &assign_PssIEEE2B_t3)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE2B.t4"), &assign_PssIEEE2B_t4)); @@ -418,24 +449,20 @@ void PssIEEE2B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE2B::debugName[] = "PssIEEE2B"; -const char* PssIEEE2B::debugString() +void PssIEEE2B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE2B::debugName; } const BaseClassDefiner PssIEEE2B::declare() @@ -443,4 +470,10 @@ const BaseClassDefiner PssIEEE2B::declare() return BaseClassDefiner(PssIEEE2B::addConstructToMap, PssIEEE2B::addPrimitiveAssignFnsToMap, PssIEEE2B::addClassAssignFnsToMap, PssIEEE2B::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE2B_factory() + { + return new PssIEEE2B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE2B.hpp b/CGMES_2.4.15_27JAN2020/PssIEEE2B.hpp index 7cdf57c4e..d08edd8fe 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE2B.hpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE2B.hpp @@ -1,67 +1,68 @@ #ifndef PssIEEE2B_H #define PssIEEE2B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" +#include "Integer.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS2B power system stabilizer model. This stabilizer model is designed to represent a variety of dual-input stabilizers, which normally use combinations of power and speed or frequency to derive the stabilizing signal. Reference: IEEE 2B 421.5-2005 Section 8.2. */ - class PssIEEE2B: public PowerSystemStabilizerDynamics + class PssIEEE2B : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ - CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ - CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ - CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ - CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ - CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ - CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ - CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ - CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ - CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE2B(); - virtual ~PssIEEE2B(); - + ~PssIEEE2B() override; + + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = rotorSpeed. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::PU ks1; /* Stabilizer gain (Ks1). Typical Value = 12. Default: nullptr */ + CIMPP::PU ks2; /* Gain on signal #2 (Ks2). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU ks3; /* Gain on signal #2 input before ramp-tracking filter (Ks3). Typical Value = 1. Default: nullptr */ + CIMPP::Integer m; /* Denominator order of ramp tracking filter (M). Typical Value = 5. Default: 0 */ + CIMPP::Integer n; /* Order of ramp tracking filter (N). Typical Value = 1. Default: 0 */ + CIMPP::Seconds t1; /* Lead/lag time constant (T1). Typical Value = 0.12. Default: nullptr */ + CIMPP::Seconds t10; /* Lead/lag time constant (T10). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t11; /* Lead/lag time constant (T11). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t2; /* Lead/lag time constant (T2). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t3; /* Lead/lag time constant (T3). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t4; /* Lead/lag time constant (T4). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t6; /* Time constant on signal #1 (T6). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds t7; /* Time constant on signal #2 (T7). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds t8; /* Lead of ramp tracking filter (T8). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t9; /* Lag of ramp tracking filter (T9). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds tw1; /* First washout on signal #1 (Tw1). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw2; /* Second washout on signal #1 (Tw2). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw3; /* First washout on signal #2 (Tw3). Typical Value = 2. Default: nullptr */ + CIMPP::Seconds tw4; /* Second washout on signal #2 (Tw4). Typical Value = 0. Default: nullptr */ + CIMPP::PU vsi1max; /* Input signal #1 max limit (Vsi1max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi1min; /* Input signal #1 min limit (Vsi1min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vsi2max; /* Input signal #2 max limit (Vsi2max). Typical Value = 2. Default: nullptr */ + CIMPP::PU vsi2min; /* Input signal #2 min limit (Vsi2min). Typical Value = -2. Default: nullptr */ + CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE2B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE3B.cpp b/CGMES_2.4.15_27JAN2020/PssIEEE3B.cpp index 905f9274c..30e610d2a 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE3B.cpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE3B.cpp @@ -1,14 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE3B.hpp" -#include "InputSignalKind.hpp" -#include "InputSignalKind.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,286 +14,304 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "InputSignalKind.hpp" +#include "InputSignalKind.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; PssIEEE3B::PssIEEE3B() {}; - PssIEEE3B::~PssIEEE3B() {}; +bool assign_PssIEEE3B_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tw3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE3B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE3B_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_tw1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_tw2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_tw3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tw3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_ks1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_ks2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_a8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE3B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE3B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PssIEEE3B_factory() { - return new PssIEEE3B; - } +const char PssIEEE3B::debugName[] = "PssIEEE3B"; +const char* PssIEEE3B::debugString() const +{ + return PssIEEE3B::debugName; } -void PssIEEE3B::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE3B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE3B"), &PssIEEE3B_factory)); } -void PssIEEE3B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.inputSignal1Type"), &assign_PssIEEE3B_inputSignal1Type)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.inputSignal2Type"), &assign_PssIEEE3B_inputSignal2Type)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.t1"), &assign_PssIEEE3B_t1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.t2"), &assign_PssIEEE3B_t2)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.tw1"), &assign_PssIEEE3B_tw1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.tw2"), &assign_PssIEEE3B_tw2)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.tw3"), &assign_PssIEEE3B_tw3)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.ks1"), &assign_PssIEEE3B_ks1)); - assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.ks2"), &assign_PssIEEE3B_ks2)); +void PssIEEE3B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.a1"), &assign_PssIEEE3B_a1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.a2"), &assign_PssIEEE3B_a2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE3B.a3"), &assign_PssIEEE3B_a3)); @@ -305,17 +320,21 @@ void PssIEEE3B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE3B::debugName[] = "PssIEEE3B"; -const char* PssIEEE3B::debugString() +void PssIEEE3B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE3B::debugName; } const BaseClassDefiner PssIEEE3B::declare() @@ -323,4 +342,10 @@ const BaseClassDefiner PssIEEE3B::declare() return BaseClassDefiner(PssIEEE3B::addConstructToMap, PssIEEE3B::addPrimitiveAssignFnsToMap, PssIEEE3B::addClassAssignFnsToMap, PssIEEE3B::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE3B_factory() + { + return new PssIEEE3B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE3B.hpp b/CGMES_2.4.15_27JAN2020/PssIEEE3B.hpp index 7b8c2d367..80ca94ed5 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE3B.hpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE3B.hpp @@ -1,58 +1,59 @@ #ifndef PssIEEE3B_H #define PssIEEE3B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" -#include "Seconds.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS3B power system stabilizer model. The PSS model PSS3B has dual inputs of electrical power and rotor angular frequency deviation. The signals are used to derive an equivalent mechanical power signal. Reference: IEEE 3B 421.5-2005 Section 8.3. */ - class PssIEEE3B: public PowerSystemStabilizerDynamics + class PssIEEE3B : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = generatorElectricalPower. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = rotorSpeed. Default: 0 */ - CIMPP::Seconds t1; /* Transducer time constant (T1). Typical Value = 0.012. Default: nullptr */ - CIMPP::Seconds t2; /* Transducer time constant (T2). Typical Value = 0.012. Default: nullptr */ - CIMPP::Seconds tw1; /* Washout time constant (Tw1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tw2; /* Washout time constant (Tw2). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds tw3; /* Washout time constant (Tw3). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU ks1; /* Gain on signal # 1 (Ks1). Typical Value = -0.602. Default: nullptr */ - CIMPP::PU ks2; /* Gain on signal # 2 (Ks2). Typical Value = 30.12. Default: nullptr */ - CIMPP::PU a1; /* Notch filter parameter (A1). Typical Value = 0.359. Default: nullptr */ - CIMPP::PU a2; /* Notch filter parameter (A2). Typical Value = 0.586. Default: nullptr */ - CIMPP::PU a3; /* Notch filter parameter (A3). Typical Value = 0.429. Default: nullptr */ - CIMPP::PU a4; /* Notch filter parameter (A4). Typical Value = 0.564. Default: nullptr */ - CIMPP::PU a5; /* Notch filter parameter (A5). Typical Value = 0.001. Default: nullptr */ - CIMPP::PU a6; /* Notch filter parameter (A6). Typical Value = 0. Default: nullptr */ - CIMPP::PU a7; /* Notch filter parameter (A7). Typical Value = 0.031. Default: nullptr */ - CIMPP::PU a8; /* Notch filter parameter (A8). Typical Value = 0. Default: nullptr */ - CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE3B(); - virtual ~PssIEEE3B(); - + ~PssIEEE3B() override; + + CIMPP::PU a1; /* Notch filter parameter (A1). Typical Value = 0.359. Default: nullptr */ + CIMPP::PU a2; /* Notch filter parameter (A2). Typical Value = 0.586. Default: nullptr */ + CIMPP::PU a3; /* Notch filter parameter (A3). Typical Value = 0.429. Default: nullptr */ + CIMPP::PU a4; /* Notch filter parameter (A4). Typical Value = 0.564. Default: nullptr */ + CIMPP::PU a5; /* Notch filter parameter (A5). Typical Value = 0.001. Default: nullptr */ + CIMPP::PU a6; /* Notch filter parameter (A6). Typical Value = 0. Default: nullptr */ + CIMPP::PU a7; /* Notch filter parameter (A7). Typical Value = 0.031. Default: nullptr */ + CIMPP::PU a8; /* Notch filter parameter (A8). Typical Value = 0. Default: nullptr */ + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Typical Value = generatorElectricalPower. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Typical Value = rotorSpeed. Default: 0 */ + CIMPP::PU ks1; /* Gain on signal # 1 (Ks1). Typical Value = -0.602. Default: nullptr */ + CIMPP::PU ks2; /* Gain on signal # 2 (Ks2). Typical Value = 30.12. Default: nullptr */ + CIMPP::Seconds t1; /* Transducer time constant (T1). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds t2; /* Transducer time constant (T2). Typical Value = 0.012. Default: nullptr */ + CIMPP::Seconds tw1; /* Washout time constant (Tw1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tw2; /* Washout time constant (Tw2). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds tw3; /* Washout time constant (Tw3). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU vstmax; /* Stabilizer output max limit (Vstmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vstmin; /* Stabilizer output min limit (Vstmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE3B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE4B.cpp b/CGMES_2.4.15_27JAN2020/PssIEEE4B.cpp index b745b73d1..696becf72 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE4B.cpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE4B.cpp @@ -1,7 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssIEEE4B.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -73,893 +77,961 @@ using namespace CIMPP; PssIEEE4B::PssIEEE4B() {}; - PssIEEE4B::~PssIEEE4B() {}; +bool assign_PssIEEE4B_bwh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_bwh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwh2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_bwl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_bwl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->bwl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh17; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kh2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki17; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ki2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl17; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_kl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganh2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_omeganl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omeganl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_th9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->th9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_ti9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ti9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssIEEE4B_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssIEEE4B_tl10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl11; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl12; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssIEEE4B_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_tl9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tl9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vhmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vhmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vlmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vlmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vlmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssIEEE4B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vstmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssIEEE4B_bwh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_bwh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwh2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_bwl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_bwl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->bwl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_kh(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_kh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssIEEE4B_kh11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kh17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh17; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kh2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki17; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ki2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl17(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl17; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_kl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganh2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganh2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_omeganl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omeganl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_th9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->th9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_ti9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ti9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl11(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl11; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl12(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl12; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_tl9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tl9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vhmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vhmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vhmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vlmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vlmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vlmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vstmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssIEEE4B_vstmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssIEEE4B* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vstmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssIEEE4B_factory() { - return new PssIEEE4B; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char PssIEEE4B::debugName[] = "PssIEEE4B"; +const char* PssIEEE4B::debugString() const +{ + return PssIEEE4B::debugName; } -void PssIEEE4B::addConstructToMap(std::unordered_map& factory_map) { +void PssIEEE4B::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssIEEE4B"), &PssIEEE4B_factory)); } -void PssIEEE4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssIEEE4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssIEEE4B.bwh1"), &assign_PssIEEE4B_bwh1)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE4B.bwh2"), &assign_PssIEEE4B_bwh2)); assign_map.insert(std::make_pair(std::string("cim:PssIEEE4B.bwl1"), &assign_PssIEEE4B_bwl1)); @@ -1029,13 +1101,8 @@ void PssIEEE4B::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssIEEE4B::debugName[] = "PssIEEE4B"; -const char* PssIEEE4B::debugString() +void PssIEEE4B::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssIEEE4B::debugName; } const BaseClassDefiner PssIEEE4B::declare() @@ -1043,4 +1110,10 @@ const BaseClassDefiner PssIEEE4B::declare() return BaseClassDefiner(PssIEEE4B::addConstructToMap, PssIEEE4B::addPrimitiveAssignFnsToMap, PssIEEE4B::addClassAssignFnsToMap, PssIEEE4B::debugName); } - +namespace CIMPP +{ + BaseClass* PssIEEE4B_factory() + { + return new PssIEEE4B; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssIEEE4B.hpp b/CGMES_2.4.15_27JAN2020/PssIEEE4B.hpp index 76fc604fc..f72ebfc7e 100644 --- a/CGMES_2.4.15_27JAN2020/PssIEEE4B.hpp +++ b/CGMES_2.4.15_27JAN2020/PssIEEE4B.hpp @@ -1,106 +1,107 @@ #ifndef PssIEEE4B_H #define PssIEEE4B_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Std 421.5-2005 type PSS2B power system stabilizer model. The PSS4B model represents a structure based on multiple working frequency bands. Three separate bands, respectively dedicated to the low-, intermediate- and high-frequency modes of oscillations, are used in this delta-omega (speed input) PSS. Reference: IEEE 4B 421.5-2005 Section 8.4. */ - class PssIEEE4B: public PowerSystemStabilizerDynamics + class PssIEEE4B : public PowerSystemStabilizerDynamics { - public: - CIMPP::Simple_Float bwh1; /* Notch filter 1 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::Simple_Float bwh2; /* Notch filter 2 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::Simple_Float bwl1; /* Notch filter 1 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::Simple_Float bwl2; /* Notch filter 2 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ - CIMPP::PU kh; /* High band gain (K). Typical Value = 120. Default: nullptr */ - CIMPP::PU kh1; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU kh11; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh17; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kh2; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU ki; /* Intermediate band gain (K). Typical Value = 30. Default: nullptr */ - CIMPP::PU ki1; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU ki11; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ki17; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU ki2; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU kl; /* Low band gain (K). Typical Value = 7.5. Default: nullptr */ - CIMPP::PU kl1; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::PU kl11; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl17; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU kl2; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ - CIMPP::Simple_Float omeganh1; /* Notch filter 1 (high-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Simple_Float omeganh2; /* Notch filter 2 (high-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Simple_Float omeganl1; /* Notch filter 1 (low-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Simple_Float omeganl2; /* Notch filter 2 (low-frequency band): filter frequency (omega). Default: nullptr */ - CIMPP::Seconds th1; /* High band time constant (T). Typical Value = 0.01513. Default: nullptr */ - CIMPP::Seconds th10; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th11; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th12; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th2; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ - CIMPP::Seconds th3; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th4; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th5; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th6; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds th7; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ - CIMPP::Seconds th8; /* High band time constant (T). Typical Value = 0.02179. Default: nullptr */ - CIMPP::Seconds th9; /* High band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti1; /* Intermediate band time constant (T). Typical Value = 0.173. Default: nullptr */ - CIMPP::Seconds ti10; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti11; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti12; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti2; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ - CIMPP::Seconds ti3; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti4; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti5; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti6; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds ti7; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ - CIMPP::Seconds ti8; /* Intermediate band time constant (T). Typical Value = 0.2491. Default: nullptr */ - CIMPP::Seconds ti9; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl1; /* Low band time constant (T). Typical Value = 1.73. Default: nullptr */ - CIMPP::Seconds tl10; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl11; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl12; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl2; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ - CIMPP::Seconds tl3; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl4; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl5; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl6; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tl7; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ - CIMPP::Seconds tl8; /* Low band time constant (T). Typical Value = 2.491. Default: nullptr */ - CIMPP::Seconds tl9; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vhmax; /* High band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vhmin; /* High band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ - CIMPP::PU vimax; /* Intermediate band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU vimin; /* Intermediate band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ - CIMPP::PU vlmax; /* Low band output maximum limit (V). Typical Value = 0.075. Default: nullptr */ - CIMPP::PU vlmin; /* Low band output minimum limit (V). Typical Value = -0.075. Default: nullptr */ - CIMPP::PU vstmax; /* PSS output maximum limit (V). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU vstmin; /* PSS output minimum limit (V). Typical Value = -0.15. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssIEEE4B(); - virtual ~PssIEEE4B(); - + ~PssIEEE4B() override; + + CIMPP::Simple_Float bwh1; /* Notch filter 1 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::Simple_Float bwh2; /* Notch filter 2 (high-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::Simple_Float bwl1; /* Notch filter 1 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::Simple_Float bwl2; /* Notch filter 2 (low-frequency band): Three dB bandwidth (B). Default: nullptr */ + CIMPP::PU kh; /* High band gain (K). Typical Value = 120. Default: nullptr */ + CIMPP::PU kh1; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU kh11; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kh17; /* High band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kh2; /* High band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU ki; /* Intermediate band gain (K). Typical Value = 30. Default: nullptr */ + CIMPP::PU ki1; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU ki11; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki17; /* Intermediate band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU ki2; /* Intermediate band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU kl; /* Low band gain (K). Typical Value = 7.5. Default: nullptr */ + CIMPP::PU kl1; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::PU kl11; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl17; /* Low band first lead-lag blocks coefficient (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU kl2; /* Low band differential filter gain (K). Typical Value = 66. Default: nullptr */ + CIMPP::Simple_Float omeganh1; /* Notch filter 1 (high-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Simple_Float omeganh2; /* Notch filter 2 (high-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Simple_Float omeganl1; /* Notch filter 1 (low-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Simple_Float omeganl2; /* Notch filter 2 (low-frequency band): filter frequency (omega). Default: nullptr */ + CIMPP::Seconds th1; /* High band time constant (T). Typical Value = 0.01513. Default: nullptr */ + CIMPP::Seconds th10; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th11; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th12; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th2; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ + CIMPP::Seconds th3; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th4; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th5; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th6; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds th7; /* High band time constant (T). Typical Value = 0.01816. Default: nullptr */ + CIMPP::Seconds th8; /* High band time constant (T). Typical Value = 0.02179. Default: nullptr */ + CIMPP::Seconds th9; /* High band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti1; /* Intermediate band time constant (T). Typical Value = 0.173. Default: nullptr */ + CIMPP::Seconds ti10; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti11; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti12; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti2; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ + CIMPP::Seconds ti3; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti4; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti5; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti6; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds ti7; /* Intermediate band time constant (T). Typical Value = 0.2075. Default: nullptr */ + CIMPP::Seconds ti8; /* Intermediate band time constant (T). Typical Value = 0.2491. Default: nullptr */ + CIMPP::Seconds ti9; /* Intermediate band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl1; /* Low band time constant (T). Typical Value = 1.73. Default: nullptr */ + CIMPP::Seconds tl10; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl11; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl12; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl2; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ + CIMPP::Seconds tl3; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl4; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl5; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl6; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tl7; /* Low band time constant (T). Typical Value = 2.075. Default: nullptr */ + CIMPP::Seconds tl8; /* Low band time constant (T). Typical Value = 2.491. Default: nullptr */ + CIMPP::Seconds tl9; /* Low band time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::PU vhmax; /* High band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU vhmin; /* High band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ + CIMPP::PU vimax; /* Intermediate band output maximum limit (V). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU vimin; /* Intermediate band output minimum limit (V). Typical Value = -0.6. Default: nullptr */ + CIMPP::PU vlmax; /* Low band output maximum limit (V). Typical Value = 0.075. Default: nullptr */ + CIMPP::PU vlmin; /* Low band output minimum limit (V). Typical Value = -0.075. Default: nullptr */ + CIMPP::PU vstmax; /* PSS output maximum limit (V). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU vstmin; /* PSS output minimum limit (V). Typical Value = -0.15. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssIEEE4B_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssPTIST1.cpp b/CGMES_2.4.15_27JAN2020/PssPTIST1.cpp index 9e2f9ee94..c7bd7baeb 100644 --- a/CGMES_2.4.15_27JAN2020/PssPTIST1.cpp +++ b/CGMES_2.4.15_27JAN2020/PssPTIST1.cpp @@ -1,15 +1,19 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssPTIST1.hpp" -#include "PU.hpp" +#include +#include + #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "PU.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -17,185 +21,192 @@ using namespace CIMPP; PssPTIST1::PssPTIST1() {}; - PssPTIST1::~PssPTIST1() {}; +bool assign_PssPTIST1_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST1_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssPTIST1_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST1_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST1_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST1_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssPTIST1_factory() { - return new PssPTIST1; - } + + + + + + + + + +const char PssPTIST1::debugName[] = "PssPTIST1"; +const char* PssPTIST1::debugString() const +{ + return PssPTIST1::debugName; } -void PssPTIST1::addConstructToMap(std::unordered_map& factory_map) { +void PssPTIST1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssPTIST1"), &PssPTIST1_factory)); } -void PssPTIST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssPTIST1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtc"), &assign_PssPTIST1_dtc)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtf"), &assign_PssPTIST1_dtf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtp"), &assign_PssPTIST1_dtp)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.k"), &assign_PssPTIST1_k)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.m"), &assign_PssPTIST1_m)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tf"), &assign_PssPTIST1_tf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tp"), &assign_PssPTIST1_tp)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t1"), &assign_PssPTIST1_t1)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t2"), &assign_PssPTIST1_t2)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t3"), &assign_PssPTIST1_t3)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.t4"), &assign_PssPTIST1_t4)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.k"), &assign_PssPTIST1_k)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtf"), &assign_PssPTIST1_dtf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtc"), &assign_PssPTIST1_dtc)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.dtp"), &assign_PssPTIST1_dtp)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tf"), &assign_PssPTIST1_tf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST1.tp"), &assign_PssPTIST1_tp)); } -void PssPTIST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssPTIST1::debugName[] = "PssPTIST1"; -const char* PssPTIST1::debugString() +void PssPTIST1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssPTIST1::debugName; } const BaseClassDefiner PssPTIST1::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssPTIST1::declare() return BaseClassDefiner(PssPTIST1::addConstructToMap, PssPTIST1::addPrimitiveAssignFnsToMap, PssPTIST1::addClassAssignFnsToMap, PssPTIST1::debugName); } - +namespace CIMPP +{ + BaseClass* PssPTIST1_factory() + { + return new PssPTIST1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssPTIST1.hpp b/CGMES_2.4.15_27JAN2020/PssPTIST1.hpp index 6e8f9983b..40174cc49 100644 --- a/CGMES_2.4.15_27JAN2020/PssPTIST1.hpp +++ b/CGMES_2.4.15_27JAN2020/PssPTIST1.hpp @@ -1,49 +1,50 @@ #ifndef PssPTIST1_H #define PssPTIST1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PTI Microprocessor-Based Stabilizer type 1. */ - class PssPTIST1: public PowerSystemStabilizerDynamics + class PssPTIST1 : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds dtf; /* Time step frequency calculation (Dtf). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtc; /* Time step related to activation of controls (Dtc). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtp; /* Time step active power calculation (Dtp). Typical Value = 0.0125. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssPTIST1(); - virtual ~PssPTIST1(); - + ~PssPTIST1() override; + + CIMPP::Seconds dtc; /* Time step related to activation of controls (Dtc). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtf; /* Time step frequency calculation (Dtf). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtp; /* Time step active power calculation (Dtp). Typical Value = 0.0125. Default: nullptr */ + CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ + CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssPTIST1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssPTIST3.cpp b/CGMES_2.4.15_27JAN2020/PssPTIST3.cpp index 21f6c7999..bdb5b8ad3 100644 --- a/CGMES_2.4.15_27JAN2020/PssPTIST3.cpp +++ b/CGMES_2.4.15_27JAN2020/PssPTIST3.cpp @@ -1,20 +1,12 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssPTIST3.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -29,518 +21,560 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" +#include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; PssPTIST3::PssPTIST3() {}; - PssPTIST3::~PssPTIST3() {}; +bool assign_PssPTIST3_a0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->a5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_al(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->al; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_athres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->athres; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_b5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_isw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->isw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_lthres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lthres; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->m; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_nav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nav; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_ncl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ncl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_ncr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ncr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssPTIST3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssPTIST3_m(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->m; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_tf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_tp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssPTIST3_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dtf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dtc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dtp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_a5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->a5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_b5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_athres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->athres; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_dl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_al(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->al; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_lthres(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lthres; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_pmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_isw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->isw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_nav(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nav; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_ncl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ncl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssPTIST3_ncr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssPTIST3* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ncr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssPTIST3_factory() { - return new PssPTIST3; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char PssPTIST3::debugName[] = "PssPTIST3"; +const char* PssPTIST3::debugString() const +{ + return PssPTIST3::debugName; } -void PssPTIST3::addConstructToMap(std::unordered_map& factory_map) { +void PssPTIST3::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssPTIST3"), &PssPTIST3_factory)); } -void PssPTIST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.m"), &assign_PssPTIST3_m)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tf"), &assign_PssPTIST3_tf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tp"), &assign_PssPTIST3_tp)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t1"), &assign_PssPTIST3_t1)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t2"), &assign_PssPTIST3_t2)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t3"), &assign_PssPTIST3_t3)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t4"), &assign_PssPTIST3_t4)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.k"), &assign_PssPTIST3_k)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtf"), &assign_PssPTIST3_dtf)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtc"), &assign_PssPTIST3_dtc)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtp"), &assign_PssPTIST3_dtp)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t5"), &assign_PssPTIST3_t5)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t6"), &assign_PssPTIST3_t6)); +void PssPTIST3::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a0"), &assign_PssPTIST3_a0)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a1"), &assign_PssPTIST3_a1)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a2"), &assign_PssPTIST3_a2)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b0"), &assign_PssPTIST3_b0)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b1"), &assign_PssPTIST3_b1)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b2"), &assign_PssPTIST3_b2)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a3"), &assign_PssPTIST3_a3)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a4"), &assign_PssPTIST3_a4)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.a5"), &assign_PssPTIST3_a5)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.al"), &assign_PssPTIST3_al)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.athres"), &assign_PssPTIST3_athres)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b0"), &assign_PssPTIST3_b0)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b1"), &assign_PssPTIST3_b1)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b2"), &assign_PssPTIST3_b2)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b3"), &assign_PssPTIST3_b3)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b4"), &assign_PssPTIST3_b4)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.b5"), &assign_PssPTIST3_b5)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.athres"), &assign_PssPTIST3_athres)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dl"), &assign_PssPTIST3_dl)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.al"), &assign_PssPTIST3_al)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.lthres"), &assign_PssPTIST3_lthres)); - assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.pmin"), &assign_PssPTIST3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtc"), &assign_PssPTIST3_dtc)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtf"), &assign_PssPTIST3_dtf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.dtp"), &assign_PssPTIST3_dtp)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.isw"), &assign_PssPTIST3_isw)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.k"), &assign_PssPTIST3_k)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.lthres"), &assign_PssPTIST3_lthres)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.m"), &assign_PssPTIST3_m)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.nav"), &assign_PssPTIST3_nav)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.ncl"), &assign_PssPTIST3_ncl)); assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.ncr"), &assign_PssPTIST3_ncr)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.pmin"), &assign_PssPTIST3_pmin)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t1"), &assign_PssPTIST3_t1)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t2"), &assign_PssPTIST3_t2)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t3"), &assign_PssPTIST3_t3)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t4"), &assign_PssPTIST3_t4)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t5"), &assign_PssPTIST3_t5)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.t6"), &assign_PssPTIST3_t6)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tf"), &assign_PssPTIST3_tf)); + assign_map.insert(std::make_pair(std::string("cim:PssPTIST3.tp"), &assign_PssPTIST3_tp)); } -void PssPTIST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssPTIST3::debugName[] = "PssPTIST3"; -const char* PssPTIST3::debugString() +void PssPTIST3::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssPTIST3::debugName; } const BaseClassDefiner PssPTIST3::declare() @@ -548,4 +582,10 @@ const BaseClassDefiner PssPTIST3::declare() return BaseClassDefiner(PssPTIST3::addConstructToMap, PssPTIST3::addPrimitiveAssignFnsToMap, PssPTIST3::addClassAssignFnsToMap, PssPTIST3::debugName); } - +namespace CIMPP +{ + BaseClass* PssPTIST3_factory() + { + return new PssPTIST3; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssPTIST3.hpp b/CGMES_2.4.15_27JAN2020/PssPTIST3.hpp index 77bed928c..72f604647 100644 --- a/CGMES_2.4.15_27JAN2020/PssPTIST3.hpp +++ b/CGMES_2.4.15_27JAN2020/PssPTIST3.hpp @@ -1,74 +1,75 @@ #ifndef PssPTIST3_H #define PssPTIST3_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PTI Microprocessor-Based Stabilizer type 3. */ - class PssPTIST3: public PowerSystemStabilizerDynamics + class PssPTIST3 : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ - CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ - CIMPP::Seconds dtf; /* Time step frequency calculation (0.03 for 50 Hz) (Dtf). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtc; /* Time step related to activation of controls (0.03 for 50 Hz) (Dtc). Typical Value = 0.025. Default: nullptr */ - CIMPP::Seconds dtp; /* Time step active power calculation (0.015 for 50 Hz) (Dtp). Typical Value = 0.0125. Default: nullptr */ - CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ - CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ - CIMPP::PU a0; /* Filter coefficient (A0). Default: nullptr */ - CIMPP::PU a1; /* Limiter (Al). Default: nullptr */ - CIMPP::PU a2; /* Filter coefficient (A2). Default: nullptr */ - CIMPP::PU b0; /* Filter coefficient (B0). Default: nullptr */ - CIMPP::PU b1; /* Filter coefficient (B1). Default: nullptr */ - CIMPP::PU b2; /* Filter coefficient (B2). Default: nullptr */ - CIMPP::PU a3; /* Filter coefficient (A3). Default: nullptr */ - CIMPP::PU a4; /* Filter coefficient (A4). Default: nullptr */ - CIMPP::PU a5; /* Filter coefficient (A5). Default: nullptr */ - CIMPP::PU b3; /* Filter coefficient (B3). Default: nullptr */ - CIMPP::PU b4; /* Filter coefficient (B4). Default: nullptr */ - CIMPP::PU b5; /* Filter coefficient (B5). Default: nullptr */ - CIMPP::PU athres; /* Threshold value above which output averaging will be bypassed (Athres). Typical Value = 0.005. Default: nullptr */ - CIMPP::PU dl; /* Limiter (Dl). Default: nullptr */ - CIMPP::PU al; /* Limiter (Al). Default: nullptr */ - CIMPP::PU lthres; /* Threshold value (Lthres). Default: nullptr */ - CIMPP::PU pmin; /* (Pmin). Default: nullptr */ - CIMPP::Boolean isw; /* Digital/analog output switch (Isw). true = produce analog output false = convert to digital output, using tap selection table. Default: false */ - CIMPP::Simple_Float nav; /* Number of control outputs to average (Nav) (1 <= Nav <= 16). Typical Value = 4. Default: nullptr */ - CIMPP::Simple_Float ncl; /* Number of counts at limit to active limit function (Ncl) (>0). Default: nullptr */ - CIMPP::Simple_Float ncr; /* Number of counts until reset after limit function is triggered (Ncr). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssPTIST3(); - virtual ~PssPTIST3(); - + ~PssPTIST3() override; + + CIMPP::PU a0; /* Filter coefficient (A0). Default: nullptr */ + CIMPP::PU a1; /* Limiter (Al). Default: nullptr */ + CIMPP::PU a2; /* Filter coefficient (A2). Default: nullptr */ + CIMPP::PU a3; /* Filter coefficient (A3). Default: nullptr */ + CIMPP::PU a4; /* Filter coefficient (A4). Default: nullptr */ + CIMPP::PU a5; /* Filter coefficient (A5). Default: nullptr */ + CIMPP::PU al; /* Limiter (Al). Default: nullptr */ + CIMPP::PU athres; /* Threshold value above which output averaging will be bypassed (Athres). Typical Value = 0.005. Default: nullptr */ + CIMPP::PU b0; /* Filter coefficient (B0). Default: nullptr */ + CIMPP::PU b1; /* Filter coefficient (B1). Default: nullptr */ + CIMPP::PU b2; /* Filter coefficient (B2). Default: nullptr */ + CIMPP::PU b3; /* Filter coefficient (B3). Default: nullptr */ + CIMPP::PU b4; /* Filter coefficient (B4). Default: nullptr */ + CIMPP::PU b5; /* Filter coefficient (B5). Default: nullptr */ + CIMPP::PU dl; /* Limiter (Dl). Default: nullptr */ + CIMPP::Seconds dtc; /* Time step related to activation of controls (0.03 for 50 Hz) (Dtc). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtf; /* Time step frequency calculation (0.03 for 50 Hz) (Dtf). Typical Value = 0.025. Default: nullptr */ + CIMPP::Seconds dtp; /* Time step active power calculation (0.015 for 50 Hz) (Dtp). Typical Value = 0.0125. Default: nullptr */ + CIMPP::Boolean isw; /* Digital/analog output switch (Isw). true = produce analog output false = convert to digital output, using tap selection table. Default: false */ + CIMPP::PU k; /* Gain (K). Typical Value = 9. Default: nullptr */ + CIMPP::PU lthres; /* Threshold value (Lthres). Default: nullptr */ + CIMPP::PU m; /* (M). M=2*H. Typical Value = 5. Default: nullptr */ + CIMPP::Simple_Float nav; /* Number of control outputs to average (Nav) (1 <= Nav <= 16). Typical Value = 4. Default: nullptr */ + CIMPP::Simple_Float ncl; /* Number of counts at limit to active limit function (Ncl) (>0). Default: nullptr */ + CIMPP::Simple_Float ncr; /* Number of counts until reset after limit function is triggered (Ncr). Default: nullptr */ + CIMPP::PU pmin; /* (Pmin). Default: nullptr */ + CIMPP::Seconds t1; /* Time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant (T2). Typical Value = 1. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant (T3). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds t4; /* Time constant (T4). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds t5; /* Time constant (T5). Default: nullptr */ + CIMPP::Seconds t6; /* Time constant (T6). Default: nullptr */ + CIMPP::Seconds tf; /* Time constant (Tf). Typical Value = 0.2. Default: nullptr */ + CIMPP::Seconds tp; /* Time constant (Tp). Typical Value = 0.2. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssPTIST3_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssSB4.cpp b/CGMES_2.4.15_27JAN2020/PssSB4.cpp index 94f0a847c..f6dca8bb3 100644 --- a/CGMES_2.4.15_27JAN2020/PssSB4.cpp +++ b/CGMES_2.4.15_27JAN2020/PssSB4.cpp @@ -1,8 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssSB4.hpp" -#include "Seconds.hpp" +#include +#include + #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -11,191 +14,199 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" using namespace CIMPP; PssSB4::PssSB4() {}; - PssSB4::~PssSB4() {}; +bool assign_PssSB4_kx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->te; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tx1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_tx2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tx2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSB4_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSB4* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssSB4_tt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSB4_kx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSB4_tx2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_ta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_tx1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tx1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_tb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_te(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->te; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSB4_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSB4* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssSB4_factory() { - return new PssSB4; - } + + + + + + + + + +const char PssSB4::debugName[] = "PssSB4"; +const char* PssSB4::debugString() const +{ + return PssSB4::debugName; } -void PssSB4::addConstructToMap(std::unordered_map& factory_map) { +void PssSB4::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssSB4"), &PssSB4_factory)); } -void PssSB4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:PssSB4.tt"), &assign_PssSB4_tt)); +void PssSB4::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssSB4.kx"), &assign_PssSB4_kx)); - assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx2"), &assign_PssSB4_tx2)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.ta"), &assign_PssSB4_ta)); - assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx1"), &assign_PssSB4_tx1)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.tb"), &assign_PssSB4_tb)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.tc"), &assign_PssSB4_tc)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.td"), &assign_PssSB4_td)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.te"), &assign_PssSB4_te)); + assign_map.insert(std::make_pair(std::string("cim:PssSB4.tt"), &assign_PssSB4_tt)); + assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx1"), &assign_PssSB4_tx1)); + assign_map.insert(std::make_pair(std::string("cim:PssSB4.tx2"), &assign_PssSB4_tx2)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.vsmax"), &assign_PssSB4_vsmax)); assign_map.insert(std::make_pair(std::string("cim:PssSB4.vsmin"), &assign_PssSB4_vsmin)); } -void PssSB4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssSB4::debugName[] = "PssSB4"; -const char* PssSB4::debugString() +void PssSB4::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssSB4::debugName; } const BaseClassDefiner PssSB4::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssSB4::declare() return BaseClassDefiner(PssSB4::addConstructToMap, PssSB4::addPrimitiveAssignFnsToMap, PssSB4::addClassAssignFnsToMap, PssSB4::debugName); } - +namespace CIMPP +{ + BaseClass* PssSB4_factory() + { + return new PssSB4; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssSB4.hpp b/CGMES_2.4.15_27JAN2020/PssSB4.hpp index 31f1ed9c7..a18083e3c 100644 --- a/CGMES_2.4.15_27JAN2020/PssSB4.hpp +++ b/CGMES_2.4.15_27JAN2020/PssSB4.hpp @@ -1,49 +1,50 @@ #ifndef PssSB4_H #define PssSB4_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Power sensitive stabilizer model. */ - class PssSB4: public PowerSystemStabilizerDynamics + class PssSB4 : public PowerSystemStabilizerDynamics { - public: - CIMPP::Seconds tt; /* Time constant (Tt). Default: nullptr */ - CIMPP::PU kx; /* Gain (Kx). Default: nullptr */ - CIMPP::Seconds tx2; /* Time constant (Tx2). Default: nullptr */ - CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ - CIMPP::Seconds tx1; /* Reset time constant (Tx1). Default: nullptr */ - CIMPP::Seconds tb; /* Time constant (Tb). Default: nullptr */ - CIMPP::Seconds tc; /* Time constant (Tc). Default: nullptr */ - CIMPP::Seconds td; /* Time constant (Td). Default: nullptr */ - CIMPP::Seconds te; /* Time constant (Te). Default: nullptr */ - CIMPP::PU vsmax; /* Limiter (Vsmax). Default: nullptr */ - CIMPP::PU vsmin; /* Limiter (Vsmin). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssSB4(); - virtual ~PssSB4(); - + ~PssSB4() override; + + CIMPP::PU kx; /* Gain (Kx). Default: nullptr */ + CIMPP::Seconds ta; /* Time constant (Ta). Default: nullptr */ + CIMPP::Seconds tb; /* Time constant (Tb). Default: nullptr */ + CIMPP::Seconds tc; /* Time constant (Tc). Default: nullptr */ + CIMPP::Seconds td; /* Time constant (Td). Default: nullptr */ + CIMPP::Seconds te; /* Time constant (Te). Default: nullptr */ + CIMPP::Seconds tt; /* Time constant (Tt). Default: nullptr */ + CIMPP::Seconds tx1; /* Reset time constant (Tx1). Default: nullptr */ + CIMPP::Seconds tx2; /* Time constant (Tx2). Default: nullptr */ + CIMPP::PU vsmax; /* Limiter (Vsmax). Default: nullptr */ + CIMPP::PU vsmin; /* Limiter (Vsmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssSB4_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssSH.cpp b/CGMES_2.4.15_27JAN2020/PssSH.cpp index ffb22736d..e8b98edbd 100644 --- a/CGMES_2.4.15_27JAN2020/PssSH.cpp +++ b/CGMES_2.4.15_27JAN2020/PssSH.cpp @@ -1,7 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssSH.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -19,13 +23,177 @@ using namespace CIMPP; PssSH::PssSH() {}; - PssSH::~PssSH() {}; +bool assign_PssSH_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_PssSH_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->td; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSH_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSH_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSH* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} @@ -37,195 +205,40 @@ PssSH::~PssSH() {}; -bool assign_PssSH_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSH_k0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSH_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSH_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_k4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_td(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->td; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSH_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSH* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssSH_factory() { - return new PssSH; - } + +const char PssSH::debugName[] = "PssSH"; +const char* PssSH::debugString() const +{ + return PssSH::debugName; } -void PssSH::addConstructToMap(std::unordered_map& factory_map) { +void PssSH::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssSH"), &PssSH_factory)); } -void PssSH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssSH::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssSH.k"), &assign_PssSH_k)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k0"), &assign_PssSH_k0)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k1"), &assign_PssSH_k1)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k2"), &assign_PssSH_k2)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k3"), &assign_PssSH_k3)); assign_map.insert(std::make_pair(std::string("cim:PssSH.k4"), &assign_PssSH_k4)); - assign_map.insert(std::make_pair(std::string("cim:PssSH.td"), &assign_PssSH_td)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t1"), &assign_PssSH_t1)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t2"), &assign_PssSH_t2)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t3"), &assign_PssSH_t3)); assign_map.insert(std::make_pair(std::string("cim:PssSH.t4"), &assign_PssSH_t4)); + assign_map.insert(std::make_pair(std::string("cim:PssSH.td"), &assign_PssSH_td)); assign_map.insert(std::make_pair(std::string("cim:PssSH.vsmax"), &assign_PssSH_vsmax)); assign_map.insert(std::make_pair(std::string("cim:PssSH.vsmin"), &assign_PssSH_vsmin)); } -void PssSH::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssSH::debugName[] = "PssSH"; -const char* PssSH::debugString() +void PssSH::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssSH::debugName; } const BaseClassDefiner PssSH::declare() @@ -233,4 +246,10 @@ const BaseClassDefiner PssSH::declare() return BaseClassDefiner(PssSH::addConstructToMap, PssSH::addPrimitiveAssignFnsToMap, PssSH::addClassAssignFnsToMap, PssSH::debugName); } - +namespace CIMPP +{ + BaseClass* PssSH_factory() + { + return new PssSH; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssSH.hpp b/CGMES_2.4.15_27JAN2020/PssSH.hpp index dd728e153..72614d6c4 100644 --- a/CGMES_2.4.15_27JAN2020/PssSH.hpp +++ b/CGMES_2.4.15_27JAN2020/PssSH.hpp @@ -1,51 +1,52 @@ #ifndef PssSH_H #define PssSH_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Model for Siemens "H infinity" power system stabilizer with generator electrical power input. */ - class PssSH: public PowerSystemStabilizerDynamics + class PssSH : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU k; /* Main gain (K). Typical Value = 1. Default: nullptr */ - CIMPP::PU k0; /* Gain 0 (K0). Typical Value = 0.012. Default: nullptr */ - CIMPP::PU k1; /* Gain 1 (K1). Typical Value = 0.488. Default: nullptr */ - CIMPP::PU k2; /* Gain 2 (K2). Typical Value = 0.064. Default: nullptr */ - CIMPP::PU k3; /* Gain 3 (K3). Typical Value = 0.224. Default: nullptr */ - CIMPP::PU k4; /* Gain 4 (K4). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds td; /* Input time constant (Td). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds t1; /* Time constant 1 (T1). Typical Value = 0.076. Default: nullptr */ - CIMPP::Seconds t2; /* Time constant 2 (T2). Typical Value = 0.086. Default: nullptr */ - CIMPP::Seconds t3; /* Time constant 3 (T3). Typical Value = 1.068. Default: nullptr */ - CIMPP::Seconds t4; /* Time constant 4 (T4). Typical Value = 1.913. Default: nullptr */ - CIMPP::PU vsmax; /* Output maximum limit (Vsmax). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vsmin; /* Output minimum limit (Vsmin). Typical Value = -0.1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssSH(); - virtual ~PssSH(); - + ~PssSH() override; + + CIMPP::PU k; /* Main gain (K). Typical Value = 1. Default: nullptr */ + CIMPP::PU k0; /* Gain 0 (K0). Typical Value = 0.012. Default: nullptr */ + CIMPP::PU k1; /* Gain 1 (K1). Typical Value = 0.488. Default: nullptr */ + CIMPP::PU k2; /* Gain 2 (K2). Typical Value = 0.064. Default: nullptr */ + CIMPP::PU k3; /* Gain 3 (K3). Typical Value = 0.224. Default: nullptr */ + CIMPP::PU k4; /* Gain 4 (K4). Typical Value = 0.1. Default: nullptr */ + CIMPP::Seconds t1; /* Time constant 1 (T1). Typical Value = 0.076. Default: nullptr */ + CIMPP::Seconds t2; /* Time constant 2 (T2). Typical Value = 0.086. Default: nullptr */ + CIMPP::Seconds t3; /* Time constant 3 (T3). Typical Value = 1.068. Default: nullptr */ + CIMPP::Seconds t4; /* Time constant 4 (T4). Typical Value = 1.913. Default: nullptr */ + CIMPP::Seconds td; /* Input time constant (Td). Typical Value = 10. Default: nullptr */ + CIMPP::PU vsmax; /* Output maximum limit (Vsmax). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU vsmin; /* Output minimum limit (Vsmin). Typical Value = -0.1. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssSH_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssSK.cpp b/CGMES_2.4.15_27JAN2020/PssSK.cpp index 3ce8b4a2c..cff220b90 100644 --- a/CGMES_2.4.15_27JAN2020/PssSK.cpp +++ b/CGMES_2.4.15_27JAN2020/PssSK.cpp @@ -1,7 +1,11 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssSK.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,165 +21,177 @@ using namespace CIMPP; PssSK::PssSK() {}; - PssSK::~PssSK() {}; +bool assign_PssSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssSK_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssSK* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssSK_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSK_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssSK_k3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_PssSK_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssSK* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* PssSK_factory() { - return new PssSK; - } + + + + + + + + + +const char PssSK::debugName[] = "PssSK"; +const char* PssSK::debugString() const +{ + return PssSK::debugName; } -void PssSK::addConstructToMap(std::unordered_map& factory_map) { +void PssSK::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssSK"), &PssSK_factory)); } -void PssSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssSK.k1"), &assign_PssSK_k1)); assign_map.insert(std::make_pair(std::string("cim:PssSK.k2"), &assign_PssSK_k2)); assign_map.insert(std::make_pair(std::string("cim:PssSK.k3"), &assign_PssSK_k3)); @@ -189,13 +205,8 @@ void PssSK::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssSK::debugName[] = "PssSK"; -const char* PssSK::debugString() +void PssSK::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssSK::debugName; } const BaseClassDefiner PssSK::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner PssSK::declare() return BaseClassDefiner(PssSK::addConstructToMap, PssSK::addPrimitiveAssignFnsToMap, PssSK::addClassAssignFnsToMap, PssSK::debugName); } - +namespace CIMPP +{ + BaseClass* PssSK_factory() + { + return new PssSK; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssSK.hpp b/CGMES_2.4.15_27JAN2020/PssSK.hpp index d1951bedb..767897b2b 100644 --- a/CGMES_2.4.15_27JAN2020/PssSK.hpp +++ b/CGMES_2.4.15_27JAN2020/PssSK.hpp @@ -1,49 +1,50 @@ #ifndef PssSK_H #define PssSK_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* PSS Slovakian type - three inputs. */ - class PssSK: public PowerSystemStabilizerDynamics + class PssSK : public PowerSystemStabilizerDynamics { - public: - CIMPP::PU k1; /* Gain P (K1). Typical Value = -0.3. Default: nullptr */ - CIMPP::PU k2; /* Gain fe (K2). Typical Value = -0.15. Default: nullptr */ - CIMPP::PU k3; /* Gain If (K3). Typical Value = 10. Default: nullptr */ - CIMPP::Seconds t1; /* Denominator time constant (T1). Typical Value = 0.3. Default: nullptr */ - CIMPP::Seconds t2; /* Filter time constant (T2). Typical Value = 0.35. Default: nullptr */ - CIMPP::Seconds t3; /* Denominator time constant (T3). Typical Value = 0.22. Default: nullptr */ - CIMPP::Seconds t4; /* Filter time constant (T4). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t5; /* Denominator time constant (T5). Typical Value = 0.02. Default: nullptr */ - CIMPP::Seconds t6; /* Filter time constant (T6). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU vsmax; /* Stabilizer output max limit (Vsmax). Typical Value = 0.4. Default: nullptr */ - CIMPP::PU vsmin; /* Stabilizer output min limit (Vsmin). Typical Value = -0.4. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssSK(); - virtual ~PssSK(); - + ~PssSK() override; + + CIMPP::PU k1; /* Gain P (K1). Typical Value = -0.3. Default: nullptr */ + CIMPP::PU k2; /* Gain fe (K2). Typical Value = -0.15. Default: nullptr */ + CIMPP::PU k3; /* Gain If (K3). Typical Value = 10. Default: nullptr */ + CIMPP::Seconds t1; /* Denominator time constant (T1). Typical Value = 0.3. Default: nullptr */ + CIMPP::Seconds t2; /* Filter time constant (T2). Typical Value = 0.35. Default: nullptr */ + CIMPP::Seconds t3; /* Denominator time constant (T3). Typical Value = 0.22. Default: nullptr */ + CIMPP::Seconds t4; /* Filter time constant (T4). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t5; /* Denominator time constant (T5). Typical Value = 0.02. Default: nullptr */ + CIMPP::Seconds t6; /* Filter time constant (T6). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU vsmax; /* Stabilizer output max limit (Vsmax). Typical Value = 0.4. Default: nullptr */ + CIMPP::PU vsmin; /* Stabilizer output min limit (Vsmin). Typical Value = -0.4. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssSK_factory(); diff --git a/CGMES_2.4.15_27JAN2020/PssWECC.cpp b/CGMES_2.4.15_27JAN2020/PssWECC.cpp index fee24fae9..92f2fc3c1 100644 --- a/CGMES_2.4.15_27JAN2020/PssWECC.cpp +++ b/CGMES_2.4.15_27JAN2020/PssWECC.cpp @@ -1,11 +1,14 @@ -#include -#include "PowerSystemStabilizerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "PssWECC.hpp" +#include +#include + #include "InputSignalKind.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" @@ -16,6 +19,7 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -24,261 +28,281 @@ using namespace CIMPP; PssWECC::PssWECC() {}; - PssWECC::~PssWECC() {}; +bool assign_PssWECC_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal1Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inputSignal2Type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vcu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_PssWECC_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (PssWECC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vsmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_PssWECC_inputSignal1Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal1Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_inputSignal2Type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inputSignal2Type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_t9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vsmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vsmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vsmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vcu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_PssWECC_vcl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(PssWECC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vcl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* PssWECC_factory() { - return new PssWECC; - } +const char PssWECC::debugName[] = "PssWECC"; +const char* PssWECC::debugString() const +{ + return PssWECC::debugName; } -void PssWECC::addConstructToMap(std::unordered_map& factory_map) { +void PssWECC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:PssWECC"), &PssWECC_factory)); } -void PssWECC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void PssWECC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:PssWECC.inputSignal1Type"), &assign_PssWECC_inputSignal1Type)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.inputSignal2Type"), &assign_PssWECC_inputSignal2Type)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.k1"), &assign_PssWECC_k1)); - assign_map.insert(std::make_pair(std::string("cim:PssWECC.t1"), &assign_PssWECC_t1)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.k2"), &assign_PssWECC_k2)); + assign_map.insert(std::make_pair(std::string("cim:PssWECC.t1"), &assign_PssWECC_t1)); + assign_map.insert(std::make_pair(std::string("cim:PssWECC.t10"), &assign_PssWECC_t10)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.t2"), &assign_PssWECC_t2)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.t3"), &assign_PssWECC_t3)); assign_map.insert(std::make_pair(std::string("cim:PssWECC.t4"), &assign_PssWECC_t4)); @@ -286,21 +310,15 @@ void PssWECC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char PssWECC::debugName[] = "PssWECC"; -const char* PssWECC::debugString() +void PssWECC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return PssWECC::debugName; } const BaseClassDefiner PssWECC::declare() @@ -308,4 +326,10 @@ const BaseClassDefiner PssWECC::declare() return BaseClassDefiner(PssWECC::addConstructToMap, PssWECC::addPrimitiveAssignFnsToMap, PssWECC::addClassAssignFnsToMap, PssWECC::debugName); } - +namespace CIMPP +{ + BaseClass* PssWECC_factory() + { + return new PssWECC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/PssWECC.hpp b/CGMES_2.4.15_27JAN2020/PssWECC.hpp index 56daeaa51..f1e2066e4 100644 --- a/CGMES_2.4.15_27JAN2020/PssWECC.hpp +++ b/CGMES_2.4.15_27JAN2020/PssWECC.hpp @@ -1,57 +1,58 @@ #ifndef PssWECC_H #define PssWECC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemStabilizerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "PowerSystemStabilizerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "InputSignalKind.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Dual input Power System Stabilizer, based on IEEE type 2, with modified output limiter defined by WECC (Western Electricity Coordinating Council, USA). */ - class PssWECC: public PowerSystemStabilizerDynamics + class PssWECC : public PowerSystemStabilizerDynamics { - public: - CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Default: 0 */ - CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Default: 0 */ - CIMPP::PU k1; /* Input signal 1 gain (K). Default: nullptr */ - CIMPP::Seconds t1; /* Input signal 1 transducer time constant (T). Default: nullptr */ - CIMPP::PU k2; /* Input signal 2 gain (K). Default: nullptr */ - CIMPP::Seconds t2; /* Input signal 2 transducer time constant (T). Default: nullptr */ - CIMPP::Seconds t3; /* Stabilizer washout time constant (T). Default: nullptr */ - CIMPP::Seconds t4; /* Stabilizer washout time lag constant (T) (>0). Default: nullptr */ - CIMPP::Seconds t5; /* Lead time constant (T). Default: nullptr */ - CIMPP::Seconds t6; /* Lag time constant (T). Default: nullptr */ - CIMPP::Seconds t7; /* Lead time constant (T). Default: nullptr */ - CIMPP::Seconds t8; /* Lag time constant (T). Default: nullptr */ - CIMPP::Seconds t10; /* Lag time constant (T). Default: nullptr */ - CIMPP::Seconds t9; /* Lead time constant (T). Default: nullptr */ - CIMPP::PU vsmax; /* Maximum output signal (Vsmax). Default: nullptr */ - CIMPP::PU vsmin; /* Minimum output signal (Vsmin). Default: nullptr */ - CIMPP::PU vcu; /* Maximum value for voltage compensator output (V). Default: nullptr */ - CIMPP::PU vcl; /* Minimum value for voltage compensator output (V). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ PssWECC(); - virtual ~PssWECC(); - + ~PssWECC() override; + + CIMPP::InputSignalKind inputSignal1Type; /* Type of input signal #1. Default: 0 */ + CIMPP::InputSignalKind inputSignal2Type; /* Type of input signal #2. Default: 0 */ + CIMPP::PU k1; /* Input signal 1 gain (K). Default: nullptr */ + CIMPP::PU k2; /* Input signal 2 gain (K). Default: nullptr */ + CIMPP::Seconds t1; /* Input signal 1 transducer time constant (T). Default: nullptr */ + CIMPP::Seconds t10; /* Lag time constant (T). Default: nullptr */ + CIMPP::Seconds t2; /* Input signal 2 transducer time constant (T). Default: nullptr */ + CIMPP::Seconds t3; /* Stabilizer washout time constant (T). Default: nullptr */ + CIMPP::Seconds t4; /* Stabilizer washout time lag constant (T) (>0). Default: nullptr */ + CIMPP::Seconds t5; /* Lead time constant (T). Default: nullptr */ + CIMPP::Seconds t6; /* Lag time constant (T). Default: nullptr */ + CIMPP::Seconds t7; /* Lead time constant (T). Default: nullptr */ + CIMPP::Seconds t8; /* Lag time constant (T). Default: nullptr */ + CIMPP::Seconds t9; /* Lead time constant (T). Default: nullptr */ + CIMPP::PU vcl; /* Minimum value for voltage compensator output (V). Default: nullptr */ + CIMPP::PU vcu; /* Maximum value for voltage compensator output (V). Default: nullptr */ + CIMPP::PU vsmax; /* Maximum output signal (Vsmax). Default: nullptr */ + CIMPP::PU vsmin; /* Minimum output signal (Vsmin). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* PssWECC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Quality61850.cpp b/CGMES_2.4.15_27JAN2020/Quality61850.cpp index 882cf9b2b..ac78a9b84 100644 --- a/CGMES_2.4.15_27JAN2020/Quality61850.cpp +++ b/CGMES_2.4.15_27JAN2020/Quality61850.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Quality61850.hpp" +#include +#include + #include "Boolean.hpp" #include "Boolean.hpp" #include "Boolean.hpp" @@ -18,178 +22,191 @@ using namespace CIMPP; Quality61850::Quality61850() {}; - Quality61850::~Quality61850() {}; +bool assign_Quality61850_badReference(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->badReference; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_estimatorReplaced(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->estimatorReplaced; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_failure(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->failure; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_oldData(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oldData; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_operatorBlocked(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operatorBlocked; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_oscillatory(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->oscillatory; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_outOfRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->outOfRange; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_overFlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->overFlow; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_source(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->source; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_suspect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->suspect; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_test(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->test; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Quality61850_validity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Quality61850* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->validity; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Quality61850_badReference(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->badReference; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Quality61850_estimatorReplaced(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->estimatorReplaced; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Quality61850_failure(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->failure; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Quality61850_oldData(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oldData; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_operatorBlocked(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operatorBlocked; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_oscillatory(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->oscillatory; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_outOfRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->outOfRange; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_overFlow(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->overFlow; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_source(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->source; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_suspect(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->suspect; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_test(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->test; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_Quality61850_validity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Quality61850* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->validity; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* Quality61850_factory() { - return new Quality61850; - } + + + + + + + + + +const char Quality61850::debugName[] = "Quality61850"; +const char* Quality61850::debugString() const +{ + return Quality61850::debugName; } -void Quality61850::addConstructToMap(std::unordered_map& factory_map) { +void Quality61850::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Quality61850"), &Quality61850_factory)); } -void Quality61850::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Quality61850::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Quality61850.badReference"), &assign_Quality61850_badReference)); assign_map.insert(std::make_pair(std::string("cim:Quality61850.estimatorReplaced"), &assign_Quality61850_estimatorReplaced)); assign_map.insert(std::make_pair(std::string("cim:Quality61850.failure"), &assign_Quality61850_failure)); @@ -204,13 +221,8 @@ void Quality61850::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char Quality61850::debugName[] = "Quality61850"; -const char* Quality61850::debugString() +void Quality61850::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Quality61850::debugName; } const BaseClassDefiner Quality61850::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner Quality61850::declare() return BaseClassDefiner(Quality61850::addConstructToMap, Quality61850::addPrimitiveAssignFnsToMap, Quality61850::addClassAssignFnsToMap, Quality61850::debugName); } - +namespace CIMPP +{ + BaseClass* Quality61850_factory() + { + return new Quality61850; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Quality61850.hpp b/CGMES_2.4.15_27JAN2020/Quality61850.hpp index 6e6d4eb6a..fb8336676 100644 --- a/CGMES_2.4.15_27JAN2020/Quality61850.hpp +++ b/CGMES_2.4.15_27JAN2020/Quality61850.hpp @@ -1,51 +1,52 @@ #ifndef Quality61850_H #define Quality61850_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "Source.hpp" #include "Validity.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Quality flags in this class are as defined in IEC 61850, except for estimatorReplaced, which has been included in this class for convenience. */ - class Quality61850: public BaseClass + class Quality61850 : public BaseClass { - public: - CIMPP::Boolean badReference; /* Measurement value may be incorrect due to a reference being out of calibration. Default: false */ - CIMPP::Boolean estimatorReplaced; /* Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience. Default: false */ - CIMPP::Boolean failure; /* This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure. Default: false */ - CIMPP::Boolean oldData; /* Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval. Default: false */ - CIMPP::Boolean operatorBlocked; /* Measurement value is blocked and hence unavailable for transmission. Default: false */ - CIMPP::Boolean oscillatory; /* To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier `oscillatory` is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status `questionable` is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status `questionable` is reset and `invalid` is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status `invalid` is set immediately in addition to the detail quality identifier `oscillatory` (used for status information only). Default: false */ - CIMPP::Boolean outOfRange; /* Measurement value is beyond a predefined range of value. Default: false */ - CIMPP::Boolean overFlow; /* Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero. Default: false */ - CIMPP::Source source; /* Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Default: 0 */ - CIMPP::Boolean suspect; /* A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator. Default: false */ - CIMPP::Boolean test; /* Measurement value is transmitted for test purposes. Default: false */ - CIMPP::Validity validity; /* Validity of the measurement value. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Quality61850(); - virtual ~Quality61850(); - + ~Quality61850() override; + + CIMPP::Boolean badReference; /* Measurement value may be incorrect due to a reference being out of calibration. Default: false */ + CIMPP::Boolean estimatorReplaced; /* Value has been replaced by State Estimator. estimatorReplaced is not an IEC61850 quality bit but has been put in this class for convenience. Default: false */ + CIMPP::Boolean failure; /* This identifier indicates that a supervision function has detected an internal or external failure, e.g. communication failure. Default: false */ + CIMPP::Boolean oldData; /* Measurement value is old and possibly invalid, as it has not been successfully updated during a specified time interval. Default: false */ + CIMPP::Boolean operatorBlocked; /* Measurement value is blocked and hence unavailable for transmission. Default: false */ + CIMPP::Boolean oscillatory; /* To prevent some overload of the communication it is sensible to detect and suppress oscillating (fast changing) binary inputs. If a signal changes in a defined time (tosc) twice in the same direction (from 0 to 1 or from 1 to 0) then oscillation is detected and the detail quality identifier `oscillatory` is set. If it is detected a configured numbers of transient changes could be passed by. In this time the validity status `questionable` is set. If after this defined numbers of changes the signal is still in the oscillating state the value shall be set either to the opposite state of the previous stable value or to a defined default value. In this case the validity status `questionable` is reset and `invalid` is set as long as the signal is oscillating. If it is configured such that no transient changes should be passed by then the validity status `invalid` is set immediately in addition to the detail quality identifier `oscillatory` (used for status information only). Default: false */ + CIMPP::Boolean outOfRange; /* Measurement value is beyond a predefined range of value. Default: false */ + CIMPP::Boolean overFlow; /* Measurement value is beyond the capability of being represented properly. For example, a counter value overflows from maximum count back to a value of zero. Default: false */ + CIMPP::Source source; /* Source gives information related to the origin of a value. The value may be acquired from the process, defaulted or substituted. Default: 0 */ + CIMPP::Boolean suspect; /* A correlation function has detected that the value is not consitent with other values. Typically set by a network State Estimator. Default: false */ + CIMPP::Boolean test; /* Measurement value is transmitted for test purposes. Default: false */ + CIMPP::Validity validity; /* Validity of the measurement value. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Quality61850_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.cpp b/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.cpp index 96b62d8dc..066aa79a7 100644 --- a/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.cpp +++ b/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.cpp @@ -1,49 +1,56 @@ -#include -#include "AnalogControl.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RaiseLowerCommand.hpp" +#include +#include + #include "ValueAliasSet.hpp" using namespace CIMPP; -RaiseLowerCommand::RaiseLowerCommand(): ValueAliasSet(nullptr) {}; - +RaiseLowerCommand::RaiseLowerCommand() : ValueAliasSet(nullptr) {}; RaiseLowerCommand::~RaiseLowerCommand() {}; -bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass*, BaseClass*); -bool assign_RaiseLowerCommand_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RaiseLowerCommand* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_RaiseLowerCommands(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* RaiseLowerCommand_factory() { - return new RaiseLowerCommand; +bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass*, BaseClass*); +bool assign_RaiseLowerCommand_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RaiseLowerCommand* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_RaiseLowerCommands(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void RaiseLowerCommand::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand"), &RaiseLowerCommand_factory)); +const char RaiseLowerCommand::debugName[] = "RaiseLowerCommand"; +const char* RaiseLowerCommand::debugString() const +{ + return RaiseLowerCommand::debugName; } -void RaiseLowerCommand::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void RaiseLowerCommand::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand"), &RaiseLowerCommand_factory)); +} -void RaiseLowerCommand::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand.ValueAliasSet"), &assign_RaiseLowerCommand_ValueAliasSet)); +void RaiseLowerCommand::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RaiseLowerCommand::debugName[] = "RaiseLowerCommand"; -const char* RaiseLowerCommand::debugString() +void RaiseLowerCommand::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RaiseLowerCommand::debugName; + assign_map.insert(std::make_pair(std::string("cim:RaiseLowerCommand.ValueAliasSet"), &assign_RaiseLowerCommand_ValueAliasSet)); } const BaseClassDefiner RaiseLowerCommand::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner RaiseLowerCommand::declare() return BaseClassDefiner(RaiseLowerCommand::addConstructToMap, RaiseLowerCommand::addPrimitiveAssignFnsToMap, RaiseLowerCommand::addClassAssignFnsToMap, RaiseLowerCommand::debugName); } - +namespace CIMPP +{ + BaseClass* RaiseLowerCommand_factory() + { + return new RaiseLowerCommand; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.hpp b/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.hpp index 98c85b0ac..a64ed8aa0 100644 --- a/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.hpp +++ b/CGMES_2.4.15_27JAN2020/RaiseLowerCommand.hpp @@ -1,38 +1,39 @@ #ifndef RaiseLowerCommand_H #define RaiseLowerCommand_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AnalogControl.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "AnalogControl.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ValueAliasSet; -class ValueAliasSet; /* An analog control that increase or decrease a set point value with pulses. */ - class RaiseLowerCommand: public AnalogControl + class RaiseLowerCommand : public AnalogControl { - public: - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RaiseLowerCommand(); - virtual ~RaiseLowerCommand(); - + ~RaiseLowerCommand() override; + + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueAliasSet used for translation of a Control value to a name. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RaiseLowerCommand_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RatioTapChanger.cpp b/CGMES_2.4.15_27JAN2020/RatioTapChanger.cpp index f584544c0..a6b71a322 100644 --- a/CGMES_2.4.15_27JAN2020/RatioTapChanger.cpp +++ b/CGMES_2.4.15_27JAN2020/RatioTapChanger.cpp @@ -1,92 +1,108 @@ -#include -#include "TapChanger.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RatioTapChanger.hpp" -#include "TransformerControlMode.hpp" -#include "PerCent.hpp" +#include +#include + #include "RatioTapChangerTable.hpp" #include "TransformerEnd.hpp" +#include "PerCent.hpp" +#include "TransformerControlMode.hpp" using namespace CIMPP; -RatioTapChanger::RatioTapChanger(): RatioTapChangerTable(nullptr), TransformerEnd(nullptr) {}; - +RatioTapChanger::RatioTapChanger() : RatioTapChangerTable(nullptr), TransformerEnd(nullptr) {}; RatioTapChanger::~RatioTapChanger() {}; -bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass*, BaseClass*); -bool assign_RatioTapChanger_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->RatioTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->RatioTapChangerTable != nullptr) - return assign_RatioTapChangerTable_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RatioTapChanger_stepVoltageIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->stepVoltageIncrement; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_TransformerEnd_RatioTapChanger(BaseClass*, BaseClass*); -bool assign_RatioTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->TransformerEnd = dynamic_cast(BaseClass_ptr2); - if(element->TransformerEnd != nullptr) - return assign_TransformerEnd_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RatioTapChanger_tculControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tculControlMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_RatioTapChanger_tculControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tculControlMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass*, BaseClass*); +bool assign_RatioTapChanger_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChanger* element = dynamic_cast(BaseClass_ptr1); + RatioTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RatioTapChangerTable != element2) + { + element->RatioTapChangerTable = element2; + return assign_RatioTapChangerTable_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RatioTapChanger_stepVoltageIncrement(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RatioTapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->stepVoltageIncrement; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TransformerEnd_RatioTapChanger(BaseClass*, BaseClass*); +bool assign_RatioTapChanger_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChanger* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TransformerEnd != element2) + { + element->TransformerEnd = element2; + return assign_TransformerEnd_RatioTapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* RatioTapChanger_factory() { - return new RatioTapChanger; - } +const char RatioTapChanger::debugName[] = "RatioTapChanger"; +const char* RatioTapChanger::debugString() const +{ + return RatioTapChanger::debugName; } -void RatioTapChanger::addConstructToMap(std::unordered_map& factory_map) { +void RatioTapChanger::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RatioTapChanger"), &RatioTapChanger_factory)); } -void RatioTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.tculControlMode"), &assign_RatioTapChanger_tculControlMode)); +void RatioTapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.stepVoltageIncrement"), &assign_RatioTapChanger_stepVoltageIncrement)); - } - -void RatioTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.RatioTapChangerTable"), &assign_RatioTapChanger_RatioTapChangerTable)); - assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.TransformerEnd"), &assign_RatioTapChanger_TransformerEnd)); + assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.tculControlMode"), &assign_RatioTapChanger_tculControlMode)); } -const char RatioTapChanger::debugName[] = "RatioTapChanger"; -const char* RatioTapChanger::debugString() +void RatioTapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RatioTapChanger::debugName; + assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.RatioTapChangerTable"), &assign_RatioTapChanger_RatioTapChangerTable)); + assign_map.insert(std::make_pair(std::string("cim:RatioTapChanger.TransformerEnd"), &assign_RatioTapChanger_TransformerEnd)); } const BaseClassDefiner RatioTapChanger::declare() @@ -94,4 +110,10 @@ const BaseClassDefiner RatioTapChanger::declare() return BaseClassDefiner(RatioTapChanger::addConstructToMap, RatioTapChanger::addPrimitiveAssignFnsToMap, RatioTapChanger::addClassAssignFnsToMap, RatioTapChanger::debugName); } - +namespace CIMPP +{ + BaseClass* RatioTapChanger_factory() + { + return new RatioTapChanger; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RatioTapChanger.hpp b/CGMES_2.4.15_27JAN2020/RatioTapChanger.hpp index f4de91f70..522680ece 100644 --- a/CGMES_2.4.15_27JAN2020/RatioTapChanger.hpp +++ b/CGMES_2.4.15_27JAN2020/RatioTapChanger.hpp @@ -1,44 +1,45 @@ #ifndef RatioTapChanger_H #define RatioTapChanger_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChanger.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "TransformerControlMode.hpp" +#include "TapChanger.hpp" +#include "BaseClassDefiner.hpp" #include "PerCent.hpp" +#include "TransformerControlMode.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class RatioTapChangerTable; + class TransformerEnd; -class RatioTapChangerTable; -class TransformerEnd; /* A tap changer that changes the voltage ratio impacting the voltage magnitude but not the phase angle across the transformer. */ - class RatioTapChanger: public TapChanger + class RatioTapChanger : public TapChanger { - public: - CIMPP::TransformerControlMode tculControlMode; /* Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Default: 0 */ - CIMPP::PerCent stepVoltageIncrement; /* Tap step increment, in per cent of nominal voltage, per step position. Default: nullptr */ - CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* The ratio tap changer of this tap ratio table. Default: 0 */ - CIMPP::TransformerEnd* TransformerEnd; /* Ratio tap changer associated with this transformer end. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RatioTapChanger(); - virtual ~RatioTapChanger(); - + ~RatioTapChanger() override; + + CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* The ratio tap changer of this tap ratio table. Default: 0 */ + CIMPP::TransformerEnd* TransformerEnd; /* Ratio tap changer associated with this transformer end. Default: 0 */ + CIMPP::PerCent stepVoltageIncrement; /* Tap step increment, in per cent of nominal voltage, per step position. Default: nullptr */ + CIMPP::TransformerControlMode tculControlMode; /* Specifies the regulation control mode (voltage or reactive) of the RatioTapChanger. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RatioTapChanger_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.cpp b/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.cpp index d61eef797..ee5dac524 100644 --- a/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.cpp +++ b/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RatioTapChangerTable.hpp" +#include +#include + #include "RatioTapChanger.hpp" #include "RatioTapChangerTablePoint.hpp" using namespace CIMPP; RatioTapChangerTable::RatioTapChangerTable() {}; - RatioTapChangerTable::~RatioTapChangerTable() {}; -bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RatioTapChanger.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_RatioTapChanger_RatioTapChangerTable(BaseClass*, BaseClass*); +bool assign_RatioTapChangerTable_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + RatioTapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RatioTapChanger.begin(), element->RatioTapChanger.end(), element2) == element->RatioTapChanger.end()) + { + element->RatioTapChanger.push_back(element2); + return assign_RatioTapChanger_RatioTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RatioTapChangerTablePoint.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass*, BaseClass*); +bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChangerTable* element = dynamic_cast(BaseClass_ptr1); + RatioTapChangerTablePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RatioTapChangerTablePoint.begin(), element->RatioTapChangerTablePoint.end(), element2) == element->RatioTapChangerTablePoint.end()) + { + element->RatioTapChangerTablePoint.push_back(element2); + return assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* RatioTapChangerTable_factory() { - return new RatioTapChangerTable; - } +const char RatioTapChangerTable::debugName[] = "RatioTapChangerTable"; +const char* RatioTapChangerTable::debugString() const +{ + return RatioTapChangerTable::debugName; } -void RatioTapChangerTable::addConstructToMap(std::unordered_map& factory_map) { +void RatioTapChangerTable::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable"), &RatioTapChangerTable_factory)); } -void RatioTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void RatioTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChanger"), &assign_RatioTapChangerTable_RatioTapChanger)); - assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChangerTablePoint"), &assign_RatioTapChangerTable_RatioTapChangerTablePoint)); +void RatioTapChangerTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RatioTapChangerTable::debugName[] = "RatioTapChangerTable"; -const char* RatioTapChangerTable::debugString() +void RatioTapChangerTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RatioTapChangerTable::debugName; + assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChanger"), &assign_RatioTapChangerTable_RatioTapChanger)); + assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTable.RatioTapChangerTablePoint"), &assign_RatioTapChangerTable_RatioTapChangerTablePoint)); } const BaseClassDefiner RatioTapChangerTable::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner RatioTapChangerTable::declare() return BaseClassDefiner(RatioTapChangerTable::addConstructToMap, RatioTapChangerTable::addPrimitiveAssignFnsToMap, RatioTapChangerTable::addClassAssignFnsToMap, RatioTapChangerTable::debugName); } - +namespace CIMPP +{ + BaseClass* RatioTapChangerTable_factory() + { + return new RatioTapChangerTable; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.hpp b/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.hpp index 6bfa9abad..e3677c982 100644 --- a/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.hpp +++ b/CGMES_2.4.15_27JAN2020/RatioTapChangerTable.hpp @@ -1,40 +1,41 @@ #ifndef RatioTapChangerTable_H #define RatioTapChangerTable_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RatioTapChanger; + class RatioTapChangerTablePoint; -class RatioTapChanger; -class RatioTapChangerTablePoint; /* Describes a curve for how the voltage magnitude and impedance varies with the tap step. */ - class RatioTapChangerTable: public IdentifiedObject + class RatioTapChangerTable : public IdentifiedObject { - public: - std::list RatioTapChanger; /* The tap ratio table for this ratio tap changer. Default: 0 */ - std::list RatioTapChangerTablePoint; /* Table of this point. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RatioTapChangerTable(); - virtual ~RatioTapChangerTable(); - + ~RatioTapChangerTable() override; + + std::list RatioTapChanger; /* The tap ratio table for this ratio tap changer. Default: 0 */ + std::list RatioTapChangerTablePoint; /* Table of this point. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RatioTapChangerTable_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.cpp b/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.cpp index 0a258a916..4253a4d8b 100644 --- a/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.cpp +++ b/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.cpp @@ -1,49 +1,56 @@ -#include -#include "TapChangerTablePoint.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RatioTapChangerTablePoint.hpp" +#include +#include + #include "RatioTapChangerTable.hpp" using namespace CIMPP; -RatioTapChangerTablePoint::RatioTapChangerTablePoint(): RatioTapChangerTable(nullptr) {}; - +RatioTapChangerTablePoint::RatioTapChangerTablePoint() : RatioTapChangerTable(nullptr) {}; RatioTapChangerTablePoint::~RatioTapChangerTablePoint() {}; -bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass*, BaseClass*); -bool assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RatioTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->RatioTapChangerTable = dynamic_cast(BaseClass_ptr2); - if(element->RatioTapChangerTable != nullptr) - return assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* RatioTapChangerTablePoint_factory() { - return new RatioTapChangerTablePoint; +bool assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass*, BaseClass*); +bool assign_RatioTapChangerTablePoint_RatioTapChangerTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RatioTapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1); + RatioTapChangerTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RatioTapChangerTable != element2) + { + element->RatioTapChangerTable = element2; + return assign_RatioTapChangerTable_RatioTapChangerTablePoint(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void RatioTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint"), &RatioTapChangerTablePoint_factory)); +const char RatioTapChangerTablePoint::debugName[] = "RatioTapChangerTablePoint"; +const char* RatioTapChangerTablePoint::debugString() const +{ + return RatioTapChangerTablePoint::debugName; } -void RatioTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void RatioTapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint"), &RatioTapChangerTablePoint_factory)); +} -void RatioTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint.RatioTapChangerTable"), &assign_RatioTapChangerTablePoint_RatioTapChangerTable)); +void RatioTapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RatioTapChangerTablePoint::debugName[] = "RatioTapChangerTablePoint"; -const char* RatioTapChangerTablePoint::debugString() +void RatioTapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RatioTapChangerTablePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:RatioTapChangerTablePoint.RatioTapChangerTable"), &assign_RatioTapChangerTablePoint_RatioTapChangerTable)); } const BaseClassDefiner RatioTapChangerTablePoint::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner RatioTapChangerTablePoint::declare() return BaseClassDefiner(RatioTapChangerTablePoint::addConstructToMap, RatioTapChangerTablePoint::addPrimitiveAssignFnsToMap, RatioTapChangerTablePoint::addClassAssignFnsToMap, RatioTapChangerTablePoint::debugName); } - +namespace CIMPP +{ + BaseClass* RatioTapChangerTablePoint_factory() + { + return new RatioTapChangerTablePoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.hpp b/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.hpp index 3750262d1..07c7889db 100644 --- a/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.hpp +++ b/CGMES_2.4.15_27JAN2020/RatioTapChangerTablePoint.hpp @@ -1,38 +1,39 @@ #ifndef RatioTapChangerTablePoint_H #define RatioTapChangerTablePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TapChangerTablePoint.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "TapChangerTablePoint.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RatioTapChangerTable; -class RatioTapChangerTable; /* Describes each tap step in the ratio tap changer tabular curve. */ - class RatioTapChangerTablePoint: public TapChangerTablePoint + class RatioTapChangerTablePoint : public TapChangerTablePoint { - public: - CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* Points of this table. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RatioTapChangerTablePoint(); - virtual ~RatioTapChangerTablePoint(); - + ~RatioTapChangerTablePoint() override; + + CIMPP::RatioTapChangerTable* RatioTapChangerTable; /* Points of this table. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RatioTapChangerTablePoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Reactance.cpp b/CGMES_2.4.15_27JAN2020/Reactance.cpp index e5ea380cd..6b2d635d6 100644 --- a/CGMES_2.4.15_27JAN2020/Reactance.cpp +++ b/CGMES_2.4.15_27JAN2020/Reactance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Reactance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Reactance::Reactance() {} -Reactance::~Reactance(){} +#include -Reactance::Reactance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Reactance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Reactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Reactance& Reactance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Reactance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Reactance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Reactance::debugName[] = "Reactance"; -const char* Reactance::debugString() { +const char* Reactance::debugString() const +{ return Reactance::debugName; } - -const BaseClassDefiner Reactance::declare() { - return BaseClassDefiner(Reactance::addConstructToMap, Reactance::addPrimitiveAssignFnsToMap, Reactance::addClassAssignFnsToMap, Reactance::debugName); +Reactance& Reactance::operator+=(const Reactance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Reactance& Reactance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Reactance& Reactance::operator-=(const Reactance& rhs) { - value -= rhs.value; - return *this; - } - - Reactance& Reactance::operator*=(const Reactance& rhs) { - value *= rhs.value; - return *this; - } - - Reactance& Reactance::operator/=(const Reactance& rhs) { - value /= rhs.value; - return *this; - } +Reactance& Reactance::operator-=(const Reactance& rhs) +{ + value -= rhs.value; + return *this; +} - Reactance& Reactance::operator+=(const Reactance& rhs) { - value += rhs.value; - return *this; - } +Reactance& Reactance::operator*=(const Reactance& rhs) +{ + value *= rhs.value; + return *this; +} - Reactance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Reactance& Reactance::operator/=(const Reactance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Reactance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Reactance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Reactance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Reactance.hpp b/CGMES_2.4.15_27JAN2020/Reactance.hpp index ba0ae3f00..a811d499a 100644 --- a/CGMES_2.4.15_27JAN2020/Reactance.hpp +++ b/CGMES_2.4.15_27JAN2020/Reactance.hpp @@ -1,38 +1,39 @@ #ifndef Reactance_H #define Reactance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Reactance : public BaseClass + /* + Reactance (imaginary part of impedance), at rated frequency. + */ + class Reactance { - public: - Reactance(); - virtual ~Reactance(); - Reactance(long double value); - static const BaseClassDefiner declare(); - Reactance& operator=(long double &rop); + Reactance() : value(0.0), initialized(false) {} + Reactance(long double value) : value(value), initialized(true) {} + + Reactance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Reactance& operator+=(const Reactance& rhs); Reactance& operator-=(const Reactance& rhs); Reactance& operator*=(const Reactance& rhs); Reactance& operator/=(const Reactance& rhs); + friend std::istream& operator>>(std::istream& lop, Reactance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Reactance& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.cpp b/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.cpp index 1e25f308d..493bd8bf5 100644 --- a/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.cpp +++ b/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.cpp @@ -1,62 +1,76 @@ -#include -#include "Curve.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ReactiveCapabilityCurve.hpp" +#include +#include + #include "EquivalentInjection.hpp" #include "SynchronousMachine.hpp" using namespace CIMPP; ReactiveCapabilityCurve::ReactiveCapabilityCurve() {}; - ReactiveCapabilityCurve::~ReactiveCapabilityCurve() {}; -bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->EquivalentInjection.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass*, BaseClass*); +bool assign_ReactiveCapabilityCurve_EquivalentInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1); + EquivalentInjection* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->EquivalentInjection.begin(), element->EquivalentInjection.end(), element2) == element->EquivalentInjection.end()) + { + element->EquivalentInjection.push_back(element2); + return assign_EquivalentInjection_ReactiveCapabilityCurve(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->InitiallyUsedBySynchronousMachines.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass*, BaseClass*); +bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReactiveCapabilityCurve* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->InitiallyUsedBySynchronousMachines.begin(), element->InitiallyUsedBySynchronousMachines.end(), element2) == element->InitiallyUsedBySynchronousMachines.end()) + { + element->InitiallyUsedBySynchronousMachines.push_back(element2); + return assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ReactiveCapabilityCurve_factory() { - return new ReactiveCapabilityCurve; - } +const char ReactiveCapabilityCurve::debugName[] = "ReactiveCapabilityCurve"; +const char* ReactiveCapabilityCurve::debugString() const +{ + return ReactiveCapabilityCurve::debugName; } -void ReactiveCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) { +void ReactiveCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve"), &ReactiveCapabilityCurve_factory)); } -void ReactiveCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ReactiveCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.EquivalentInjection"), &assign_ReactiveCapabilityCurve_EquivalentInjection)); - assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines"), &assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines)); +void ReactiveCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ReactiveCapabilityCurve::debugName[] = "ReactiveCapabilityCurve"; -const char* ReactiveCapabilityCurve::debugString() +void ReactiveCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ReactiveCapabilityCurve::debugName; + assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.EquivalentInjection"), &assign_ReactiveCapabilityCurve_EquivalentInjection)); + assign_map.insert(std::make_pair(std::string("cim:ReactiveCapabilityCurve.InitiallyUsedBySynchronousMachines"), &assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines)); } const BaseClassDefiner ReactiveCapabilityCurve::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ReactiveCapabilityCurve::declare() return BaseClassDefiner(ReactiveCapabilityCurve::addConstructToMap, ReactiveCapabilityCurve::addPrimitiveAssignFnsToMap, ReactiveCapabilityCurve::addClassAssignFnsToMap, ReactiveCapabilityCurve::debugName); } - +namespace CIMPP +{ + BaseClass* ReactiveCapabilityCurve_factory() + { + return new ReactiveCapabilityCurve; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.hpp b/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.hpp index c81f39345..95cefa865 100644 --- a/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.hpp +++ b/CGMES_2.4.15_27JAN2020/ReactiveCapabilityCurve.hpp @@ -1,40 +1,41 @@ #ifndef ReactiveCapabilityCurve_H #define ReactiveCapabilityCurve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Curve.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Curve.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EquivalentInjection; + class SynchronousMachine; -class EquivalentInjection; -class SynchronousMachine; /* Reactive power rating envelope versus the synchronous machine's active power, in both the generating and motoring modes. For each active power value there is a corresponding high and low reactive power limit value. Typically there will be a separate curve for each coolant condition, such as hydrogen pressure. The Y1 axis values represent reactive minimum and the Y2 axis values represent reactive maximum. */ - class ReactiveCapabilityCurve: public Curve + class ReactiveCapabilityCurve : public Curve { - public: - std::list EquivalentInjection; /* The reactive capability curve used by this equivalent injection. Default: 0 */ - std::list InitiallyUsedBySynchronousMachines; /* The default reactive capability curve for use by a synchronous machine. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ReactiveCapabilityCurve(); - virtual ~ReactiveCapabilityCurve(); - + ~ReactiveCapabilityCurve() override; + + std::list EquivalentInjection; /* The reactive capability curve used by this equivalent injection. Default: 0 */ + std::list InitiallyUsedBySynchronousMachines; /* The default reactive capability curve for use by a synchronous machine. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ReactiveCapabilityCurve_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ReactivePower.cpp b/CGMES_2.4.15_27JAN2020/ReactivePower.cpp index 45b4344f3..568f514f7 100644 --- a/CGMES_2.4.15_27JAN2020/ReactivePower.cpp +++ b/CGMES_2.4.15_27JAN2020/ReactivePower.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ReactivePower.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -ReactivePower::ReactivePower() {} -ReactivePower::~ReactivePower(){} +#include -ReactivePower::ReactivePower(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void ReactivePower::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void ReactivePower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +ReactivePower& ReactivePower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void ReactivePower::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +ReactivePower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char ReactivePower::debugName[] = "ReactivePower"; -const char* ReactivePower::debugString() { +const char* ReactivePower::debugString() const +{ return ReactivePower::debugName; } - -const BaseClassDefiner ReactivePower::declare() { - return BaseClassDefiner(ReactivePower::addConstructToMap, ReactivePower::addPrimitiveAssignFnsToMap, ReactivePower::addClassAssignFnsToMap, ReactivePower::debugName); +ReactivePower& ReactivePower::operator+=(const ReactivePower& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - ReactivePower& ReactivePower::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - ReactivePower& ReactivePower::operator-=(const ReactivePower& rhs) { - value -= rhs.value; - return *this; - } - - ReactivePower& ReactivePower::operator*=(const ReactivePower& rhs) { - value *= rhs.value; - return *this; - } - - ReactivePower& ReactivePower::operator/=(const ReactivePower& rhs) { - value /= rhs.value; - return *this; - } +ReactivePower& ReactivePower::operator-=(const ReactivePower& rhs) +{ + value -= rhs.value; + return *this; +} - ReactivePower& ReactivePower::operator+=(const ReactivePower& rhs) { - value += rhs.value; - return *this; - } +ReactivePower& ReactivePower::operator*=(const ReactivePower& rhs) +{ + value *= rhs.value; + return *this; +} - ReactivePower::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +ReactivePower& ReactivePower::operator/=(const ReactivePower& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, ReactivePower& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ReactivePower& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const ReactivePower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/ReactivePower.hpp b/CGMES_2.4.15_27JAN2020/ReactivePower.hpp index 0b22e461b..e80659b92 100644 --- a/CGMES_2.4.15_27JAN2020/ReactivePower.hpp +++ b/CGMES_2.4.15_27JAN2020/ReactivePower.hpp @@ -1,38 +1,39 @@ #ifndef ReactivePower_H #define ReactivePower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class ReactivePower : public BaseClass + /* + Product of RMS value of the voltage and the RMS value of the quadrature component of the current. + */ + class ReactivePower { - public: - ReactivePower(); - virtual ~ReactivePower(); - ReactivePower(long double value); - static const BaseClassDefiner declare(); - ReactivePower& operator=(long double &rop); + ReactivePower() : value(0.0), initialized(false) {} + ReactivePower(long double value) : value(value), initialized(true) {} + + ReactivePower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + ReactivePower& operator+=(const ReactivePower& rhs); ReactivePower& operator-=(const ReactivePower& rhs); ReactivePower& operator*=(const ReactivePower& rhs); ReactivePower& operator/=(const ReactivePower& rhs); + friend std::istream& operator>>(std::istream& lop, ReactivePower& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const ReactivePower& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.cpp b/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.cpp index d887a2de7..b6a466799 100644 --- a/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.cpp @@ -1,76 +1,88 @@ -#include -#include "BasicIntervalSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegularIntervalSchedule.hpp" -#include "Seconds.hpp" -#include "DateTime.hpp" +#include +#include + #include "RegularTimePoint.hpp" +#include "DateTime.hpp" +#include "Seconds.hpp" using namespace CIMPP; -RegularIntervalSchedule::RegularIntervalSchedule(): endTime(nullptr) {}; - +RegularIntervalSchedule::RegularIntervalSchedule() {}; RegularIntervalSchedule::~RegularIntervalSchedule() {}; -bool assign_RegularIntervalSchedule_endTime(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->endTime = dynamic_cast(BaseClass_ptr2); - if(element->endTime != nullptr) - return true; - } - return false; +bool assign_RegularIntervalSchedule_endTime(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + element->endTime = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_RegularIntervalSchedule_TimePoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TimePoints.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_RegularIntervalSchedule_timeStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->timeStep; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_RegularIntervalSchedule_timeStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->timeStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegularTimePoint_IntervalSchedule(BaseClass*, BaseClass*); +bool assign_RegularIntervalSchedule_TimePoints(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegularIntervalSchedule* element = dynamic_cast(BaseClass_ptr1); + RegularTimePoint* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TimePoints.begin(), element->TimePoints.end(), element2) == element->TimePoints.end()) + { + element->TimePoints.push_back(element2); + return assign_RegularTimePoint_IntervalSchedule(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* RegularIntervalSchedule_factory() { - return new RegularIntervalSchedule; - } +const char RegularIntervalSchedule::debugName[] = "RegularIntervalSchedule"; +const char* RegularIntervalSchedule::debugString() const +{ + return RegularIntervalSchedule::debugName; } -void RegularIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) { +void RegularIntervalSchedule::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule"), &RegularIntervalSchedule_factory)); } -void RegularIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void RegularIntervalSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.endTime"), &assign_RegularIntervalSchedule_endTime)); assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.timeStep"), &assign_RegularIntervalSchedule_timeStep)); - } - -void RegularIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.endTime"), &assign_RegularIntervalSchedule_endTime)); - assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.TimePoints"), &assign_RegularIntervalSchedule_TimePoints)); } -const char RegularIntervalSchedule::debugName[] = "RegularIntervalSchedule"; -const char* RegularIntervalSchedule::debugString() +void RegularIntervalSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegularIntervalSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegularIntervalSchedule.TimePoints"), &assign_RegularIntervalSchedule_TimePoints)); } const BaseClassDefiner RegularIntervalSchedule::declare() @@ -78,4 +90,10 @@ const BaseClassDefiner RegularIntervalSchedule::declare() return BaseClassDefiner(RegularIntervalSchedule::addConstructToMap, RegularIntervalSchedule::addPrimitiveAssignFnsToMap, RegularIntervalSchedule::addClassAssignFnsToMap, RegularIntervalSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* RegularIntervalSchedule_factory() + { + return new RegularIntervalSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.hpp b/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.hpp index de8973301..6b57324c8 100644 --- a/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/RegularIntervalSchedule.hpp @@ -1,42 +1,43 @@ #ifndef RegularIntervalSchedule_H #define RegularIntervalSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BasicIntervalSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BasicIntervalSchedule.hpp" +#include "BaseClassDefiner.hpp" +#include "DateTime.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class RegularTimePoint; - -class DateTime; -class RegularTimePoint; /* The schedule has time points where the time between them is constant. */ - class RegularIntervalSchedule: public BasicIntervalSchedule + class RegularIntervalSchedule : public BasicIntervalSchedule { - public: - CIMPP::Seconds timeStep; /* The time between each pair of subsequent regular time points in sequence order. Default: nullptr */ - CIMPP::DateTime* endTime; /* The time for the last time point. Default: '' */ - std::list TimePoints; /* The regular interval time point data values that define this schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegularIntervalSchedule(); - virtual ~RegularIntervalSchedule(); - + ~RegularIntervalSchedule() override; + + std::list TimePoints; /* The regular interval time point data values that define this schedule. Default: 0 */ + CIMPP::DateTime endTime; /* The time for the last time point. Default: '' */ + CIMPP::Seconds timeStep; /* The time between each pair of subsequent regular time points in sequence order. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegularIntervalSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RegularTimePoint.cpp b/CGMES_2.4.15_27JAN2020/RegularTimePoint.cpp index 33e56c754..e5733a393 100644 --- a/CGMES_2.4.15_27JAN2020/RegularTimePoint.cpp +++ b/CGMES_2.4.15_27JAN2020/RegularTimePoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegularTimePoint.hpp" +#include +#include + #include "RegularIntervalSchedule.hpp" #include "Integer.hpp" #include "Simple_Float.hpp" @@ -9,86 +13,92 @@ using namespace CIMPP; -RegularTimePoint::RegularTimePoint(): IntervalSchedule(nullptr) {}; - +RegularTimePoint::RegularTimePoint() : IntervalSchedule(nullptr) {}; RegularTimePoint::~RegularTimePoint() {}; -bool assign_RegularIntervalSchedule_TimePoints(BaseClass*, BaseClass*); -bool assign_RegularTimePoint_IntervalSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - element->IntervalSchedule = dynamic_cast(BaseClass_ptr2); - if(element->IntervalSchedule != nullptr) - return assign_RegularIntervalSchedule_TimePoints(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_RegularTimePoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequenceNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegularTimePoint_value1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegularTimePoint_value2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RegularTimePoint_sequenceNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequenceNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegularIntervalSchedule_TimePoints(BaseClass*, BaseClass*); +bool assign_RegularTimePoint_IntervalSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegularTimePoint* element = dynamic_cast(BaseClass_ptr1); + RegularIntervalSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->IntervalSchedule != element2) + { + element->IntervalSchedule = element2; + return assign_RegularIntervalSchedule_TimePoints(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RegularTimePoint_value1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegularTimePoint_value2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegularTimePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RegularTimePoint_factory() { - return new RegularTimePoint; - } + +const char RegularTimePoint::debugName[] = "RegularTimePoint"; +const char* RegularTimePoint::debugString() const +{ + return RegularTimePoint::debugName; } -void RegularTimePoint::addConstructToMap(std::unordered_map& factory_map) { +void RegularTimePoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegularTimePoint"), &RegularTimePoint_factory)); } -void RegularTimePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.sequenceNumber"), &assign_RegularTimePoint_sequenceNumber)); +void RegularTimePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.sequenceNumber"), &assign_RegularTimePoint_sequenceNumber)); assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.value1"), &assign_RegularTimePoint_value1)); assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.value2"), &assign_RegularTimePoint_value2)); } -void RegularTimePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.IntervalSchedule"), &assign_RegularTimePoint_IntervalSchedule)); - } - -const char RegularTimePoint::debugName[] = "RegularTimePoint"; -const char* RegularTimePoint::debugString() +void RegularTimePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegularTimePoint::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegularTimePoint.IntervalSchedule"), &assign_RegularTimePoint_IntervalSchedule)); } const BaseClassDefiner RegularTimePoint::declare() @@ -96,4 +106,10 @@ const BaseClassDefiner RegularTimePoint::declare() return BaseClassDefiner(RegularTimePoint::addConstructToMap, RegularTimePoint::addPrimitiveAssignFnsToMap, RegularTimePoint::addClassAssignFnsToMap, RegularTimePoint::debugName); } - +namespace CIMPP +{ + BaseClass* RegularTimePoint_factory() + { + return new RegularTimePoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RegularTimePoint.hpp b/CGMES_2.4.15_27JAN2020/RegularTimePoint.hpp index a313cfc35..3d8667b37 100644 --- a/CGMES_2.4.15_27JAN2020/RegularTimePoint.hpp +++ b/CGMES_2.4.15_27JAN2020/RegularTimePoint.hpp @@ -1,43 +1,44 @@ #ifndef RegularTimePoint_H #define RegularTimePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class RegularIntervalSchedule; - -class RegularIntervalSchedule; /* Time point for a schedule where the time between the consecutive points is constant. */ - class RegularTimePoint: public BaseClass + class RegularTimePoint : public BaseClass { - public: - CIMPP::RegularIntervalSchedule* IntervalSchedule; /* Regular interval schedule containing this time point. Default: 0 */ - CIMPP::Integer sequenceNumber; /* The position of the regular time point in the sequence. Note that time points don`t have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the associated regular interval schedule`s time step with the regular time point sequence number and adding the associated schedules start time. Default: 0 */ - CIMPP::Simple_Float value1; /* The first value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ - CIMPP::Simple_Float value2; /* The second value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegularTimePoint(); - virtual ~RegularTimePoint(); - + ~RegularTimePoint() override; + + CIMPP::RegularIntervalSchedule* IntervalSchedule; /* Regular interval schedule containing this time point. Default: 0 */ + CIMPP::Integer sequenceNumber; /* The position of the regular time point in the sequence. Note that time points don`t have to be sequential, i.e. time points may be omitted. The actual time for a RegularTimePoint is computed by multiplying the associated regular interval schedule`s time step with the regular time point sequence number and adding the associated schedules start time. Default: 0 */ + CIMPP::Simple_Float value1; /* The first value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ + CIMPP::Simple_Float value2; /* The second value at the time. The meaning of the value is defined by the derived type of the associated schedule. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegularTimePoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RegulatingCondEq.cpp b/CGMES_2.4.15_27JAN2020/RegulatingCondEq.cpp index a2dbb3cd1..19bb9d5eb 100644 --- a/CGMES_2.4.15_27JAN2020/RegulatingCondEq.cpp +++ b/CGMES_2.4.15_27JAN2020/RegulatingCondEq.cpp @@ -1,64 +1,72 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulatingCondEq.hpp" +#include +#include + #include "RegulatingControl.hpp" #include "Boolean.hpp" using namespace CIMPP; -RegulatingCondEq::RegulatingCondEq(): RegulatingControl(nullptr) {}; - +RegulatingCondEq::RegulatingCondEq() : RegulatingControl(nullptr) {}; RegulatingCondEq::~RegulatingCondEq() {}; -bool assign_RegulatingControl_RegulatingCondEq(BaseClass*, BaseClass*); -bool assign_RegulatingCondEq_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1)) { - element->RegulatingControl = dynamic_cast(BaseClass_ptr2); - if(element->RegulatingControl != nullptr) - return assign_RegulatingControl_RegulatingCondEq(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_RegulatingCondEq_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->controlEnabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RegulatingCondEq_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->controlEnabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RegulatingControl_RegulatingCondEq(BaseClass*, BaseClass*); +bool assign_RegulatingCondEq_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingCondEq* element = dynamic_cast(BaseClass_ptr1); + RegulatingControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RegulatingControl != element2) + { + element->RegulatingControl = element2; + return assign_RegulatingControl_RegulatingCondEq(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* RegulatingCondEq_factory() { - return new RegulatingCondEq; - } + +const char RegulatingCondEq::debugName[] = "RegulatingCondEq"; +const char* RegulatingCondEq::debugString() const +{ + return RegulatingCondEq::debugName; } -void RegulatingCondEq::addConstructToMap(std::unordered_map& factory_map) { +void RegulatingCondEq::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegulatingCondEq"), &RegulatingCondEq_factory)); } -void RegulatingCondEq::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.controlEnabled"), &assign_RegulatingCondEq_controlEnabled)); +void RegulatingCondEq::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.controlEnabled"), &assign_RegulatingCondEq_controlEnabled)); } -void RegulatingCondEq::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.RegulatingControl"), &assign_RegulatingCondEq_RegulatingControl)); - } - -const char RegulatingCondEq::debugName[] = "RegulatingCondEq"; -const char* RegulatingCondEq::debugString() +void RegulatingCondEq::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegulatingCondEq::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegulatingCondEq.RegulatingControl"), &assign_RegulatingCondEq_RegulatingControl)); } const BaseClassDefiner RegulatingCondEq::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner RegulatingCondEq::declare() return BaseClassDefiner(RegulatingCondEq::addConstructToMap, RegulatingCondEq::addPrimitiveAssignFnsToMap, RegulatingCondEq::addClassAssignFnsToMap, RegulatingCondEq::debugName); } - +namespace CIMPP +{ + BaseClass* RegulatingCondEq_factory() + { + return new RegulatingCondEq; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RegulatingCondEq.hpp b/CGMES_2.4.15_27JAN2020/RegulatingCondEq.hpp index d468fd9ab..4540114e0 100644 --- a/CGMES_2.4.15_27JAN2020/RegulatingCondEq.hpp +++ b/CGMES_2.4.15_27JAN2020/RegulatingCondEq.hpp @@ -1,40 +1,41 @@ #ifndef RegulatingCondEq_H #define RegulatingCondEq_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class RegulatingControl; -class RegulatingControl; /* A type of conducting equipment that can regulate a quantity (i.e. voltage or flow) at a specific point in the network. */ - class RegulatingCondEq: public ConductingEquipment + class RegulatingCondEq : public ConductingEquipment { - public: - CIMPP::RegulatingControl* RegulatingControl; /* The regulating control scheme in which this equipment participates. Default: 0 */ - CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegulatingCondEq(); - virtual ~RegulatingCondEq(); - + ~RegulatingCondEq() override; + + CIMPP::RegulatingControl* RegulatingControl; /* The regulating control scheme in which this equipment participates. Default: 0 */ + CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegulatingCondEq_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RegulatingControl.cpp b/CGMES_2.4.15_27JAN2020/RegulatingControl.cpp index e4ce79408..8516c962f 100644 --- a/CGMES_2.4.15_27JAN2020/RegulatingControl.cpp +++ b/CGMES_2.4.15_27JAN2020/RegulatingControl.cpp @@ -1,165 +1,192 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulatingControl.hpp" -#include "Terminal.hpp" +#include +#include + #include "RegulatingCondEq.hpp" -#include "RegulatingControlModeKind.hpp" #include "RegulationSchedule.hpp" +#include "Terminal.hpp" #include "Boolean.hpp" #include "Boolean.hpp" +#include "RegulatingControlModeKind.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "UnitMultiplier.hpp" using namespace CIMPP; -RegulatingControl::RegulatingControl(): Terminal(nullptr) {}; - +RegulatingControl::RegulatingControl() : Terminal(nullptr) {}; RegulatingControl::~RegulatingControl() {}; -bool assign_Terminal_RegulatingControl(BaseClass*, BaseClass*); -bool assign_RegulatingControl_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_RegulatingControl_RegulatingCondEq(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RegulatingCondEq.push_back(dynamic_cast(BaseClass_ptr2)); + + +bool assign_RegulatingControl_discrete(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->discrete; + if (buffer.fail()) + return false; + else return true; - } } return false; } - -bool assign_RegulatingControl_RegulationSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RegulationSchedule.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_RegulatingControl_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->enabled; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_RegulatingControl_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegulatingControl_targetDeadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetDeadband; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegulatingControl_targetValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegulatingControl_targetValueUnitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetValueUnitMultiplier; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RegulatingCondEq_RegulatingControl(BaseClass*, BaseClass*); +bool assign_RegulatingControl_RegulatingCondEq(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingControl* element = dynamic_cast(BaseClass_ptr1); + RegulatingCondEq* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RegulatingCondEq.begin(), element->RegulatingCondEq.end(), element2) == element->RegulatingCondEq.end()) + { + element->RegulatingCondEq.push_back(element2); + return assign_RegulatingCondEq_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_RegulationSchedule_RegulatingControl(BaseClass*, BaseClass*); +bool assign_RegulatingControl_RegulationSchedule(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingControl* element = dynamic_cast(BaseClass_ptr1); + RegulationSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RegulationSchedule.begin(), element->RegulationSchedule.end(), element2) == element->RegulationSchedule.end()) + { + element->RegulationSchedule.push_back(element2); + return assign_RegulationSchedule_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} - -bool assign_RegulatingControl_mode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_RegulatingControl(BaseClass*, BaseClass*); +bool assign_RegulatingControl_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulatingControl* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_RegulatingControl(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RegulatingControl_discrete(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->discrete; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_enabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->enabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_targetDeadband(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetDeadband; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_targetValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RegulatingControl_targetValueUnitMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RegulatingControl* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetValueUnitMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RegulatingControl_factory() { - return new RegulatingControl; - } +const char RegulatingControl::debugName[] = "RegulatingControl"; +const char* RegulatingControl::debugString() const +{ + return RegulatingControl::debugName; } -void RegulatingControl::addConstructToMap(std::unordered_map& factory_map) { +void RegulatingControl::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RegulatingControl"), &RegulatingControl_factory)); } -void RegulatingControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.mode"), &assign_RegulatingControl_mode)); - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.discrete"), &assign_RegulatingControl_discrete)); +void RegulatingControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.discrete"), &assign_RegulatingControl_discrete)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.enabled"), &assign_RegulatingControl_enabled)); + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.mode"), &assign_RegulatingControl_mode)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.targetDeadband"), &assign_RegulatingControl_targetDeadband)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.targetValue"), &assign_RegulatingControl_targetValue)); assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.targetValueUnitMultiplier"), &assign_RegulatingControl_targetValueUnitMultiplier)); } -void RegulatingControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.Terminal"), &assign_RegulatingControl_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulatingCondEq"), &assign_RegulatingControl_RegulatingCondEq)); - assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulationSchedule"), &assign_RegulatingControl_RegulationSchedule)); - } - -const char RegulatingControl::debugName[] = "RegulatingControl"; -const char* RegulatingControl::debugString() +void RegulatingControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegulatingControl::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulatingCondEq"), &assign_RegulatingControl_RegulatingCondEq)); + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.RegulationSchedule"), &assign_RegulatingControl_RegulationSchedule)); + assign_map.insert(std::make_pair(std::string("cim:RegulatingControl.Terminal"), &assign_RegulatingControl_Terminal)); } const BaseClassDefiner RegulatingControl::declare() @@ -167,4 +194,10 @@ const BaseClassDefiner RegulatingControl::declare() return BaseClassDefiner(RegulatingControl::addConstructToMap, RegulatingControl::addPrimitiveAssignFnsToMap, RegulatingControl::addClassAssignFnsToMap, RegulatingControl::debugName); } - +namespace CIMPP +{ + BaseClass* RegulatingControl_factory() + { + return new RegulatingControl; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RegulatingControl.hpp b/CGMES_2.4.15_27JAN2020/RegulatingControl.hpp index 922f84d25..6053d20d9 100644 --- a/CGMES_2.4.15_27JAN2020/RegulatingControl.hpp +++ b/CGMES_2.4.15_27JAN2020/RegulatingControl.hpp @@ -1,52 +1,53 @@ #ifndef RegulatingControl_H #define RegulatingControl_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "RegulatingControlModeKind.hpp" +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "RegulatingControlModeKind.hpp" #include "Simple_Float.hpp" #include "UnitMultiplier.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class RegulatingCondEq; + class RegulationSchedule; + class Terminal; -class Terminal; -class RegulatingCondEq; -class RegulationSchedule; /* Specifies a set of equipment that works together to control a power system quantity such as voltage or flow. Remote bus voltage control is possible by specifying the controlled terminal located at some place remote from the controlling equipment. In case multiple equipment, possibly of different types, control same terminal there must be only one RegulatingControl at that terminal. The most specific subtype of RegulatingControl shall be used in case such equipment participate in the control, e.g. TapChangerControl for tap changers. For flow control load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. */ - class RegulatingControl: public PowerSystemResource + class RegulatingControl : public PowerSystemResource { - public: - CIMPP::Terminal* Terminal; /* The controls regulating this terminal. Default: 0 */ - std::list RegulatingCondEq; /* The equipment that participates in this regulating control scheme. Default: 0 */ - CIMPP::RegulatingControlModeKind mode; /* The regulating control mode presently available. This specification allows for determining the kind of regulation without need for obtaining the units from a schedule. Default: 0 */ - std::list RegulationSchedule; /* Schedule for this Regulating regulating control. Default: 0 */ - CIMPP::Boolean discrete; /* The regulation is performed in a discrete mode. This applies to equipment with discrete controls, e.g. tap changers and shunt compensators. Default: false */ - CIMPP::Boolean enabled; /* The flag tells if regulation is enabled. Default: false */ - CIMPP::Simple_Float targetDeadband; /* This is a deadband used with discrete control to avoid excessive update of controls like tap changers and shunt compensator banks while regulating. The units of those appropriate for the mode. Default: nullptr */ - CIMPP::Simple_Float targetValue; /* The target value specified for case input. This value can be used for the target value without the use of schedules. The value has the units appropriate to the mode attribute. Default: nullptr */ - CIMPP::UnitMultiplier targetValueUnitMultiplier; /* Specify the multiplier for used for the targetValue. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegulatingControl(); - virtual ~RegulatingControl(); - + ~RegulatingControl() override; + + std::list RegulatingCondEq; /* The equipment that participates in this regulating control scheme. Default: 0 */ + std::list RegulationSchedule; /* Schedule for this Regulating regulating control. Default: 0 */ + CIMPP::Terminal* Terminal; /* The controls regulating this terminal. Default: 0 */ + CIMPP::Boolean discrete; /* The regulation is performed in a discrete mode. This applies to equipment with discrete controls, e.g. tap changers and shunt compensators. Default: false */ + CIMPP::Boolean enabled; /* The flag tells if regulation is enabled. Default: false */ + CIMPP::RegulatingControlModeKind mode; /* The regulating control mode presently available. This specification allows for determining the kind of regulation without need for obtaining the units from a schedule. Default: 0 */ + CIMPP::Simple_Float targetDeadband; /* This is a deadband used with discrete control to avoid excessive update of controls like tap changers and shunt compensator banks while regulating. The units of those appropriate for the mode. Default: nullptr */ + CIMPP::Simple_Float targetValue; /* The target value specified for case input. This value can be used for the target value without the use of schedules. The value has the units appropriate to the mode attribute. Default: nullptr */ + CIMPP::UnitMultiplier targetValueUnitMultiplier; /* Specify the multiplier for used for the targetValue. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegulatingControl_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.cpp b/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.cpp index 36d62b3f6..7ac923d24 100644 --- a/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.cpp +++ b/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulatingControlModeKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::RegulatingControlModeKind& rop) +RegulatingControlModeKind& RegulatingControlModeKind::operator=(RegulatingControlModeKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +RegulatingControlModeKind::operator RegulatingControlModeKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char RegulatingControlModeKind::debugName[] = "RegulatingControlModeKind"; +const char* RegulatingControlModeKind::debugString() const +{ + return RegulatingControlModeKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RegulatingControlModeKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -63,5 +94,51 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const RegulatingControlModeKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == RegulatingControlModeKind::voltage) + { + EnumSymbol = "voltage"; + } + if (obj.value == RegulatingControlModeKind::activePower) + { + EnumSymbol = "activePower"; + } + if (obj.value == RegulatingControlModeKind::reactivePower) + { + EnumSymbol = "reactivePower"; + } + if (obj.value == RegulatingControlModeKind::currentFlow) + { + EnumSymbol = "currentFlow"; + } + if (obj.value == RegulatingControlModeKind::admittance) + { + EnumSymbol = "admittance"; + } + if (obj.value == RegulatingControlModeKind::timeScheduled) + { + EnumSymbol = "timeScheduled"; + } + if (obj.value == RegulatingControlModeKind::temperature) + { + EnumSymbol = "temperature"; + } + if (obj.value == RegulatingControlModeKind::powerFactor) + { + EnumSymbol = "powerFactor"; + } + + if (!EnumSymbol.empty()) + { + os << "RegulatingControlModeKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.hpp b/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.hpp index fc671981d..ed5351e3e 100644 --- a/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.hpp +++ b/CGMES_2.4.15_27JAN2020/RegulatingControlModeKind.hpp @@ -1,45 +1,70 @@ #ifndef RegulatingControlModeKind_H #define RegulatingControlModeKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The kind of regulation model. For example regulating voltage, reactive power, active power, etc. */ - enum class RegulatingControlModeKind + class RegulatingControlModeKind { - /** - * Voltage is specified. - */ - voltage, - /** - * Active power is specified. - */ - activePower, - /** - * Reactive power is specified. - */ - reactivePower, - /** - * Current flow is specified. - */ - currentFlow, - /** - * Admittance is specified. - */ - admittance, - /** - * Control switches on/off by time of day. The times may change on the weekend, or in different seasons. - */ - timeScheduled, - /** - * Control switches on/off based on the local temperature (i.e., a thermostat). - */ - temperature, - /** - * Power factor is specified. - */ - powerFactor, + public: + enum RegulatingControlModeKind_ENUM + { + /** + * Voltage is specified. + */ + voltage, + /** + * Active power is specified. + */ + activePower, + /** + * Reactive power is specified. + */ + reactivePower, + /** + * Current flow is specified. + */ + currentFlow, + /** + * Admittance is specified. + */ + admittance, + /** + * Control switches on/off by time of day. The times may change on the weekend, or in different seasons. + */ + timeScheduled, + /** + * Control switches on/off based on the local temperature (i.e., a thermostat). + */ + temperature, + /** + * Power factor is specified. + */ + powerFactor, + }; + + RegulatingControlModeKind() : value(), initialized(false) {} + RegulatingControlModeKind(RegulatingControlModeKind_ENUM value) : value(value), initialized(true) {} + + RegulatingControlModeKind& operator=(RegulatingControlModeKind_ENUM rop); + operator RegulatingControlModeKind_ENUM() const; + + RegulatingControlModeKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, RegulatingControlModeKind& rop); + friend std::ostream& operator<<(std::ostream& os, const RegulatingControlModeKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::RegulatingControlModeKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/RegulationSchedule.cpp b/CGMES_2.4.15_27JAN2020/RegulationSchedule.cpp index 74a4e7b8f..71c2e0c89 100644 --- a/CGMES_2.4.15_27JAN2020/RegulationSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/RegulationSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RegulationSchedule.hpp" +#include +#include + #include "RegulatingControl.hpp" using namespace CIMPP; -RegulationSchedule::RegulationSchedule(): RegulatingControl(nullptr) {}; - +RegulationSchedule::RegulationSchedule() : RegulatingControl(nullptr) {}; RegulationSchedule::~RegulationSchedule() {}; -bool assign_RegulatingControl_RegulationSchedule(BaseClass*, BaseClass*); -bool assign_RegulationSchedule_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RegulationSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->RegulatingControl = dynamic_cast(BaseClass_ptr2); - if(element->RegulatingControl != nullptr) - return assign_RegulatingControl_RegulationSchedule(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* RegulationSchedule_factory() { - return new RegulationSchedule; +bool assign_RegulatingControl_RegulationSchedule(BaseClass*, BaseClass*); +bool assign_RegulationSchedule_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RegulationSchedule* element = dynamic_cast(BaseClass_ptr1); + RegulatingControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RegulatingControl != element2) + { + element->RegulatingControl = element2; + return assign_RegulatingControl_RegulationSchedule(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void RegulationSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RegulationSchedule"), &RegulationSchedule_factory)); +const char RegulationSchedule::debugName[] = "RegulationSchedule"; +const char* RegulationSchedule::debugString() const +{ + return RegulationSchedule::debugName; } -void RegulationSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void RegulationSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:RegulationSchedule"), &RegulationSchedule_factory)); +} -void RegulationSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RegulationSchedule.RegulatingControl"), &assign_RegulationSchedule_RegulatingControl)); +void RegulationSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char RegulationSchedule::debugName[] = "RegulationSchedule"; -const char* RegulationSchedule::debugString() +void RegulationSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RegulationSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:RegulationSchedule.RegulatingControl"), &assign_RegulationSchedule_RegulatingControl)); } const BaseClassDefiner RegulationSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner RegulationSchedule::declare() return BaseClassDefiner(RegulationSchedule::addConstructToMap, RegulationSchedule::addPrimitiveAssignFnsToMap, RegulationSchedule::addClassAssignFnsToMap, RegulationSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* RegulationSchedule_factory() + { + return new RegulationSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RegulationSchedule.hpp b/CGMES_2.4.15_27JAN2020/RegulationSchedule.hpp index 0d8fed494..5b8a56428 100644 --- a/CGMES_2.4.15_27JAN2020/RegulationSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/RegulationSchedule.hpp @@ -1,38 +1,39 @@ #ifndef RegulationSchedule_H #define RegulationSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RegulatingControl; -class RegulatingControl; /* A pre-established pattern over time for a controlled variable, e.g., busbar voltage. */ - class RegulationSchedule: public SeasonDayTypeSchedule + class RegulationSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::RegulatingControl* RegulatingControl; /* Regulating controls that have this Schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RegulationSchedule(); - virtual ~RegulationSchedule(); - + ~RegulationSchedule() override; + + CIMPP::RegulatingControl* RegulatingControl; /* Regulating controls that have this Schedule. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RegulationSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RemoteInputSignal.cpp b/CGMES_2.4.15_27JAN2020/RemoteInputSignal.cpp index 217f515ba..30f558ba0 100644 --- a/CGMES_2.4.15_27JAN2020/RemoteInputSignal.cpp +++ b/CGMES_2.4.15_27JAN2020/RemoteInputSignal.cpp @@ -1,165 +1,232 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RemoteInputSignal.hpp" -#include "Terminal.hpp" -#include "RemoteSignalKind.hpp" +#include +#include + +#include "DiscontinuousExcitationControlDynamics.hpp" #include "PFVArControllerType1Dynamics.hpp" +#include "PowerSystemStabilizerDynamics.hpp" +#include "Terminal.hpp" #include "UnderexcitationLimiterDynamics.hpp" -#include "WindTurbineType1or2Dynamics.hpp" #include "VoltageCompensatorDynamics.hpp" -#include "PowerSystemStabilizerDynamics.hpp" -#include "DiscontinuousExcitationControlDynamics.hpp" -#include "WindTurbineType3or4Dynamics.hpp" #include "WindPlantDynamics.hpp" +#include "WindTurbineType1or2Dynamics.hpp" +#include "WindTurbineType3or4Dynamics.hpp" +#include "RemoteSignalKind.hpp" using namespace CIMPP; -RemoteInputSignal::RemoteInputSignal(): Terminal(nullptr), PFVArControllerType1Dynamics(nullptr), UnderexcitationLimiterDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr), VoltageCompensatorDynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), DiscontinuousExcitationControlDynamics(nullptr), WindTurbineType3or4Dynamics(nullptr), WindPlantDynamics(nullptr) {}; - +RemoteInputSignal::RemoteInputSignal() : DiscontinuousExcitationControlDynamics(nullptr), PFVArControllerType1Dynamics(nullptr), PowerSystemStabilizerDynamics(nullptr), Terminal(nullptr), UnderexcitationLimiterDynamics(nullptr), VoltageCompensatorDynamics(nullptr), WindPlantDynamics(nullptr), WindTurbineType1or2Dynamics(nullptr), WindTurbineType3or4Dynamics(nullptr) {}; RemoteInputSignal::~RemoteInputSignal() {}; -bool assign_Terminal_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1Dynamics != nullptr) - return assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->UnderexcitationLimiterDynamics = dynamic_cast(BaseClass_ptr2); - if(element->UnderexcitationLimiterDynamics != nullptr) - return assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2Dynamics != nullptr) - return true; - } - return false; -} -bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->VoltageCompensatorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->VoltageCompensatorDynamics != nullptr) - return assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->PowerSystemStabilizerDynamics = dynamic_cast(BaseClass_ptr2); - if(element->PowerSystemStabilizerDynamics != nullptr) - return assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass*, BaseClass*); -bool assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->DiscontinuousExcitationControlDynamics = dynamic_cast(BaseClass_ptr2); - if(element->DiscontinuousExcitationControlDynamics != nullptr) - return assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4Dynamics != nullptr) - return true; - } - return false; -} -bool assign_RemoteInputSignal_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantDynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantDynamics != nullptr) - return true; - } - return false; +bool assign_RemoteInputSignal_remoteSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->remoteSignalType; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + DiscontinuousExcitationControlDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DiscontinuousExcitationControlDynamics != element2) + { + element->DiscontinuousExcitationControlDynamics = element2; + return assign_DiscontinuousExcitationControlDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_RemoteInputSignal_remoteSignalType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->remoteSignalType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1Dynamics != element2) + { + element->PFVArControllerType1Dynamics = element2; + return assign_PFVArControllerType1Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_PowerSystemStabilizerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + PowerSystemStabilizerDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PowerSystemStabilizerDynamics != element2) + { + element->PowerSystemStabilizerDynamics = element2; + return assign_PowerSystemStabilizerDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_Terminal_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + UnderexcitationLimiterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->UnderexcitationLimiterDynamics != element2) + { + element->UnderexcitationLimiterDynamics = element2; + return assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + VoltageCompensatorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->VoltageCompensatorDynamics != element2) + { + element->VoltageCompensatorDynamics = element2; + return assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindPlantDynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + WindPlantDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantDynamics != element2) + { + element->WindPlantDynamics = element2; + return assign_WindPlantDynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2Dynamics != element2) + { + element->WindTurbineType1or2Dynamics = element2; + return assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass*, BaseClass*); +bool assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RemoteInputSignal* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4Dynamics != element2) + { + element->WindTurbineType3or4Dynamics = element2; + return assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* RemoteInputSignal_factory() { - return new RemoteInputSignal; - } +const char RemoteInputSignal::debugName[] = "RemoteInputSignal"; +const char* RemoteInputSignal::debugString() const +{ + return RemoteInputSignal::debugName; } -void RemoteInputSignal::addConstructToMap(std::unordered_map& factory_map) { +void RemoteInputSignal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RemoteInputSignal"), &RemoteInputSignal_factory)); } -void RemoteInputSignal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.remoteSignalType"), &assign_RemoteInputSignal_remoteSignalType)); - } +void RemoteInputSignal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.remoteSignalType"), &assign_RemoteInputSignal_remoteSignalType)); +} -void RemoteInputSignal::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void RemoteInputSignal::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.DiscontinuousExcitationControlDynamics"), &assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics)); + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PFVArControllerType1Dynamics"), &assign_RemoteInputSignal_PFVArControllerType1Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PowerSystemStabilizerDynamics"), &assign_RemoteInputSignal_PowerSystemStabilizerDynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.Terminal"), &assign_RemoteInputSignal_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PFVArControllerType1Dynamics"), &assign_RemoteInputSignal_PFVArControllerType1Dynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.UnderexcitationLimiterDynamics"), &assign_RemoteInputSignal_UnderexcitationLimiterDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType1or2Dynamics"), &assign_RemoteInputSignal_WindTurbineType1or2Dynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.VoltageCompensatorDynamics"), &assign_RemoteInputSignal_VoltageCompensatorDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.PowerSystemStabilizerDynamics"), &assign_RemoteInputSignal_PowerSystemStabilizerDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.DiscontinuousExcitationControlDynamics"), &assign_RemoteInputSignal_DiscontinuousExcitationControlDynamics)); - assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType3or4Dynamics"), &assign_RemoteInputSignal_WindTurbineType3or4Dynamics)); assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindPlantDynamics"), &assign_RemoteInputSignal_WindPlantDynamics)); -} - -const char RemoteInputSignal::debugName[] = "RemoteInputSignal"; -const char* RemoteInputSignal::debugString() -{ - return RemoteInputSignal::debugName; + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType1or2Dynamics"), &assign_RemoteInputSignal_WindTurbineType1or2Dynamics)); + assign_map.insert(std::make_pair(std::string("cim:RemoteInputSignal.WindTurbineType3or4Dynamics"), &assign_RemoteInputSignal_WindTurbineType3or4Dynamics)); } const BaseClassDefiner RemoteInputSignal::declare() @@ -167,4 +234,10 @@ const BaseClassDefiner RemoteInputSignal::declare() return BaseClassDefiner(RemoteInputSignal::addConstructToMap, RemoteInputSignal::addPrimitiveAssignFnsToMap, RemoteInputSignal::addClassAssignFnsToMap, RemoteInputSignal::debugName); } - +namespace CIMPP +{ + BaseClass* RemoteInputSignal_factory() + { + return new RemoteInputSignal; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RemoteInputSignal.hpp b/CGMES_2.4.15_27JAN2020/RemoteInputSignal.hpp index 908d89be5..6f856860e 100644 --- a/CGMES_2.4.15_27JAN2020/RemoteInputSignal.hpp +++ b/CGMES_2.4.15_27JAN2020/RemoteInputSignal.hpp @@ -1,56 +1,57 @@ #ifndef RemoteInputSignal_H #define RemoteInputSignal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "RemoteSignalKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiscontinuousExcitationControlDynamics; + class PFVArControllerType1Dynamics; + class PowerSystemStabilizerDynamics; + class Terminal; + class UnderexcitationLimiterDynamics; + class VoltageCompensatorDynamics; + class WindPlantDynamics; + class WindTurbineType1or2Dynamics; + class WindTurbineType3or4Dynamics; - -class Terminal; -class PFVArControllerType1Dynamics; -class UnderexcitationLimiterDynamics; -class WindTurbineType1or2Dynamics; -class VoltageCompensatorDynamics; -class PowerSystemStabilizerDynamics; -class DiscontinuousExcitationControlDynamics; -class WindTurbineType3or4Dynamics; -class WindPlantDynamics; /* Supports connection to a terminal associated with a remote bus from which an input signal of a specific type is coming. */ - class RemoteInputSignal: public IdentifiedObject + class RemoteInputSignal : public IdentifiedObject { - public: - CIMPP::Terminal* Terminal; /* Remote terminal with which this input signal is associated. Default: 0 */ - CIMPP::RemoteSignalKind remoteSignalType; /* Type of input signal. Default: 0 */ - CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model using this remote input signal. Default: 0 */ - CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Underexcitation limiter model using this remote input signal. Default: 0 */ - CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator Type 1 or Type 2 model using this remote input signal. Default: 0 */ - CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model using this remote input signal. Default: 0 */ - CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model using this remote input signal. Default: 0 */ - CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model using this remote input signal. Default: 0 */ - CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Remote input signal used by these wind turbine Type 3 or 4 models. Default: 0 */ - CIMPP::WindPlantDynamics* WindPlantDynamics; /* The remote signal with which this power plant is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RemoteInputSignal(); - virtual ~RemoteInputSignal(); - + ~RemoteInputSignal() override; + + CIMPP::DiscontinuousExcitationControlDynamics* DiscontinuousExcitationControlDynamics; /* Discontinuous excitation control model using this remote input signal. Default: 0 */ + CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model using this remote input signal. Default: 0 */ + CIMPP::PowerSystemStabilizerDynamics* PowerSystemStabilizerDynamics; /* Power system stabilizer model using this remote input signal. Default: 0 */ + CIMPP::Terminal* Terminal; /* Remote terminal with which this input signal is associated. Default: 0 */ + CIMPP::UnderexcitationLimiterDynamics* UnderexcitationLimiterDynamics; /* Underexcitation limiter model using this remote input signal. Default: 0 */ + CIMPP::VoltageCompensatorDynamics* VoltageCompensatorDynamics; /* Voltage compensator model using this remote input signal. Default: 0 */ + CIMPP::WindPlantDynamics* WindPlantDynamics; /* The remote signal with which this power plant is associated. Default: 0 */ + CIMPP::WindTurbineType1or2Dynamics* WindTurbineType1or2Dynamics; /* Wind generator Type 1 or Type 2 model using this remote input signal. Default: 0 */ + CIMPP::WindTurbineType3or4Dynamics* WindTurbineType3or4Dynamics; /* Remote input signal used by these wind turbine Type 3 or 4 models. Default: 0 */ + CIMPP::RemoteSignalKind remoteSignalType; /* Type of input signal. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RemoteInputSignal_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RemoteSignalKind.cpp b/CGMES_2.4.15_27JAN2020/RemoteSignalKind.cpp index 9909a7ec1..e1cd4d2e7 100644 --- a/CGMES_2.4.15_27JAN2020/RemoteSignalKind.cpp +++ b/CGMES_2.4.15_27JAN2020/RemoteSignalKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RemoteSignalKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::RemoteSignalKind& rop) +RemoteSignalKind& RemoteSignalKind::operator=(RemoteSignalKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +RemoteSignalKind::operator RemoteSignalKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char RemoteSignalKind::debugName[] = "RemoteSignalKind"; +const char* RemoteSignalKind::debugString() const +{ + return RemoteSignalKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RemoteSignalKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -68,5 +99,55 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const RemoteSignalKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == RemoteSignalKind::remoteBusVoltageFrequency) + { + EnumSymbol = "remoteBusVoltageFrequency"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltageFrequencyDeviation) + { + EnumSymbol = "remoteBusVoltageFrequencyDeviation"; + } + if (obj.value == RemoteSignalKind::remoteBusFrequency) + { + EnumSymbol = "remoteBusFrequency"; + } + if (obj.value == RemoteSignalKind::remoteBusFrequencyDeviation) + { + EnumSymbol = "remoteBusFrequencyDeviation"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltageAmplitude) + { + EnumSymbol = "remoteBusVoltageAmplitude"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltage) + { + EnumSymbol = "remoteBusVoltage"; + } + if (obj.value == RemoteSignalKind::remoteBranchCurrentAmplitude) + { + EnumSymbol = "remoteBranchCurrentAmplitude"; + } + if (obj.value == RemoteSignalKind::remoteBusVoltageAmplitudeDerivative) + { + EnumSymbol = "remoteBusVoltageAmplitudeDerivative"; + } + if (obj.value == RemoteSignalKind::remotePuBusVoltageDerivative) + { + EnumSymbol = "remotePuBusVoltageDerivative"; + } + + if (!EnumSymbol.empty()) + { + os << "RemoteSignalKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RemoteSignalKind.hpp b/CGMES_2.4.15_27JAN2020/RemoteSignalKind.hpp index 007451b50..17a1358d3 100644 --- a/CGMES_2.4.15_27JAN2020/RemoteSignalKind.hpp +++ b/CGMES_2.4.15_27JAN2020/RemoteSignalKind.hpp @@ -1,49 +1,74 @@ #ifndef RemoteSignalKind_H #define RemoteSignalKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of input signal coming from remote bus. */ - enum class RemoteSignalKind + class RemoteSignalKind { - /** - * Input is voltage frequency from remote terminal bus. - */ - remoteBusVoltageFrequency, - /** - * Input is voltage frequency deviation from remote terminal bus. - */ - remoteBusVoltageFrequencyDeviation, - /** - * Input is frequency from remote terminal bus. - */ - remoteBusFrequency, - /** - * Input is frequency deviation from remote terminal bus. - */ - remoteBusFrequencyDeviation, - /** - * Input is voltage amplitude from remote terminal bus. - */ - remoteBusVoltageAmplitude, - /** - * Input is voltage from remote terminal bus. - */ - remoteBusVoltage, - /** - * Input is branch current amplitude from remote terminal bus. - */ - remoteBranchCurrentAmplitude, - /** - * Input is branch current amplitude derivative from remote terminal bus. - */ - remoteBusVoltageAmplitudeDerivative, - /** - * Input is PU voltage derivative from remote terminal bus. - */ - remotePuBusVoltageDerivative, + public: + enum RemoteSignalKind_ENUM + { + /** + * Input is voltage frequency from remote terminal bus. + */ + remoteBusVoltageFrequency, + /** + * Input is voltage frequency deviation from remote terminal bus. + */ + remoteBusVoltageFrequencyDeviation, + /** + * Input is frequency from remote terminal bus. + */ + remoteBusFrequency, + /** + * Input is frequency deviation from remote terminal bus. + */ + remoteBusFrequencyDeviation, + /** + * Input is voltage amplitude from remote terminal bus. + */ + remoteBusVoltageAmplitude, + /** + * Input is voltage from remote terminal bus. + */ + remoteBusVoltage, + /** + * Input is branch current amplitude from remote terminal bus. + */ + remoteBranchCurrentAmplitude, + /** + * Input is branch current amplitude derivative from remote terminal bus. + */ + remoteBusVoltageAmplitudeDerivative, + /** + * Input is PU voltage derivative from remote terminal bus. + */ + remotePuBusVoltageDerivative, + }; + + RemoteSignalKind() : value(), initialized(false) {} + RemoteSignalKind(RemoteSignalKind_ENUM value) : value(value), initialized(true) {} + + RemoteSignalKind& operator=(RemoteSignalKind_ENUM rop); + operator RemoteSignalKind_ENUM() const; + + RemoteSignalKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, RemoteSignalKind& rop); + friend std::ostream& operator<<(std::ostream& os, const RemoteSignalKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::RemoteSignalKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ReportingGroup.cpp b/CGMES_2.4.15_27JAN2020/ReportingGroup.cpp index b42bf9cec..c453a2c6f 100644 --- a/CGMES_2.4.15_27JAN2020/ReportingGroup.cpp +++ b/CGMES_2.4.15_27JAN2020/ReportingGroup.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ReportingGroup.hpp" +#include +#include + #include "BusNameMarker.hpp" #include "TopologicalNode.hpp" using namespace CIMPP; ReportingGroup::ReportingGroup() {}; - ReportingGroup::~ReportingGroup() {}; -bool assign_ReportingGroup_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReportingGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->BusNameMarker.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + +bool assign_BusNameMarker_ReportingGroup(BaseClass*, BaseClass*); +bool assign_ReportingGroup_BusNameMarker(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReportingGroup* element = dynamic_cast(BaseClass_ptr1); + BusNameMarker* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->BusNameMarker.begin(), element->BusNameMarker.end(), element2) == element->BusNameMarker.end()) + { + element->BusNameMarker.push_back(element2); + return assign_BusNameMarker_ReportingGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ReportingGroup_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ReportingGroup* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNode.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_ReportingGroup(BaseClass*, BaseClass*); +bool assign_ReportingGroup_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ReportingGroup* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNode.begin(), element->TopologicalNode.end(), element2) == element->TopologicalNode.end()) + { + element->TopologicalNode.push_back(element2); + return assign_TopologicalNode_ReportingGroup(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* ReportingGroup_factory() { - return new ReportingGroup; - } +const char ReportingGroup::debugName[] = "ReportingGroup"; +const char* ReportingGroup::debugString() const +{ + return ReportingGroup::debugName; } -void ReportingGroup::addConstructToMap(std::unordered_map& factory_map) { +void ReportingGroup::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ReportingGroup"), &ReportingGroup_factory)); } -void ReportingGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ReportingGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.BusNameMarker"), &assign_ReportingGroup_BusNameMarker)); - assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.TopologicalNode"), &assign_ReportingGroup_TopologicalNode)); +void ReportingGroup::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ReportingGroup::debugName[] = "ReportingGroup"; -const char* ReportingGroup::debugString() +void ReportingGroup::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ReportingGroup::debugName; + assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.BusNameMarker"), &assign_ReportingGroup_BusNameMarker)); + assign_map.insert(std::make_pair(std::string("cim:ReportingGroup.TopologicalNode"), &assign_ReportingGroup_TopologicalNode)); } const BaseClassDefiner ReportingGroup::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner ReportingGroup::declare() return BaseClassDefiner(ReportingGroup::addConstructToMap, ReportingGroup::addPrimitiveAssignFnsToMap, ReportingGroup::addClassAssignFnsToMap, ReportingGroup::debugName); } - +namespace CIMPP +{ + BaseClass* ReportingGroup_factory() + { + return new ReportingGroup; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ReportingGroup.hpp b/CGMES_2.4.15_27JAN2020/ReportingGroup.hpp index 0cb6eab61..66fb1b9e2 100644 --- a/CGMES_2.4.15_27JAN2020/ReportingGroup.hpp +++ b/CGMES_2.4.15_27JAN2020/ReportingGroup.hpp @@ -1,40 +1,41 @@ #ifndef ReportingGroup_H #define ReportingGroup_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class BusNameMarker; + class TopologicalNode; -class BusNameMarker; -class TopologicalNode; /* A reporting group is used for various ad-hoc groupings used for reporting. */ - class ReportingGroup: public IdentifiedObject + class ReportingGroup : public IdentifiedObject { - public: - std::list BusNameMarker; /* The reporting group to which this bus name marker belongs. Default: 0 */ - std::list TopologicalNode; /* The reporting group to which the topological node belongs. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ReportingGroup(); - virtual ~ReportingGroup(); - + ~ReportingGroup() override; + + std::list BusNameMarker; /* The reporting group to which this bus name marker belongs. Default: 0 */ + std::list TopologicalNode; /* The reporting group to which the topological node belongs. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ReportingGroup_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Resistance.cpp b/CGMES_2.4.15_27JAN2020/Resistance.cpp index e588088c7..4686fd861 100644 --- a/CGMES_2.4.15_27JAN2020/Resistance.cpp +++ b/CGMES_2.4.15_27JAN2020/Resistance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Resistance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Resistance::Resistance() {} -Resistance::~Resistance(){} +#include -Resistance::Resistance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Resistance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Resistance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Resistance& Resistance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Resistance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Resistance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Resistance::debugName[] = "Resistance"; -const char* Resistance::debugString() { +const char* Resistance::debugString() const +{ return Resistance::debugName; } - -const BaseClassDefiner Resistance::declare() { - return BaseClassDefiner(Resistance::addConstructToMap, Resistance::addPrimitiveAssignFnsToMap, Resistance::addClassAssignFnsToMap, Resistance::debugName); +Resistance& Resistance::operator+=(const Resistance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Resistance& Resistance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Resistance& Resistance::operator-=(const Resistance& rhs) { - value -= rhs.value; - return *this; - } - - Resistance& Resistance::operator*=(const Resistance& rhs) { - value *= rhs.value; - return *this; - } - - Resistance& Resistance::operator/=(const Resistance& rhs) { - value /= rhs.value; - return *this; - } +Resistance& Resistance::operator-=(const Resistance& rhs) +{ + value -= rhs.value; + return *this; +} - Resistance& Resistance::operator+=(const Resistance& rhs) { - value += rhs.value; - return *this; - } +Resistance& Resistance::operator*=(const Resistance& rhs) +{ + value *= rhs.value; + return *this; +} - Resistance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Resistance& Resistance::operator/=(const Resistance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Resistance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Resistance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Resistance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Resistance.hpp b/CGMES_2.4.15_27JAN2020/Resistance.hpp index f8f3b51fa..cd68a214f 100644 --- a/CGMES_2.4.15_27JAN2020/Resistance.hpp +++ b/CGMES_2.4.15_27JAN2020/Resistance.hpp @@ -1,38 +1,39 @@ #ifndef Resistance_H #define Resistance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Resistance : public BaseClass + /* + Resistance (real part of impedance). + */ + class Resistance { - public: - Resistance(); - virtual ~Resistance(); - Resistance(long double value); - static const BaseClassDefiner declare(); - Resistance& operator=(long double &rop); + Resistance() : value(0.0), initialized(false) {} + Resistance(long double value) : value(value), initialized(true) {} + + Resistance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Resistance& operator+=(const Resistance& rhs); Resistance& operator-=(const Resistance& rhs); Resistance& operator*=(const Resistance& rhs); Resistance& operator/=(const Resistance& rhs); + friend std::istream& operator>>(std::istream& lop, Resistance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Resistance& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/ResistancePerLength.cpp b/CGMES_2.4.15_27JAN2020/ResistancePerLength.cpp index 306291ec7..4fb05fd6b 100644 --- a/CGMES_2.4.15_27JAN2020/ResistancePerLength.cpp +++ b/CGMES_2.4.15_27JAN2020/ResistancePerLength.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ResistancePerLength.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -ResistancePerLength::ResistancePerLength(): value(nullptr) {}; - -ResistancePerLength::~ResistancePerLength() {}; - - -bool assign_ResistancePerLength_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_ResistancePerLength_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_ResistancePerLength_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_ResistancePerLength_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_ResistancePerLength_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ResistancePerLength* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +ResistancePerLength& ResistancePerLength::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* ResistancePerLength_factory() { - return new ResistancePerLength; +ResistancePerLength::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void ResistancePerLength::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:ResistancePerLength"), &ResistancePerLength_factory)); +const char ResistancePerLength::debugName[] = "ResistancePerLength"; +const char* ResistancePerLength::debugString() const +{ + return ResistancePerLength::debugName; } -void ResistancePerLength::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.unit"), &assign_ResistancePerLength_unit)); - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.multiplier"), &assign_ResistancePerLength_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.denominatorUnit"), &assign_ResistancePerLength_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.denominatorMultiplier"), &assign_ResistancePerLength_denominatorMultiplier)); +ResistancePerLength& ResistancePerLength::operator+=(const ResistancePerLength& rhs) +{ + value += rhs.value; + return *this; } -void ResistancePerLength::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ResistancePerLength.value"), &assign_ResistancePerLength_value)); - } +ResistancePerLength& ResistancePerLength::operator-=(const ResistancePerLength& rhs) +{ + value -= rhs.value; + return *this; +} -const char ResistancePerLength::debugName[] = "ResistancePerLength"; -const char* ResistancePerLength::debugString() +ResistancePerLength& ResistancePerLength::operator*=(const ResistancePerLength& rhs) { - return ResistancePerLength::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner ResistancePerLength::declare() +ResistancePerLength& ResistancePerLength::operator/=(const ResistancePerLength& rhs) { - return BaseClassDefiner(ResistancePerLength::addConstructToMap, ResistancePerLength::addPrimitiveAssignFnsToMap, ResistancePerLength::addClassAssignFnsToMap, ResistancePerLength::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ResistancePerLength& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const ResistancePerLength& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ResistancePerLength.hpp b/CGMES_2.4.15_27JAN2020/ResistancePerLength.hpp index ffcd9b0f9..dc8f5da8d 100644 --- a/CGMES_2.4.15_27JAN2020/ResistancePerLength.hpp +++ b/CGMES_2.4.15_27JAN2020/ResistancePerLength.hpp @@ -1,46 +1,39 @@ #ifndef ResistancePerLength_H #define ResistancePerLength_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Resistance (real part of impedance) per unit of length. */ - class ResistancePerLength: public BaseClass + class ResistancePerLength { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + ResistancePerLength() : value(0.0), initialized(false) {} + ResistancePerLength(long double value) : value(value), initialized(true) {} + + ResistancePerLength& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - ResistancePerLength(); - virtual ~ResistancePerLength(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + ResistancePerLength& operator+=(const ResistancePerLength& rhs); + ResistancePerLength& operator-=(const ResistancePerLength& rhs); + ResistancePerLength& operator*=(const ResistancePerLength& rhs); + ResistancePerLength& operator/=(const ResistancePerLength& rhs); - BaseClass* ResistancePerLength_factory(); + friend std::istream& operator>>(std::istream& lop, ResistancePerLength& rop); + friend std::ostream& operator<<(std::ostream& os, const ResistancePerLength& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/RotatingMachine.cpp b/CGMES_2.4.15_27JAN2020/RotatingMachine.cpp index 44051f042..8943d68a5 100644 --- a/CGMES_2.4.15_27JAN2020/RotatingMachine.cpp +++ b/CGMES_2.4.15_27JAN2020/RotatingMachine.cpp @@ -1,136 +1,156 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotatingMachine.hpp" +#include +#include + #include "GeneratingUnit.hpp" #include "HydroPump.hpp" +#include "ActivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" #include "ApparentPower.hpp" #include "Voltage.hpp" -#include "ActivePower.hpp" -#include "ReactivePower.hpp" using namespace CIMPP; -RotatingMachine::RotatingMachine(): GeneratingUnit(nullptr), HydroPump(nullptr) {}; - +RotatingMachine::RotatingMachine() : GeneratingUnit(nullptr), HydroPump(nullptr) {}; RotatingMachine::~RotatingMachine() {}; -bool assign_GeneratingUnit_RotatingMachine(BaseClass*, BaseClass*); -bool assign_RotatingMachine_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->GeneratingUnit = dynamic_cast(BaseClass_ptr2); - if(element->GeneratingUnit != nullptr) - return assign_GeneratingUnit_RotatingMachine(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_RotatingMachine_HydroPump(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->HydroPump = dynamic_cast(BaseClass_ptr2); - if(element->HydroPump != nullptr) - return true; - } - return false; -} - +bool assign_RotatingMachine_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachine_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachine_ratedPowerFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedPowerFactor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachine_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedS; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachine_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RotatingMachine_ratedPowerFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedPowerFactor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_GeneratingUnit_RotatingMachine(BaseClass*, BaseClass*); +bool assign_RotatingMachine_GeneratingUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RotatingMachine* element = dynamic_cast(BaseClass_ptr1); + GeneratingUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->GeneratingUnit != element2) + { + element->GeneratingUnit = element2; + return assign_GeneratingUnit_RotatingMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RotatingMachine_ratedS(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedS; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_HydroPump_RotatingMachine(BaseClass*, BaseClass*); +bool assign_RotatingMachine_HydroPump(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + RotatingMachine* element = dynamic_cast(BaseClass_ptr1); + HydroPump* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->HydroPump != element2) + { + element->HydroPump = element2; + return assign_HydroPump_RotatingMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_RotatingMachine_ratedU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachine_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachine_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RotatingMachine_factory() { - return new RotatingMachine; - } + + +const char RotatingMachine::debugName[] = "RotatingMachine"; +const char* RotatingMachine::debugString() const +{ + return RotatingMachine::debugName; } -void RotatingMachine::addConstructToMap(std::unordered_map& factory_map) { +void RotatingMachine::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RotatingMachine"), &RotatingMachine_factory)); } -void RotatingMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedPowerFactor"), &assign_RotatingMachine_ratedPowerFactor)); - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedS"), &assign_RotatingMachine_ratedS)); - assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedU"), &assign_RotatingMachine_ratedU)); +void RotatingMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.p"), &assign_RotatingMachine_p)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.q"), &assign_RotatingMachine_q)); + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedPowerFactor"), &assign_RotatingMachine_ratedPowerFactor)); + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedS"), &assign_RotatingMachine_ratedS)); + assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.ratedU"), &assign_RotatingMachine_ratedU)); } -void RotatingMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void RotatingMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.GeneratingUnit"), &assign_RotatingMachine_GeneratingUnit)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachine.HydroPump"), &assign_RotatingMachine_HydroPump)); - } - -const char RotatingMachine::debugName[] = "RotatingMachine"; -const char* RotatingMachine::debugString() -{ - return RotatingMachine::debugName; } const BaseClassDefiner RotatingMachine::declare() @@ -138,4 +158,10 @@ const BaseClassDefiner RotatingMachine::declare() return BaseClassDefiner(RotatingMachine::addConstructToMap, RotatingMachine::addPrimitiveAssignFnsToMap, RotatingMachine::addClassAssignFnsToMap, RotatingMachine::debugName); } - +namespace CIMPP +{ + BaseClass* RotatingMachine_factory() + { + return new RotatingMachine; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RotatingMachine.hpp b/CGMES_2.4.15_27JAN2020/RotatingMachine.hpp index f71adb5e0..52b9d80da 100644 --- a/CGMES_2.4.15_27JAN2020/RotatingMachine.hpp +++ b/CGMES_2.4.15_27JAN2020/RotatingMachine.hpp @@ -1,50 +1,51 @@ #ifndef RotatingMachine_H #define RotatingMachine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "ApparentPower.hpp" -#include "Voltage.hpp" +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" +#include "ApparentPower.hpp" #include "ReactivePower.hpp" +#include "Simple_Float.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class GeneratingUnit; + class HydroPump; -class GeneratingUnit; -class HydroPump; /* A rotating machine which may be used as a generator or motor. */ - class RotatingMachine: public RegulatingCondEq + class RotatingMachine : public RegulatingCondEq { - public: - CIMPP::GeneratingUnit* GeneratingUnit; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ - CIMPP::HydroPump* HydroPump; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ - CIMPP::Simple_Float ratedPowerFactor; /* Power factor (nameplate data). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ - CIMPP::ApparentPower ratedS; /* Nameplate apparent power rating for the unit. The attribute shall have a positive value. Default: nullptr */ - CIMPP::Voltage ratedU; /* Rated voltage (nameplate data, Ur in IEC 60909-0). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ - CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RotatingMachine(); - virtual ~RotatingMachine(); - + ~RotatingMachine() override; + + CIMPP::GeneratingUnit* GeneratingUnit; /* A synchronous machine may operate as a generator and as such becomes a member of a generating unit. Default: 0 */ + CIMPP::HydroPump* HydroPump; /* The synchronous machine drives the turbine which moves the water from a low elevation to a higher elevation. The direction of machine rotation for pumping may or may not be the same as for generating. Default: 0 */ + CIMPP::ActivePower p; /* Active power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ + CIMPP::Simple_Float ratedPowerFactor; /* Power factor (nameplate data). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ + CIMPP::ApparentPower ratedS; /* Nameplate apparent power rating for the unit. The attribute shall have a positive value. Default: nullptr */ + CIMPP::Voltage ratedU; /* Rated voltage (nameplate data, Ur in IEC 60909-0). It is primarily used for short circuit data exchange according to IEC 60909. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RotatingMachine_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.cpp b/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.cpp index ea42560c6..8714af2c3 100644 --- a/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.cpp @@ -1,7 +1,11 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotatingMachineDynamics.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" @@ -12,100 +16,107 @@ using namespace CIMPP; RotatingMachineDynamics::RotatingMachineDynamics() {}; - RotatingMachineDynamics::~RotatingMachineDynamics() {}; +bool assign_RotatingMachineDynamics_damping(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->damping; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_inertia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inertia; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_saturationFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_saturationFactor120(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactor120; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_statorLeakageReactance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->statorLeakageReactance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_RotatingMachineDynamics_statorResistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->statorResistance; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_RotatingMachineDynamics_damping(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->damping; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_inertia(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inertia; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_saturationFactor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_saturationFactor120(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactor120; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_statorLeakageReactance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->statorLeakageReactance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_RotatingMachineDynamics_statorResistance(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotatingMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->statorResistance; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* RotatingMachineDynamics_factory() { - return new RotatingMachineDynamics; - } +const char RotatingMachineDynamics::debugName[] = "RotatingMachineDynamics"; +const char* RotatingMachineDynamics::debugString() const +{ + return RotatingMachineDynamics::debugName; } -void RotatingMachineDynamics::addConstructToMap(std::unordered_map& factory_map) { +void RotatingMachineDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics"), &RotatingMachineDynamics_factory)); } -void RotatingMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void RotatingMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics.damping"), &assign_RotatingMachineDynamics_damping)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics.inertia"), &assign_RotatingMachineDynamics_inertia)); assign_map.insert(std::make_pair(std::string("cim:RotatingMachineDynamics.saturationFactor"), &assign_RotatingMachineDynamics_saturationFactor)); @@ -114,13 +125,8 @@ void RotatingMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char RotatingMachineDynamics::debugName[] = "RotatingMachineDynamics"; -const char* RotatingMachineDynamics::debugString() +void RotatingMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return RotatingMachineDynamics::debugName; } const BaseClassDefiner RotatingMachineDynamics::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner RotatingMachineDynamics::declare() return BaseClassDefiner(RotatingMachineDynamics::addConstructToMap, RotatingMachineDynamics::addPrimitiveAssignFnsToMap, RotatingMachineDynamics::addClassAssignFnsToMap, RotatingMachineDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* RotatingMachineDynamics_factory() + { + return new RotatingMachineDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.hpp b/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.hpp index 013a8be45..adebde499 100644 --- a/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/RotatingMachineDynamics.hpp @@ -1,45 +1,46 @@ #ifndef RotatingMachineDynamics_H #define RotatingMachineDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Abstract parent class for all synchronous and asynchronous machine standard models. */ - class RotatingMachineDynamics: public DynamicsFunctionBlock + class RotatingMachineDynamics : public DynamicsFunctionBlock { - public: - CIMPP::Simple_Float damping; /* Damping torque coefficient (D). A proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque. This value is often zero when the sources of damping torques (generator damper windings, load damping effects, etc.) are modelled in detail. Typical Value = 0. Default: nullptr */ - CIMPP::Seconds inertia; /* Inertia constant of generator or motor and mechanical load (H) (>0). This is the specification for the stored energy in the rotating mass when operating at rated speed. For a generator, this includes the generator plus all other elements (turbine, exciter) on the same shaft and has units of MW*sec. For a motor, it includes the motor plus its mechanical load. Conventional units are per unit on the generator MVA base, usually expressed as MW*second/MVA or just second. This value is used in the accelerating power reference frame for operator training simulator solutions. Typical Value = 3. Default: nullptr */ - CIMPP::Simple_Float saturationFactor; /* Saturation factor at rated terminal voltage (S1) (> or =0). Not used by simplified model. Defined by defined by S(E1) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.02. Default: nullptr */ - CIMPP::Simple_Float saturationFactor120; /* Saturation factor at 120% of rated terminal voltage (S12) (> or =S1). Not used by the simplified model, defined by S(E2) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.12. Default: nullptr */ - CIMPP::PU statorLeakageReactance; /* Stator leakage reactance (Xl) (> or =0). Typical Value = 0.15. Default: nullptr */ - CIMPP::PU statorResistance; /* Stator (armature) resistance (Rs) (> or =0). Typical Value = 0.005. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ RotatingMachineDynamics(); - virtual ~RotatingMachineDynamics(); - + ~RotatingMachineDynamics() override; + + CIMPP::Simple_Float damping; /* Damping torque coefficient (D). A proportionality constant that, when multiplied by the angular velocity of the rotor poles with respect to the magnetic field (frequency), results in the damping torque. This value is often zero when the sources of damping torques (generator damper windings, load damping effects, etc.) are modelled in detail. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds inertia; /* Inertia constant of generator or motor and mechanical load (H) (>0). This is the specification for the stored energy in the rotating mass when operating at rated speed. For a generator, this includes the generator plus all other elements (turbine, exciter) on the same shaft and has units of MW*sec. For a motor, it includes the motor plus its mechanical load. Conventional units are per unit on the generator MVA base, usually expressed as MW*second/MVA or just second. This value is used in the accelerating power reference frame for operator training simulator solutions. Typical Value = 3. Default: nullptr */ + CIMPP::Simple_Float saturationFactor; /* Saturation factor at rated terminal voltage (S1) (> or =0). Not used by simplified model. Defined by defined by S(E1) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.02. Default: nullptr */ + CIMPP::Simple_Float saturationFactor120; /* Saturation factor at 120% of rated terminal voltage (S12) (> or =S1). Not used by the simplified model, defined by S(E2) in the SynchronousMachineSaturationParameters diagram. Typical Value = 0.12. Default: nullptr */ + CIMPP::PU statorLeakageReactance; /* Stator leakage reactance (Xl) (> or =0). Typical Value = 0.15. Default: nullptr */ + CIMPP::PU statorResistance; /* Stator (armature) resistance (Rs) (> or =0). Typical Value = 0.005. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* RotatingMachineDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/RotationSpeed.cpp b/CGMES_2.4.15_27JAN2020/RotationSpeed.cpp index b9797951b..a0e1b9953 100644 --- a/CGMES_2.4.15_27JAN2020/RotationSpeed.cpp +++ b/CGMES_2.4.15_27JAN2020/RotationSpeed.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotationSpeed.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" +#include -using namespace CIMPP; - -RotationSpeed::RotationSpeed(): value(nullptr) {}; - -RotationSpeed::~RotationSpeed() {}; - - -bool assign_RotationSpeed_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_RotationSpeed_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_RotationSpeed_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_RotationSpeed_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_RotationSpeed_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(RotationSpeed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +RotationSpeed& RotationSpeed::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* RotationSpeed_factory() { - return new RotationSpeed; +RotationSpeed::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void RotationSpeed::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:RotationSpeed"), &RotationSpeed_factory)); +const char RotationSpeed::debugName[] = "RotationSpeed"; +const char* RotationSpeed::debugString() const +{ + return RotationSpeed::debugName; } -void RotationSpeed::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.unit"), &assign_RotationSpeed_unit)); - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.multiplier"), &assign_RotationSpeed_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.denominatorUnit"), &assign_RotationSpeed_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.denominatorMultiplier"), &assign_RotationSpeed_denominatorMultiplier)); +RotationSpeed& RotationSpeed::operator+=(const RotationSpeed& rhs) +{ + value += rhs.value; + return *this; } -void RotationSpeed::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:RotationSpeed.value"), &assign_RotationSpeed_value)); - } +RotationSpeed& RotationSpeed::operator-=(const RotationSpeed& rhs) +{ + value -= rhs.value; + return *this; +} -const char RotationSpeed::debugName[] = "RotationSpeed"; -const char* RotationSpeed::debugString() +RotationSpeed& RotationSpeed::operator*=(const RotationSpeed& rhs) { - return RotationSpeed::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner RotationSpeed::declare() +RotationSpeed& RotationSpeed::operator/=(const RotationSpeed& rhs) { - return BaseClassDefiner(RotationSpeed::addConstructToMap, RotationSpeed::addPrimitiveAssignFnsToMap, RotationSpeed::addClassAssignFnsToMap, RotationSpeed::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RotationSpeed& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const RotationSpeed& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RotationSpeed.hpp b/CGMES_2.4.15_27JAN2020/RotationSpeed.hpp index 6baff3f75..20dae4027 100644 --- a/CGMES_2.4.15_27JAN2020/RotationSpeed.hpp +++ b/CGMES_2.4.15_27JAN2020/RotationSpeed.hpp @@ -1,46 +1,39 @@ #ifndef RotationSpeed_H #define RotationSpeed_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Number of revolutions per second. */ - class RotationSpeed: public BaseClass + class RotationSpeed { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - + RotationSpeed() : value(0.0), initialized(false) {} + RotationSpeed(long double value) : value(value), initialized(true) {} + + RotationSpeed& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - RotationSpeed(); - virtual ~RotationSpeed(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + RotationSpeed& operator+=(const RotationSpeed& rhs); + RotationSpeed& operator-=(const RotationSpeed& rhs); + RotationSpeed& operator*=(const RotationSpeed& rhs); + RotationSpeed& operator/=(const RotationSpeed& rhs); - BaseClass* RotationSpeed_factory(); + friend std::istream& operator>>(std::istream& lop, RotationSpeed& rop); + friend std::ostream& operator<<(std::ostream& os, const RotationSpeed& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/RotorKind.cpp b/CGMES_2.4.15_27JAN2020/RotorKind.cpp index 154709fe1..155faceec 100644 --- a/CGMES_2.4.15_27JAN2020/RotorKind.cpp +++ b/CGMES_2.4.15_27JAN2020/RotorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "RotorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::RotorKind& rop) +RotorKind& RotorKind::operator=(RotorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +RotorKind::operator RotorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char RotorKind::debugName[] = "RotorKind"; +const char* RotorKind::debugString() const +{ + return RotorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, RotorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const RotorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == RotorKind::roundRotor) + { + EnumSymbol = "roundRotor"; + } + if (obj.value == RotorKind::salientPole) + { + EnumSymbol = "salientPole"; + } + + if (!EnumSymbol.empty()) + { + os << "RotorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/RotorKind.hpp b/CGMES_2.4.15_27JAN2020/RotorKind.hpp index f531247aa..d86eccaa1 100644 --- a/CGMES_2.4.15_27JAN2020/RotorKind.hpp +++ b/CGMES_2.4.15_27JAN2020/RotorKind.hpp @@ -1,21 +1,46 @@ #ifndef RotorKind_H #define RotorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of rotor on physical machine. */ - enum class RotorKind + class RotorKind { - /** - * Round rotor type of synchronous machine. - */ - roundRotor, - /** - * Salient pole type of synchronous machine. - */ - salientPole, + public: + enum RotorKind_ENUM + { + /** + * Round rotor type of synchronous machine. + */ + roundRotor, + /** + * Salient pole type of synchronous machine. + */ + salientPole, + }; + + RotorKind() : value(), initialized(false) {} + RotorKind(RotorKind_ENUM value) : value(value), initialized(true) {} + + RotorKind& operator=(RotorKind_ENUM rop); + operator RotorKind_ENUM() const; + + RotorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, RotorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const RotorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::RotorKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/SVCControlMode.cpp b/CGMES_2.4.15_27JAN2020/SVCControlMode.cpp index 3b920e5f2..4ccad37d6 100644 --- a/CGMES_2.4.15_27JAN2020/SVCControlMode.cpp +++ b/CGMES_2.4.15_27JAN2020/SVCControlMode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SVCControlMode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SVCControlMode& rop) +SVCControlMode& SVCControlMode::operator=(SVCControlMode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SVCControlMode::operator SVCControlMode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SVCControlMode::debugName[] = "SVCControlMode"; +const char* SVCControlMode::debugString() const +{ + return SVCControlMode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SVCControlMode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SVCControlMode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SVCControlMode::reactivePower) + { + EnumSymbol = "reactivePower"; + } + if (obj.value == SVCControlMode::voltage) + { + EnumSymbol = "voltage"; + } + + if (!EnumSymbol.empty()) + { + os << "SVCControlMode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SVCControlMode.hpp b/CGMES_2.4.15_27JAN2020/SVCControlMode.hpp index 8884a84af..52da28bad 100644 --- a/CGMES_2.4.15_27JAN2020/SVCControlMode.hpp +++ b/CGMES_2.4.15_27JAN2020/SVCControlMode.hpp @@ -1,21 +1,40 @@ #ifndef SVCControlMode_H #define SVCControlMode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Static VAr Compensator control mode. */ - enum class SVCControlMode + class SVCControlMode { - /** - * - */ - reactivePower, - /** - * - */ - voltage, + public: + enum SVCControlMode_ENUM + { + reactivePower, + voltage, + }; + + SVCControlMode() : value(), initialized(false) {} + SVCControlMode(SVCControlMode_ENUM value) : value(value), initialized(true) {} + + SVCControlMode& operator=(SVCControlMode_ENUM rop); + operator SVCControlMode_ENUM() const; + + SVCControlMode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SVCControlMode& rop); + friend std::ostream& operator<<(std::ostream& os, const SVCControlMode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SVCControlMode& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/Season.cpp b/CGMES_2.4.15_27JAN2020/Season.cpp index 2b3829758..aa28cae01 100644 --- a/CGMES_2.4.15_27JAN2020/Season.cpp +++ b/CGMES_2.4.15_27JAN2020/Season.cpp @@ -1,73 +1,88 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Season.hpp" +#include +#include + +#include "SeasonDayTypeSchedule.hpp" #include "MonthDay.hpp" #include "MonthDay.hpp" -#include "SeasonDayTypeSchedule.hpp" using namespace CIMPP; -Season::Season(): endDate(nullptr), startDate(nullptr) {}; - +Season::Season() {}; Season::~Season() {}; -bool assign_Season_endDate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Season* element = dynamic_cast(BaseClass_ptr1)) { - element->endDate = dynamic_cast(BaseClass_ptr2); - if(element->endDate != nullptr) - return true; - } - return false; -} -bool assign_Season_startDate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Season* element = dynamic_cast(BaseClass_ptr1)) { - element->startDate = dynamic_cast(BaseClass_ptr2); - if(element->startDate != nullptr) - return true; - } - return false; +bool assign_Season_endDate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Season* element = dynamic_cast(BaseClass_ptr1)) + { + element->endDate = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_Season_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Season* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SeasonDayTypeSchedules.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Season_startDate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Season* element = dynamic_cast(BaseClass_ptr1)) + { + element->startDate = buffer.str(); + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_SeasonDayTypeSchedule_Season(BaseClass*, BaseClass*); +bool assign_Season_SeasonDayTypeSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Season* element = dynamic_cast(BaseClass_ptr1); + SeasonDayTypeSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SeasonDayTypeSchedules.begin(), element->SeasonDayTypeSchedules.end(), element2) == element->SeasonDayTypeSchedules.end()) + { + element->SeasonDayTypeSchedules.push_back(element2); + return assign_SeasonDayTypeSchedule_Season(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* Season_factory() { - return new Season; - } +const char Season::debugName[] = "Season"; +const char* Season::debugString() const +{ + return Season::debugName; } -void Season::addConstructToMap(std::unordered_map& factory_map) { +void Season::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Season"), &Season_factory)); } -void Season::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void Season::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Season::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Season.endDate"), &assign_Season_endDate)); assign_map.insert(std::make_pair(std::string("cim:Season.startDate"), &assign_Season_startDate)); - assign_map.insert(std::make_pair(std::string("cim:Season.SeasonDayTypeSchedules"), &assign_Season_SeasonDayTypeSchedules)); } -const char Season::debugName[] = "Season"; -const char* Season::debugString() +void Season::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Season::debugName; + assign_map.insert(std::make_pair(std::string("cim:Season.SeasonDayTypeSchedules"), &assign_Season_SeasonDayTypeSchedules)); } const BaseClassDefiner Season::declare() @@ -75,4 +90,10 @@ const BaseClassDefiner Season::declare() return BaseClassDefiner(Season::addConstructToMap, Season::addPrimitiveAssignFnsToMap, Season::addClassAssignFnsToMap, Season::debugName); } - +namespace CIMPP +{ + BaseClass* Season_factory() + { + return new Season; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Season.hpp b/CGMES_2.4.15_27JAN2020/Season.hpp index 3372a6d21..31957d835 100644 --- a/CGMES_2.4.15_27JAN2020/Season.hpp +++ b/CGMES_2.4.15_27JAN2020/Season.hpp @@ -1,41 +1,42 @@ #ifndef Season_H #define Season_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "MonthDay.hpp" +namespace CIMPP +{ + class SeasonDayTypeSchedule; -class MonthDay; -class SeasonDayTypeSchedule; /* A specified time period of the year. */ - class Season: public IdentifiedObject + class Season : public IdentifiedObject { - public: - CIMPP::MonthDay* endDate; /* Date season ends. Default: nullptr */ - CIMPP::MonthDay* startDate; /* Date season starts. Default: nullptr */ - std::list SeasonDayTypeSchedules; /* Season for the Schedule. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Season(); - virtual ~Season(); - + ~Season() override; + + std::list SeasonDayTypeSchedules; /* Season for the Schedule. Default: 0 */ + CIMPP::MonthDay endDate; /* Date season ends. Default: nullptr */ + CIMPP::MonthDay startDate; /* Date season starts. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Season_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.cpp b/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.cpp index 73e3f63cd..0827e77ed 100644 --- a/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.cpp @@ -1,62 +1,76 @@ -#include -#include "RegularIntervalSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SeasonDayTypeSchedule.hpp" +#include +#include + #include "DayType.hpp" #include "Season.hpp" using namespace CIMPP; -SeasonDayTypeSchedule::SeasonDayTypeSchedule(): DayType(nullptr), Season(nullptr) {}; - +SeasonDayTypeSchedule::SeasonDayTypeSchedule() : DayType(nullptr), Season(nullptr) {}; SeasonDayTypeSchedule::~SeasonDayTypeSchedule() {}; + + + bool assign_DayType_SeasonDayTypeSchedules(BaseClass*, BaseClass*); -bool assign_SeasonDayTypeSchedule_DayType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->DayType = dynamic_cast(BaseClass_ptr2); - if(element->DayType != nullptr) - return assign_DayType_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SeasonDayTypeSchedule_DayType(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1); + DayType* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->DayType != element2) + { + element->DayType = element2; + return assign_DayType_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_Season_SeasonDayTypeSchedules(BaseClass*, BaseClass*); -bool assign_SeasonDayTypeSchedule_Season(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->Season = dynamic_cast(BaseClass_ptr2); - if(element->Season != nullptr) - return assign_Season_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SeasonDayTypeSchedule_Season(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SeasonDayTypeSchedule* element = dynamic_cast(BaseClass_ptr1); + Season* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Season != element2) + { + element->Season = element2; + return assign_Season_SeasonDayTypeSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* SeasonDayTypeSchedule_factory() { - return new SeasonDayTypeSchedule; - } +const char SeasonDayTypeSchedule::debugName[] = "SeasonDayTypeSchedule"; +const char* SeasonDayTypeSchedule::debugString() const +{ + return SeasonDayTypeSchedule::debugName; } -void SeasonDayTypeSchedule::addConstructToMap(std::unordered_map& factory_map) { +void SeasonDayTypeSchedule::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule"), &SeasonDayTypeSchedule_factory)); } -void SeasonDayTypeSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void SeasonDayTypeSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.DayType"), &assign_SeasonDayTypeSchedule_DayType)); - assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.Season"), &assign_SeasonDayTypeSchedule_Season)); +void SeasonDayTypeSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SeasonDayTypeSchedule::debugName[] = "SeasonDayTypeSchedule"; -const char* SeasonDayTypeSchedule::debugString() +void SeasonDayTypeSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SeasonDayTypeSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.DayType"), &assign_SeasonDayTypeSchedule_DayType)); + assign_map.insert(std::make_pair(std::string("cim:SeasonDayTypeSchedule.Season"), &assign_SeasonDayTypeSchedule_Season)); } const BaseClassDefiner SeasonDayTypeSchedule::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner SeasonDayTypeSchedule::declare() return BaseClassDefiner(SeasonDayTypeSchedule::addConstructToMap, SeasonDayTypeSchedule::addPrimitiveAssignFnsToMap, SeasonDayTypeSchedule::addClassAssignFnsToMap, SeasonDayTypeSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* SeasonDayTypeSchedule_factory() + { + return new SeasonDayTypeSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.hpp b/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.hpp index 06ac128af..ee9830d7b 100644 --- a/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/SeasonDayTypeSchedule.hpp @@ -1,40 +1,41 @@ #ifndef SeasonDayTypeSchedule_H #define SeasonDayTypeSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegularIntervalSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RegularIntervalSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DayType; + class Season; -class DayType; -class Season; /* A time schedule covering a 24 hour period, with curve data for a specific type of season and day. */ - class SeasonDayTypeSchedule: public RegularIntervalSchedule + class SeasonDayTypeSchedule : public RegularIntervalSchedule { - public: - CIMPP::DayType* DayType; /* Schedules that use this DayType. Default: 0 */ - CIMPP::Season* Season; /* Schedules that use this Season. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SeasonDayTypeSchedule(); - virtual ~SeasonDayTypeSchedule(); - + ~SeasonDayTypeSchedule() override; + + CIMPP::DayType* DayType; /* Schedules that use this DayType. Default: 0 */ + CIMPP::Season* Season; /* Schedules that use this Season. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SeasonDayTypeSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Seconds.cpp b/CGMES_2.4.15_27JAN2020/Seconds.cpp index 7d5d3e99e..31ff76a12 100644 --- a/CGMES_2.4.15_27JAN2020/Seconds.cpp +++ b/CGMES_2.4.15_27JAN2020/Seconds.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Seconds.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Seconds::Seconds() {} -Seconds::~Seconds(){} +#include -Seconds::Seconds(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Seconds::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Seconds::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Seconds& Seconds::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Seconds::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Seconds::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Seconds::debugName[] = "Seconds"; -const char* Seconds::debugString() { +const char* Seconds::debugString() const +{ return Seconds::debugName; } - -const BaseClassDefiner Seconds::declare() { - return BaseClassDefiner(Seconds::addConstructToMap, Seconds::addPrimitiveAssignFnsToMap, Seconds::addClassAssignFnsToMap, Seconds::debugName); +Seconds& Seconds::operator+=(const Seconds& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Seconds& Seconds::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Seconds& Seconds::operator-=(const Seconds& rhs) { - value -= rhs.value; - return *this; - } - - Seconds& Seconds::operator*=(const Seconds& rhs) { - value *= rhs.value; - return *this; - } - - Seconds& Seconds::operator/=(const Seconds& rhs) { - value /= rhs.value; - return *this; - } +Seconds& Seconds::operator-=(const Seconds& rhs) +{ + value -= rhs.value; + return *this; +} - Seconds& Seconds::operator+=(const Seconds& rhs) { - value += rhs.value; - return *this; - } +Seconds& Seconds::operator*=(const Seconds& rhs) +{ + value *= rhs.value; + return *this; +} - Seconds::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Seconds& Seconds::operator/=(const Seconds& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Seconds& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Seconds& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Seconds& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Seconds.hpp b/CGMES_2.4.15_27JAN2020/Seconds.hpp index 7e1278190..60e9a668b 100644 --- a/CGMES_2.4.15_27JAN2020/Seconds.hpp +++ b/CGMES_2.4.15_27JAN2020/Seconds.hpp @@ -1,38 +1,39 @@ #ifndef Seconds_H #define Seconds_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Seconds : public BaseClass + /* + Time, in seconds. + */ + class Seconds { - public: - Seconds(); - virtual ~Seconds(); - Seconds(long double value); - static const BaseClassDefiner declare(); - Seconds& operator=(long double &rop); + Seconds() : value(0.0), initialized(false) {} + Seconds(long double value) : value(value), initialized(true) {} + + Seconds& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Seconds& operator+=(const Seconds& rhs); Seconds& operator-=(const Seconds& rhs); Seconds& operator*=(const Seconds& rhs); Seconds& operator/=(const Seconds& rhs); + friend std::istream& operator>>(std::istream& lop, Seconds& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Seconds& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/SeriesCompensator.cpp b/CGMES_2.4.15_27JAN2020/SeriesCompensator.cpp index 373f6a42d..3c0a3d55b 100644 --- a/CGMES_2.4.15_27JAN2020/SeriesCompensator.cpp +++ b/CGMES_2.4.15_27JAN2020/SeriesCompensator.cpp @@ -1,141 +1,148 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SeriesCompensator.hpp" +#include +#include + +#include "Resistance.hpp" #include "Resistance.hpp" -#include "Reactance.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" #include "Voltage.hpp" -#include "Resistance.hpp" +#include "Reactance.hpp" #include "Reactance.hpp" using namespace CIMPP; SeriesCompensator::SeriesCompensator() {}; - SeriesCompensator::~SeriesCompensator() {}; +bool assign_SeriesCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_varistorPresent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->varistorPresent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_varistorRatedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->varistorRatedCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_varistorVoltageThreshold(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->varistorVoltageThreshold; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SeriesCompensator_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SeriesCompensator_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_varistorPresent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->varistorPresent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_varistorRatedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->varistorRatedCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_varistorVoltageThreshold(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->varistorVoltageThreshold; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SeriesCompensator_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SeriesCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SeriesCompensator_factory() { - return new SeriesCompensator; - } +const char SeriesCompensator::debugName[] = "SeriesCompensator"; +const char* SeriesCompensator::debugString() const +{ + return SeriesCompensator::debugName; } -void SeriesCompensator::addConstructToMap(std::unordered_map& factory_map) { +void SeriesCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SeriesCompensator"), &SeriesCompensator_factory)); } -void SeriesCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SeriesCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.r"), &assign_SeriesCompensator_r)); - assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.x"), &assign_SeriesCompensator_x)); + assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.r0"), &assign_SeriesCompensator_r0)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.varistorPresent"), &assign_SeriesCompensator_varistorPresent)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.varistorRatedCurrent"), &assign_SeriesCompensator_varistorRatedCurrent)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.varistorVoltageThreshold"), &assign_SeriesCompensator_varistorVoltageThreshold)); - assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.r0"), &assign_SeriesCompensator_r0)); + assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.x"), &assign_SeriesCompensator_x)); assign_map.insert(std::make_pair(std::string("cim:SeriesCompensator.x0"), &assign_SeriesCompensator_x0)); } -void SeriesCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SeriesCompensator::debugName[] = "SeriesCompensator"; -const char* SeriesCompensator::debugString() +void SeriesCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SeriesCompensator::debugName; } const BaseClassDefiner SeriesCompensator::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner SeriesCompensator::declare() return BaseClassDefiner(SeriesCompensator::addConstructToMap, SeriesCompensator::addPrimitiveAssignFnsToMap, SeriesCompensator::addClassAssignFnsToMap, SeriesCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* SeriesCompensator_factory() + { + return new SeriesCompensator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SeriesCompensator.hpp b/CGMES_2.4.15_27JAN2020/SeriesCompensator.hpp index 112833df4..513d29359 100644 --- a/CGMES_2.4.15_27JAN2020/SeriesCompensator.hpp +++ b/CGMES_2.4.15_27JAN2020/SeriesCompensator.hpp @@ -1,48 +1,49 @@ #ifndef SeriesCompensator_H #define SeriesCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Resistance.hpp" -#include "Reactance.hpp" +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" +#include "Reactance.hpp" +#include "Resistance.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A Series Compensator is a series capacitor or reactor or an AC transmission line without charging susceptance. It is a two terminal device. */ - class SeriesCompensator: public ConductingEquipment + class SeriesCompensator : public ConductingEquipment { - public: - CIMPP::Resistance r; /* Positive sequence resistance. Default: nullptr */ - CIMPP::Reactance x; /* Positive sequence reactance. Default: nullptr */ - CIMPP::Boolean varistorPresent; /* Describe if a metal oxide varistor (mov) for over voltage protection is configured at the series compensator. Default: false */ - CIMPP::CurrentFlow varistorRatedCurrent; /* The maximum current the varistor is designed to handle at specified duration. Default: nullptr */ - CIMPP::Voltage varistorVoltageThreshold; /* The dc voltage at which the varistor start conducting. Default: nullptr */ - CIMPP::Resistance r0; /* Zero sequence resistance. Default: nullptr */ - CIMPP::Reactance x0; /* Zero sequence reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SeriesCompensator(); - virtual ~SeriesCompensator(); - + ~SeriesCompensator() override; + + CIMPP::Resistance r; /* Positive sequence resistance. Default: nullptr */ + CIMPP::Resistance r0; /* Zero sequence resistance. Default: nullptr */ + CIMPP::Boolean varistorPresent; /* Describe if a metal oxide varistor (mov) for over voltage protection is configured at the series compensator. Default: false */ + CIMPP::CurrentFlow varistorRatedCurrent; /* The maximum current the varistor is designed to handle at specified duration. Default: nullptr */ + CIMPP::Voltage varistorVoltageThreshold; /* The dc voltage at which the varistor start conducting. Default: nullptr */ + CIMPP::Reactance x; /* Positive sequence reactance. Default: nullptr */ + CIMPP::Reactance x0; /* Zero sequence reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SeriesCompensator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SetPoint.cpp b/CGMES_2.4.15_27JAN2020/SetPoint.cpp index 7ff0d8d24..3a8c53288 100644 --- a/CGMES_2.4.15_27JAN2020/SetPoint.cpp +++ b/CGMES_2.4.15_27JAN2020/SetPoint.cpp @@ -1,66 +1,68 @@ -#include -#include "AnalogControl.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SetPoint.hpp" +#include +#include + #include "Simple_Float.hpp" #include "Simple_Float.hpp" using namespace CIMPP; SetPoint::SetPoint() {}; - SetPoint::~SetPoint() {}; +bool assign_SetPoint_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SetPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SetPoint_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SetPoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SetPoint_normalValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SetPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SetPoint_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SetPoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SetPoint_factory() { - return new SetPoint; - } +const char SetPoint::debugName[] = "SetPoint"; +const char* SetPoint::debugString() const +{ + return SetPoint::debugName; } -void SetPoint::addConstructToMap(std::unordered_map& factory_map) { +void SetPoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SetPoint"), &SetPoint_factory)); } -void SetPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SetPoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SetPoint.normalValue"), &assign_SetPoint_normalValue)); assign_map.insert(std::make_pair(std::string("cim:SetPoint.value"), &assign_SetPoint_value)); } -void SetPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SetPoint::debugName[] = "SetPoint"; -const char* SetPoint::debugString() +void SetPoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SetPoint::debugName; } const BaseClassDefiner SetPoint::declare() @@ -68,4 +70,10 @@ const BaseClassDefiner SetPoint::declare() return BaseClassDefiner(SetPoint::addConstructToMap, SetPoint::addPrimitiveAssignFnsToMap, SetPoint::addClassAssignFnsToMap, SetPoint::debugName); } - +namespace CIMPP +{ + BaseClass* SetPoint_factory() + { + return new SetPoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SetPoint.hpp b/CGMES_2.4.15_27JAN2020/SetPoint.hpp index a0b6d6322..28ebed07c 100644 --- a/CGMES_2.4.15_27JAN2020/SetPoint.hpp +++ b/CGMES_2.4.15_27JAN2020/SetPoint.hpp @@ -1,39 +1,40 @@ #ifndef SetPoint_H #define SetPoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "AnalogControl.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "AnalogControl.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* An analog control that issue a set point value. */ - class SetPoint: public AnalogControl + class SetPoint : public AnalogControl { - public: - CIMPP::Simple_Float normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: nullptr */ - CIMPP::Simple_Float value; /* The value representing the actuator output. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SetPoint(); - virtual ~SetPoint(); - + ~SetPoint() override; + + CIMPP::Simple_Float normalValue; /* Normal value for Control.value e.g. used for percentage scaling. Default: nullptr */ + CIMPP::Simple_Float value; /* The value representing the actuator output. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SetPoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.cpp b/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.cpp index dbd0a619b..9e7ea1852 100644 --- a/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.cpp +++ b/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ShortCircuitRotorKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::ShortCircuitRotorKind& rop) +ShortCircuitRotorKind& ShortCircuitRotorKind::operator=(ShortCircuitRotorKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +ShortCircuitRotorKind::operator ShortCircuitRotorKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char ShortCircuitRotorKind::debugName[] = "ShortCircuitRotorKind"; +const char* ShortCircuitRotorKind::debugString() const +{ + return ShortCircuitRotorKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, ShortCircuitRotorKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const ShortCircuitRotorKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == ShortCircuitRotorKind::salientPole1) + { + EnumSymbol = "salientPole1"; + } + if (obj.value == ShortCircuitRotorKind::salientPole2) + { + EnumSymbol = "salientPole2"; + } + if (obj.value == ShortCircuitRotorKind::turboSeries1) + { + EnumSymbol = "turboSeries1"; + } + if (obj.value == ShortCircuitRotorKind::turboSeries2) + { + EnumSymbol = "turboSeries2"; + } + + if (!EnumSymbol.empty()) + { + os << "ShortCircuitRotorKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.hpp b/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.hpp index 0da968334..76f473214 100644 --- a/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.hpp +++ b/CGMES_2.4.15_27JAN2020/ShortCircuitRotorKind.hpp @@ -1,29 +1,54 @@ #ifndef ShortCircuitRotorKind_H #define ShortCircuitRotorKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of rotor, used by short circuit applications. */ - enum class ShortCircuitRotorKind + class ShortCircuitRotorKind { - /** - * Salient pole 1 in the IEC 60909 - */ - salientPole1, - /** - * Salient pole 2 in IEC 60909 - */ - salientPole2, - /** - * Turbo Series 1 in the IEC 60909 - */ - turboSeries1, - /** - * Turbo series 2 in IEC 60909 - */ - turboSeries2, + public: + enum ShortCircuitRotorKind_ENUM + { + /** + * Salient pole 1 in the IEC 60909 + */ + salientPole1, + /** + * Salient pole 2 in IEC 60909 + */ + salientPole2, + /** + * Turbo Series 1 in the IEC 60909 + */ + turboSeries1, + /** + * Turbo series 2 in IEC 60909 + */ + turboSeries2, + }; + + ShortCircuitRotorKind() : value(), initialized(false) {} + ShortCircuitRotorKind(ShortCircuitRotorKind_ENUM value) : value(value), initialized(true) {} + + ShortCircuitRotorKind& operator=(ShortCircuitRotorKind_ENUM rop); + operator ShortCircuitRotorKind_ENUM() const; + + ShortCircuitRotorKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, ShortCircuitRotorKind& rop); + friend std::ostream& operator<<(std::ostream& os, const ShortCircuitRotorKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::ShortCircuitRotorKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ShuntCompensator.cpp b/CGMES_2.4.15_27JAN2020/ShuntCompensator.cpp index f76358f70..b205bfc3b 100644 --- a/CGMES_2.4.15_27JAN2020/ShuntCompensator.cpp +++ b/CGMES_2.4.15_27JAN2020/ShuntCompensator.cpp @@ -1,177 +1,200 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ShuntCompensator.hpp" +#include +#include + +#include "SvShuntCompensatorSections.hpp" #include "Seconds.hpp" #include "Boolean.hpp" #include "Integer.hpp" #include "Voltage.hpp" #include "Integer.hpp" +#include "Simple_Float.hpp" #include "Integer.hpp" #include "DateTime.hpp" #include "VoltagePerReactivePower.hpp" -#include "Simple_Float.hpp" -#include "SvShuntCompensatorSections.hpp" using namespace CIMPP; -ShuntCompensator::ShuntCompensator(): switchOnDate(nullptr), voltageSensitivity(nullptr), SvShuntCompensatorSections(nullptr) {}; - +ShuntCompensator::ShuntCompensator() : SvShuntCompensatorSections(nullptr) {}; ShuntCompensator::~ShuntCompensator() {}; +bool assign_ShuntCompensator_aVRDelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->aVRDelay; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->grounded; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_maximumSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maximumSections; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_nomU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->nomU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_ShuntCompensator_normalSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalSections; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ShuntCompensator_switchOnDate(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->switchOnDate = dynamic_cast(BaseClass_ptr2); - if(element->switchOnDate != nullptr) - return true; - } - return false; +bool assign_ShuntCompensator_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sections; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ShuntCompensator_voltageSensitivity(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->voltageSensitivity = dynamic_cast(BaseClass_ptr2); - if(element->voltageSensitivity != nullptr) - return true; - } - return false; +bool assign_ShuntCompensator_switchOnCount(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->switchOnCount; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_ShuntCompensator_switchOnDate(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + element->switchOnDate = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->SvShuntCompensatorSections = dynamic_cast(BaseClass_ptr2); - if(element->SvShuntCompensatorSections != nullptr) - return true; - } - return false; +bool assign_ShuntCompensator_voltageSensitivity(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageSensitivity; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_ShuntCompensator_aVRDelay(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->aVRDelay; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass*, BaseClass*); +bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ShuntCompensator* element = dynamic_cast(BaseClass_ptr1); + SvShuntCompensatorSections* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvShuntCompensatorSections != element2) + { + element->SvShuntCompensatorSections = element2; + return assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_ShuntCompensator_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->grounded; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_maximumSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maximumSections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_nomU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->nomU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_normalSections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalSections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_ShuntCompensator_switchOnCount(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->switchOnCount; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - -bool assign_ShuntCompensator_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ShuntCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* ShuntCompensator_factory() { - return new ShuntCompensator; - } + + + + + +const char ShuntCompensator::debugName[] = "ShuntCompensator"; +const char* ShuntCompensator::debugString() const +{ + return ShuntCompensator::debugName; } -void ShuntCompensator::addConstructToMap(std::unordered_map& factory_map) { +void ShuntCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ShuntCompensator"), &ShuntCompensator_factory)); } -void ShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void ShuntCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.aVRDelay"), &assign_ShuntCompensator_aVRDelay)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.grounded"), &assign_ShuntCompensator_grounded)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.maximumSections"), &assign_ShuntCompensator_maximumSections)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.nomU"), &assign_ShuntCompensator_nomU)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.normalSections"), &assign_ShuntCompensator_normalSections)); + assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.sections"), &assign_ShuntCompensator_sections)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.switchOnCount"), &assign_ShuntCompensator_switchOnCount)); - assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.sections"), &assign_ShuntCompensator_sections)); - } - -void ShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.switchOnDate"), &assign_ShuntCompensator_switchOnDate)); + assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.switchOnDate"), &assign_ShuntCompensator_switchOnDate)); assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.voltageSensitivity"), &assign_ShuntCompensator_voltageSensitivity)); - assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.SvShuntCompensatorSections"), &assign_ShuntCompensator_SvShuntCompensatorSections)); } -const char ShuntCompensator::debugName[] = "ShuntCompensator"; -const char* ShuntCompensator::debugString() +void ShuntCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ShuntCompensator::debugName; + assign_map.insert(std::make_pair(std::string("cim:ShuntCompensator.SvShuntCompensatorSections"), &assign_ShuntCompensator_SvShuntCompensatorSections)); } const BaseClassDefiner ShuntCompensator::declare() @@ -179,4 +202,10 @@ const BaseClassDefiner ShuntCompensator::declare() return BaseClassDefiner(ShuntCompensator::addConstructToMap, ShuntCompensator::addPrimitiveAssignFnsToMap, ShuntCompensator::addClassAssignFnsToMap, ShuntCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* ShuntCompensator_factory() + { + return new ShuntCompensator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ShuntCompensator.hpp b/CGMES_2.4.15_27JAN2020/ShuntCompensator.hpp index c2b3de36e..9285b79ef 100644 --- a/CGMES_2.4.15_27JAN2020/ShuntCompensator.hpp +++ b/CGMES_2.4.15_27JAN2020/ShuntCompensator.hpp @@ -1,54 +1,55 @@ #ifndef ShuntCompensator_H #define ShuntCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Seconds.hpp" +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "DateTime.hpp" #include "Integer.hpp" -#include "Voltage.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" +#include "Voltage.hpp" +#include "VoltagePerReactivePower.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class SvShuntCompensatorSections; -class DateTime; -class VoltagePerReactivePower; -class SvShuntCompensatorSections; /* A shunt capacitor or reactor or switchable bank of shunt capacitors or reactors. A section of a shunt compensator is an individual capacitor or reactor. A negative value for reactivePerSection indicates that the compensator is a reactor. ShuntCompensator is a single terminal device. Ground is implied. */ - class ShuntCompensator: public RegulatingCondEq + class ShuntCompensator : public RegulatingCondEq { - public: - CIMPP::Seconds aVRDelay; /* Time delay required for the device to be connected or disconnected by automatic voltage regulation (AVR). Default: nullptr */ - CIMPP::Boolean grounded; /* Used for Yn and Zn connections. True if the neutral is solidly grounded. Default: false */ - CIMPP::Integer maximumSections; /* The maximum number of sections that may be switched in. Default: 0 */ - CIMPP::Voltage nomU; /* The voltage at which the nominal reactive power may be calculated. This should normally be within 10% of the voltage at which the capacitor is connected to the network. Default: nullptr */ - CIMPP::Integer normalSections; /* The normal number of sections switched in. Default: 0 */ - CIMPP::Integer switchOnCount; /* The switch on count since the capacitor count was last reset or initialized. Default: 0 */ - CIMPP::DateTime* switchOnDate; /* The date and time when the capacitor bank was last switched on. Default: '' */ - CIMPP::VoltagePerReactivePower* voltageSensitivity; /* Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. Default: nullptr */ - CIMPP::Simple_Float sections; /* Shunt compensator sections in use. Starting value for steady state solution. Non integer values are allowed to support continuous variables. The reasons for continuous value are to support study cases where no discrete shunt compensators has yet been designed, a solutions where a narrow voltage band force the sections to oscillate or accommodate for a continuous solution as input. Default: nullptr */ - CIMPP::SvShuntCompensatorSections* SvShuntCompensatorSections; /* The state for the number of shunt compensator sections in service. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ShuntCompensator(); - virtual ~ShuntCompensator(); - + ~ShuntCompensator() override; + + CIMPP::SvShuntCompensatorSections* SvShuntCompensatorSections; /* The state for the number of shunt compensator sections in service. Default: 0 */ + CIMPP::Seconds aVRDelay; /* Time delay required for the device to be connected or disconnected by automatic voltage regulation (AVR). Default: nullptr */ + CIMPP::Boolean grounded; /* Used for Yn and Zn connections. True if the neutral is solidly grounded. Default: false */ + CIMPP::Integer maximumSections; /* The maximum number of sections that may be switched in. Default: 0 */ + CIMPP::Voltage nomU; /* The voltage at which the nominal reactive power may be calculated. This should normally be within 10% of the voltage at which the capacitor is connected to the network. Default: nullptr */ + CIMPP::Integer normalSections; /* The normal number of sections switched in. Default: 0 */ + CIMPP::Simple_Float sections; /* Shunt compensator sections in use. Starting value for steady state solution. Non integer values are allowed to support continuous variables. The reasons for continuous value are to support study cases where no discrete shunt compensators has yet been designed, a solutions where a narrow voltage band force the sections to oscillate or accommodate for a continuous solution as input. Default: nullptr */ + CIMPP::Integer switchOnCount; /* The switch on count since the capacitor count was last reset or initialized. Default: 0 */ + CIMPP::DateTime switchOnDate; /* The date and time when the capacitor bank was last switched on. Default: '' */ + CIMPP::VoltagePerReactivePower voltageSensitivity; /* Voltage sensitivity required for the device to regulate the bus voltage, in voltage/reactive power. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ShuntCompensator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Simple_Float.cpp b/CGMES_2.4.15_27JAN2020/Simple_Float.cpp index 58f419031..447282928 100644 --- a/CGMES_2.4.15_27JAN2020/Simple_Float.cpp +++ b/CGMES_2.4.15_27JAN2020/Simple_Float.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Simple_Float.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Simple_Float::Simple_Float() {} -Simple_Float::~Simple_Float(){} +#include -Simple_Float::Simple_Float(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Simple_Float::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Simple_Float::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Simple_Float& Simple_Float::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Simple_Float::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Simple_Float::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Simple_Float::debugName[] = "Simple_Float"; -const char* Simple_Float::debugString() { +const char* Simple_Float::debugString() const +{ return Simple_Float::debugName; } - -const BaseClassDefiner Simple_Float::declare() { - return BaseClassDefiner(Simple_Float::addConstructToMap, Simple_Float::addPrimitiveAssignFnsToMap, Simple_Float::addClassAssignFnsToMap, Simple_Float::debugName); +Simple_Float& Simple_Float::operator+=(const Simple_Float& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Simple_Float& Simple_Float::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Simple_Float& Simple_Float::operator-=(const Simple_Float& rhs) { - value -= rhs.value; - return *this; - } - - Simple_Float& Simple_Float::operator*=(const Simple_Float& rhs) { - value *= rhs.value; - return *this; - } - - Simple_Float& Simple_Float::operator/=(const Simple_Float& rhs) { - value /= rhs.value; - return *this; - } +Simple_Float& Simple_Float::operator-=(const Simple_Float& rhs) +{ + value -= rhs.value; + return *this; +} - Simple_Float& Simple_Float::operator+=(const Simple_Float& rhs) { - value += rhs.value; - return *this; - } +Simple_Float& Simple_Float::operator*=(const Simple_Float& rhs) +{ + value *= rhs.value; + return *this; +} - Simple_Float::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Simple_Float& Simple_Float::operator/=(const Simple_Float& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Simple_Float& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Simple_Float& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Simple_Float& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Simple_Float.hpp b/CGMES_2.4.15_27JAN2020/Simple_Float.hpp index c56e4bb97..58d48ce8f 100644 --- a/CGMES_2.4.15_27JAN2020/Simple_Float.hpp +++ b/CGMES_2.4.15_27JAN2020/Simple_Float.hpp @@ -1,38 +1,39 @@ #ifndef Simple_Float_H #define Simple_Float_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Simple_Float : public BaseClass + /* + A floating point number. The range is unspecified and not limited. + */ + class Simple_Float { - public: - Simple_Float(); - virtual ~Simple_Float(); - Simple_Float(long double value); - static const BaseClassDefiner declare(); - Simple_Float& operator=(long double &rop); + Simple_Float() : value(0.0), initialized(false) {} + Simple_Float(long double value) : value(value), initialized(true) {} + + Simple_Float& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Simple_Float& operator+=(const Simple_Float& rhs); Simple_Float& operator-=(const Simple_Float& rhs); Simple_Float& operator*=(const Simple_Float& rhs); Simple_Float& operator/=(const Simple_Float& rhs); + friend std::istream& operator>>(std::istream& lop, Simple_Float& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Simple_Float& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.cpp index 2ef7948ba..729d7b8ce 100644 --- a/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.cpp @@ -1,36 +1,36 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SolarGeneratingUnit.hpp" +#include +#include + using namespace CIMPP; SolarGeneratingUnit::SolarGeneratingUnit() {}; - SolarGeneratingUnit::~SolarGeneratingUnit() {}; -namespace CIMPP { - BaseClass* SolarGeneratingUnit_factory() { - return new SolarGeneratingUnit; - } +const char SolarGeneratingUnit::debugName[] = "SolarGeneratingUnit"; +const char* SolarGeneratingUnit::debugString() const +{ + return SolarGeneratingUnit::debugName; } -void SolarGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void SolarGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SolarGeneratingUnit"), &SolarGeneratingUnit_factory)); } -void SolarGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void SolarGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void SolarGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SolarGeneratingUnit::debugName[] = "SolarGeneratingUnit"; -const char* SolarGeneratingUnit::debugString() +void SolarGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SolarGeneratingUnit::debugName; } const BaseClassDefiner SolarGeneratingUnit::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner SolarGeneratingUnit::declare() return BaseClassDefiner(SolarGeneratingUnit::addConstructToMap, SolarGeneratingUnit::addPrimitiveAssignFnsToMap, SolarGeneratingUnit::addClassAssignFnsToMap, SolarGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* SolarGeneratingUnit_factory() + { + return new SolarGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.hpp index 497cbea6a..0fa75b7ac 100644 --- a/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/SolarGeneratingUnit.hpp @@ -1,36 +1,37 @@ #ifndef SolarGeneratingUnit_H #define SolarGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* A solar thermal generating unit. */ - class SolarGeneratingUnit: public GeneratingUnit + class SolarGeneratingUnit : public GeneratingUnit { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SolarGeneratingUnit(); - virtual ~SolarGeneratingUnit(); - + ~SolarGeneratingUnit() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SolarGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Source.cpp b/CGMES_2.4.15_27JAN2020/Source.cpp index 1a37656e9..54f9266b5 100644 --- a/CGMES_2.4.15_27JAN2020/Source.cpp +++ b/CGMES_2.4.15_27JAN2020/Source.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Source.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::Source& rop) +Source& Source::operator=(Source_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +Source::operator Source_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Source::debugName[] = "Source"; +const char* Source::debugString() const +{ + return Source::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Source& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const Source& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == Source::PROCESS) + { + EnumSymbol = "PROCESS"; + } + if (obj.value == Source::DEFAULTED) + { + EnumSymbol = "DEFAULTED"; + } + if (obj.value == Source::SUBSTITUTED) + { + EnumSymbol = "SUBSTITUTED"; + } + + if (!EnumSymbol.empty()) + { + os << "Source." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Source.hpp b/CGMES_2.4.15_27JAN2020/Source.hpp index bff597490..0cbf17fb0 100644 --- a/CGMES_2.4.15_27JAN2020/Source.hpp +++ b/CGMES_2.4.15_27JAN2020/Source.hpp @@ -1,25 +1,50 @@ #ifndef Source_H #define Source_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Source gives information related to the origin of a value. */ - enum class Source + class Source { - /** - * The value is provided by input from the process I/O or being calculated from some function. - */ - PROCESS, - /** - * The value contains a default value. - */ - DEFAULTED, - /** - * The value is provided by input of an operator or by an automatic source. - */ - SUBSTITUTED, + public: + enum Source_ENUM + { + /** + * The value is provided by input from the process I/O or being calculated from some function. + */ + PROCESS, + /** + * The value contains a default value. + */ + DEFAULTED, + /** + * The value is provided by input of an operator or by an automatic source. + */ + SUBSTITUTED, + }; + + Source() : value(), initialized(false) {} + Source(Source_ENUM value) : value(value), initialized(true) {} + + Source& operator=(Source_ENUM rop); + operator Source_ENUM() const; + + Source_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Source& rop); + friend std::ostream& operator<<(std::ostream& os, const Source& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::Source& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/StateVariablesVersion.cpp b/CGMES_2.4.15_27JAN2020/StateVariablesVersion.cpp index ac589b5ae..4ec1e2cae 100644 --- a/CGMES_2.4.15_27JAN2020/StateVariablesVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/StateVariablesVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StateVariablesVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -StateVariablesVersion::StateVariablesVersion(): date(nullptr) {}; - +StateVariablesVersion::StateVariablesVersion() {}; StateVariablesVersion::~StateVariablesVersion() {}; - - -bool assign_StateVariablesVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_StateVariablesVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_StateVariablesVersion_baseUML(std::stringstream &buffer, BaseClass* return false; } -bool assign_StateVariablesVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_StateVariablesVersion_baseURI(std::stringstream &buffer, BaseClass* return false; } +bool assign_StateVariablesVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_StateVariablesVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_StateVariablesVersion_differenceModelURI(std::stringstream &buffer, return false; } -bool assign_StateVariablesVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_StateVariablesVersion_entsoeUML(std::stringstream &buffer, BaseClass return false; } -bool assign_StateVariablesVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_StateVariablesVersion_entsoeURI(std::stringstream &buffer, BaseClass return false; } -bool assign_StateVariablesVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_StateVariablesVersion_modelDescriptionURI(std::stringstream &buffer, return false; } -bool assign_StateVariablesVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_StateVariablesVersion_namespaceRDF(std::stringstream &buffer, BaseCl return false; } -bool assign_StateVariablesVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_StateVariablesVersion_namespaceUML(std::stringstream &buffer, BaseCl return false; } -bool assign_StateVariablesVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StateVariablesVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StateVariablesVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_StateVariablesVersion_shortName(std::stringstream &buffer, BaseClass return false; } -namespace CIMPP { - BaseClass* StateVariablesVersion_factory() { - return new StateVariablesVersion; - } + + + + + + + + + + + +const char StateVariablesVersion::debugName[] = "StateVariablesVersion"; +const char* StateVariablesVersion::debugString() const +{ + return StateVariablesVersion::debugName; } -void StateVariablesVersion::addConstructToMap(std::unordered_map& factory_map) { +void StateVariablesVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StateVariablesVersion"), &StateVariablesVersion_factory)); } -void StateVariablesVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void StateVariablesVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.baseUML"), &assign_StateVariablesVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.baseURI"), &assign_StateVariablesVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.differenceModelURI"), &assign_StateVariablesVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.date"), &assign_StateVariablesVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.differenceModelURI"), &assign_StateVariablesVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.entsoeUML"), &assign_StateVariablesVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.entsoeURI"), &assign_StateVariablesVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.modelDescriptionURI"), &assign_StateVariablesVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void StateVariablesVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StateVariablesVersion.date"), &assign_StateVariablesVersion_date)); - } - -const char StateVariablesVersion::debugName[] = "StateVariablesVersion"; -const char* StateVariablesVersion::debugString() +void StateVariablesVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StateVariablesVersion::debugName; } const BaseClassDefiner StateVariablesVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner StateVariablesVersion::declare() return BaseClassDefiner(StateVariablesVersion::addConstructToMap, StateVariablesVersion::addPrimitiveAssignFnsToMap, StateVariablesVersion::addClassAssignFnsToMap, StateVariablesVersion::debugName); } - +namespace CIMPP +{ + BaseClass* StateVariablesVersion_factory() + { + return new StateVariablesVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/StateVariablesVersion.hpp b/CGMES_2.4.15_27JAN2020/StateVariablesVersion.hpp index 604650d9a..adc7bfe6d 100644 --- a/CGMES_2.4.15_27JAN2020/StateVariablesVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/StateVariablesVersion.hpp @@ -1,48 +1,49 @@ #ifndef StateVariablesVersion_H #define StateVariablesVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class StateVariablesVersion: public BaseClass + class StateVariablesVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/StateVariables/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StateVariablesVersion(); - virtual ~StateVariablesVersion(); - + ~StateVariablesVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/StateVariables/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StateVariablesVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.cpp b/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.cpp index c845ea521..e3d149299 100644 --- a/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.cpp +++ b/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StaticLoadModelKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::StaticLoadModelKind& rop) +StaticLoadModelKind& StaticLoadModelKind::operator=(StaticLoadModelKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +StaticLoadModelKind::operator StaticLoadModelKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char StaticLoadModelKind::debugName[] = "StaticLoadModelKind"; +const char* StaticLoadModelKind::debugString() const +{ + return StaticLoadModelKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, StaticLoadModelKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const StaticLoadModelKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == StaticLoadModelKind::exponential) + { + EnumSymbol = "exponential"; + } + if (obj.value == StaticLoadModelKind::zIP1) + { + EnumSymbol = "zIP1"; + } + if (obj.value == StaticLoadModelKind::zIP2) + { + EnumSymbol = "zIP2"; + } + if (obj.value == StaticLoadModelKind::constantZ) + { + EnumSymbol = "constantZ"; + } + + if (!EnumSymbol.empty()) + { + os << "StaticLoadModelKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.hpp b/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.hpp index ecb0dd9b5..362cca7ea 100644 --- a/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.hpp +++ b/CGMES_2.4.15_27JAN2020/StaticLoadModelKind.hpp @@ -1,29 +1,54 @@ #ifndef StaticLoadModelKind_H #define StaticLoadModelKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of static load model. */ - enum class StaticLoadModelKind + class StaticLoadModelKind { - /** - * Exponential P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf, ep1, ep2, ep3 kq1, kq2, kq3, kqf, eq1, eq2, eq3. - */ - exponential, - /** - * ZIP1 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf kq1, kq2, kq3, kqf. - */ - zIP1, - /** - * This model separates the frequency-dependent load (primarily motors) from other load. ZIP2 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kq4, kpf kq1, kq2, kq3, kq4, kqf. - */ - zIP2, - /** - * The load is represented as a constant impedance. ConstantZ P and Q equations are used and no attributes are required. - */ - constantZ, + public: + enum StaticLoadModelKind_ENUM + { + /** + * Exponential P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf, ep1, ep2, ep3 kq1, kq2, kq3, kqf, eq1, eq2, eq3. + */ + exponential, + /** + * ZIP1 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kpf kq1, kq2, kq3, kqf. + */ + zIP1, + /** + * This model separates the frequency-dependent load (primarily motors) from other load. ZIP2 P and Q equations are used and the following attributes are required: kp1, kp2, kp3, kq4, kpf kq1, kq2, kq3, kq4, kqf. + */ + zIP2, + /** + * The load is represented as a constant impedance. ConstantZ P and Q equations are used and no attributes are required. + */ + constantZ, + }; + + StaticLoadModelKind() : value(), initialized(false) {} + StaticLoadModelKind(StaticLoadModelKind_ENUM value) : value(value), initialized(true) {} + + StaticLoadModelKind& operator=(StaticLoadModelKind_ENUM rop); + operator StaticLoadModelKind_ENUM() const; + + StaticLoadModelKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, StaticLoadModelKind& rop); + friend std::ostream& operator<<(std::ostream& os, const StaticLoadModelKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::StaticLoadModelKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/StaticVarCompensator.cpp b/CGMES_2.4.15_27JAN2020/StaticVarCompensator.cpp index 76bede8d6..46d3ed25b 100644 --- a/CGMES_2.4.15_27JAN2020/StaticVarCompensator.cpp +++ b/CGMES_2.4.15_27JAN2020/StaticVarCompensator.cpp @@ -1,123 +1,132 @@ -#include -#include "RegulatingCondEq.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StaticVarCompensator.hpp" +#include +#include + #include "Reactance.hpp" #include "Reactance.hpp" -#include "VoltagePerReactivePower.hpp" +#include "ReactivePower.hpp" #include "SVCControlMode.hpp" +#include "VoltagePerReactivePower.hpp" #include "Voltage.hpp" -#include "ReactivePower.hpp" using namespace CIMPP; -StaticVarCompensator::StaticVarCompensator(): slope(nullptr) {}; - +StaticVarCompensator::StaticVarCompensator() {}; StaticVarCompensator::~StaticVarCompensator() {}; +bool assign_StaticVarCompensator_capacitiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->capacitiveRating; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_StaticVarCompensator_inductiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inductiveRating; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_StaticVarCompensator_slope(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - element->slope = dynamic_cast(BaseClass_ptr2); - if(element->slope != nullptr) - return true; - } - return false; +bool assign_StaticVarCompensator_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_StaticVarCompensator_sVCControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sVCControlMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_StaticVarCompensator_slope(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->slope; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_StaticVarCompensator_voltageSetPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageSetPoint; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_StaticVarCompensator_capacitiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->capacitiveRating; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_inductiveRating(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inductiveRating; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_sVCControlMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sVCControlMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_voltageSetPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageSetPoint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_StaticVarCompensator_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StaticVarCompensator* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* StaticVarCompensator_factory() { - return new StaticVarCompensator; - } +const char StaticVarCompensator::debugName[] = "StaticVarCompensator"; +const char* StaticVarCompensator::debugString() const +{ + return StaticVarCompensator::debugName; } -void StaticVarCompensator::addConstructToMap(std::unordered_map& factory_map) { +void StaticVarCompensator::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StaticVarCompensator"), &StaticVarCompensator_factory)); } -void StaticVarCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void StaticVarCompensator::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.capacitiveRating"), &assign_StaticVarCompensator_capacitiveRating)); assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.inductiveRating"), &assign_StaticVarCompensator_inductiveRating)); - assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.sVCControlMode"), &assign_StaticVarCompensator_sVCControlMode)); - assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.voltageSetPoint"), &assign_StaticVarCompensator_voltageSetPoint)); assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.q"), &assign_StaticVarCompensator_q)); + assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.sVCControlMode"), &assign_StaticVarCompensator_sVCControlMode)); + assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.slope"), &assign_StaticVarCompensator_slope)); + assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.voltageSetPoint"), &assign_StaticVarCompensator_voltageSetPoint)); } -void StaticVarCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StaticVarCompensator.slope"), &assign_StaticVarCompensator_slope)); - } - -const char StaticVarCompensator::debugName[] = "StaticVarCompensator"; -const char* StaticVarCompensator::debugString() +void StaticVarCompensator::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StaticVarCompensator::debugName; } const BaseClassDefiner StaticVarCompensator::declare() @@ -125,4 +134,10 @@ const BaseClassDefiner StaticVarCompensator::declare() return BaseClassDefiner(StaticVarCompensator::addConstructToMap, StaticVarCompensator::addPrimitiveAssignFnsToMap, StaticVarCompensator::addClassAssignFnsToMap, StaticVarCompensator::debugName); } - +namespace CIMPP +{ + BaseClass* StaticVarCompensator_factory() + { + return new StaticVarCompensator; + } +} diff --git a/CGMES_2.4.15_27JAN2020/StaticVarCompensator.hpp b/CGMES_2.4.15_27JAN2020/StaticVarCompensator.hpp index 55b2947df..f42209f24 100644 --- a/CGMES_2.4.15_27JAN2020/StaticVarCompensator.hpp +++ b/CGMES_2.4.15_27JAN2020/StaticVarCompensator.hpp @@ -1,47 +1,48 @@ #ifndef StaticVarCompensator_H #define StaticVarCompensator_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingCondEq.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "RegulatingCondEq.hpp" +#include "BaseClassDefiner.hpp" #include "Reactance.hpp" +#include "ReactivePower.hpp" #include "SVCControlMode.hpp" #include "Voltage.hpp" -#include "ReactivePower.hpp" - -namespace CIMPP { +#include "VoltagePerReactivePower.hpp" +namespace CIMPP +{ -class VoltagePerReactivePower; /* A facility for providing variable and controllable shunt reactive power. The SVC typically consists of a stepdown transformer, filter, thyristor-controlled reactor, and thyristor-switched capacitor arms. The SVC may operate in fixed MVar output mode or in voltage control mode. When in voltage control mode, the output of the SVC will be proportional to the deviation of voltage at the controlled bus from the voltage setpoint. The SVC characteristic slope defines the proportion. If the voltage at the controlled bus is equal to the voltage setpoint, the SVC MVar output is zero. */ - class StaticVarCompensator: public RegulatingCondEq + class StaticVarCompensator : public RegulatingCondEq { - public: - CIMPP::Reactance capacitiveRating; /* Maximum available capacitive reactance. Default: nullptr */ - CIMPP::Reactance inductiveRating; /* Maximum available inductive reactance. Default: nullptr */ - CIMPP::VoltagePerReactivePower* slope; /* The characteristics slope of an SVC defines how the reactive power output changes in proportion to the difference between the regulated bus voltage and the voltage setpoint. Default: nullptr */ - CIMPP::SVCControlMode sVCControlMode; /* SVC control mode. Default: 0 */ - CIMPP::Voltage voltageSetPoint; /* The reactive power output of the SVC is proportional to the difference between the voltage at the regulated bus and the voltage setpoint. When the regulated bus voltage is equal to the voltage setpoint, the reactive power output is zero. Default: nullptr */ - CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StaticVarCompensator(); - virtual ~StaticVarCompensator(); - + ~StaticVarCompensator() override; + + CIMPP::Reactance capacitiveRating; /* Maximum available capacitive reactance. Default: nullptr */ + CIMPP::Reactance inductiveRating; /* Maximum available inductive reactance. Default: nullptr */ + CIMPP::ReactivePower q; /* Reactive power injection. Load sign convention is used, i.e. positive sign means flow out from a node. Starting value for a steady state solution. Default: nullptr */ + CIMPP::SVCControlMode sVCControlMode; /* SVC control mode. Default: 0 */ + CIMPP::VoltagePerReactivePower slope; /* The characteristics slope of an SVC defines how the reactive power output changes in proportion to the difference between the regulated bus voltage and the voltage setpoint. Default: nullptr */ + CIMPP::Voltage voltageSetPoint; /* The reactive power output of the SVC is proportional to the difference between the voltage at the regulated bus and the voltage setpoint. When the regulated bus voltage is equal to the voltage setpoint, the reactive power output is zero. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StaticVarCompensator_factory(); diff --git a/CGMES_2.4.15_27JAN2020/StationSupply.cpp b/CGMES_2.4.15_27JAN2020/StationSupply.cpp index fe0641442..ba3e084c7 100644 --- a/CGMES_2.4.15_27JAN2020/StationSupply.cpp +++ b/CGMES_2.4.15_27JAN2020/StationSupply.cpp @@ -1,36 +1,36 @@ -#include -#include "EnergyConsumer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StationSupply.hpp" +#include +#include + using namespace CIMPP; StationSupply::StationSupply() {}; - StationSupply::~StationSupply() {}; -namespace CIMPP { - BaseClass* StationSupply_factory() { - return new StationSupply; - } +const char StationSupply::debugName[] = "StationSupply"; +const char* StationSupply::debugString() const +{ + return StationSupply::debugName; } -void StationSupply::addConstructToMap(std::unordered_map& factory_map) { +void StationSupply::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StationSupply"), &StationSupply_factory)); } -void StationSupply::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void StationSupply::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void StationSupply::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char StationSupply::debugName[] = "StationSupply"; -const char* StationSupply::debugString() +void StationSupply::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StationSupply::debugName; } const BaseClassDefiner StationSupply::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner StationSupply::declare() return BaseClassDefiner(StationSupply::addConstructToMap, StationSupply::addPrimitiveAssignFnsToMap, StationSupply::addClassAssignFnsToMap, StationSupply::debugName); } - +namespace CIMPP +{ + BaseClass* StationSupply_factory() + { + return new StationSupply; + } +} diff --git a/CGMES_2.4.15_27JAN2020/StationSupply.hpp b/CGMES_2.4.15_27JAN2020/StationSupply.hpp index a974df9de..e8dad59fe 100644 --- a/CGMES_2.4.15_27JAN2020/StationSupply.hpp +++ b/CGMES_2.4.15_27JAN2020/StationSupply.hpp @@ -1,36 +1,37 @@ #ifndef StationSupply_H #define StationSupply_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyConsumer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyConsumer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* Station supply with load derived from the station output. */ - class StationSupply: public EnergyConsumer + class StationSupply : public EnergyConsumer { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StationSupply(); - virtual ~StationSupply(); - + ~StationSupply() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StationSupply_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.cpp b/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.cpp index 2c3ac7407..2533eb481 100644 --- a/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SteadyStateHypothesisVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -SteadyStateHypothesisVersion::SteadyStateHypothesisVersion(): date(nullptr) {}; - +SteadyStateHypothesisVersion::SteadyStateHypothesisVersion() {}; SteadyStateHypothesisVersion::~SteadyStateHypothesisVersion() {}; - - -bool assign_SteadyStateHypothesisVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_SteadyStateHypothesisVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_SteadyStateHypothesisVersion_baseUML(std::stringstream &buffer, Base return false; } -bool assign_SteadyStateHypothesisVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_SteadyStateHypothesisVersion_baseURI(std::stringstream &buffer, Base return false; } +bool assign_SteadyStateHypothesisVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SteadyStateHypothesisVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_SteadyStateHypothesisVersion_differenceModelURI(std::stringstream &b return false; } -bool assign_SteadyStateHypothesisVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_SteadyStateHypothesisVersion_entsoeUML(std::stringstream &buffer, Ba return false; } -bool assign_SteadyStateHypothesisVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_SteadyStateHypothesisVersion_entsoeURI(std::stringstream &buffer, Ba return false; } -bool assign_SteadyStateHypothesisVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_SteadyStateHypothesisVersion_modelDescriptionURI(std::stringstream & return false; } -bool assign_SteadyStateHypothesisVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_SteadyStateHypothesisVersion_namespaceRDF(std::stringstream &buffer, return false; } -bool assign_SteadyStateHypothesisVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_SteadyStateHypothesisVersion_namespaceUML(std::stringstream &buffer, return false; } -bool assign_SteadyStateHypothesisVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_SteadyStateHypothesisVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SteadyStateHypothesisVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_SteadyStateHypothesisVersion_shortName(std::stringstream &buffer, Ba return false; } -namespace CIMPP { - BaseClass* SteadyStateHypothesisVersion_factory() { - return new SteadyStateHypothesisVersion; - } + + + + + + + + + + + +const char SteadyStateHypothesisVersion::debugName[] = "SteadyStateHypothesisVersion"; +const char* SteadyStateHypothesisVersion::debugString() const +{ + return SteadyStateHypothesisVersion::debugName; } -void SteadyStateHypothesisVersion::addConstructToMap(std::unordered_map& factory_map) { +void SteadyStateHypothesisVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion"), &SteadyStateHypothesisVersion_factory)); } -void SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.baseUML"), &assign_SteadyStateHypothesisVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.baseURI"), &assign_SteadyStateHypothesisVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.differenceModelURI"), &assign_SteadyStateHypothesisVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.date"), &assign_SteadyStateHypothesisVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.differenceModelURI"), &assign_SteadyStateHypothesisVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.entsoeUML"), &assign_SteadyStateHypothesisVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.entsoeURI"), &assign_SteadyStateHypothesisVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.modelDescriptionURI"), &assign_SteadyStateHypothesisVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap(std::unordered_map assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.shortName"), &assign_SteadyStateHypothesisVersion_shortName)); } -void SteadyStateHypothesisVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SteadyStateHypothesisVersion.date"), &assign_SteadyStateHypothesisVersion_date)); - } - -const char SteadyStateHypothesisVersion::debugName[] = "SteadyStateHypothesisVersion"; -const char* SteadyStateHypothesisVersion::debugString() +void SteadyStateHypothesisVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SteadyStateHypothesisVersion::debugName; } const BaseClassDefiner SteadyStateHypothesisVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner SteadyStateHypothesisVersion::declare() return BaseClassDefiner(SteadyStateHypothesisVersion::addConstructToMap, SteadyStateHypothesisVersion::addPrimitiveAssignFnsToMap, SteadyStateHypothesisVersion::addClassAssignFnsToMap, SteadyStateHypothesisVersion::debugName); } - +namespace CIMPP +{ + BaseClass* SteadyStateHypothesisVersion_factory() + { + return new SteadyStateHypothesisVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.hpp b/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.hpp index 79fde578d..7eeaa2af7 100644 --- a/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/SteadyStateHypothesisVersion.hpp @@ -1,48 +1,49 @@ #ifndef SteadyStateHypothesisVersion_H #define SteadyStateHypothesisVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class SteadyStateHypothesisVersion: public BaseClass + class SteadyStateHypothesisVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/SteadyStateHypothesis/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SteadyStateHypothesisVersion(); - virtual ~SteadyStateHypothesisVersion(); - + ~SteadyStateHypothesisVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/SteadyStateHypothesis/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SteadyStateHypothesisVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/String.cpp b/CGMES_2.4.15_27JAN2020/String.cpp new file mode 100644 index 000000000..e39ff2f00 --- /dev/null +++ b/CGMES_2.4.15_27JAN2020/String.cpp @@ -0,0 +1,49 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ +#include "String.hpp" + +#include "../src/CIMExceptions.hpp" + +using namespace CIMPP; + +String& String::operator=(const std::string& rop) +{ + value = rop; + initialized = true; + return *this; +} + +String::operator std::string() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char String::debugName[] = "String"; +const char* String::debugString() const +{ + return String::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, String& rop) + { + lop >> rop.value; + rop.initialized = true; + return lop; + } + + std::ostream& operator<<(std::ostream& os, const String& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/String.hpp b/CGMES_2.4.15_27JAN2020/String.hpp new file mode 100644 index 000000000..60fcbbbc0 --- /dev/null +++ b/CGMES_2.4.15_27JAN2020/String.hpp @@ -0,0 +1,35 @@ +#ifndef String_H +#define String_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ + +#include +#include +#include + +namespace CIMPP +{ + /* + A string consisting of a sequence of characters. The character encoding is UTF-8. The string length is unspecified and unlimited. + */ + class String + { + public: + String() : initialized(false) {} + String(const std::string& value) : value(value), initialized(true) {} + + String& operator=(const std::string &rop); + operator std::string() const; + + std::string value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, String& rop); + friend std::ostream& operator<<(std::ostream& os, const String& obj); + }; +} +#endif diff --git a/CGMES_2.4.15_27JAN2020/StringMeasurement.cpp b/CGMES_2.4.15_27JAN2020/StringMeasurement.cpp index 84ffd2b8d..1eb7acf05 100644 --- a/CGMES_2.4.15_27JAN2020/StringMeasurement.cpp +++ b/CGMES_2.4.15_27JAN2020/StringMeasurement.cpp @@ -1,49 +1,56 @@ -#include -#include "Measurement.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StringMeasurement.hpp" +#include +#include + #include "StringMeasurementValue.hpp" using namespace CIMPP; StringMeasurement::StringMeasurement() {}; - StringMeasurement::~StringMeasurement() {}; -bool assign_StringMeasurement_StringMeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StringMeasurement* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->StringMeasurementValues.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_StringMeasurementValue_StringMeasurement(BaseClass*, BaseClass*); +bool assign_StringMeasurement_StringMeasurementValues(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + StringMeasurement* element = dynamic_cast(BaseClass_ptr1); + StringMeasurementValue* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->StringMeasurementValues.begin(), element->StringMeasurementValues.end(), element2) == element->StringMeasurementValues.end()) + { + element->StringMeasurementValues.push_back(element2); + return assign_StringMeasurementValue_StringMeasurement(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* StringMeasurement_factory() { - return new StringMeasurement; - } +const char StringMeasurement::debugName[] = "StringMeasurement"; +const char* StringMeasurement::debugString() const +{ + return StringMeasurement::debugName; } -void StringMeasurement::addConstructToMap(std::unordered_map& factory_map) { +void StringMeasurement::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:StringMeasurement"), &StringMeasurement_factory)); } -void StringMeasurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void StringMeasurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StringMeasurement.StringMeasurementValues"), &assign_StringMeasurement_StringMeasurementValues)); +void StringMeasurement::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char StringMeasurement::debugName[] = "StringMeasurement"; -const char* StringMeasurement::debugString() +void StringMeasurement::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StringMeasurement::debugName; + assign_map.insert(std::make_pair(std::string("cim:StringMeasurement.StringMeasurementValues"), &assign_StringMeasurement_StringMeasurementValues)); } const BaseClassDefiner StringMeasurement::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner StringMeasurement::declare() return BaseClassDefiner(StringMeasurement::addConstructToMap, StringMeasurement::addPrimitiveAssignFnsToMap, StringMeasurement::addClassAssignFnsToMap, StringMeasurement::debugName); } - +namespace CIMPP +{ + BaseClass* StringMeasurement_factory() + { + return new StringMeasurement; + } +} diff --git a/CGMES_2.4.15_27JAN2020/StringMeasurement.hpp b/CGMES_2.4.15_27JAN2020/StringMeasurement.hpp index c95a15cf6..dbe295067 100644 --- a/CGMES_2.4.15_27JAN2020/StringMeasurement.hpp +++ b/CGMES_2.4.15_27JAN2020/StringMeasurement.hpp @@ -1,38 +1,39 @@ #ifndef StringMeasurement_H #define StringMeasurement_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Measurement.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Measurement.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class StringMeasurementValue; -class StringMeasurementValue; /* StringMeasurement represents a measurement with values of type string. */ - class StringMeasurement: public Measurement + class StringMeasurement : public Measurement { - public: - std::list StringMeasurementValues; /* The values connected to this measurement. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StringMeasurement(); - virtual ~StringMeasurement(); - + ~StringMeasurement() override; + + std::list StringMeasurementValues; /* The values connected to this measurement. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StringMeasurement_factory(); diff --git a/CGMES_2.4.15_27JAN2020/StringMeasurementValue.cpp b/CGMES_2.4.15_27JAN2020/StringMeasurementValue.cpp index e4a525151..68102fc0e 100644 --- a/CGMES_2.4.15_27JAN2020/StringMeasurementValue.cpp +++ b/CGMES_2.4.15_27JAN2020/StringMeasurementValue.cpp @@ -1,34 +1,27 @@ -#include -#include "MeasurementValue.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "StringMeasurementValue.hpp" +#include +#include + #include "StringMeasurement.hpp" #include "String.hpp" using namespace CIMPP; -StringMeasurementValue::StringMeasurementValue(): StringMeasurement(nullptr) {}; - +StringMeasurementValue::StringMeasurementValue() : StringMeasurement(nullptr) {}; StringMeasurementValue::~StringMeasurementValue() {}; -bool assign_StringMeasurement_StringMeasurementValues(BaseClass*, BaseClass*); -bool assign_StringMeasurementValue_StringMeasurement(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { - element->StringMeasurement = dynamic_cast(BaseClass_ptr2); - if(element->StringMeasurement != nullptr) - return assign_StringMeasurement_StringMeasurementValues(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - - -bool assign_StringMeasurementValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_StringMeasurementValue_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1)) + { element->value = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -36,28 +29,44 @@ bool assign_StringMeasurementValue_value(std::stringstream &buffer, BaseClass* B return false; } -namespace CIMPP { - BaseClass* StringMeasurementValue_factory() { - return new StringMeasurementValue; + +bool assign_StringMeasurement_StringMeasurementValues(BaseClass*, BaseClass*); +bool assign_StringMeasurementValue_StringMeasurement(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + StringMeasurementValue* element = dynamic_cast(BaseClass_ptr1); + StringMeasurement* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->StringMeasurement != element2) + { + element->StringMeasurement = element2; + return assign_StringMeasurement_StringMeasurementValues(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void StringMeasurementValue::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:StringMeasurementValue"), &StringMeasurementValue_factory)); + +const char StringMeasurementValue::debugName[] = "StringMeasurementValue"; +const char* StringMeasurementValue::debugString() const +{ + return StringMeasurementValue::debugName; } -void StringMeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.value"), &assign_StringMeasurementValue_value)); +void StringMeasurementValue::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:StringMeasurementValue"), &StringMeasurementValue_factory)); } -void StringMeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.StringMeasurement"), &assign_StringMeasurementValue_StringMeasurement)); - } +void StringMeasurementValue::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.value"), &assign_StringMeasurementValue_value)); +} -const char StringMeasurementValue::debugName[] = "StringMeasurementValue"; -const char* StringMeasurementValue::debugString() +void StringMeasurementValue::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return StringMeasurementValue::debugName; + assign_map.insert(std::make_pair(std::string("cim:StringMeasurementValue.StringMeasurement"), &assign_StringMeasurementValue_StringMeasurement)); } const BaseClassDefiner StringMeasurementValue::declare() @@ -65,4 +74,10 @@ const BaseClassDefiner StringMeasurementValue::declare() return BaseClassDefiner(StringMeasurementValue::addConstructToMap, StringMeasurementValue::addPrimitiveAssignFnsToMap, StringMeasurementValue::addClassAssignFnsToMap, StringMeasurementValue::debugName); } - +namespace CIMPP +{ + BaseClass* StringMeasurementValue_factory() + { + return new StringMeasurementValue; + } +} diff --git a/CGMES_2.4.15_27JAN2020/StringMeasurementValue.hpp b/CGMES_2.4.15_27JAN2020/StringMeasurementValue.hpp index 9d1533ae8..415428c41 100644 --- a/CGMES_2.4.15_27JAN2020/StringMeasurementValue.hpp +++ b/CGMES_2.4.15_27JAN2020/StringMeasurementValue.hpp @@ -1,40 +1,41 @@ #ifndef StringMeasurementValue_H #define StringMeasurementValue_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "MeasurementValue.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "MeasurementValue.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ + class StringMeasurement; - -class StringMeasurement; /* StringMeasurementValue represents a measurement value of type string. */ - class StringMeasurementValue: public MeasurementValue + class StringMeasurementValue : public MeasurementValue { - public: - CIMPP::StringMeasurement* StringMeasurement; /* Measurement to which this value is connected. Default: 0 */ - CIMPP::String value; /* The value to supervise. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ StringMeasurementValue(); - virtual ~StringMeasurementValue(); - + ~StringMeasurementValue() override; + + CIMPP::StringMeasurement* StringMeasurement; /* Measurement to which this value is connected. Default: 0 */ + CIMPP::String value; /* The value to supervise. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* StringMeasurementValue_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.cpp b/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.cpp index 0cf95c61a..f16780fa0 100644 --- a/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.cpp +++ b/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.cpp @@ -1,93 +1,127 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SubGeographicalRegion.hpp" +#include +#include + #include "DCLine.hpp" -#include "GeographicalRegion.hpp" #include "Line.hpp" +#include "GeographicalRegion.hpp" #include "Substation.hpp" using namespace CIMPP; -SubGeographicalRegion::SubGeographicalRegion(): Region(nullptr) {}; - +SubGeographicalRegion::SubGeographicalRegion() : Region(nullptr) {}; SubGeographicalRegion::~SubGeographicalRegion() {}; -bool assign_SubGeographicalRegion_DCLines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCLines.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + + +bool assign_DCLine_Region(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_DCLines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + DCLine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCLines.begin(), element->DCLines.end(), element2) == element->DCLines.end()) + { + element->DCLines.push_back(element2); + return assign_DCLine_Region(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_GeographicalRegion_Regions(BaseClass*, BaseClass*); -bool assign_SubGeographicalRegion_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_GeographicalRegion_Regions(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Line_Region(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_Lines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + Line* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Lines.begin(), element->Lines.end(), element2) == element->Lines.end()) + { + element->Lines.push_back(element2); + return assign_Line_Region(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SubGeographicalRegion_Lines(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Lines.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_GeographicalRegion_Regions(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + GeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_GeographicalRegion_Regions(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_SubGeographicalRegion_Substations(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Substations.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Substation_Region(BaseClass*, BaseClass*); +bool assign_SubGeographicalRegion_Substations(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubGeographicalRegion* element = dynamic_cast(BaseClass_ptr1); + Substation* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Substations.begin(), element->Substations.end(), element2) == element->Substations.end()) + { + element->Substations.push_back(element2); + return assign_Substation_Region(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - -namespace CIMPP { - BaseClass* SubGeographicalRegion_factory() { - return new SubGeographicalRegion; - } +const char SubGeographicalRegion::debugName[] = "SubGeographicalRegion"; +const char* SubGeographicalRegion::debugString() const +{ + return SubGeographicalRegion::debugName; } -void SubGeographicalRegion::addConstructToMap(std::unordered_map& factory_map) { +void SubGeographicalRegion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion"), &SubGeographicalRegion_factory)); } -void SubGeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void SubGeographicalRegion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void SubGeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void SubGeographicalRegion::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.DCLines"), &assign_SubGeographicalRegion_DCLines)); - assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Region"), &assign_SubGeographicalRegion_Region)); assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Lines"), &assign_SubGeographicalRegion_Lines)); + assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Region"), &assign_SubGeographicalRegion_Region)); assign_map.insert(std::make_pair(std::string("cim:SubGeographicalRegion.Substations"), &assign_SubGeographicalRegion_Substations)); } -const char SubGeographicalRegion::debugName[] = "SubGeographicalRegion"; -const char* SubGeographicalRegion::debugString() -{ - return SubGeographicalRegion::debugName; -} - const BaseClassDefiner SubGeographicalRegion::declare() { return BaseClassDefiner(SubGeographicalRegion::addConstructToMap, SubGeographicalRegion::addPrimitiveAssignFnsToMap, SubGeographicalRegion::addClassAssignFnsToMap, SubGeographicalRegion::debugName); } - +namespace CIMPP +{ + BaseClass* SubGeographicalRegion_factory() + { + return new SubGeographicalRegion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.hpp b/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.hpp index 9ea5e6a4d..99e296385 100644 --- a/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.hpp +++ b/CGMES_2.4.15_27JAN2020/SubGeographicalRegion.hpp @@ -1,44 +1,45 @@ #ifndef SubGeographicalRegion_H #define SubGeographicalRegion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCLine; + class GeographicalRegion; + class Line; + class Substation; -class DCLine; -class GeographicalRegion; -class Line; -class Substation; /* A subset of a geographical region of a power system network model. */ - class SubGeographicalRegion: public IdentifiedObject + class SubGeographicalRegion : public IdentifiedObject { - public: - std::list DCLines; /* Default: 0 */ - CIMPP::GeographicalRegion* Region; /* The geographical region to which this sub-geographical region is within. Default: 0 */ - std::list Lines; /* The lines within the sub-geographical region. Default: 0 */ - std::list Substations; /* The substations in this sub-geographical region. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SubGeographicalRegion(); - virtual ~SubGeographicalRegion(); - + ~SubGeographicalRegion() override; + + std::list DCLines; /* Default: 0 */ + std::list Lines; /* The sub-geographical region of the line. Default: 0 */ + CIMPP::GeographicalRegion* Region; /* The geographical region to which this sub-geographical region is within. Default: 0 */ + std::list Substations; /* The substations in this sub-geographical region. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SubGeographicalRegion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SubLoadArea.cpp b/CGMES_2.4.15_27JAN2020/SubLoadArea.cpp index caa12cdf0..d52b226c0 100644 --- a/CGMES_2.4.15_27JAN2020/SubLoadArea.cpp +++ b/CGMES_2.4.15_27JAN2020/SubLoadArea.cpp @@ -1,62 +1,76 @@ -#include -#include "EnergyArea.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SubLoadArea.hpp" +#include +#include + #include "LoadArea.hpp" #include "LoadGroup.hpp" using namespace CIMPP; -SubLoadArea::SubLoadArea(): LoadArea(nullptr) {}; - +SubLoadArea::SubLoadArea() : LoadArea(nullptr) {}; SubLoadArea::~SubLoadArea() {}; + + + bool assign_LoadArea_SubLoadAreas(BaseClass*, BaseClass*); -bool assign_SubLoadArea_LoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubLoadArea* element = dynamic_cast(BaseClass_ptr1)) { - element->LoadArea = dynamic_cast(BaseClass_ptr2); - if(element->LoadArea != nullptr) - return assign_LoadArea_SubLoadAreas(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SubLoadArea_LoadArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubLoadArea* element = dynamic_cast(BaseClass_ptr1); + LoadArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->LoadArea != element2) + { + element->LoadArea = element2; + return assign_LoadArea_SubLoadAreas(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SubLoadArea_LoadGroups(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SubLoadArea* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->LoadGroups.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_LoadGroup_SubLoadArea(BaseClass*, BaseClass*); +bool assign_SubLoadArea_LoadGroups(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SubLoadArea* element = dynamic_cast(BaseClass_ptr1); + LoadGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->LoadGroups.begin(), element->LoadGroups.end(), element2) == element->LoadGroups.end()) + { + element->LoadGroups.push_back(element2); + return assign_LoadGroup_SubLoadArea(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* SubLoadArea_factory() { - return new SubLoadArea; - } +const char SubLoadArea::debugName[] = "SubLoadArea"; +const char* SubLoadArea::debugString() const +{ + return SubLoadArea::debugName; } -void SubLoadArea::addConstructToMap(std::unordered_map& factory_map) { +void SubLoadArea::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SubLoadArea"), &SubLoadArea_factory)); } -void SubLoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void SubLoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadArea"), &assign_SubLoadArea_LoadArea)); - assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadGroups"), &assign_SubLoadArea_LoadGroups)); +void SubLoadArea::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SubLoadArea::debugName[] = "SubLoadArea"; -const char* SubLoadArea::debugString() +void SubLoadArea::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SubLoadArea::debugName; + assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadArea"), &assign_SubLoadArea_LoadArea)); + assign_map.insert(std::make_pair(std::string("cim:SubLoadArea.LoadGroups"), &assign_SubLoadArea_LoadGroups)); } const BaseClassDefiner SubLoadArea::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner SubLoadArea::declare() return BaseClassDefiner(SubLoadArea::addConstructToMap, SubLoadArea::addPrimitiveAssignFnsToMap, SubLoadArea::addClassAssignFnsToMap, SubLoadArea::debugName); } - +namespace CIMPP +{ + BaseClass* SubLoadArea_factory() + { + return new SubLoadArea; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SubLoadArea.hpp b/CGMES_2.4.15_27JAN2020/SubLoadArea.hpp index 23effe803..344ee5c42 100644 --- a/CGMES_2.4.15_27JAN2020/SubLoadArea.hpp +++ b/CGMES_2.4.15_27JAN2020/SubLoadArea.hpp @@ -1,40 +1,41 @@ #ifndef SubLoadArea_H #define SubLoadArea_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EnergyArea.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EnergyArea.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class LoadArea; + class LoadGroup; -class LoadArea; -class LoadGroup; /* The class is the second level in a hierarchical structure for grouping of loads for the purpose of load flow load scaling. */ - class SubLoadArea: public EnergyArea + class SubLoadArea : public EnergyArea { - public: - CIMPP::LoadArea* LoadArea; /* The LoadArea where the SubLoadArea belongs. Default: 0 */ - std::list LoadGroups; /* The Loadgroups in the SubLoadArea. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SubLoadArea(); - virtual ~SubLoadArea(); - + ~SubLoadArea() override; + + CIMPP::LoadArea* LoadArea; /* The LoadArea where the SubLoadArea belongs. Default: 0 */ + std::list LoadGroups; /* The Loadgroups in the SubLoadArea. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SubLoadArea_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Substation.cpp b/CGMES_2.4.15_27JAN2020/Substation.cpp index 42d61f23a..1184170ee 100644 --- a/CGMES_2.4.15_27JAN2020/Substation.cpp +++ b/CGMES_2.4.15_27JAN2020/Substation.cpp @@ -1,80 +1,107 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Substation.hpp" +#include +#include + #include "DCConverterUnit.hpp" #include "SubGeographicalRegion.hpp" #include "VoltageLevel.hpp" using namespace CIMPP; -Substation::Substation(): Region(nullptr) {}; - +Substation::Substation() : Region(nullptr) {}; Substation::~Substation() {}; -bool assign_Substation_DCConverterUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Substation* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->DCConverterUnit.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_DCConverterUnit_Substation(BaseClass*, BaseClass*); +bool assign_Substation_DCConverterUnit(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Substation* element = dynamic_cast(BaseClass_ptr1); + DCConverterUnit* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->DCConverterUnit.begin(), element->DCConverterUnit.end(), element2) == element->DCConverterUnit.end()) + { + element->DCConverterUnit.push_back(element2); + return assign_DCConverterUnit_Substation(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_SubGeographicalRegion_Substations(BaseClass*, BaseClass*); -bool assign_Substation_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Substation* element = dynamic_cast(BaseClass_ptr1)) { - element->Region = dynamic_cast(BaseClass_ptr2); - if(element->Region != nullptr) - return assign_SubGeographicalRegion_Substations(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_Substation_Region(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Substation* element = dynamic_cast(BaseClass_ptr1); + SubGeographicalRegion* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Region != element2) + { + element->Region = element2; + return assign_SubGeographicalRegion_Substations(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Substation_VoltageLevels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Substation* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VoltageLevels.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_VoltageLevel_Substation(BaseClass*, BaseClass*); +bool assign_Substation_VoltageLevels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Substation* element = dynamic_cast(BaseClass_ptr1); + VoltageLevel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VoltageLevels.begin(), element->VoltageLevels.end(), element2) == element->VoltageLevels.end()) + { + element->VoltageLevels.push_back(element2); + return assign_VoltageLevel_Substation(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - -namespace CIMPP { - BaseClass* Substation_factory() { - return new Substation; - } +const char Substation::debugName[] = "Substation"; +const char* Substation::debugString() const +{ + return Substation::debugName; } -void Substation::addConstructToMap(std::unordered_map& factory_map) { +void Substation::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Substation"), &Substation_factory)); } -void Substation::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void Substation::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void Substation::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void Substation::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Substation.DCConverterUnit"), &assign_Substation_DCConverterUnit)); assign_map.insert(std::make_pair(std::string("cim:Substation.Region"), &assign_Substation_Region)); assign_map.insert(std::make_pair(std::string("cim:Substation.VoltageLevels"), &assign_Substation_VoltageLevels)); } -const char Substation::debugName[] = "Substation"; -const char* Substation::debugString() -{ - return Substation::debugName; -} - const BaseClassDefiner Substation::declare() { return BaseClassDefiner(Substation::addConstructToMap, Substation::addPrimitiveAssignFnsToMap, Substation::addClassAssignFnsToMap, Substation::debugName); } - +namespace CIMPP +{ + BaseClass* Substation_factory() + { + return new Substation; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Substation.hpp b/CGMES_2.4.15_27JAN2020/Substation.hpp index 9309a7e14..a1a9e6881 100644 --- a/CGMES_2.4.15_27JAN2020/Substation.hpp +++ b/CGMES_2.4.15_27JAN2020/Substation.hpp @@ -1,42 +1,43 @@ #ifndef Substation_H #define Substation_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class DCConverterUnit; + class SubGeographicalRegion; + class VoltageLevel; -class DCConverterUnit; -class SubGeographicalRegion; -class VoltageLevel; /* A collection of equipment for purposes other than generation or utilization, through which electric energy in bulk is passed for the purposes of switching or modifying its characteristics. */ - class Substation: public EquipmentContainer + class Substation : public EquipmentContainer { - public: - std::list DCConverterUnit; /* Default: 0 */ - CIMPP::SubGeographicalRegion* Region; /* The SubGeographicalRegion containing the substation. Default: 0 */ - std::list VoltageLevels; /* The voltage levels within this substation. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Substation(); - virtual ~Substation(); - + ~Substation() override; + + std::list DCConverterUnit; /* Default: 0 */ + CIMPP::SubGeographicalRegion* Region; /* The SubGeographicalRegion containing the substation. Default: 0 */ + std::list VoltageLevels; /* The voltage levels within this substation. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Substation_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Susceptance.cpp b/CGMES_2.4.15_27JAN2020/Susceptance.cpp index 965ca66b4..2c15bc914 100644 --- a/CGMES_2.4.15_27JAN2020/Susceptance.cpp +++ b/CGMES_2.4.15_27JAN2020/Susceptance.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Susceptance.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Susceptance::Susceptance() {} -Susceptance::~Susceptance(){} +#include -Susceptance::Susceptance(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Susceptance::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Susceptance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Susceptance& Susceptance::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Susceptance::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Susceptance::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Susceptance::debugName[] = "Susceptance"; -const char* Susceptance::debugString() { +const char* Susceptance::debugString() const +{ return Susceptance::debugName; } - -const BaseClassDefiner Susceptance::declare() { - return BaseClassDefiner(Susceptance::addConstructToMap, Susceptance::addPrimitiveAssignFnsToMap, Susceptance::addClassAssignFnsToMap, Susceptance::debugName); +Susceptance& Susceptance::operator+=(const Susceptance& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Susceptance& Susceptance::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Susceptance& Susceptance::operator-=(const Susceptance& rhs) { - value -= rhs.value; - return *this; - } - - Susceptance& Susceptance::operator*=(const Susceptance& rhs) { - value *= rhs.value; - return *this; - } - - Susceptance& Susceptance::operator/=(const Susceptance& rhs) { - value /= rhs.value; - return *this; - } +Susceptance& Susceptance::operator-=(const Susceptance& rhs) +{ + value -= rhs.value; + return *this; +} - Susceptance& Susceptance::operator+=(const Susceptance& rhs) { - value += rhs.value; - return *this; - } +Susceptance& Susceptance::operator*=(const Susceptance& rhs) +{ + value *= rhs.value; + return *this; +} - Susceptance::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Susceptance& Susceptance::operator/=(const Susceptance& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Susceptance& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Susceptance& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Susceptance& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Susceptance.hpp b/CGMES_2.4.15_27JAN2020/Susceptance.hpp index f4c64d673..c213337b1 100644 --- a/CGMES_2.4.15_27JAN2020/Susceptance.hpp +++ b/CGMES_2.4.15_27JAN2020/Susceptance.hpp @@ -1,38 +1,39 @@ #ifndef Susceptance_H #define Susceptance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Susceptance : public BaseClass + /* + Imaginary part of admittance. + */ + class Susceptance { - public: - Susceptance(); - virtual ~Susceptance(); - Susceptance(long double value); - static const BaseClassDefiner declare(); - Susceptance& operator=(long double &rop); + Susceptance() : value(0.0), initialized(false) {} + Susceptance(long double value) : value(value), initialized(true) {} + + Susceptance& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Susceptance& operator+=(const Susceptance& rhs); Susceptance& operator-=(const Susceptance& rhs); Susceptance& operator*=(const Susceptance& rhs); Susceptance& operator/=(const Susceptance& rhs); + friend std::istream& operator>>(std::istream& lop, Susceptance& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Susceptance& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/SvInjection.cpp b/CGMES_2.4.15_27JAN2020/SvInjection.cpp index fb6fffeb8..bed4c3d82 100644 --- a/CGMES_2.4.15_27JAN2020/SvInjection.cpp +++ b/CGMES_2.4.15_27JAN2020/SvInjection.cpp @@ -1,79 +1,88 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvInjection.hpp" +#include +#include + +#include "TopologicalNode.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -#include "TopologicalNode.hpp" using namespace CIMPP; -SvInjection::SvInjection(): TopologicalNode(nullptr) {}; - +SvInjection::SvInjection() : TopologicalNode(nullptr) {}; SvInjection::~SvInjection() {}; +bool assign_SvInjection_pInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pInjection; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologicalNode_SvInjection(BaseClass*, BaseClass*); -bool assign_SvInjection_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvInjection* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_SvInjection(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvInjection_qInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvInjection* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qInjection; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvInjection_pInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pInjection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TopologicalNode_SvInjection(BaseClass*, BaseClass*); +bool assign_SvInjection_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvInjection* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_SvInjection(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SvInjection_qInjection(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvInjection* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qInjection; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SvInjection_factory() { - return new SvInjection; - } +const char SvInjection::debugName[] = "SvInjection"; +const char* SvInjection::debugString() const +{ + return SvInjection::debugName; } -void SvInjection::addConstructToMap(std::unordered_map& factory_map) { +void SvInjection::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvInjection"), &SvInjection_factory)); } -void SvInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvInjection::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvInjection.pInjection"), &assign_SvInjection_pInjection)); assign_map.insert(std::make_pair(std::string("cim:SvInjection.qInjection"), &assign_SvInjection_qInjection)); - } - -void SvInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvInjection.TopologicalNode"), &assign_SvInjection_TopologicalNode)); } -const char SvInjection::debugName[] = "SvInjection"; -const char* SvInjection::debugString() +void SvInjection::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvInjection::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvInjection.TopologicalNode"), &assign_SvInjection_TopologicalNode)); } const BaseClassDefiner SvInjection::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner SvInjection::declare() return BaseClassDefiner(SvInjection::addConstructToMap, SvInjection::addPrimitiveAssignFnsToMap, SvInjection::addClassAssignFnsToMap, SvInjection::debugName); } - +namespace CIMPP +{ + BaseClass* SvInjection_factory() + { + return new SvInjection; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SvInjection.hpp b/CGMES_2.4.15_27JAN2020/SvInjection.hpp index a272c3211..cc2f21267 100644 --- a/CGMES_2.4.15_27JAN2020/SvInjection.hpp +++ b/CGMES_2.4.15_27JAN2020/SvInjection.hpp @@ -1,42 +1,43 @@ #ifndef SvInjection_H #define SvInjection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class TopologicalNode; - -class TopologicalNode; /* The SvInjection is reporting the calculated bus injection minus the sum of the terminal flows. The terminal flow is positive out from the bus (load sign convention) and bus injection has positive flow into the bus. SvInjection may have the remainder after state estimation or slack after power flow calculation. */ - class SvInjection: public BaseClass + class SvInjection : public BaseClass { - public: - CIMPP::ActivePower pInjection; /* The active power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ - CIMPP::ReactivePower qInjection; /* The reactive power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ - CIMPP::TopologicalNode* TopologicalNode; /* The injection flows state variables associated with the topological node. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvInjection(); - virtual ~SvInjection(); - + ~SvInjection() override; + + CIMPP::TopologicalNode* TopologicalNode; /* The injection flows state variables associated with the topological node. Default: 0 */ + CIMPP::ActivePower pInjection; /* The active power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ + CIMPP::ReactivePower qInjection; /* The reactive power injected into the bus in addition to injections from equipment terminals. Positive sign means injection into the TopologicalNode (bus). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvInjection_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SvPowerFlow.cpp b/CGMES_2.4.15_27JAN2020/SvPowerFlow.cpp index c71367f35..96125e597 100644 --- a/CGMES_2.4.15_27JAN2020/SvPowerFlow.cpp +++ b/CGMES_2.4.15_27JAN2020/SvPowerFlow.cpp @@ -1,79 +1,88 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvPowerFlow.hpp" +#include +#include + #include "Terminal.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" using namespace CIMPP; -SvPowerFlow::SvPowerFlow(): Terminal(nullptr) {}; - +SvPowerFlow::SvPowerFlow() : Terminal(nullptr) {}; SvPowerFlow::~SvPowerFlow() {}; -bool assign_Terminal_SvPowerFlow(BaseClass*, BaseClass*); -bool assign_SvPowerFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_SvPowerFlow(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_SvPowerFlow_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SvPowerFlow_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SvPowerFlow_p(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_SvPowerFlow(BaseClass*, BaseClass*); +bool assign_SvPowerFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvPowerFlow* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_SvPowerFlow(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SvPowerFlow_q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvPowerFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SvPowerFlow_factory() { - return new SvPowerFlow; - } + +const char SvPowerFlow::debugName[] = "SvPowerFlow"; +const char* SvPowerFlow::debugString() const +{ + return SvPowerFlow::debugName; } -void SvPowerFlow::addConstructToMap(std::unordered_map& factory_map) { +void SvPowerFlow::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvPowerFlow"), &SvPowerFlow_factory)); } -void SvPowerFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.p"), &assign_SvPowerFlow_p)); +void SvPowerFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.p"), &assign_SvPowerFlow_p)); assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.q"), &assign_SvPowerFlow_q)); } -void SvPowerFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.Terminal"), &assign_SvPowerFlow_Terminal)); - } - -const char SvPowerFlow::debugName[] = "SvPowerFlow"; -const char* SvPowerFlow::debugString() +void SvPowerFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvPowerFlow::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvPowerFlow.Terminal"), &assign_SvPowerFlow_Terminal)); } const BaseClassDefiner SvPowerFlow::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner SvPowerFlow::declare() return BaseClassDefiner(SvPowerFlow::addConstructToMap, SvPowerFlow::addPrimitiveAssignFnsToMap, SvPowerFlow::addClassAssignFnsToMap, SvPowerFlow::debugName); } - +namespace CIMPP +{ + BaseClass* SvPowerFlow_factory() + { + return new SvPowerFlow; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SvPowerFlow.hpp b/CGMES_2.4.15_27JAN2020/SvPowerFlow.hpp index 5ef4b3afd..a5075dfae 100644 --- a/CGMES_2.4.15_27JAN2020/SvPowerFlow.hpp +++ b/CGMES_2.4.15_27JAN2020/SvPowerFlow.hpp @@ -1,42 +1,43 @@ #ifndef SvPowerFlow_H #define SvPowerFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "ReactivePower.hpp" -namespace CIMPP { +namespace CIMPP +{ + class Terminal; - -class Terminal; /* State variable for power flow. Load convention is used for flow direction. This means flow out from the TopologicalNode into the equipment is positive. */ - class SvPowerFlow: public BaseClass + class SvPowerFlow : public BaseClass { - public: - CIMPP::Terminal* Terminal; /* The terminal associated with the power flow state variable. Default: 0 */ - CIMPP::ActivePower p; /* The active power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ - CIMPP::ReactivePower q; /* The reactive power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvPowerFlow(); - virtual ~SvPowerFlow(); - + ~SvPowerFlow() override; + + CIMPP::Terminal* Terminal; /* The terminal associated with the power flow state variable. Default: 0 */ + CIMPP::ActivePower p; /* The active power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ + CIMPP::ReactivePower q; /* The reactive power flow. Load sign convention is used, i.e. positive sign means flow out from a TopologicalNode (bus) into the conducting equipment. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvPowerFlow_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.cpp b/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.cpp index 934385944..11f0ceeb5 100644 --- a/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.cpp +++ b/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.cpp @@ -1,64 +1,72 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvShuntCompensatorSections.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "ShuntCompensator.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; -SvShuntCompensatorSections::SvShuntCompensatorSections(): ShuntCompensator(nullptr) {}; - +SvShuntCompensatorSections::SvShuntCompensatorSections() : ShuntCompensator(nullptr) {}; SvShuntCompensatorSections::~SvShuntCompensatorSections() {}; -bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass*, BaseClass*); -bool assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1)) { - element->ShuntCompensator = dynamic_cast(BaseClass_ptr2); - if(element->ShuntCompensator != nullptr) - return assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvShuntCompensatorSections_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sections; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvShuntCompensatorSections_sections(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sections; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass*, BaseClass*); +bool assign_SvShuntCompensatorSections_ShuntCompensator(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvShuntCompensatorSections* element = dynamic_cast(BaseClass_ptr1); + ShuntCompensator* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ShuntCompensator != element2) + { + element->ShuntCompensator = element2; + return assign_ShuntCompensator_SvShuntCompensatorSections(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SvShuntCompensatorSections_factory() { - return new SvShuntCompensatorSections; - } +const char SvShuntCompensatorSections::debugName[] = "SvShuntCompensatorSections"; +const char* SvShuntCompensatorSections::debugString() const +{ + return SvShuntCompensatorSections::debugName; } -void SvShuntCompensatorSections::addConstructToMap(std::unordered_map& factory_map) { +void SvShuntCompensatorSections::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections"), &SvShuntCompensatorSections_factory)); } -void SvShuntCompensatorSections::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvShuntCompensatorSections::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections.sections"), &assign_SvShuntCompensatorSections_sections)); - } - -void SvShuntCompensatorSections::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections.ShuntCompensator"), &assign_SvShuntCompensatorSections_ShuntCompensator)); } -const char SvShuntCompensatorSections::debugName[] = "SvShuntCompensatorSections"; -const char* SvShuntCompensatorSections::debugString() +void SvShuntCompensatorSections::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvShuntCompensatorSections::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvShuntCompensatorSections.ShuntCompensator"), &assign_SvShuntCompensatorSections_ShuntCompensator)); } const BaseClassDefiner SvShuntCompensatorSections::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SvShuntCompensatorSections::declare() return BaseClassDefiner(SvShuntCompensatorSections::addConstructToMap, SvShuntCompensatorSections::addPrimitiveAssignFnsToMap, SvShuntCompensatorSections::addClassAssignFnsToMap, SvShuntCompensatorSections::debugName); } - +namespace CIMPP +{ + BaseClass* SvShuntCompensatorSections_factory() + { + return new SvShuntCompensatorSections; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.hpp b/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.hpp index bffb9e15d..0541b7d9b 100644 --- a/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.hpp +++ b/CGMES_2.4.15_27JAN2020/SvShuntCompensatorSections.hpp @@ -1,40 +1,41 @@ #ifndef SvShuntCompensatorSections_H #define SvShuntCompensatorSections_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ShuntCompensator; - -class ShuntCompensator; /* State variable for the number of sections in service for a shunt compensator. */ - class SvShuntCompensatorSections: public BaseClass + class SvShuntCompensatorSections : public BaseClass { - public: - CIMPP::Simple_Float sections; /* The number of sections in service as a continous variable. To get integer value scale with ShuntCompensator.bPerSection. Default: nullptr */ - CIMPP::ShuntCompensator* ShuntCompensator; /* The shunt compensator for which the state applies. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvShuntCompensatorSections(); - virtual ~SvShuntCompensatorSections(); - + ~SvShuntCompensatorSections() override; + + CIMPP::ShuntCompensator* ShuntCompensator; /* The shunt compensator for which the state applies. Default: 0 */ + CIMPP::Simple_Float sections; /* The number of sections in service as a continous variable. To get integer value scale with ShuntCompensator.bPerSection. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvShuntCompensatorSections_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SvStatus.cpp b/CGMES_2.4.15_27JAN2020/SvStatus.cpp index 3d89ab4cb..57825fc15 100644 --- a/CGMES_2.4.15_27JAN2020/SvStatus.cpp +++ b/CGMES_2.4.15_27JAN2020/SvStatus.cpp @@ -1,64 +1,72 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvStatus.hpp" +#include +#include + #include "ConductingEquipment.hpp" #include "Boolean.hpp" using namespace CIMPP; -SvStatus::SvStatus(): ConductingEquipment(nullptr) {}; - +SvStatus::SvStatus() : ConductingEquipment(nullptr) {}; SvStatus::~SvStatus() {}; -bool assign_ConductingEquipment_SvStatus(BaseClass*, BaseClass*); -bool assign_SvStatus_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvStatus* element = dynamic_cast(BaseClass_ptr1)) { - element->ConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->ConductingEquipment != nullptr) - return assign_ConductingEquipment_SvStatus(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_SvStatus_inService(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvStatus* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->inService; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SvStatus_inService(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvStatus* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->inService; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ConductingEquipment_SvStatus(BaseClass*, BaseClass*); +bool assign_SvStatus_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvStatus* element = dynamic_cast(BaseClass_ptr1); + ConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConductingEquipment != element2) + { + element->ConductingEquipment = element2; + return assign_ConductingEquipment_SvStatus(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SvStatus_factory() { - return new SvStatus; - } + +const char SvStatus::debugName[] = "SvStatus"; +const char* SvStatus::debugString() const +{ + return SvStatus::debugName; } -void SvStatus::addConstructToMap(std::unordered_map& factory_map) { +void SvStatus::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvStatus"), &SvStatus_factory)); } -void SvStatus::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvStatus.inService"), &assign_SvStatus_inService)); +void SvStatus::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:SvStatus.inService"), &assign_SvStatus_inService)); } -void SvStatus::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvStatus.ConductingEquipment"), &assign_SvStatus_ConductingEquipment)); - } - -const char SvStatus::debugName[] = "SvStatus"; -const char* SvStatus::debugString() +void SvStatus::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvStatus::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvStatus.ConductingEquipment"), &assign_SvStatus_ConductingEquipment)); } const BaseClassDefiner SvStatus::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SvStatus::declare() return BaseClassDefiner(SvStatus::addConstructToMap, SvStatus::addPrimitiveAssignFnsToMap, SvStatus::addClassAssignFnsToMap, SvStatus::debugName); } - +namespace CIMPP +{ + BaseClass* SvStatus_factory() + { + return new SvStatus; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SvStatus.hpp b/CGMES_2.4.15_27JAN2020/SvStatus.hpp index 242b1a277..6c2d2d10e 100644 --- a/CGMES_2.4.15_27JAN2020/SvStatus.hpp +++ b/CGMES_2.4.15_27JAN2020/SvStatus.hpp @@ -1,40 +1,41 @@ #ifndef SvStatus_H #define SvStatus_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ConductingEquipment; -class ConductingEquipment; /* State variable for status. */ - class SvStatus: public BaseClass + class SvStatus : public BaseClass { - public: - CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment associated with the status state variable. Default: 0 */ - CIMPP::Boolean inService; /* The in service status as a result of topology processing. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvStatus(); - virtual ~SvStatus(); - + ~SvStatus() override; + + CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment associated with the status state variable. Default: 0 */ + CIMPP::Boolean inService; /* The in service status as a result of topology processing. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvStatus_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SvTapStep.cpp b/CGMES_2.4.15_27JAN2020/SvTapStep.cpp index e9a367cf3..e828dc3e3 100644 --- a/CGMES_2.4.15_27JAN2020/SvTapStep.cpp +++ b/CGMES_2.4.15_27JAN2020/SvTapStep.cpp @@ -1,64 +1,72 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvTapStep.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "TapChanger.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; -SvTapStep::SvTapStep(): TapChanger(nullptr) {}; - +SvTapStep::SvTapStep() : TapChanger(nullptr) {}; SvTapStep::~SvTapStep() {}; -bool assign_TapChanger_SvTapStep(BaseClass*, BaseClass*); -bool assign_SvTapStep_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvTapStep* element = dynamic_cast(BaseClass_ptr1)) { - element->TapChanger = dynamic_cast(BaseClass_ptr2); - if(element->TapChanger != nullptr) - return assign_TapChanger_SvTapStep(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvTapStep_position(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvTapStep* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->position; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvTapStep_position(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvTapStep* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->position; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TapChanger_SvTapStep(BaseClass*, BaseClass*); +bool assign_SvTapStep_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvTapStep* element = dynamic_cast(BaseClass_ptr1); + TapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TapChanger != element2) + { + element->TapChanger = element2; + return assign_TapChanger_SvTapStep(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SvTapStep_factory() { - return new SvTapStep; - } +const char SvTapStep::debugName[] = "SvTapStep"; +const char* SvTapStep::debugString() const +{ + return SvTapStep::debugName; } -void SvTapStep::addConstructToMap(std::unordered_map& factory_map) { +void SvTapStep::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvTapStep"), &SvTapStep_factory)); } -void SvTapStep::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvTapStep::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvTapStep.position"), &assign_SvTapStep_position)); - } - -void SvTapStep::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvTapStep.TapChanger"), &assign_SvTapStep_TapChanger)); } -const char SvTapStep::debugName[] = "SvTapStep"; -const char* SvTapStep::debugString() +void SvTapStep::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvTapStep::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvTapStep.TapChanger"), &assign_SvTapStep_TapChanger)); } const BaseClassDefiner SvTapStep::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SvTapStep::declare() return BaseClassDefiner(SvTapStep::addConstructToMap, SvTapStep::addPrimitiveAssignFnsToMap, SvTapStep::addClassAssignFnsToMap, SvTapStep::debugName); } - +namespace CIMPP +{ + BaseClass* SvTapStep_factory() + { + return new SvTapStep; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SvTapStep.hpp b/CGMES_2.4.15_27JAN2020/SvTapStep.hpp index dccf76782..74a224484 100644 --- a/CGMES_2.4.15_27JAN2020/SvTapStep.hpp +++ b/CGMES_2.4.15_27JAN2020/SvTapStep.hpp @@ -1,40 +1,41 @@ #ifndef SvTapStep_H #define SvTapStep_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Simple_Float.hpp" -namespace CIMPP { +namespace CIMPP +{ + class TapChanger; - -class TapChanger; /* State variable for transformer tap step. This class is to be used for taps of LTC (load tap changing) transformers, not fixed tap transformers. */ - class SvTapStep: public BaseClass + class SvTapStep : public BaseClass { - public: - CIMPP::Simple_Float position; /* The floating point tap position. This is not the tap ratio, but rather the tap step position as defined by the related tap changer model and normally is constrained to be within the range of minimum and maximum tap positions. Default: nullptr */ - CIMPP::TapChanger* TapChanger; /* The tap changer associated with the tap step state. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvTapStep(); - virtual ~SvTapStep(); - + ~SvTapStep() override; + + CIMPP::TapChanger* TapChanger; /* The tap changer associated with the tap step state. Default: 0 */ + CIMPP::Simple_Float position; /* The floating point tap position. This is not the tap ratio, but rather the tap step position as defined by the related tap changer model and normally is constrained to be within the range of minimum and maximum tap positions. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvTapStep_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SvVoltage.cpp b/CGMES_2.4.15_27JAN2020/SvVoltage.cpp index 627dd3cac..95b8265ea 100644 --- a/CGMES_2.4.15_27JAN2020/SvVoltage.cpp +++ b/CGMES_2.4.15_27JAN2020/SvVoltage.cpp @@ -1,79 +1,88 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SvVoltage.hpp" +#include +#include + +#include "TopologicalNode.hpp" #include "AngleDegrees.hpp" #include "Voltage.hpp" -#include "TopologicalNode.hpp" using namespace CIMPP; -SvVoltage::SvVoltage(): TopologicalNode(nullptr) {}; - +SvVoltage::SvVoltage() : TopologicalNode(nullptr) {}; SvVoltage::~SvVoltage() {}; +bool assign_SvVoltage_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvVoltage* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->angle; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologicalNode_SvVoltage(BaseClass*, BaseClass*); -bool assign_SvVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SvVoltage* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_SvVoltage(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SvVoltage_v(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SvVoltage* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->v; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_SvVoltage_angle(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvVoltage* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->angle; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TopologicalNode_SvVoltage(BaseClass*, BaseClass*); +bool assign_SvVoltage_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SvVoltage* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_SvVoltage(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SvVoltage_v(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SvVoltage* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->v; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SvVoltage_factory() { - return new SvVoltage; - } +const char SvVoltage::debugName[] = "SvVoltage"; +const char* SvVoltage::debugString() const +{ + return SvVoltage::debugName; } -void SvVoltage::addConstructToMap(std::unordered_map& factory_map) { +void SvVoltage::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SvVoltage"), &SvVoltage_factory)); } -void SvVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SvVoltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SvVoltage.angle"), &assign_SvVoltage_angle)); assign_map.insert(std::make_pair(std::string("cim:SvVoltage.v"), &assign_SvVoltage_v)); - } - -void SvVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SvVoltage.TopologicalNode"), &assign_SvVoltage_TopologicalNode)); } -const char SvVoltage::debugName[] = "SvVoltage"; -const char* SvVoltage::debugString() +void SvVoltage::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SvVoltage::debugName; + assign_map.insert(std::make_pair(std::string("cim:SvVoltage.TopologicalNode"), &assign_SvVoltage_TopologicalNode)); } const BaseClassDefiner SvVoltage::declare() @@ -81,4 +90,10 @@ const BaseClassDefiner SvVoltage::declare() return BaseClassDefiner(SvVoltage::addConstructToMap, SvVoltage::addPrimitiveAssignFnsToMap, SvVoltage::addClassAssignFnsToMap, SvVoltage::debugName); } - +namespace CIMPP +{ + BaseClass* SvVoltage_factory() + { + return new SvVoltage; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SvVoltage.hpp b/CGMES_2.4.15_27JAN2020/SvVoltage.hpp index 0b1341e75..f70a44314 100644 --- a/CGMES_2.4.15_27JAN2020/SvVoltage.hpp +++ b/CGMES_2.4.15_27JAN2020/SvVoltage.hpp @@ -1,42 +1,43 @@ #ifndef SvVoltage_H #define SvVoltage_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class TopologicalNode; - -class TopologicalNode; /* State variable for voltage. */ - class SvVoltage: public BaseClass + class SvVoltage : public BaseClass { - public: - CIMPP::AngleDegrees angle; /* The voltage angle of the topological node complex voltage with respect to system reference. Default: nullptr */ - CIMPP::Voltage v; /* The voltage magnitude of the topological node. Default: nullptr */ - CIMPP::TopologicalNode* TopologicalNode; /* The state voltage associated with the topological node. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SvVoltage(); - virtual ~SvVoltage(); - + ~SvVoltage() override; + + CIMPP::TopologicalNode* TopologicalNode; /* The state voltage associated with the topological node. Default: 0 */ + CIMPP::AngleDegrees angle; /* The voltage angle of the topological node complex voltage with respect to system reference. Default: nullptr */ + CIMPP::Voltage v; /* The voltage magnitude of the topological node. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SvVoltage_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Switch.cpp b/CGMES_2.4.15_27JAN2020/Switch.cpp index 7e57a3daf..dc1be1a67 100644 --- a/CGMES_2.4.15_27JAN2020/Switch.cpp +++ b/CGMES_2.4.15_27JAN2020/Switch.cpp @@ -1,109 +1,120 @@ -#include -#include "ConductingEquipment.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Switch.hpp" +#include +#include + +#include "SwitchSchedule.hpp" #include "Boolean.hpp" -#include "CurrentFlow.hpp" #include "Boolean.hpp" -#include "SwitchSchedule.hpp" +#include "CurrentFlow.hpp" #include "Boolean.hpp" using namespace CIMPP; Switch::Switch() {}; - Switch::~Switch() {}; +bool assign_Switch_normalOpen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalOpen; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_Switch_open(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->open; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Switch_SwitchSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SwitchSchedules.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_Switch_ratedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratedCurrent; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_Switch_retained(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Switch* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->retained; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_Switch_normalOpen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalOpen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SwitchSchedule_Switch(BaseClass*, BaseClass*); +bool assign_Switch_SwitchSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Switch* element = dynamic_cast(BaseClass_ptr1); + SwitchSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SwitchSchedules.begin(), element->SwitchSchedules.end(), element2) == element->SwitchSchedules.end()) + { + element->SwitchSchedules.push_back(element2); + return assign_SwitchSchedule_Switch(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Switch_ratedCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratedCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Switch_retained(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->retained; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_Switch_open(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Switch* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->open; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* Switch_factory() { - return new Switch; - } +const char Switch::debugName[] = "Switch"; +const char* Switch::debugString() const +{ + return Switch::debugName; } -void Switch::addConstructToMap(std::unordered_map& factory_map) { +void Switch::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Switch"), &Switch_factory)); } -void Switch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void Switch::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Switch.normalOpen"), &assign_Switch_normalOpen)); + assign_map.insert(std::make_pair(std::string("cim:Switch.open"), &assign_Switch_open)); assign_map.insert(std::make_pair(std::string("cim:Switch.ratedCurrent"), &assign_Switch_ratedCurrent)); assign_map.insert(std::make_pair(std::string("cim:Switch.retained"), &assign_Switch_retained)); - assign_map.insert(std::make_pair(std::string("cim:Switch.open"), &assign_Switch_open)); } -void Switch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Switch.SwitchSchedules"), &assign_Switch_SwitchSchedules)); - } - -const char Switch::debugName[] = "Switch"; -const char* Switch::debugString() +void Switch::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return Switch::debugName; + assign_map.insert(std::make_pair(std::string("cim:Switch.SwitchSchedules"), &assign_Switch_SwitchSchedules)); } const BaseClassDefiner Switch::declare() @@ -111,4 +122,10 @@ const BaseClassDefiner Switch::declare() return BaseClassDefiner(Switch::addConstructToMap, Switch::addPrimitiveAssignFnsToMap, Switch::addClassAssignFnsToMap, Switch::debugName); } - +namespace CIMPP +{ + BaseClass* Switch_factory() + { + return new Switch; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Switch.hpp b/CGMES_2.4.15_27JAN2020/Switch.hpp index 5cf0ca21e..431a0db40 100644 --- a/CGMES_2.4.15_27JAN2020/Switch.hpp +++ b/CGMES_2.4.15_27JAN2020/Switch.hpp @@ -1,44 +1,45 @@ #ifndef Switch_H #define Switch_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ConductingEquipment.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ConductingEquipment.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "CurrentFlow.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class SwitchSchedule; -class SwitchSchedule; /* A generic device designed to close, or open, or both, one or more electric circuits. All switches are two terminal devices including grounding switches. */ - class Switch: public ConductingEquipment + class Switch : public ConductingEquipment { - public: - CIMPP::Boolean normalOpen; /* The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurement the Discrete.normalValue is expected to match with the Switch.normalOpen. Default: false */ - CIMPP::CurrentFlow ratedCurrent; /* The maximum continuous current carrying capacity in amps governed by the device material and construction. Default: nullptr */ - CIMPP::Boolean retained; /* Branch is retained in a bus branch model. The flow through retained switches will normally be calculated in power flow. Default: false */ - std::list SwitchSchedules; /* A SwitchSchedule is associated with a Switch. Default: 0 */ - CIMPP::Boolean open; /* The attribute tells if the switch is considered open when used as input to topology processing. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Switch(); - virtual ~Switch(); - + ~Switch() override; + + std::list SwitchSchedules; /* A SwitchSchedule is associated with a Switch. Default: 0 */ + CIMPP::Boolean normalOpen; /* The attribute is used in cases when no Measurement for the status value is present. If the Switch has a status measurement the Discrete.normalValue is expected to match with the Switch.normalOpen. Default: false */ + CIMPP::Boolean open; /* The attribute tells if the switch is considered open when used as input to topology processing. Default: false */ + CIMPP::CurrentFlow ratedCurrent; /* The maximum continuous current carrying capacity in amps governed by the device material and construction. Default: nullptr */ + CIMPP::Boolean retained; /* Branch is retained in a bus branch model. The flow through retained switches will normally be calculated in power flow. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Switch_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SwitchSchedule.cpp b/CGMES_2.4.15_27JAN2020/SwitchSchedule.cpp index faa15f446..2181dfba6 100644 --- a/CGMES_2.4.15_27JAN2020/SwitchSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/SwitchSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SwitchSchedule.hpp" +#include +#include + #include "Switch.hpp" using namespace CIMPP; -SwitchSchedule::SwitchSchedule(): Switch(nullptr) {}; - +SwitchSchedule::SwitchSchedule() : Switch(nullptr) {}; SwitchSchedule::~SwitchSchedule() {}; -bool assign_Switch_SwitchSchedules(BaseClass*, BaseClass*); -bool assign_SwitchSchedule_Switch(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SwitchSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->Switch = dynamic_cast(BaseClass_ptr2); - if(element->Switch != nullptr) - return assign_Switch_SwitchSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* SwitchSchedule_factory() { - return new SwitchSchedule; +bool assign_Switch_SwitchSchedules(BaseClass*, BaseClass*); +bool assign_SwitchSchedule_Switch(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SwitchSchedule* element = dynamic_cast(BaseClass_ptr1); + Switch* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Switch != element2) + { + element->Switch = element2; + return assign_Switch_SwitchSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void SwitchSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:SwitchSchedule"), &SwitchSchedule_factory)); +const char SwitchSchedule::debugName[] = "SwitchSchedule"; +const char* SwitchSchedule::debugString() const +{ + return SwitchSchedule::debugName; } -void SwitchSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void SwitchSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:SwitchSchedule"), &SwitchSchedule_factory)); +} -void SwitchSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SwitchSchedule.Switch"), &assign_SwitchSchedule_Switch)); +void SwitchSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SwitchSchedule::debugName[] = "SwitchSchedule"; -const char* SwitchSchedule::debugString() +void SwitchSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SwitchSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:SwitchSchedule.Switch"), &assign_SwitchSchedule_Switch)); } const BaseClassDefiner SwitchSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner SwitchSchedule::declare() return BaseClassDefiner(SwitchSchedule::addConstructToMap, SwitchSchedule::addPrimitiveAssignFnsToMap, SwitchSchedule::addClassAssignFnsToMap, SwitchSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* SwitchSchedule_factory() + { + return new SwitchSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SwitchSchedule.hpp b/CGMES_2.4.15_27JAN2020/SwitchSchedule.hpp index cdddbe7d7..91f5fe1aa 100644 --- a/CGMES_2.4.15_27JAN2020/SwitchSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/SwitchSchedule.hpp @@ -1,38 +1,39 @@ #ifndef SwitchSchedule_H #define SwitchSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Switch; -class Switch; /* A schedule of switch positions. If RegularTimePoint.value1 is 0, the switch is open. If 1, the switch is closed. */ - class SwitchSchedule: public SeasonDayTypeSchedule + class SwitchSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::Switch* Switch; /* A Switch can be associated with SwitchSchedules. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SwitchSchedule(); - virtual ~SwitchSchedule(); - + ~SwitchSchedule() override; + + CIMPP::Switch* Switch; /* A Switch can be associated with SwitchSchedules. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SwitchSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachine.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachine.cpp index ed24af249..0de495d1b 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachine.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachine.cpp @@ -1,376 +1,412 @@ -#include -#include "RotatingMachine.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachine.hpp" +#include +#include + #include "ReactiveCapabilityCurve.hpp" -#include "ReactivePower.hpp" -#include "ReactivePower.hpp" -#include "PerCent.hpp" -#include "SynchronousMachineKind.hpp" +#include "SynchronousMachineDynamics.hpp" #include "Boolean.hpp" #include "Resistance.hpp" #include "Reactance.hpp" #include "CurrentFlow.hpp" +#include "ReactivePower.hpp" +#include "ReactivePower.hpp" #include "Simple_Float.hpp" +#include "SynchronousMachineOperatingMode.hpp" +#include "PerCent.hpp" +#include "Resistance.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Integer.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "ShortCircuitRotorKind.hpp" +#include "SynchronousMachineKind.hpp" #include "PerCent.hpp" -#include "Resistance.hpp" #include "PU.hpp" #include "PU.hpp" -#include "SynchronousMachineOperatingMode.hpp" -#include "Integer.hpp" -#include "SynchronousMachineDynamics.hpp" using namespace CIMPP; -SynchronousMachine::SynchronousMachine(): InitialReactiveCapabilityCurve(nullptr), SynchronousMachineDynamics(nullptr) {}; - +SynchronousMachine::SynchronousMachine() : InitialReactiveCapabilityCurve(nullptr), SynchronousMachineDynamics(nullptr) {}; SynchronousMachine::~SynchronousMachine() {}; -bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass*, BaseClass*); -bool assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->InitialReactiveCapabilityCurve = dynamic_cast(BaseClass_ptr2); - if(element->InitialReactiveCapabilityCurve != nullptr) - return assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_SynchronousMachine_earthing(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->earthing; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_earthingStarPointR(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->earthingStarPointR; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_earthingStarPointX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->earthingStarPointX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_ikk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ikk; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->minQ; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_mu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->operatingMode; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_qPercent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qPercent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->referencePriority; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_satDirectSubtransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->satDirectSubtransX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_satDirectSyncX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->satDirectSyncX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_satDirectTransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->satDirectTransX; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_shortCircuitRotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->shortCircuitRotorType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->type; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachine_voltageRegulationRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->voltageRegulationRange; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachineDynamics != nullptr) - return true; - } - return false; +bool assign_SynchronousMachine_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x0; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_SynchronousMachine_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachine_maxQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass*, BaseClass*); +bool assign_SynchronousMachine_InitialReactiveCapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachine* element = dynamic_cast(BaseClass_ptr1); + ReactiveCapabilityCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->InitialReactiveCapabilityCurve != element2) + { + element->InitialReactiveCapabilityCurve = element2; + return assign_ReactiveCapabilityCurve_InitiallyUsedBySynchronousMachines(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachine_minQ(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->minQ; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass*, BaseClass*); +bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachine* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachineDynamics != element2) + { + element->SynchronousMachineDynamics = element2; + return assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachine_qPercent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qPercent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_type(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->type; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_earthing(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->earthing; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_earthingStarPointR(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->earthingStarPointR; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_earthingStarPointX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->earthingStarPointX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_ikk(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ikk; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_mu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_r0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_r2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_satDirectSubtransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->satDirectSubtransX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_satDirectSyncX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->satDirectSyncX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_satDirectTransX(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->satDirectTransX; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_shortCircuitRotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->shortCircuitRotorType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_voltageRegulationRange(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->voltageRegulationRange; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_x0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_x2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_operatingMode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->operatingMode; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachine_referencePriority(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachine* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->referencePriority; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SynchronousMachine_factory() { - return new SynchronousMachine; - } + +const char SynchronousMachine::debugName[] = "SynchronousMachine"; +const char* SynchronousMachine::debugString() const +{ + return SynchronousMachine::debugName; } -void SynchronousMachine::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachine::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachine"), &SynchronousMachine_factory)); } -void SynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.maxQ"), &assign_SynchronousMachine_maxQ)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.minQ"), &assign_SynchronousMachine_minQ)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.qPercent"), &assign_SynchronousMachine_qPercent)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.type"), &assign_SynchronousMachine_type)); +void SynchronousMachine::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthing"), &assign_SynchronousMachine_earthing)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthingStarPointR"), &assign_SynchronousMachine_earthingStarPointR)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.earthingStarPointX"), &assign_SynchronousMachine_earthingStarPointX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.ikk"), &assign_SynchronousMachine_ikk)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.maxQ"), &assign_SynchronousMachine_maxQ)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.minQ"), &assign_SynchronousMachine_minQ)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.mu"), &assign_SynchronousMachine_mu)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.operatingMode"), &assign_SynchronousMachine_operatingMode)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.qPercent"), &assign_SynchronousMachine_qPercent)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r"), &assign_SynchronousMachine_r)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r0"), &assign_SynchronousMachine_r0)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r2"), &assign_SynchronousMachine_r2)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.referencePriority"), &assign_SynchronousMachine_referencePriority)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.satDirectSubtransX"), &assign_SynchronousMachine_satDirectSubtransX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.satDirectSyncX"), &assign_SynchronousMachine_satDirectSyncX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.satDirectTransX"), &assign_SynchronousMachine_satDirectTransX)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.shortCircuitRotorType"), &assign_SynchronousMachine_shortCircuitRotorType)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.type"), &assign_SynchronousMachine_type)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.voltageRegulationRange"), &assign_SynchronousMachine_voltageRegulationRange)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.r"), &assign_SynchronousMachine_r)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.x0"), &assign_SynchronousMachine_x0)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.x2"), &assign_SynchronousMachine_x2)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.operatingMode"), &assign_SynchronousMachine_operatingMode)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.referencePriority"), &assign_SynchronousMachine_referencePriority)); - } - -void SynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.InitialReactiveCapabilityCurve"), &assign_SynchronousMachine_InitialReactiveCapabilityCurve)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.SynchronousMachineDynamics"), &assign_SynchronousMachine_SynchronousMachineDynamics)); } -const char SynchronousMachine::debugName[] = "SynchronousMachine"; -const char* SynchronousMachine::debugString() +void SynchronousMachine::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachine::debugName; + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.InitialReactiveCapabilityCurve"), &assign_SynchronousMachine_InitialReactiveCapabilityCurve)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachine.SynchronousMachineDynamics"), &assign_SynchronousMachine_SynchronousMachineDynamics)); } const BaseClassDefiner SynchronousMachine::declare() @@ -378,4 +414,10 @@ const BaseClassDefiner SynchronousMachine::declare() return BaseClassDefiner(SynchronousMachine::addConstructToMap, SynchronousMachine::addPrimitiveAssignFnsToMap, SynchronousMachine::addClassAssignFnsToMap, SynchronousMachine::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachine_factory() + { + return new SynchronousMachine; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachine.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachine.hpp index 8afda9fde..4c5f7ed12 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachine.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachine.hpp @@ -1,73 +1,74 @@ #ifndef SynchronousMachine_H #define SynchronousMachine_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachine.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "ReactivePower.hpp" -#include "PerCent.hpp" -#include "SynchronousMachineKind.hpp" +#include "RotatingMachine.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Resistance.hpp" -#include "Reactance.hpp" #include "CurrentFlow.hpp" -#include "Simple_Float.hpp" +#include "Integer.hpp" #include "PU.hpp" +#include "PerCent.hpp" +#include "Reactance.hpp" +#include "ReactivePower.hpp" +#include "Resistance.hpp" #include "ShortCircuitRotorKind.hpp" +#include "Simple_Float.hpp" +#include "SynchronousMachineKind.hpp" #include "SynchronousMachineOperatingMode.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class ReactiveCapabilityCurve; + class SynchronousMachineDynamics; -class ReactiveCapabilityCurve; -class SynchronousMachineDynamics; /* An electromechanical device that operates with shaft rotating synchronously with the network. It is a single machine operating either as a generator or synchronous condenser or pump. */ - class SynchronousMachine: public RotatingMachine + class SynchronousMachine : public RotatingMachine { - public: - CIMPP::ReactiveCapabilityCurve* InitialReactiveCapabilityCurve; /* Synchronous machines using this curve as default. Default: 0 */ - CIMPP::ReactivePower maxQ; /* Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. Default: nullptr */ - CIMPP::ReactivePower minQ; /* Minimum reactive power limit for the unit. Default: nullptr */ - CIMPP::PerCent qPercent; /* Percent of the coordinated reactive control that comes from this machine. Default: nullptr */ - CIMPP::SynchronousMachineKind type; /* Modes that this synchronous machine can operate in. Default: 0 */ - CIMPP::Boolean earthing; /* Indicates whether or not the generator is earthed. Used for short circuit data exchange according to IEC 60909 Default: false */ - CIMPP::Resistance earthingStarPointR; /* Generator star point earthing resistance (Re). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::Reactance earthingStarPointX; /* Generator star point earthing reactance (Xe). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::CurrentFlow ikk; /* Steady-state short-circuit current (in A for the profile) of generator with compound excitation during 3-phase short circuit. - Ikk=0: Generator with no compound excitation. - Ikk?0: Generator with compound excitation. Ikk is used to calculate the minimum steady-state short-circuit current for generators with compound excitation (Section 4.6.1.2 in the IEC 60909-0) Used only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0) Default: nullptr */ - CIMPP::Simple_Float mu; /* Factor to calculate the breaking current (Section 4.5.2.1 in the IEC 60909-0). Used only for single fed short circuit on a generator (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ - CIMPP::PU r0; /* Zero sequence resistance of the synchronous machine. Default: nullptr */ - CIMPP::PU r2; /* Negative sequence resistance. Default: nullptr */ - CIMPP::PU satDirectSubtransX; /* Direct-axis subtransient reactance saturated, also known as Xd`sat. Default: nullptr */ - CIMPP::PU satDirectSyncX; /* Direct-axes saturated synchronous reactance (xdsat); reciprocal of short-circuit ration. Used for short circuit data exchange, only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ - CIMPP::PU satDirectTransX; /* Saturated Direct-axis transient reactance. The attribute is primarily used for short circuit calculations according to ANSI. Default: nullptr */ - CIMPP::ShortCircuitRotorKind shortCircuitRotorType; /* Type of rotor, used by short circuit applications, only for single fed short circuit according to IEC 60909. Default: 0 */ - CIMPP::PerCent voltageRegulationRange; /* Range of generator voltage regulation (PG in the IEC 60909-0) used for calculation of the impedance correction factor KG defined in IEC 60909-0 This attribute is used to describe the operating voltage of the generating unit. Default: nullptr */ - CIMPP::Resistance r; /* Equivalent resistance (RG) of generator. RG is considered for the calculation of all currents, except for the calculation of the peak current ip. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ - CIMPP::PU x0; /* Zero sequence reactance of the synchronous machine. Default: nullptr */ - CIMPP::PU x2; /* Negative sequence reactance. Default: nullptr */ - CIMPP::SynchronousMachineOperatingMode operatingMode; /* Current mode of operation. Default: 0 */ - CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ - CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine dynamics model used to describe dynamic behavior of this synchronous machine. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachine(); - virtual ~SynchronousMachine(); - + ~SynchronousMachine() override; + + CIMPP::ReactiveCapabilityCurve* InitialReactiveCapabilityCurve; /* Synchronous machines using this curve as default. Default: 0 */ + CIMPP::SynchronousMachineDynamics* SynchronousMachineDynamics; /* Synchronous machine dynamics model used to describe dynamic behavior of this synchronous machine. Default: 0 */ + CIMPP::Boolean earthing; /* Indicates whether or not the generator is earthed. Used for short circuit data exchange according to IEC 60909 Default: false */ + CIMPP::Resistance earthingStarPointR; /* Generator star point earthing resistance (Re). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::Reactance earthingStarPointX; /* Generator star point earthing reactance (Xe). Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::CurrentFlow ikk; /* Steady-state short-circuit current (in A for the profile) of generator with compound excitation during 3-phase short circuit. - Ikk=0: Generator with no compound excitation. - Ikk?0: Generator with compound excitation. Ikk is used to calculate the minimum steady-state short-circuit current for generators with compound excitation (Section 4.6.1.2 in the IEC 60909-0) Used only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0) Default: nullptr */ + CIMPP::ReactivePower maxQ; /* Maximum reactive power limit. This is the maximum (nameplate) limit for the unit. Default: nullptr */ + CIMPP::ReactivePower minQ; /* Minimum reactive power limit for the unit. Default: nullptr */ + CIMPP::Simple_Float mu; /* Factor to calculate the breaking current (Section 4.5.2.1 in the IEC 60909-0). Used only for single fed short circuit on a generator (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ + CIMPP::SynchronousMachineOperatingMode operatingMode; /* Current mode of operation. Default: 0 */ + CIMPP::PerCent qPercent; /* Percent of the coordinated reactive control that comes from this machine. Default: nullptr */ + CIMPP::Resistance r; /* Equivalent resistance (RG) of generator. RG is considered for the calculation of all currents, except for the calculation of the peak current ip. Used for short circuit data exchange according to IEC 60909 Default: nullptr */ + CIMPP::PU r0; /* Zero sequence resistance of the synchronous machine. Default: nullptr */ + CIMPP::PU r2; /* Negative sequence resistance. Default: nullptr */ + CIMPP::Integer referencePriority; /* Priority of unit for use as powerflow voltage phase angle reference bus selection. 0 = don t care (default) 1 = highest priority. 2 is less than 1 and so on. Default: 0 */ + CIMPP::PU satDirectSubtransX; /* Direct-axis subtransient reactance saturated, also known as Xd`sat. Default: nullptr */ + CIMPP::PU satDirectSyncX; /* Direct-axes saturated synchronous reactance (xdsat); reciprocal of short-circuit ration. Used for short circuit data exchange, only for single fed short circuit on a generator. (Section 4.3.4.2. in the IEC 60909-0). Default: nullptr */ + CIMPP::PU satDirectTransX; /* Saturated Direct-axis transient reactance. The attribute is primarily used for short circuit calculations according to ANSI. Default: nullptr */ + CIMPP::ShortCircuitRotorKind shortCircuitRotorType; /* Type of rotor, used by short circuit applications, only for single fed short circuit according to IEC 60909. Default: 0 */ + CIMPP::SynchronousMachineKind type; /* Modes that this synchronous machine can operate in. Default: 0 */ + CIMPP::PerCent voltageRegulationRange; /* Range of generator voltage regulation (PG in the IEC 60909-0) used for calculation of the impedance correction factor KG defined in IEC 60909-0 This attribute is used to describe the operating voltage of the generating unit. Default: nullptr */ + CIMPP::PU x0; /* Zero sequence reactance of the synchronous machine. Default: nullptr */ + CIMPP::PU x2; /* Negative sequence reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachine_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.cpp index f9d3a71c3..7d74fe85f 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.cpp @@ -1,111 +1,116 @@ -#include -#include "SynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineDetailed.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" +#include +#include + #include "Simple_Float.hpp" #include "IfdBaseKind.hpp" #include "CurrentFlow.hpp" +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" using namespace CIMPP; SynchronousMachineDetailed::SynchronousMachineDetailed() {}; - SynchronousMachineDetailed::~SynchronousMachineDetailed() {}; +bool assign_SynchronousMachineDetailed_efdBaseRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->efdBaseRatio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_ifdBaseType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdBaseType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_ifdBaseValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ifdBaseValue; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_saturationFactor120QAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactor120QAxis; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineDetailed_saturationFactorQAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->saturationFactorQAxis; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachineDetailed_saturationFactorQAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactorQAxis; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_saturationFactor120QAxis(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->saturationFactor120QAxis; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_efdBaseRatio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->efdBaseRatio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_ifdBaseType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdBaseType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineDetailed_ifdBaseValue(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineDetailed* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ifdBaseValue; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* SynchronousMachineDetailed_factory() { - return new SynchronousMachineDetailed; - } +const char SynchronousMachineDetailed::debugName[] = "SynchronousMachineDetailed"; +const char* SynchronousMachineDetailed::debugString() const +{ + return SynchronousMachineDetailed::debugName; } -void SynchronousMachineDetailed::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineDetailed::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed"), &SynchronousMachineDetailed_factory)); } -void SynchronousMachineDetailed::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactorQAxis"), &assign_SynchronousMachineDetailed_saturationFactorQAxis)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactor120QAxis"), &assign_SynchronousMachineDetailed_saturationFactor120QAxis)); +void SynchronousMachineDetailed::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.efdBaseRatio"), &assign_SynchronousMachineDetailed_efdBaseRatio)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.ifdBaseType"), &assign_SynchronousMachineDetailed_ifdBaseType)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.ifdBaseValue"), &assign_SynchronousMachineDetailed_ifdBaseValue)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactor120QAxis"), &assign_SynchronousMachineDetailed_saturationFactor120QAxis)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDetailed.saturationFactorQAxis"), &assign_SynchronousMachineDetailed_saturationFactorQAxis)); } -void SynchronousMachineDetailed::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SynchronousMachineDetailed::debugName[] = "SynchronousMachineDetailed"; -const char* SynchronousMachineDetailed::debugString() +void SynchronousMachineDetailed::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineDetailed::debugName; } const BaseClassDefiner SynchronousMachineDetailed::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner SynchronousMachineDetailed::declare() return BaseClassDefiner(SynchronousMachineDetailed::addConstructToMap, SynchronousMachineDetailed::addPrimitiveAssignFnsToMap, SynchronousMachineDetailed::addClassAssignFnsToMap, SynchronousMachineDetailed::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineDetailed_factory() + { + return new SynchronousMachineDetailed; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.hpp index cabf4cb8b..3d7c37290 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineDetailed.hpp @@ -1,44 +1,45 @@ #ifndef SynchronousMachineDetailed_H #define SynchronousMachineDetailed_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "IfdBaseKind.hpp" +#include "SynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "CurrentFlow.hpp" +#include "IfdBaseKind.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* All synchronous machine detailed types use a subset of the same data parameters and input/output variables. The several variations differ in the following ways: It is not necessary for each simulation tool to have separate models for each of the model types. The same model can often be used for several types by alternative logic within the model. Also, differences in saturation representation may not result in significant model performance differences so model substitutions are often acceptable. */ - class SynchronousMachineDetailed: public SynchronousMachineDynamics + class SynchronousMachineDetailed : public SynchronousMachineDynamics { - public: - CIMPP::Simple_Float saturationFactorQAxis; /* Q-axis saturation factor at rated terminal voltage (S1q) (>= 0). Typical Value = 0.02. Default: nullptr */ - CIMPP::Simple_Float saturationFactor120QAxis; /* Q-axis saturation factor at 120% of rated terminal voltage (S12q) (>=S1q). Typical Value = 0.12. Default: nullptr */ - CIMPP::Simple_Float efdBaseRatio; /* Ratio of Efd bases of exciter and generator models. Typical Value = 1. Default: nullptr */ - CIMPP::IfdBaseKind ifdBaseType; /* Excitation base system mode. Typical Value = ifag. Default: 0 */ - CIMPP::CurrentFlow ifdBaseValue; /* Ifd base current if .ifdBaseType = other. Not needed if .ifdBaseType not = other. Unit = A. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineDetailed(); - virtual ~SynchronousMachineDetailed(); - + ~SynchronousMachineDetailed() override; + + CIMPP::Simple_Float efdBaseRatio; /* Ratio of Efd bases of exciter and generator models. Typical Value = 1. Default: nullptr */ + CIMPP::IfdBaseKind ifdBaseType; /* Excitation base system mode. Typical Value = ifag. Default: 0 */ + CIMPP::CurrentFlow ifdBaseValue; /* Ifd base current if .ifdBaseType = other. Not needed if .ifdBaseType not = other. Unit = A. Typical Value = 0. Default: nullptr */ + CIMPP::Simple_Float saturationFactor120QAxis; /* Q-axis saturation factor at 120% of rated terminal voltage (S12q) (>=S1q). Typical Value = 0.12. Default: nullptr */ + CIMPP::Simple_Float saturationFactorQAxis; /* Q-axis saturation factor at rated terminal voltage (S1q) (>= 0). Typical Value = 0.02. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineDetailed_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.cpp index f6d915cfd..9ef4f1aca 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.cpp @@ -1,99 +1,136 @@ -#include -#include "RotatingMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineDynamics.hpp" -#include "SynchronousMachine.hpp" -#include "TurbineGovernorDynamics.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" -#include "MechanicalLoadDynamics.hpp" #include "GenICompensationForGenJ.hpp" +#include "MechanicalLoadDynamics.hpp" +#include "SynchronousMachine.hpp" +#include "TurbineGovernorDynamics.hpp" using namespace CIMPP; -SynchronousMachineDynamics::SynchronousMachineDynamics(): SynchronousMachine(nullptr), ExcitationSystemDynamics(nullptr), MechanicalLoadDynamics(nullptr) {}; - +SynchronousMachineDynamics::SynchronousMachineDynamics() : ExcitationSystemDynamics(nullptr), MechanicalLoadDynamics(nullptr), SynchronousMachine(nullptr) {}; SynchronousMachineDynamics::~SynchronousMachineDynamics() {}; -bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass*, BaseClass*); -bool assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->SynchronousMachine = dynamic_cast(BaseClass_ptr2); - if(element->SynchronousMachine != nullptr) - return assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TurbineGovernorDynamics.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + + +bool assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_SynchronousMachineDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return true; - } - return false; +bool assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + GenICompensationForGenJ* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->GenICompensationForGenJ.begin(), element->GenICompensationForGenJ.end(), element2) == element->GenICompensationForGenJ.end()) + { + element->GenICompensationForGenJ.push_back(element2); + return assign_GenICompensationForGenJ_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->MechanicalLoadDynamics = dynamic_cast(BaseClass_ptr2); - if(element->MechanicalLoadDynamics != nullptr) - return true; - } - return false; +bool assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_MechanicalLoadDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + MechanicalLoadDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->MechanicalLoadDynamics != element2) + { + element->MechanicalLoadDynamics = element2; + return assign_MechanicalLoadDynamics_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_SynchronousMachineDynamics_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->GenICompensationForGenJ.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_SynchronousMachine(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachine* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SynchronousMachine != element2) + { + element->SynchronousMachine = element2; + return assign_SynchronousMachine_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - - -namespace CIMPP { - BaseClass* SynchronousMachineDynamics_factory() { - return new SynchronousMachineDynamics; +bool assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass*, BaseClass*); +bool assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TurbineGovernorDynamics.begin(), element->TurbineGovernorDynamics.end(), element2) == element->TurbineGovernorDynamics.end()) + { + element->TurbineGovernorDynamics.push_back(element2); + return assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void SynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics"), &SynchronousMachineDynamics_factory)); +const char SynchronousMachineDynamics::debugName[] = "SynchronousMachineDynamics"; +const char* SynchronousMachineDynamics::debugString() const +{ + return SynchronousMachineDynamics::debugName; } -void SynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void SynchronousMachineDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics"), &SynchronousMachineDynamics_factory)); +} -void SynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.SynchronousMachine"), &assign_SynchronousMachineDynamics_SynchronousMachine)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.TurbineGovernorDynamics"), &assign_SynchronousMachineDynamics_TurbineGovernorDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.ExcitationSystemDynamics"), &assign_SynchronousMachineDynamics_ExcitationSystemDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.MechanicalLoadDynamics"), &assign_SynchronousMachineDynamics_MechanicalLoadDynamics)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.GenICompensationForGenJ"), &assign_SynchronousMachineDynamics_GenICompensationForGenJ)); +void SynchronousMachineDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SynchronousMachineDynamics::debugName[] = "SynchronousMachineDynamics"; -const char* SynchronousMachineDynamics::debugString() +void SynchronousMachineDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.ExcitationSystemDynamics"), &assign_SynchronousMachineDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.GenICompensationForGenJ"), &assign_SynchronousMachineDynamics_GenICompensationForGenJ)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.MechanicalLoadDynamics"), &assign_SynchronousMachineDynamics_MechanicalLoadDynamics)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.SynchronousMachine"), &assign_SynchronousMachineDynamics_SynchronousMachine)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineDynamics.TurbineGovernorDynamics"), &assign_SynchronousMachineDynamics_TurbineGovernorDynamics)); } const BaseClassDefiner SynchronousMachineDynamics::declare() @@ -101,4 +138,10 @@ const BaseClassDefiner SynchronousMachineDynamics::declare() return BaseClassDefiner(SynchronousMachineDynamics::addConstructToMap, SynchronousMachineDynamics::addPrimitiveAssignFnsToMap, SynchronousMachineDynamics::addClassAssignFnsToMap, SynchronousMachineDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineDynamics_factory() + { + return new SynchronousMachineDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.hpp index e51934ac7..ee5e3e2cf 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineDynamics.hpp @@ -1,46 +1,47 @@ #ifndef SynchronousMachineDynamics_H #define SynchronousMachineDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RotatingMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RotatingMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class GenICompensationForGenJ; + class MechanicalLoadDynamics; + class SynchronousMachine; + class TurbineGovernorDynamics; -class SynchronousMachine; -class TurbineGovernorDynamics; -class ExcitationSystemDynamics; -class MechanicalLoadDynamics; -class GenICompensationForGenJ; /* Synchronous machine whose behaviour is described by reference to a standard model expressed in one of the following forms: */ - class SynchronousMachineDynamics: public RotatingMachineDynamics + class SynchronousMachineDynamics : public RotatingMachineDynamics { - public: - CIMPP::SynchronousMachine* SynchronousMachine; /* Synchronous machine to which synchronous machine dynamics model applies. Default: 0 */ - std::list TurbineGovernorDynamics; /* Synchronous machine model with which this turbine-governor model is associated. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model associated with this synchronous machine model. Default: 0 */ - CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this synchronous machine model. Default: 0 */ - std::list GenICompensationForGenJ; /* Compensation of voltage compensator`s generator for current flow out of this generator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineDynamics(); - virtual ~SynchronousMachineDynamics(); - + ~SynchronousMachineDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model associated with this synchronous machine model. Default: 0 */ + std::list GenICompensationForGenJ; /* Compensation of voltage compensator`s generator for current flow out of this generator. Default: 0 */ + CIMPP::MechanicalLoadDynamics* MechanicalLoadDynamics; /* Mechanical load model associated with this synchronous machine model. Default: 0 */ + CIMPP::SynchronousMachine* SynchronousMachine; /* Synchronous machine to which synchronous machine dynamics model applies. Default: 0 */ + std::list TurbineGovernorDynamics; /* Synchronous machine model with which this turbine-governor model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.cpp index 32f5cf134..a228afafe 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.cpp @@ -1,7 +1,11 @@ -#include -#include "SynchronousMachineDetailed.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineEquivalentCircuit.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,185 +21,192 @@ using namespace CIMPP; SynchronousMachineEquivalentCircuit::SynchronousMachineEquivalentCircuit() {}; - SynchronousMachineEquivalentCircuit::~SynchronousMachineEquivalentCircuit() {}; +bool assign_SynchronousMachineEquivalentCircuit_r1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r1d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_r1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r1q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_r2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r2q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_rfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_x1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x1d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_x1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x1q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_x2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x2q; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xad(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xad; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xaq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xaq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xf1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xf1d; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineEquivalentCircuit_xfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xfd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachineEquivalentCircuit_xad(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xad; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineEquivalentCircuit_rfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineEquivalentCircuit_xfd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xfd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_r1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r1d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_x1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x1d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_xf1d(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xf1d; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_xaq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xaq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_r1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r1q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_x1q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x1q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_r2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r2q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineEquivalentCircuit_x2q(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineEquivalentCircuit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x2q; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* SynchronousMachineEquivalentCircuit_factory() { - return new SynchronousMachineEquivalentCircuit; - } + + + + + + + + + +const char SynchronousMachineEquivalentCircuit::debugName[] = "SynchronousMachineEquivalentCircuit"; +const char* SynchronousMachineEquivalentCircuit::debugString() const +{ + return SynchronousMachineEquivalentCircuit::debugName; } -void SynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineEquivalentCircuit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit"), &SynchronousMachineEquivalentCircuit_factory)); } -void SynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xad"), &assign_SynchronousMachineEquivalentCircuit_xad)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.rfd"), &assign_SynchronousMachineEquivalentCircuit_rfd)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xfd"), &assign_SynchronousMachineEquivalentCircuit_xfd)); +void SynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.r1d"), &assign_SynchronousMachineEquivalentCircuit_r1d)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1d"), &assign_SynchronousMachineEquivalentCircuit_x1d)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xf1d"), &assign_SynchronousMachineEquivalentCircuit_xf1d)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xaq"), &assign_SynchronousMachineEquivalentCircuit_xaq)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.r1q"), &assign_SynchronousMachineEquivalentCircuit_r1q)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1q"), &assign_SynchronousMachineEquivalentCircuit_x1q)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.r2q"), &assign_SynchronousMachineEquivalentCircuit_r2q)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.rfd"), &assign_SynchronousMachineEquivalentCircuit_rfd)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1d"), &assign_SynchronousMachineEquivalentCircuit_x1d)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x1q"), &assign_SynchronousMachineEquivalentCircuit_x1q)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.x2q"), &assign_SynchronousMachineEquivalentCircuit_x2q)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xad"), &assign_SynchronousMachineEquivalentCircuit_xad)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xaq"), &assign_SynchronousMachineEquivalentCircuit_xaq)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xf1d"), &assign_SynchronousMachineEquivalentCircuit_xf1d)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineEquivalentCircuit.xfd"), &assign_SynchronousMachineEquivalentCircuit_xfd)); } -void SynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SynchronousMachineEquivalentCircuit::debugName[] = "SynchronousMachineEquivalentCircuit"; -const char* SynchronousMachineEquivalentCircuit::debugString() +void SynchronousMachineEquivalentCircuit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineEquivalentCircuit::debugName; } const BaseClassDefiner SynchronousMachineEquivalentCircuit::declare() @@ -203,4 +214,10 @@ const BaseClassDefiner SynchronousMachineEquivalentCircuit::declare() return BaseClassDefiner(SynchronousMachineEquivalentCircuit::addConstructToMap, SynchronousMachineEquivalentCircuit::addPrimitiveAssignFnsToMap, SynchronousMachineEquivalentCircuit::addClassAssignFnsToMap, SynchronousMachineEquivalentCircuit::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineEquivalentCircuit_factory() + { + return new SynchronousMachineEquivalentCircuit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.hpp index 202d73266..47630a0f5 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineEquivalentCircuit.hpp @@ -1,48 +1,49 @@ #ifndef SynchronousMachineEquivalentCircuit_H #define SynchronousMachineEquivalentCircuit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDetailed.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "SynchronousMachineDetailed.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The electrical equations for all variations of the synchronous models are based on the SynchronousEquivalentCircuit diagram for the direct and quadrature axes. = + = + * / ( + ) = + * * / ( * + * + * ) = + = + * / (+ ) = + ** / ( * + * + * ) = ( + ) / ( * ) = ( * + * + * ) / ( * * ( + ) = ( + ) / ( * ) = ( * + * + * )/ ( * * ( + ) Same equations using CIM attributes from SynchronousMachineTimeConstantReactance class on left of = sign and SynchronousMachineEquivalentCircuit class on right (except as noted): xDirectSync = xad + RotatingMachineDynamics.statorLeakageReactance xDirectTrans = RotatingMachineDynamics.statorLeakageReactance + xad * xfd / (xad + xfd) xDirectSubtrans = RotatingMachineDynamics.statorLeakageReactance + xad * xfd * x1d / (xad * xfd + xad * x1d + xfd * x1d) xQuadSync = xaq + RotatingMachineDynamics.statorLeakageReactance xQuadTrans = RotatingMachineDynamics.statorLeakageReactance + xaq * x1q / (xaq+ x1q) xQuadSubtrans = RotatingMachineDynamics.statorLeakageReactance + xaq * x1q* x2q / (xaq * x1q + xaq * x2q + x1q * x2q) tpdo = (xad + xfd) / (2*pi*nominal frequency * rfd) tppdo = (xad * xfd + xad * x1d + xfd * x1d) / (2*pi*nominal frequency * r1d * (xad + xfd) tpqo = (xaq + x1q) / (2*pi*nominal frequency * r1q) tppqo = (xaq * x1q + xaq * x2q + x1q * x2q)/ (2*pi*nominal frequency * r2q * (xaq + x1q). Are only valid for a simplified model where "Canay" reactance is zero. */ - class SynchronousMachineEquivalentCircuit: public SynchronousMachineDetailed + class SynchronousMachineEquivalentCircuit : public SynchronousMachineDetailed { - public: - CIMPP::PU xad; /* D-axis mutual reactance. Default: nullptr */ - CIMPP::PU rfd; /* Field winding resistance. Default: nullptr */ - CIMPP::PU xfd; /* Field winding leakage reactance. Default: nullptr */ - CIMPP::PU r1d; /* D-axis damper 1 winding resistance. Default: nullptr */ - CIMPP::PU x1d; /* D-axis damper 1 winding leakage reactance. Default: nullptr */ - CIMPP::PU xf1d; /* Differential mutual (`Canay`) reactance. Default: nullptr */ - CIMPP::PU xaq; /* Q-axis mutual reactance. Default: nullptr */ - CIMPP::PU r1q; /* Q-axis damper 1 winding resistance. Default: nullptr */ - CIMPP::PU x1q; /* Q-axis damper 1 winding leakage reactance. Default: nullptr */ - CIMPP::PU r2q; /* Q-axis damper 2 winding resistance. Default: nullptr */ - CIMPP::PU x2q; /* Q-axis damper 2 winding leakage reactance. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineEquivalentCircuit(); - virtual ~SynchronousMachineEquivalentCircuit(); - + ~SynchronousMachineEquivalentCircuit() override; + + CIMPP::PU r1d; /* D-axis damper 1 winding resistance. Default: nullptr */ + CIMPP::PU r1q; /* Q-axis damper 1 winding resistance. Default: nullptr */ + CIMPP::PU r2q; /* Q-axis damper 2 winding resistance. Default: nullptr */ + CIMPP::PU rfd; /* Field winding resistance. Default: nullptr */ + CIMPP::PU x1d; /* D-axis damper 1 winding leakage reactance. Default: nullptr */ + CIMPP::PU x1q; /* Q-axis damper 1 winding leakage reactance. Default: nullptr */ + CIMPP::PU x2q; /* Q-axis damper 2 winding leakage reactance. Default: nullptr */ + CIMPP::PU xad; /* D-axis mutual reactance. Default: nullptr */ + CIMPP::PU xaq; /* Q-axis mutual reactance. Default: nullptr */ + CIMPP::PU xf1d; /* Differential mutual (`Canay`) reactance. Default: nullptr */ + CIMPP::PU xfd; /* Field winding leakage reactance. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineEquivalentCircuit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.cpp index cdd209bb7..55bd958b0 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineKind& rop) +SynchronousMachineKind& SynchronousMachineKind::operator=(SynchronousMachineKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SynchronousMachineKind::operator SynchronousMachineKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SynchronousMachineKind::debugName[] = "SynchronousMachineKind"; +const char* SynchronousMachineKind::debugString() const +{ + return SynchronousMachineKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SynchronousMachineKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -58,5 +89,47 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SynchronousMachineKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SynchronousMachineKind::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == SynchronousMachineKind::condenser) + { + EnumSymbol = "condenser"; + } + if (obj.value == SynchronousMachineKind::generatorOrCondenser) + { + EnumSymbol = "generatorOrCondenser"; + } + if (obj.value == SynchronousMachineKind::motor) + { + EnumSymbol = "motor"; + } + if (obj.value == SynchronousMachineKind::generatorOrMotor) + { + EnumSymbol = "generatorOrMotor"; + } + if (obj.value == SynchronousMachineKind::motorOrCondenser) + { + EnumSymbol = "motorOrCondenser"; + } + if (obj.value == SynchronousMachineKind::generatorOrCondenserOrMotor) + { + EnumSymbol = "generatorOrCondenserOrMotor"; + } + + if (!EnumSymbol.empty()) + { + os << "SynchronousMachineKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.hpp index 9bb36f126..9b3eaf71b 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineKind.hpp @@ -1,41 +1,45 @@ #ifndef SynchronousMachineKind_H #define SynchronousMachineKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Synchronous machine type. */ - enum class SynchronousMachineKind + class SynchronousMachineKind { - /** - * - */ - generator, - /** - * - */ - condenser, - /** - * - */ - generatorOrCondenser, - /** - * - */ - motor, - /** - * - */ - generatorOrMotor, - /** - * - */ - motorOrCondenser, - /** - * - */ - generatorOrCondenserOrMotor, + public: + enum SynchronousMachineKind_ENUM + { + generator, + condenser, + generatorOrCondenser, + motor, + generatorOrMotor, + motorOrCondenser, + generatorOrCondenserOrMotor, + }; + + SynchronousMachineKind() : value(), initialized(false) {} + SynchronousMachineKind(SynchronousMachineKind_ENUM value) : value(value), initialized(true) {} + + SynchronousMachineKind& operator=(SynchronousMachineKind_ENUM rop); + operator SynchronousMachineKind_ENUM() const; + + SynchronousMachineKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SynchronousMachineKind& rop); + friend std::ostream& operator<<(std::ostream& os, const SynchronousMachineKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.cpp index 69c97d45d..10460ede1 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineModelKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineModelKind& rop) +SynchronousMachineModelKind& SynchronousMachineModelKind::operator=(SynchronousMachineModelKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SynchronousMachineModelKind::operator SynchronousMachineModelKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SynchronousMachineModelKind::debugName[] = "SynchronousMachineModelKind"; +const char* SynchronousMachineModelKind::debugString() const +{ + return SynchronousMachineModelKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SynchronousMachineModelKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -48,5 +79,39 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SynchronousMachineModelKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SynchronousMachineModelKind::subtransient) + { + EnumSymbol = "subtransient"; + } + if (obj.value == SynchronousMachineModelKind::subtransientTypeF) + { + EnumSymbol = "subtransientTypeF"; + } + if (obj.value == SynchronousMachineModelKind::subtransientTypeJ) + { + EnumSymbol = "subtransientTypeJ"; + } + if (obj.value == SynchronousMachineModelKind::subtransientSimplified) + { + EnumSymbol = "subtransientSimplified"; + } + if (obj.value == SynchronousMachineModelKind::subtransientSimplifiedDirectAxis) + { + EnumSymbol = "subtransientSimplifiedDirectAxis"; + } + + if (!EnumSymbol.empty()) + { + os << "SynchronousMachineModelKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.hpp index 0d7526111..06da8b2b5 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineModelKind.hpp @@ -1,33 +1,58 @@ #ifndef SynchronousMachineModelKind_H #define SynchronousMachineModelKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Type of synchronous machine model used in Dynamic simulation applications. */ - enum class SynchronousMachineModelKind + class SynchronousMachineModelKind { - /** - * Subtransient synchronous machine model. - */ - subtransient, - /** - * WECC Type F variant of subtransient synchronous machine model. - */ - subtransientTypeF, - /** - * WECC Type J variant of subtransient synchronous machine model. - */ - subtransientTypeJ, - /** - * Simplified version of subtransient synchronous machine model where magnetic coupling between the direct and quadrature axes is ignored. - */ - subtransientSimplified, - /** - * Simplified version of a subtransient synchronous machine model with no damper circuit on d-axis. - */ - subtransientSimplifiedDirectAxis, + public: + enum SynchronousMachineModelKind_ENUM + { + /** + * Subtransient synchronous machine model. + */ + subtransient, + /** + * WECC Type F variant of subtransient synchronous machine model. + */ + subtransientTypeF, + /** + * WECC Type J variant of subtransient synchronous machine model. + */ + subtransientTypeJ, + /** + * Simplified version of subtransient synchronous machine model where magnetic coupling between the direct and quadrature axes is ignored. + */ + subtransientSimplified, + /** + * Simplified version of a subtransient synchronous machine model with no damper circuit on d-axis. + */ + subtransientSimplifiedDirectAxis, + }; + + SynchronousMachineModelKind() : value(), initialized(false) {} + SynchronousMachineModelKind(SynchronousMachineModelKind_ENUM value) : value(value), initialized(true) {} + + SynchronousMachineModelKind& operator=(SynchronousMachineModelKind_ENUM rop); + operator SynchronousMachineModelKind_ENUM() const; + + SynchronousMachineModelKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SynchronousMachineModelKind& rop); + friend std::ostream& operator<<(std::ostream& os, const SynchronousMachineModelKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineModelKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.cpp index 17134a897..92b1e2cc3 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineOperatingMode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineOperatingMode& rop) +SynchronousMachineOperatingMode& SynchronousMachineOperatingMode::operator=(SynchronousMachineOperatingMode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +SynchronousMachineOperatingMode::operator SynchronousMachineOperatingMode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char SynchronousMachineOperatingMode::debugName[] = "SynchronousMachineOperatingMode"; +const char* SynchronousMachineOperatingMode::debugString() const +{ + return SynchronousMachineOperatingMode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, SynchronousMachineOperatingMode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const SynchronousMachineOperatingMode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == SynchronousMachineOperatingMode::generator) + { + EnumSymbol = "generator"; + } + if (obj.value == SynchronousMachineOperatingMode::condenser) + { + EnumSymbol = "condenser"; + } + if (obj.value == SynchronousMachineOperatingMode::motor) + { + EnumSymbol = "motor"; + } + + if (!EnumSymbol.empty()) + { + os << "SynchronousMachineOperatingMode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.hpp index abbfd44cf..464590a5b 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineOperatingMode.hpp @@ -1,25 +1,41 @@ #ifndef SynchronousMachineOperatingMode_H #define SynchronousMachineOperatingMode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Synchronous machine operating mode. */ - enum class SynchronousMachineOperatingMode + class SynchronousMachineOperatingMode { - /** - * - */ - generator, - /** - * - */ - condenser, - /** - * - */ - motor, + public: + enum SynchronousMachineOperatingMode_ENUM + { + generator, + condenser, + motor, + }; + + SynchronousMachineOperatingMode() : value(), initialized(false) {} + SynchronousMachineOperatingMode(SynchronousMachineOperatingMode_ENUM value) : value(value), initialized(true) {} + + SynchronousMachineOperatingMode& operator=(SynchronousMachineOperatingMode_ENUM rop); + operator SynchronousMachineOperatingMode_ENUM() const; + + SynchronousMachineOperatingMode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, SynchronousMachineOperatingMode& rop); + friend std::ostream& operator<<(std::ostream& os, const SynchronousMachineOperatingMode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::SynchronousMachineOperatingMode& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.cpp index 5def0becb..c871a8180 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.cpp @@ -1,36 +1,36 @@ -#include -#include "SynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineSimplified.hpp" +#include +#include + using namespace CIMPP; SynchronousMachineSimplified::SynchronousMachineSimplified() {}; - SynchronousMachineSimplified::~SynchronousMachineSimplified() {}; -namespace CIMPP { - BaseClass* SynchronousMachineSimplified_factory() { - return new SynchronousMachineSimplified; - } +const char SynchronousMachineSimplified::debugName[] = "SynchronousMachineSimplified"; +const char* SynchronousMachineSimplified::debugString() const +{ + return SynchronousMachineSimplified::debugName; } -void SynchronousMachineSimplified::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineSimplified::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineSimplified"), &SynchronousMachineSimplified_factory)); } -void SynchronousMachineSimplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { -} - -void SynchronousMachineSimplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void SynchronousMachineSimplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char SynchronousMachineSimplified::debugName[] = "SynchronousMachineSimplified"; -const char* SynchronousMachineSimplified::debugString() +void SynchronousMachineSimplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineSimplified::debugName; } const BaseClassDefiner SynchronousMachineSimplified::declare() @@ -38,4 +38,10 @@ const BaseClassDefiner SynchronousMachineSimplified::declare() return BaseClassDefiner(SynchronousMachineSimplified::addConstructToMap, SynchronousMachineSimplified::addPrimitiveAssignFnsToMap, SynchronousMachineSimplified::addClassAssignFnsToMap, SynchronousMachineSimplified::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineSimplified_factory() + { + return new SynchronousMachineSimplified; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.hpp index 8f216ce1c..3cb0a9a5d 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineSimplified.hpp @@ -1,36 +1,37 @@ #ifndef SynchronousMachineSimplified_H #define SynchronousMachineSimplified_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ /* The simplified model represents a synchronous generator as a constant internal voltage behind an impedance ( + ) as shown in the Simplified diagram. Since internal voltage is held constant, there is no input and any excitation system model will be ignored. There is also no output. This model should not be used for representing a real generator except, perhaps, small generators whose response is insignificant. The parameters used for the Simplified model include: */ - class SynchronousMachineSimplified: public SynchronousMachineDynamics + class SynchronousMachineSimplified : public SynchronousMachineDynamics { - public: - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineSimplified(); - virtual ~SynchronousMachineSimplified(); - + ~SynchronousMachineSimplified() override; + + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineSimplified_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.cpp index 4ac4d088b..78d9a31b1 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.cpp @@ -1,246 +1,260 @@ -#include -#include "SynchronousMachineDetailed.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineTimeConstantReactance.hpp" -#include "RotorKind.hpp" -#include "SynchronousMachineModelKind.hpp" +#include +#include + #include "Simple_Float.hpp" +#include "SynchronousMachineModelKind.hpp" +#include "RotorKind.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; SynchronousMachineTimeConstantReactance::SynchronousMachineTimeConstantReactance() {}; - SynchronousMachineTimeConstantReactance::~SynchronousMachineTimeConstantReactance() {}; +bool assign_SynchronousMachineTimeConstantReactance_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ks; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_modelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->modelType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_rotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rotorType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tpdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpdo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tppdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppdo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tppqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tppqo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_tpqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpqo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xDirectSubtrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xDirectSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xDirectSync; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xDirectTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xDirectTrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xQuadSubtrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xQuadSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xQuadSync; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_SynchronousMachineTimeConstantReactance_xQuadTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xQuadTrans; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_SynchronousMachineTimeConstantReactance_rotorType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rotorType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_modelType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->modelType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_ks(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ks; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_xDirectSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xDirectSync; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_SynchronousMachineTimeConstantReactance_xDirectTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xDirectTrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xDirectSubtrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xQuadSync(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xQuadSync; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xQuadTrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xQuadTrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xQuadSubtrans; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tpdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpdo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tppdo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppdo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tpqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpqo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tppqo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tppqo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_SynchronousMachineTimeConstantReactance_tc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineTimeConstantReactance* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* SynchronousMachineTimeConstantReactance_factory() { - return new SynchronousMachineTimeConstantReactance; - } + + + + + + + + + + +const char SynchronousMachineTimeConstantReactance::debugName[] = "SynchronousMachineTimeConstantReactance"; +const char* SynchronousMachineTimeConstantReactance::debugString() const +{ + return SynchronousMachineTimeConstantReactance::debugName; } -void SynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineTimeConstantReactance::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance"), &SynchronousMachineTimeConstantReactance_factory)); } -void SynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.rotorType"), &assign_SynchronousMachineTimeConstantReactance_rotorType)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.modelType"), &assign_SynchronousMachineTimeConstantReactance_modelType)); +void SynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.ks"), &assign_SynchronousMachineTimeConstantReactance_ks)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.modelType"), &assign_SynchronousMachineTimeConstantReactance_modelType)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.rotorType"), &assign_SynchronousMachineTimeConstantReactance_rotorType)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tc"), &assign_SynchronousMachineTimeConstantReactance_tc)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpdo"), &assign_SynchronousMachineTimeConstantReactance_tpdo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppdo"), &assign_SynchronousMachineTimeConstantReactance_tppdo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppqo"), &assign_SynchronousMachineTimeConstantReactance_tppqo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpqo"), &assign_SynchronousMachineTimeConstantReactance_tpqo)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectSync"), &assign_SynchronousMachineTimeConstantReactance_xDirectSync)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectTrans"), &assign_SynchronousMachineTimeConstantReactance_xDirectTrans)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xDirectSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xDirectSubtrans)); + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadSync"), &assign_SynchronousMachineTimeConstantReactance_xQuadSync)); assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadTrans"), &assign_SynchronousMachineTimeConstantReactance_xQuadTrans)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.xQuadSubtrans"), &assign_SynchronousMachineTimeConstantReactance_xQuadSubtrans)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpdo"), &assign_SynchronousMachineTimeConstantReactance_tpdo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppdo"), &assign_SynchronousMachineTimeConstantReactance_tppdo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tpqo"), &assign_SynchronousMachineTimeConstantReactance_tpqo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tppqo"), &assign_SynchronousMachineTimeConstantReactance_tppqo)); - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineTimeConstantReactance.tc"), &assign_SynchronousMachineTimeConstantReactance_tc)); } -void SynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char SynchronousMachineTimeConstantReactance::debugName[] = "SynchronousMachineTimeConstantReactance"; -const char* SynchronousMachineTimeConstantReactance::debugString() +void SynchronousMachineTimeConstantReactance::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineTimeConstantReactance::debugName; } const BaseClassDefiner SynchronousMachineTimeConstantReactance::declare() @@ -248,4 +262,10 @@ const BaseClassDefiner SynchronousMachineTimeConstantReactance::declare() return BaseClassDefiner(SynchronousMachineTimeConstantReactance::addConstructToMap, SynchronousMachineTimeConstantReactance::addPrimitiveAssignFnsToMap, SynchronousMachineTimeConstantReactance::addClassAssignFnsToMap, SynchronousMachineTimeConstantReactance::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineTimeConstantReactance_factory() + { + return new SynchronousMachineTimeConstantReactance; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.hpp index c783655c5..7742a80ed 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineTimeConstantReactance.hpp @@ -1,55 +1,56 @@ #ifndef SynchronousMachineTimeConstantReactance_H #define SynchronousMachineTimeConstantReactance_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDetailed.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "RotorKind.hpp" -#include "SynchronousMachineModelKind.hpp" -#include "Simple_Float.hpp" +#include "SynchronousMachineDetailed.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "RotorKind.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" +#include "SynchronousMachineModelKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Synchronous machine detailed modelling types are defined by the combination of the attributes SynchronousMachineTimeConstantReactance.modelType and SynchronousMachineTimeConstantReactance.rotorType. The parameters used for models expressed in time constant reactance form include: */ - class SynchronousMachineTimeConstantReactance: public SynchronousMachineDetailed + class SynchronousMachineTimeConstantReactance : public SynchronousMachineDetailed { - public: - CIMPP::RotorKind rotorType; /* Type of rotor on physical machine. Default: 0 */ - CIMPP::SynchronousMachineModelKind modelType; /* Type of synchronous machine model used in Dynamic simulation applications. Default: 0 */ - CIMPP::Simple_Float ks; /* Saturation loading correction factor (Ks) (>= 0). Used only by Type J model. Typical Value = 0. Default: nullptr */ - CIMPP::PU xDirectSync; /* Direct-axis synchronous reactance (Xd) (>= X`d). The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. Typical Value = 1.8. Default: nullptr */ - CIMPP::PU xDirectTrans; /* Direct-axis transient reactance (unsaturated) (X`d) (> =X``d). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU xDirectSubtrans; /* Direct-axis subtransient reactance (unsaturated) (X``d) (> Xl). Typical Value = 0.2. Default: nullptr */ - CIMPP::PU xQuadSync; /* Quadrature-axis synchronous reactance (Xq) (> =X`q). The ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency. Typical Value = 1.6. Default: nullptr */ - CIMPP::PU xQuadTrans; /* Quadrature-axis transient reactance (X`q) (> =X``q). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU xQuadSubtrans; /* Quadrature-axis subtransient reactance (X``q) (> Xl). Typical Value = 0.2. Default: nullptr */ - CIMPP::Seconds tpdo; /* Direct-axis transient rotor time constant (T`do) (> T``do). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tppdo; /* Direct-axis subtransient rotor time constant (T``do) (> 0). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tpqo; /* Quadrature-axis transient rotor time constant (T`qo) (> T``qo). Typical Value = 0.5. Default: nullptr */ - CIMPP::Seconds tppqo; /* Quadrature-axis subtransient rotor time constant (T``qo) (> 0). Typical Value = 0.03. Default: nullptr */ - CIMPP::Seconds tc; /* Damping time constant for `Canay` reactance. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineTimeConstantReactance(); - virtual ~SynchronousMachineTimeConstantReactance(); - + ~SynchronousMachineTimeConstantReactance() override; + + CIMPP::Simple_Float ks; /* Saturation loading correction factor (Ks) (>= 0). Used only by Type J model. Typical Value = 0. Default: nullptr */ + CIMPP::SynchronousMachineModelKind modelType; /* Type of synchronous machine model used in Dynamic simulation applications. Default: 0 */ + CIMPP::RotorKind rotorType; /* Type of rotor on physical machine. Default: 0 */ + CIMPP::Seconds tc; /* Damping time constant for `Canay` reactance. Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tpdo; /* Direct-axis transient rotor time constant (T`do) (> T``do). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tppdo; /* Direct-axis subtransient rotor time constant (T``do) (> 0). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tppqo; /* Quadrature-axis subtransient rotor time constant (T``qo) (> 0). Typical Value = 0.03. Default: nullptr */ + CIMPP::Seconds tpqo; /* Quadrature-axis transient rotor time constant (T`qo) (> T``qo). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU xDirectSubtrans; /* Direct-axis subtransient reactance (unsaturated) (X``d) (> Xl). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU xDirectSync; /* Direct-axis synchronous reactance (Xd) (>= X`d). The quotient of a sustained value of that AC component of armature voltage that is produced by the total direct-axis flux due to direct-axis armature current and the value of the AC component of this current, the machine running at rated speed. Typical Value = 1.8. Default: nullptr */ + CIMPP::PU xDirectTrans; /* Direct-axis transient reactance (unsaturated) (X`d) (> =X``d). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU xQuadSubtrans; /* Quadrature-axis subtransient reactance (X``q) (> Xl). Typical Value = 0.2. Default: nullptr */ + CIMPP::PU xQuadSync; /* Quadrature-axis synchronous reactance (Xq) (> =X`q). The ratio of the component of reactive armature voltage, due to the quadrature-axis component of armature current, to this component of current, under steady state conditions and at rated frequency. Typical Value = 1.6. Default: nullptr */ + CIMPP::PU xQuadTrans; /* Quadrature-axis transient reactance (X`q) (> =X``q). Typical Value = 0.3. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineTimeConstantReactance_factory(); diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.cpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.cpp index 0fde574f7..80c109209 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "SynchronousMachineDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "SynchronousMachineUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; SynchronousMachineUserDefined::SynchronousMachineUserDefined() {}; - SynchronousMachineUserDefined::~SynchronousMachineUserDefined() {}; -bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_SynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_SynchronousMachineUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass*, BaseClass*); +bool assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + SynchronousMachineUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_SynchronousMachineUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* SynchronousMachineUserDefined_factory() { - return new SynchronousMachineUserDefined; - } +const char SynchronousMachineUserDefined::debugName[] = "SynchronousMachineUserDefined"; +const char* SynchronousMachineUserDefined::debugString() const +{ + return SynchronousMachineUserDefined::debugName; } -void SynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void SynchronousMachineUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined"), &SynchronousMachineUserDefined_factory)); } -void SynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void SynchronousMachineUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined.proprietary"), &assign_SynchronousMachineUserDefined_proprietary)); - } - -void SynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics)); } -const char SynchronousMachineUserDefined::debugName[] = "SynchronousMachineUserDefined"; -const char* SynchronousMachineUserDefined::debugString() +void SynchronousMachineUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return SynchronousMachineUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:SynchronousMachineUserDefined.ProprietaryParameterDynamics"), &assign_SynchronousMachineUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner SynchronousMachineUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner SynchronousMachineUserDefined::declare() return BaseClassDefiner(SynchronousMachineUserDefined::addConstructToMap, SynchronousMachineUserDefined::addPrimitiveAssignFnsToMap, SynchronousMachineUserDefined::addClassAssignFnsToMap, SynchronousMachineUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* SynchronousMachineUserDefined_factory() + { + return new SynchronousMachineUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.hpp b/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.hpp index 9d3cf5a0d..801d49502 100644 --- a/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/SynchronousMachineUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef SynchronousMachineUserDefined_H #define SynchronousMachineUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SynchronousMachineDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "SynchronousMachineDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Synchronous machine whose dynamic behaviour is described by a user-defined model. */ - class SynchronousMachineUserDefined: public SynchronousMachineDynamics + class SynchronousMachineUserDefined : public SynchronousMachineDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ SynchronousMachineUserDefined(); - virtual ~SynchronousMachineUserDefined(); - + ~SynchronousMachineUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* SynchronousMachineUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TapChanger.cpp b/CGMES_2.4.15_27JAN2020/TapChanger.cpp index 861096fb6..b353d76ce 100644 --- a/CGMES_2.4.15_27JAN2020/TapChanger.cpp +++ b/CGMES_2.4.15_27JAN2020/TapChanger.cpp @@ -1,194 +1,224 @@ -#include -#include "PowerSystemResource.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapChanger.hpp" +#include +#include + +#include "SvTapStep.hpp" +#include "TapChangerControl.hpp" +#include "TapSchedule.hpp" +#include "Boolean.hpp" #include "Integer.hpp" #include "Integer.hpp" #include "Boolean.hpp" #include "Integer.hpp" #include "Voltage.hpp" #include "Integer.hpp" -#include "TapChangerControl.hpp" -#include "TapSchedule.hpp" -#include "Boolean.hpp" #include "Simple_Float.hpp" -#include "SvTapStep.hpp" using namespace CIMPP; -TapChanger::TapChanger(): TapChangerControl(nullptr), SvTapStep(nullptr) {}; - +TapChanger::TapChanger() : SvTapStep(nullptr), TapChangerControl(nullptr) {}; TapChanger::~TapChanger() {}; +bool assign_TapChanger_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->controlEnabled; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_TapChanger_highStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->highStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChanger_lowStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lowStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChanger_ltcFlag(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ltcFlag; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TapChangerControl_TapChanger(BaseClass*, BaseClass*); -bool assign_TapChanger_TapChangerControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->TapChangerControl = dynamic_cast(BaseClass_ptr2); - if(element->TapChangerControl != nullptr) - return assign_TapChangerControl_TapChanger(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TapChanger_TapSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TapSchedules.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TapChanger_neutralStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->neutralStep; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_TapChanger_neutralU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->neutralU; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChanger_normalStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->normalStep; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TapChanger_SvTapStep(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - element->SvTapStep = dynamic_cast(BaseClass_ptr2); - if(element->SvTapStep != nullptr) - return true; - } - return false; -} - - -bool assign_TapChanger_highStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->highStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_lowStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lowStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_ltcFlag(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ltcFlag; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_neutralStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->neutralStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_neutralU(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->neutralU; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_normalStep(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->normalStep; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - -bool assign_TapChanger_controlEnabled(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->controlEnabled; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TapChanger_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChanger* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->step; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* TapChanger_factory() { - return new TapChanger; +bool assign_TapChanger_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChanger* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->step; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + + +bool assign_SvTapStep_TapChanger(BaseClass*, BaseClass*); +bool assign_TapChanger_SvTapStep(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChanger* element = dynamic_cast(BaseClass_ptr1); + SvTapStep* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvTapStep != element2) + { + element->SvTapStep = element2; + return assign_SvTapStep_TapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TapChangerControl_TapChanger(BaseClass*, BaseClass*); +bool assign_TapChanger_TapChangerControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChanger* element = dynamic_cast(BaseClass_ptr1); + TapChangerControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TapChangerControl != element2) + { + element->TapChangerControl = element2; + return assign_TapChangerControl_TapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TapSchedule_TapChanger(BaseClass*, BaseClass*); +bool assign_TapChanger_TapSchedules(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChanger* element = dynamic_cast(BaseClass_ptr1); + TapSchedule* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TapSchedules.begin(), element->TapSchedules.end(), element2) == element->TapSchedules.end()) + { + element->TapSchedules.push_back(element2); + return assign_TapSchedule_TapChanger(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + +const char TapChanger::debugName[] = "TapChanger"; +const char* TapChanger::debugString() const +{ + return TapChanger::debugName; } -void TapChanger::addConstructToMap(std::unordered_map& factory_map) { +void TapChanger::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TapChanger"), &TapChanger_factory)); } -void TapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TapChanger::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TapChanger.controlEnabled"), &assign_TapChanger_controlEnabled)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.highStep"), &assign_TapChanger_highStep)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.lowStep"), &assign_TapChanger_lowStep)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.ltcFlag"), &assign_TapChanger_ltcFlag)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.neutralStep"), &assign_TapChanger_neutralStep)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.neutralU"), &assign_TapChanger_neutralU)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.normalStep"), &assign_TapChanger_normalStep)); - assign_map.insert(std::make_pair(std::string("cim:TapChanger.controlEnabled"), &assign_TapChanger_controlEnabled)); assign_map.insert(std::make_pair(std::string("cim:TapChanger.step"), &assign_TapChanger_step)); - } - -void TapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapChangerControl"), &assign_TapChanger_TapChangerControl)); - assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapSchedules"), &assign_TapChanger_TapSchedules)); - assign_map.insert(std::make_pair(std::string("cim:TapChanger.SvTapStep"), &assign_TapChanger_SvTapStep)); } -const char TapChanger::debugName[] = "TapChanger"; -const char* TapChanger::debugString() +void TapChanger::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapChanger::debugName; + assign_map.insert(std::make_pair(std::string("cim:TapChanger.SvTapStep"), &assign_TapChanger_SvTapStep)); + assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapChangerControl"), &assign_TapChanger_TapChangerControl)); + assign_map.insert(std::make_pair(std::string("cim:TapChanger.TapSchedules"), &assign_TapChanger_TapSchedules)); } const BaseClassDefiner TapChanger::declare() @@ -196,4 +226,10 @@ const BaseClassDefiner TapChanger::declare() return BaseClassDefiner(TapChanger::addConstructToMap, TapChanger::addPrimitiveAssignFnsToMap, TapChanger::addClassAssignFnsToMap, TapChanger::debugName); } - +namespace CIMPP +{ + BaseClass* TapChanger_factory() + { + return new TapChanger; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TapChanger.hpp b/CGMES_2.4.15_27JAN2020/TapChanger.hpp index dc4f0d568..674003d92 100644 --- a/CGMES_2.4.15_27JAN2020/TapChanger.hpp +++ b/CGMES_2.4.15_27JAN2020/TapChanger.hpp @@ -1,54 +1,55 @@ #ifndef TapChanger_H #define TapChanger_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "PowerSystemResource.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" +#include "PowerSystemResource.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -#include "Voltage.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" +#include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class SvTapStep; + class TapChangerControl; + class TapSchedule; -class TapChangerControl; -class TapSchedule; -class SvTapStep; /* Mechanism for changing transformer winding tap positions. */ - class TapChanger: public PowerSystemResource + class TapChanger : public PowerSystemResource { - public: - CIMPP::Integer highStep; /* Highest possible tap step position, advance from neutral. The attribute shall be greater than lowStep. Default: 0 */ - CIMPP::Integer lowStep; /* Lowest possible tap step position, retard from neutral Default: 0 */ - CIMPP::Boolean ltcFlag; /* Specifies whether or not a TapChanger has load tap changing capabilities. Default: false */ - CIMPP::Integer neutralStep; /* The neutral tap step position for this winding. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ - CIMPP::Voltage neutralU; /* Voltage at which the winding operates at the neutral tap setting. Default: nullptr */ - CIMPP::Integer normalStep; /* The tap step position used in `normal` network operation for this winding. For a `Fixed` tap changer indicates the current physical tap setting. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ - CIMPP::TapChangerControl* TapChangerControl; /* The tap changers that participates in this regulating tap control scheme. Default: 0 */ - std::list TapSchedules; /* A TapSchedule is associated with a TapChanger. Default: 0 */ - CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ - CIMPP::Simple_Float step; /* Tap changer position. Starting step for a steady state solution. Non integer values are allowed to support continuous tap variables. The reasons for continuous value are to support study cases where no discrete tap changers has yet been designed, a solutions where a narrow voltage band force the tap step to oscillate or accommodate for a continuous solution as input. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: nullptr */ - CIMPP::SvTapStep* SvTapStep; /* The tap step state associated with the tap changer. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapChanger(); - virtual ~TapChanger(); - + ~TapChanger() override; + + CIMPP::SvTapStep* SvTapStep; /* The tap step state associated with the tap changer. Default: 0 */ + CIMPP::TapChangerControl* TapChangerControl; /* The tap changers that participates in this regulating tap control scheme. Default: 0 */ + std::list TapSchedules; /* A TapSchedule is associated with a TapChanger. Default: 0 */ + CIMPP::Boolean controlEnabled; /* Specifies the regulation status of the equipment. True is regulating, false is not regulating. Default: false */ + CIMPP::Integer highStep; /* Highest possible tap step position, advance from neutral. The attribute shall be greater than lowStep. Default: 0 */ + CIMPP::Integer lowStep; /* Lowest possible tap step position, retard from neutral Default: 0 */ + CIMPP::Boolean ltcFlag; /* Specifies whether or not a TapChanger has load tap changing capabilities. Default: false */ + CIMPP::Integer neutralStep; /* The neutral tap step position for this winding. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ + CIMPP::Voltage neutralU; /* Voltage at which the winding operates at the neutral tap setting. Default: nullptr */ + CIMPP::Integer normalStep; /* The tap step position used in `normal` network operation for this winding. For a `Fixed` tap changer indicates the current physical tap setting. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: 0 */ + CIMPP::Simple_Float step; /* Tap changer position. Starting step for a steady state solution. Non integer values are allowed to support continuous tap variables. The reasons for continuous value are to support study cases where no discrete tap changers has yet been designed, a solutions where a narrow voltage band force the tap step to oscillate or accommodate for a continuous solution as input. The attribute shall be equal or greater than lowStep and equal or less than highStep. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapChanger_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TapChangerControl.cpp b/CGMES_2.4.15_27JAN2020/TapChangerControl.cpp index 3f5295e99..031f9704e 100644 --- a/CGMES_2.4.15_27JAN2020/TapChangerControl.cpp +++ b/CGMES_2.4.15_27JAN2020/TapChangerControl.cpp @@ -1,49 +1,56 @@ -#include -#include "RegulatingControl.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapChangerControl.hpp" +#include +#include + #include "TapChanger.hpp" using namespace CIMPP; TapChangerControl::TapChangerControl() {}; - TapChangerControl::~TapChangerControl() {}; -bool assign_TapChangerControl_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapChangerControl* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TapChanger.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_TapChanger_TapChangerControl(BaseClass*, BaseClass*); +bool assign_TapChangerControl_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapChangerControl* element = dynamic_cast(BaseClass_ptr1); + TapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TapChanger.begin(), element->TapChanger.end(), element2) == element->TapChanger.end()) + { + element->TapChanger.push_back(element2); + return assign_TapChanger_TapChangerControl(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* TapChangerControl_factory() { - return new TapChangerControl; - } +const char TapChangerControl::debugName[] = "TapChangerControl"; +const char* TapChangerControl::debugString() const +{ + return TapChangerControl::debugName; } -void TapChangerControl::addConstructToMap(std::unordered_map& factory_map) { +void TapChangerControl::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TapChangerControl"), &TapChangerControl_factory)); } -void TapChangerControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void TapChangerControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TapChangerControl.TapChanger"), &assign_TapChangerControl_TapChanger)); +void TapChangerControl::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TapChangerControl::debugName[] = "TapChangerControl"; -const char* TapChangerControl::debugString() +void TapChangerControl::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapChangerControl::debugName; + assign_map.insert(std::make_pair(std::string("cim:TapChangerControl.TapChanger"), &assign_TapChangerControl_TapChanger)); } const BaseClassDefiner TapChangerControl::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner TapChangerControl::declare() return BaseClassDefiner(TapChangerControl::addConstructToMap, TapChangerControl::addPrimitiveAssignFnsToMap, TapChangerControl::addClassAssignFnsToMap, TapChangerControl::debugName); } - +namespace CIMPP +{ + BaseClass* TapChangerControl_factory() + { + return new TapChangerControl; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TapChangerControl.hpp b/CGMES_2.4.15_27JAN2020/TapChangerControl.hpp index e9821b381..7e19b5b7a 100644 --- a/CGMES_2.4.15_27JAN2020/TapChangerControl.hpp +++ b/CGMES_2.4.15_27JAN2020/TapChangerControl.hpp @@ -1,38 +1,39 @@ #ifndef TapChangerControl_H #define TapChangerControl_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "RegulatingControl.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "RegulatingControl.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TapChanger; -class TapChanger; /* Describes behavior specific to tap changers, e.g. how the voltage at the end of a line varies with the load level and compensation of the voltage drop by tap adjustment. */ - class TapChangerControl: public RegulatingControl + class TapChangerControl : public RegulatingControl { - public: - std::list TapChanger; /* The regulating control scheme in which this tap changer participates. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapChangerControl(); - virtual ~TapChangerControl(); - + ~TapChangerControl() override; + + std::list TapChanger; /* The regulating control scheme in which this tap changer participates. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapChangerControl_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.cpp b/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.cpp index 07ea24148..764d42bac 100644 --- a/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.cpp +++ b/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapChangerTablePoint.hpp" +#include +#include + #include "PerCent.hpp" #include "PerCent.hpp" #include "PerCent.hpp" @@ -12,100 +16,107 @@ using namespace CIMPP; TapChangerTablePoint::TapChangerTablePoint() {}; - TapChangerTablePoint::~TapChangerTablePoint() {}; +bool assign_TapChangerTablePoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->b; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->g; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ratio; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->step; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TapChangerTablePoint_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->x; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TapChangerTablePoint_b(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->b; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_g(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->g; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_ratio(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ratio; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_step(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->step; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TapChangerTablePoint_x(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TapChangerTablePoint* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->x; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* TapChangerTablePoint_factory() { - return new TapChangerTablePoint; - } +const char TapChangerTablePoint::debugName[] = "TapChangerTablePoint"; +const char* TapChangerTablePoint::debugString() const +{ + return TapChangerTablePoint::debugName; } -void TapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) { +void TapChangerTablePoint::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint"), &TapChangerTablePoint_factory)); } -void TapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint.b"), &assign_TapChangerTablePoint_b)); assign_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint.g"), &assign_TapChangerTablePoint_g)); assign_map.insert(std::make_pair(std::string("cim:TapChangerTablePoint.r"), &assign_TapChangerTablePoint_r)); @@ -114,13 +125,8 @@ void TapChangerTablePoint::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char TapChangerTablePoint::debugName[] = "TapChangerTablePoint"; -const char* TapChangerTablePoint::debugString() +void TapChangerTablePoint::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapChangerTablePoint::debugName; } const BaseClassDefiner TapChangerTablePoint::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner TapChangerTablePoint::declare() return BaseClassDefiner(TapChangerTablePoint::addConstructToMap, TapChangerTablePoint::addPrimitiveAssignFnsToMap, TapChangerTablePoint::addClassAssignFnsToMap, TapChangerTablePoint::debugName); } - +namespace CIMPP +{ + BaseClass* TapChangerTablePoint_factory() + { + return new TapChangerTablePoint; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.hpp b/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.hpp index ad798ee16..72c16526f 100644 --- a/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.hpp +++ b/CGMES_2.4.15_27JAN2020/TapChangerTablePoint.hpp @@ -1,45 +1,43 @@ #ifndef TapChangerTablePoint_H #define TapChangerTablePoint_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Integer.hpp" #include "PerCent.hpp" #include "Simple_Float.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ - /* - - */ - class TapChangerTablePoint: public BaseClass + class TapChangerTablePoint : public BaseClass { - public: - CIMPP::PerCent b; /* The magnetizing branch susceptance deviation in percent of nominal value. The actual susceptance is calculated as follows: calculated magnetizing susceptance = b(nominal) * (1 + b(from this class)/100). The b(nominal) is defined as the static magnetizing susceptance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - CIMPP::PerCent g; /* The magnetizing branch conductance deviation in percent of nominal value. The actual conductance is calculated as follows: calculated magnetizing conductance = g(nominal) * (1 + g(from this class)/100). The g(nominal) is defined as the static magnetizing conductance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - CIMPP::PerCent r; /* The resistance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated resistance = r(nominal) * (1 + r(from this class)/100). The r(nominal) is defined as the static resistance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - CIMPP::Simple_Float ratio; /* The voltage ratio in per unit. Hence this is a value close to one. Default: nullptr */ - CIMPP::Integer step; /* The tap step. Default: 0 */ - CIMPP::PerCent x; /* The series reactance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated reactance = x(nominal) * (1 + x(from this class)/100). The x(nominal) is defined as the static series reactance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapChangerTablePoint(); - virtual ~TapChangerTablePoint(); - + ~TapChangerTablePoint() override; + + CIMPP::PerCent b; /* The magnetizing branch susceptance deviation in percent of nominal value. The actual susceptance is calculated as follows: calculated magnetizing susceptance = b(nominal) * (1 + b(from this class)/100). The b(nominal) is defined as the static magnetizing susceptance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + CIMPP::PerCent g; /* The magnetizing branch conductance deviation in percent of nominal value. The actual conductance is calculated as follows: calculated magnetizing conductance = g(nominal) * (1 + g(from this class)/100). The g(nominal) is defined as the static magnetizing conductance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + CIMPP::PerCent r; /* The resistance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated resistance = r(nominal) * (1 + r(from this class)/100). The r(nominal) is defined as the static resistance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + CIMPP::Simple_Float ratio; /* The voltage ratio in per unit. Hence this is a value close to one. Default: nullptr */ + CIMPP::Integer step; /* The tap step. Default: 0 */ + CIMPP::PerCent x; /* The series reactance deviation in percent of nominal value. The actual reactance is calculated as follows: calculated reactance = x(nominal) * (1 + x(from this class)/100). The x(nominal) is defined as the static series reactance on the associated power transformer end or ends. This model assumes the star impedance (pi model) form. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapChangerTablePoint_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TapSchedule.cpp b/CGMES_2.4.15_27JAN2020/TapSchedule.cpp index 231c62bb5..638119eee 100644 --- a/CGMES_2.4.15_27JAN2020/TapSchedule.cpp +++ b/CGMES_2.4.15_27JAN2020/TapSchedule.cpp @@ -1,49 +1,56 @@ -#include -#include "SeasonDayTypeSchedule.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TapSchedule.hpp" +#include +#include + #include "TapChanger.hpp" using namespace CIMPP; -TapSchedule::TapSchedule(): TapChanger(nullptr) {}; - +TapSchedule::TapSchedule() : TapChanger(nullptr) {}; TapSchedule::~TapSchedule() {}; -bool assign_TapChanger_TapSchedules(BaseClass*, BaseClass*); -bool assign_TapSchedule_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TapSchedule* element = dynamic_cast(BaseClass_ptr1)) { - element->TapChanger = dynamic_cast(BaseClass_ptr2); - if(element->TapChanger != nullptr) - return assign_TapChanger_TapSchedules(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* TapSchedule_factory() { - return new TapSchedule; +bool assign_TapChanger_TapSchedules(BaseClass*, BaseClass*); +bool assign_TapSchedule_TapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TapSchedule* element = dynamic_cast(BaseClass_ptr1); + TapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TapChanger != element2) + { + element->TapChanger = element2; + return assign_TapChanger_TapSchedules(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TapSchedule::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:TapSchedule"), &TapSchedule_factory)); +const char TapSchedule::debugName[] = "TapSchedule"; +const char* TapSchedule::debugString() const +{ + return TapSchedule::debugName; } -void TapSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void TapSchedule::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:TapSchedule"), &TapSchedule_factory)); +} -void TapSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TapSchedule.TapChanger"), &assign_TapSchedule_TapChanger)); +void TapSchedule::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TapSchedule::debugName[] = "TapSchedule"; -const char* TapSchedule::debugString() +void TapSchedule::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TapSchedule::debugName; + assign_map.insert(std::make_pair(std::string("cim:TapSchedule.TapChanger"), &assign_TapSchedule_TapChanger)); } const BaseClassDefiner TapSchedule::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner TapSchedule::declare() return BaseClassDefiner(TapSchedule::addConstructToMap, TapSchedule::addPrimitiveAssignFnsToMap, TapSchedule::addClassAssignFnsToMap, TapSchedule::debugName); } - +namespace CIMPP +{ + BaseClass* TapSchedule_factory() + { + return new TapSchedule; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TapSchedule.hpp b/CGMES_2.4.15_27JAN2020/TapSchedule.hpp index 2249aa7a5..540c7935e 100644 --- a/CGMES_2.4.15_27JAN2020/TapSchedule.hpp +++ b/CGMES_2.4.15_27JAN2020/TapSchedule.hpp @@ -1,38 +1,39 @@ #ifndef TapSchedule_H #define TapSchedule_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "SeasonDayTypeSchedule.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "SeasonDayTypeSchedule.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TapChanger; -class TapChanger; /* A pre-established pattern over time for a tap step. */ - class TapSchedule: public SeasonDayTypeSchedule + class TapSchedule : public SeasonDayTypeSchedule { - public: - CIMPP::TapChanger* TapChanger; /* A TapChanger can have TapSchedules. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TapSchedule(); - virtual ~TapSchedule(); - + ~TapSchedule() override; + + CIMPP::TapChanger* TapChanger; /* A TapChanger can have TapSchedules. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TapSchedule_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Temperature.cpp b/CGMES_2.4.15_27JAN2020/Temperature.cpp index 7b29f89d5..3a788af85 100644 --- a/CGMES_2.4.15_27JAN2020/Temperature.cpp +++ b/CGMES_2.4.15_27JAN2020/Temperature.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Temperature.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Temperature::Temperature() {} -Temperature::~Temperature(){} +#include -Temperature::Temperature(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Temperature::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Temperature::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Temperature& Temperature::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Temperature::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Temperature::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Temperature::debugName[] = "Temperature"; -const char* Temperature::debugString() { +const char* Temperature::debugString() const +{ return Temperature::debugName; } - -const BaseClassDefiner Temperature::declare() { - return BaseClassDefiner(Temperature::addConstructToMap, Temperature::addPrimitiveAssignFnsToMap, Temperature::addClassAssignFnsToMap, Temperature::debugName); +Temperature& Temperature::operator+=(const Temperature& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Temperature& Temperature::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Temperature& Temperature::operator-=(const Temperature& rhs) { - value -= rhs.value; - return *this; - } - - Temperature& Temperature::operator*=(const Temperature& rhs) { - value *= rhs.value; - return *this; - } - - Temperature& Temperature::operator/=(const Temperature& rhs) { - value /= rhs.value; - return *this; - } +Temperature& Temperature::operator-=(const Temperature& rhs) +{ + value -= rhs.value; + return *this; +} - Temperature& Temperature::operator+=(const Temperature& rhs) { - value += rhs.value; - return *this; - } +Temperature& Temperature::operator*=(const Temperature& rhs) +{ + value *= rhs.value; + return *this; +} - Temperature::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Temperature& Temperature::operator/=(const Temperature& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Temperature& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Temperature& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Temperature& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Temperature.hpp b/CGMES_2.4.15_27JAN2020/Temperature.hpp index e15440197..33ba8ea2b 100644 --- a/CGMES_2.4.15_27JAN2020/Temperature.hpp +++ b/CGMES_2.4.15_27JAN2020/Temperature.hpp @@ -1,38 +1,39 @@ #ifndef Temperature_H #define Temperature_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Temperature : public BaseClass + /* + Value of temperature in degrees Celsius. + */ + class Temperature { - public: - Temperature(); - virtual ~Temperature(); - Temperature(long double value); - static const BaseClassDefiner declare(); - Temperature& operator=(long double &rop); + Temperature() : value(0.0), initialized(false) {} + Temperature(long double value) : value(value), initialized(true) {} + + Temperature& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Temperature& operator+=(const Temperature& rhs); Temperature& operator-=(const Temperature& rhs); Temperature& operator*=(const Temperature& rhs); Temperature& operator/=(const Temperature& rhs); + friend std::istream& operator>>(std::istream& lop, Temperature& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Temperature& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/Terminal.cpp b/CGMES_2.4.15_27JAN2020/Terminal.cpp index 9bb47df2b..76c977550 100644 --- a/CGMES_2.4.15_27JAN2020/Terminal.cpp +++ b/CGMES_2.4.15_27JAN2020/Terminal.cpp @@ -1,191 +1,272 @@ -#include -#include "ACDCTerminal.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Terminal.hpp" -#include "ACDCConverter.hpp" +#include +#include + #include "ConductingEquipment.hpp" -#include "PhaseCode.hpp" -#include "RegulatingControl.hpp" -#include "TieFlow.hpp" -#include "TransformerEnd.hpp" #include "ConnectivityNode.hpp" +#include "ACDCConverter.hpp" #include "MutualCoupling.hpp" #include "MutualCoupling.hpp" -#include "SvPowerFlow.hpp" +#include "RegulatingControl.hpp" #include "RemoteInputSignal.hpp" +#include "SvPowerFlow.hpp" +#include "TieFlow.hpp" #include "TopologicalNode.hpp" +#include "TransformerEnd.hpp" +#include "PhaseCode.hpp" using namespace CIMPP; -Terminal::Terminal(): ConductingEquipment(nullptr), RegulatingControl(nullptr), TieFlow(nullptr), ConnectivityNode(nullptr), SvPowerFlow(nullptr), TopologicalNode(nullptr) {}; - +Terminal::Terminal() : ConductingEquipment(nullptr), ConnectivityNode(nullptr), RegulatingControl(nullptr), SvPowerFlow(nullptr), TopologicalNode(nullptr) {}; Terminal::~Terminal() {}; -bool assign_Terminal_ConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConverterDCSides.push_back(dynamic_cast(BaseClass_ptr2)); + + + + + + + + + + + +bool assign_Terminal_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (Terminal* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->phases; + if (buffer.fail()) + return false; + else return true; - } } return false; } + bool assign_ConductingEquipment_Terminals(BaseClass*, BaseClass*); -bool assign_Terminal_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->ConductingEquipment = dynamic_cast(BaseClass_ptr2); - if(element->ConductingEquipment != nullptr) - return assign_ConductingEquipment_Terminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - - -bool assign_Terminal_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->RegulatingControl = dynamic_cast(BaseClass_ptr2); - if(element->RegulatingControl != nullptr) - return true; - } - return false; -} - -bool assign_Terminal_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->TieFlow = dynamic_cast(BaseClass_ptr2); - if(element->TieFlow != nullptr) - return true; - } - return false; -} - -bool assign_Terminal_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TransformerEnd.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Terminal_ConductingEquipment(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + ConductingEquipment* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConductingEquipment != element2) + { + element->ConductingEquipment = element2; + return assign_ConductingEquipment_Terminals(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } bool assign_ConnectivityNode_Terminals(BaseClass*, BaseClass*); -bool assign_Terminal_ConnectivityNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->ConnectivityNode = dynamic_cast(BaseClass_ptr2); - if(element->ConnectivityNode != nullptr) - return assign_ConnectivityNode_Terminals(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_Terminal_HasFirstMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HasFirstMutualCoupling.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Terminal_ConnectivityNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConnectivityNode != element2) + { + element->ConnectivityNode = element2; + return assign_ConnectivityNode_Terminals(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Terminal_HasSecondMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->HasSecondMutualCoupling.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_ACDCConverter_PccTerminal(BaseClass*, BaseClass*); +bool assign_Terminal_ConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + ACDCConverter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConverterDCSides.begin(), element->ConverterDCSides.end(), element2) == element->ConverterDCSides.end()) + { + element->ConverterDCSides.push_back(element2); + return assign_ACDCConverter_PccTerminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_Terminal_SvPowerFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->SvPowerFlow = dynamic_cast(BaseClass_ptr2); - if(element->SvPowerFlow != nullptr) - return true; - } - return false; +bool assign_MutualCoupling_First_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_HasFirstMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + MutualCoupling* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HasFirstMutualCoupling.begin(), element->HasFirstMutualCoupling.end(), element2) == element->HasFirstMutualCoupling.end()) + { + element->HasFirstMutualCoupling.push_back(element2); + return assign_MutualCoupling_First_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_Terminal_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RemoteInputSignal.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_MutualCoupling_Second_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_HasSecondMutualCoupling(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + MutualCoupling* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->HasSecondMutualCoupling.begin(), element->HasSecondMutualCoupling.end(), element2) == element->HasSecondMutualCoupling.end()) + { + element->HasSecondMutualCoupling.push_back(element2); + return assign_MutualCoupling_Second_Terminal(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_TopologicalNode_Terminal(BaseClass*, BaseClass*); -bool assign_Terminal_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalNode != nullptr) - return assign_TopologicalNode_Terminal(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_RegulatingControl_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_RegulatingControl(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + RegulatingControl* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RegulatingControl != element2) + { + element->RegulatingControl = element2; + return assign_RegulatingControl_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -bool assign_Terminal_phases(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(Terminal* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->phases; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RemoteInputSignal_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RemoteInputSignal.begin(), element->RemoteInputSignal.end(), element2) == element->RemoteInputSignal.end()) + { + element->RemoteInputSignal.push_back(element2); + return assign_RemoteInputSignal_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_SvPowerFlow_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_SvPowerFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + SvPowerFlow* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvPowerFlow != element2) + { + element->SvPowerFlow = element2; + return assign_SvPowerFlow_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_TieFlow_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_TieFlow(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + TieFlow* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TieFlow.begin(), element->TieFlow.end(), element2) == element->TieFlow.end()) + { + element->TieFlow.push_back(element2); + return assign_TieFlow_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_TopologicalNode_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_TopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalNode != element2) + { + element->TopologicalNode = element2; + return assign_TopologicalNode_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_TransformerEnd_Terminal(BaseClass*, BaseClass*); +bool assign_Terminal_TransformerEnd(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + Terminal* element = dynamic_cast(BaseClass_ptr1); + TransformerEnd* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TransformerEnd.begin(), element->TransformerEnd.end(), element2) == element->TransformerEnd.end()) + { + element->TransformerEnd.push_back(element2); + return assign_TransformerEnd_Terminal(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} - - - - -namespace CIMPP { - BaseClass* Terminal_factory() { - return new Terminal; - } +const char Terminal::debugName[] = "Terminal"; +const char* Terminal::debugString() const +{ + return Terminal::debugName; } -void Terminal::addConstructToMap(std::unordered_map& factory_map) { +void Terminal::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:Terminal"), &Terminal_factory)); } -void Terminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Terminal.phases"), &assign_Terminal_phases)); - } +void Terminal::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:Terminal.phases"), &assign_Terminal_phases)); +} -void Terminal::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:Terminal.ConverterDCSides"), &assign_Terminal_ConverterDCSides)); +void Terminal::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:Terminal.ConductingEquipment"), &assign_Terminal_ConductingEquipment)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.RegulatingControl"), &assign_Terminal_RegulatingControl)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.TieFlow"), &assign_Terminal_TieFlow)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.TransformerEnd"), &assign_Terminal_TransformerEnd)); assign_map.insert(std::make_pair(std::string("cim:Terminal.ConnectivityNode"), &assign_Terminal_ConnectivityNode)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.ConverterDCSides"), &assign_Terminal_ConverterDCSides)); assign_map.insert(std::make_pair(std::string("cim:Terminal.HasFirstMutualCoupling"), &assign_Terminal_HasFirstMutualCoupling)); assign_map.insert(std::make_pair(std::string("cim:Terminal.HasSecondMutualCoupling"), &assign_Terminal_HasSecondMutualCoupling)); - assign_map.insert(std::make_pair(std::string("cim:Terminal.SvPowerFlow"), &assign_Terminal_SvPowerFlow)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.RegulatingControl"), &assign_Terminal_RegulatingControl)); assign_map.insert(std::make_pair(std::string("cim:Terminal.RemoteInputSignal"), &assign_Terminal_RemoteInputSignal)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.SvPowerFlow"), &assign_Terminal_SvPowerFlow)); + assign_map.insert(std::make_pair(std::string("cim:Terminal.TieFlow"), &assign_Terminal_TieFlow)); assign_map.insert(std::make_pair(std::string("cim:Terminal.TopologicalNode"), &assign_Terminal_TopologicalNode)); -} - -const char Terminal::debugName[] = "Terminal"; -const char* Terminal::debugString() -{ - return Terminal::debugName; + assign_map.insert(std::make_pair(std::string("cim:Terminal.TransformerEnd"), &assign_Terminal_TransformerEnd)); } const BaseClassDefiner Terminal::declare() @@ -193,4 +274,10 @@ const BaseClassDefiner Terminal::declare() return BaseClassDefiner(Terminal::addConstructToMap, Terminal::addPrimitiveAssignFnsToMap, Terminal::addClassAssignFnsToMap, Terminal::debugName); } - +namespace CIMPP +{ + BaseClass* Terminal_factory() + { + return new Terminal; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Terminal.hpp b/CGMES_2.4.15_27JAN2020/Terminal.hpp index b4962b205..410b5d9b5 100644 --- a/CGMES_2.4.15_27JAN2020/Terminal.hpp +++ b/CGMES_2.4.15_27JAN2020/Terminal.hpp @@ -1,59 +1,60 @@ #ifndef Terminal_H #define Terminal_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCTerminal.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "ACDCTerminal.hpp" +#include "BaseClassDefiner.hpp" #include "PhaseCode.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ACDCConverter; + class ConductingEquipment; + class ConnectivityNode; + class MutualCoupling; + class RegulatingControl; + class RemoteInputSignal; + class SvPowerFlow; + class TieFlow; + class TopologicalNode; + class TransformerEnd; - -class ACDCConverter; -class ConductingEquipment; -class RegulatingControl; -class TieFlow; -class TransformerEnd; -class ConnectivityNode; -class MutualCoupling; -class SvPowerFlow; -class RemoteInputSignal; -class TopologicalNode; /* An AC electrical connection point to a piece of conducting equipment. Terminals are connected at physical connection points called connectivity nodes. */ - class Terminal: public ACDCTerminal + class Terminal : public ACDCTerminal { - public: - std::list ConverterDCSides; /* Point of common coupling terminal for this converter DC side. It is typically the terminal on the power transformer (or switch) closest to the AC network. The power flow measurement must be the sum of all flows into the transformer. Default: 0 */ - CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment of the terminal. Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ - CIMPP::PhaseCode phases; /* Represents the normal network phasing condition. If the attribute is missing three phases (ABC or ABCN) shall be assumed. Default: 0 */ - CIMPP::RegulatingControl* RegulatingControl; /* The terminal associated with this regulating control. The terminal is associated instead of a node, since the terminal could connect into either a topological node (bus in bus-branch model) or a connectivity node (detailed switch model). Sometimes it is useful to model regulation at a terminal of a bus bar object since the bus bar can be present in both a bus-branch model or a model with switch detail. Default: 0 */ - CIMPP::TieFlow* TieFlow; /* The control area tie flows to which this terminal associates. Default: 0 */ - std::list TransformerEnd; /* All transformer ends connected at this terminal. Default: 0 */ - CIMPP::ConnectivityNode* ConnectivityNode; /* Terminals interconnected with zero impedance at a this connectivity node. Default: 0 */ - std::list HasFirstMutualCoupling; /* Mutual couplings associated with the branch as the first branch. Default: 0 */ - std::list HasSecondMutualCoupling; /* Mutual couplings with the branch associated as the first branch. Default: 0 */ - CIMPP::SvPowerFlow* SvPowerFlow; /* The power flow state variable associated with the terminal. Default: 0 */ - std::list RemoteInputSignal; /* Input signal coming from this terminal. Default: 0 */ - CIMPP::TopologicalNode* TopologicalNode; /* The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, thus making it unneccesary to model connectivity nodes in some cases. Note that if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ Terminal(); - virtual ~Terminal(); - + ~Terminal() override; + + CIMPP::ConductingEquipment* ConductingEquipment; /* The conducting equipment of the terminal. Conducting equipment have terminals that may be connected to other conducting equipment terminals via connectivity nodes or topological nodes. Default: 0 */ + CIMPP::ConnectivityNode* ConnectivityNode; /* Terminals interconnected with zero impedance at a this connectivity node. Default: 0 */ + std::list ConverterDCSides; /* Point of common coupling terminal for this converter DC side. It is typically the terminal on the power transformer (or switch) closest to the AC network. The power flow measurement must be the sum of all flows into the transformer. Default: 0 */ + std::list HasFirstMutualCoupling; /* Mutual couplings associated with the branch as the first branch. Default: 0 */ + std::list HasSecondMutualCoupling; /* Mutual couplings with the branch associated as the first branch. Default: 0 */ + CIMPP::RegulatingControl* RegulatingControl; /* The terminal associated with this regulating control. The terminal is associated instead of a node, since the terminal could connect into either a topological node (bus in bus-branch model) or a connectivity node (detailed switch model). Sometimes it is useful to model regulation at a terminal of a bus bar object since the bus bar can be present in both a bus-branch model or a model with switch detail. Default: 0 */ + std::list RemoteInputSignal; /* Input signal coming from this terminal. Default: 0 */ + CIMPP::SvPowerFlow* SvPowerFlow; /* The power flow state variable associated with the terminal. Default: 0 */ + std::list TieFlow; /* The control area tie flows to which this terminal associates. Default: 0 */ + CIMPP::TopologicalNode* TopologicalNode; /* The terminals associated with the topological node. This can be used as an alternative to the connectivity node path to terminal, thus making it unneccesary to model connectivity nodes in some cases. Note that if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ + std::list TransformerEnd; /* All transformer ends connected at this terminal. Default: 0 */ + CIMPP::PhaseCode phases; /* Represents the normal network phasing condition. If the attribute is missing three phases (ABC or ABCN) shall be assumed. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* Terminal_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TextDiagramObject.cpp b/CGMES_2.4.15_27JAN2020/TextDiagramObject.cpp index f8486b0ce..df7e44767 100644 --- a/CGMES_2.4.15_27JAN2020/TextDiagramObject.cpp +++ b/CGMES_2.4.15_27JAN2020/TextDiagramObject.cpp @@ -1,22 +1,25 @@ -#include -#include "DiagramObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TextDiagramObject.hpp" +#include +#include + #include "String.hpp" using namespace CIMPP; TextDiagramObject::TextDiagramObject() {}; - TextDiagramObject::~TextDiagramObject() {}; - - -bool assign_TextDiagramObject_text(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TextDiagramObject* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TextDiagramObject_text(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TextDiagramObject* element = dynamic_cast(BaseClass_ptr1)) + { element->text = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -24,27 +27,26 @@ bool assign_TextDiagramObject_text(std::stringstream &buffer, BaseClass* BaseCla return false; } -namespace CIMPP { - BaseClass* TextDiagramObject_factory() { - return new TextDiagramObject; - } + + +const char TextDiagramObject::debugName[] = "TextDiagramObject"; +const char* TextDiagramObject::debugString() const +{ + return TextDiagramObject::debugName; } -void TextDiagramObject::addConstructToMap(std::unordered_map& factory_map) { +void TextDiagramObject::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TextDiagramObject"), &TextDiagramObject_factory)); } -void TextDiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TextDiagramObject::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TextDiagramObject.text"), &assign_TextDiagramObject_text)); } -void TextDiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char TextDiagramObject::debugName[] = "TextDiagramObject"; -const char* TextDiagramObject::debugString() +void TextDiagramObject::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TextDiagramObject::debugName; } const BaseClassDefiner TextDiagramObject::declare() @@ -52,4 +54,10 @@ const BaseClassDefiner TextDiagramObject::declare() return BaseClassDefiner(TextDiagramObject::addConstructToMap, TextDiagramObject::addPrimitiveAssignFnsToMap, TextDiagramObject::addClassAssignFnsToMap, TextDiagramObject::debugName); } - +namespace CIMPP +{ + BaseClass* TextDiagramObject_factory() + { + return new TextDiagramObject; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TextDiagramObject.hpp b/CGMES_2.4.15_27JAN2020/TextDiagramObject.hpp index 2e7c4c272..a683f51d4 100644 --- a/CGMES_2.4.15_27JAN2020/TextDiagramObject.hpp +++ b/CGMES_2.4.15_27JAN2020/TextDiagramObject.hpp @@ -1,38 +1,39 @@ #ifndef TextDiagramObject_H #define TextDiagramObject_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DiagramObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "DiagramObject.hpp" +#include "BaseClassDefiner.hpp" #include "String.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A diagram object for placing free-text or text derived from an associated domain object. */ - class TextDiagramObject: public DiagramObject + class TextDiagramObject : public DiagramObject { - public: - CIMPP::String text; /* The text that is displayed by this text diagram object. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TextDiagramObject(); - virtual ~TextDiagramObject(); - + ~TextDiagramObject() override; + + CIMPP::String text; /* The text that is displayed by this text diagram object. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TextDiagramObject_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.cpp index b99b3b9f5..976f64b7b 100644 --- a/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.cpp @@ -1,49 +1,56 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ThermalGeneratingUnit.hpp" +#include +#include + #include "FossilFuel.hpp" using namespace CIMPP; ThermalGeneratingUnit::ThermalGeneratingUnit() {}; - ThermalGeneratingUnit::~ThermalGeneratingUnit() {}; -bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ThermalGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->FossilFuels.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_FossilFuel_ThermalGeneratingUnit(BaseClass*, BaseClass*); +bool assign_ThermalGeneratingUnit_FossilFuels(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ThermalGeneratingUnit* element = dynamic_cast(BaseClass_ptr1); + FossilFuel* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->FossilFuels.begin(), element->FossilFuels.end(), element2) == element->FossilFuels.end()) + { + element->FossilFuels.push_back(element2); + return assign_FossilFuel_ThermalGeneratingUnit(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* ThermalGeneratingUnit_factory() { - return new ThermalGeneratingUnit; - } +const char ThermalGeneratingUnit::debugName[] = "ThermalGeneratingUnit"; +const char* ThermalGeneratingUnit::debugString() const +{ + return ThermalGeneratingUnit::debugName; } -void ThermalGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void ThermalGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ThermalGeneratingUnit"), &ThermalGeneratingUnit_factory)); } -void ThermalGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void ThermalGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ThermalGeneratingUnit.FossilFuels"), &assign_ThermalGeneratingUnit_FossilFuels)); +void ThermalGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char ThermalGeneratingUnit::debugName[] = "ThermalGeneratingUnit"; -const char* ThermalGeneratingUnit::debugString() +void ThermalGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ThermalGeneratingUnit::debugName; + assign_map.insert(std::make_pair(std::string("cim:ThermalGeneratingUnit.FossilFuels"), &assign_ThermalGeneratingUnit_FossilFuels)); } const BaseClassDefiner ThermalGeneratingUnit::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner ThermalGeneratingUnit::declare() return BaseClassDefiner(ThermalGeneratingUnit::addConstructToMap, ThermalGeneratingUnit::addPrimitiveAssignFnsToMap, ThermalGeneratingUnit::addClassAssignFnsToMap, ThermalGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* ThermalGeneratingUnit_factory() + { + return new ThermalGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.hpp index db6b51ce3..ea4d6ff7c 100644 --- a/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/ThermalGeneratingUnit.hpp @@ -1,38 +1,39 @@ #ifndef ThermalGeneratingUnit_H #define ThermalGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class FossilFuel; -class FossilFuel; /* A generating unit whose prime mover could be a steam turbine, combustion turbine, or diesel engine. */ - class ThermalGeneratingUnit: public GeneratingUnit + class ThermalGeneratingUnit : public GeneratingUnit { - public: - std::list FossilFuels; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ThermalGeneratingUnit(); - virtual ~ThermalGeneratingUnit(); - + ~ThermalGeneratingUnit() override; + + std::list FossilFuels; /* A thermal generating unit may have one or more fossil fuels. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ThermalGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TieFlow.cpp b/CGMES_2.4.15_27JAN2020/TieFlow.cpp index e7e5bc532..f7f2139c5 100644 --- a/CGMES_2.4.15_27JAN2020/TieFlow.cpp +++ b/CGMES_2.4.15_27JAN2020/TieFlow.cpp @@ -1,77 +1,92 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TieFlow.hpp" -#include "Terminal.hpp" +#include +#include + #include "ControlArea.hpp" +#include "Terminal.hpp" #include "Boolean.hpp" using namespace CIMPP; -TieFlow::TieFlow(): Terminal(nullptr), ControlArea(nullptr) {}; - +TieFlow::TieFlow() : ControlArea(nullptr), Terminal(nullptr) {}; TieFlow::~TieFlow() {}; -bool assign_Terminal_TieFlow(BaseClass*, BaseClass*); -bool assign_TieFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TieFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_TieFlow(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_ControlArea_TieFlow(BaseClass*, BaseClass*); -bool assign_TieFlow_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TieFlow* element = dynamic_cast(BaseClass_ptr1)) { - element->ControlArea = dynamic_cast(BaseClass_ptr2); - if(element->ControlArea != nullptr) - return assign_ControlArea_TieFlow(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_TieFlow_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TieFlow* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->positiveFlowIn; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TieFlow_positiveFlowIn(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TieFlow* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->positiveFlowIn; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ControlArea_TieFlow(BaseClass*, BaseClass*); +bool assign_TieFlow_ControlArea(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TieFlow* element = dynamic_cast(BaseClass_ptr1); + ControlArea* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ControlArea != element2) + { + element->ControlArea = element2; + return assign_ControlArea_TieFlow(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* TieFlow_factory() { - return new TieFlow; +bool assign_Terminal_TieFlow(BaseClass*, BaseClass*); +bool assign_TieFlow_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TieFlow* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_TieFlow(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TieFlow::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:TieFlow"), &TieFlow_factory)); + +const char TieFlow::debugName[] = "TieFlow"; +const char* TieFlow::debugString() const +{ + return TieFlow::debugName; } -void TieFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TieFlow.positiveFlowIn"), &assign_TieFlow_positiveFlowIn)); +void TieFlow::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:TieFlow"), &TieFlow_factory)); } -void TieFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TieFlow.Terminal"), &assign_TieFlow_Terminal)); - assign_map.insert(std::make_pair(std::string("cim:TieFlow.ControlArea"), &assign_TieFlow_ControlArea)); - } +void TieFlow::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TieFlow.positiveFlowIn"), &assign_TieFlow_positiveFlowIn)); +} -const char TieFlow::debugName[] = "TieFlow"; -const char* TieFlow::debugString() +void TieFlow::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TieFlow::debugName; + assign_map.insert(std::make_pair(std::string("cim:TieFlow.ControlArea"), &assign_TieFlow_ControlArea)); + assign_map.insert(std::make_pair(std::string("cim:TieFlow.Terminal"), &assign_TieFlow_Terminal)); } const BaseClassDefiner TieFlow::declare() @@ -79,4 +94,10 @@ const BaseClassDefiner TieFlow::declare() return BaseClassDefiner(TieFlow::addConstructToMap, TieFlow::addPrimitiveAssignFnsToMap, TieFlow::addClassAssignFnsToMap, TieFlow::debugName); } - +namespace CIMPP +{ + BaseClass* TieFlow_factory() + { + return new TieFlow; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TieFlow.hpp b/CGMES_2.4.15_27JAN2020/TieFlow.hpp index e9f044a7c..2e02b52d2 100644 --- a/CGMES_2.4.15_27JAN2020/TieFlow.hpp +++ b/CGMES_2.4.15_27JAN2020/TieFlow.hpp @@ -1,42 +1,43 @@ #ifndef TieFlow_H #define TieFlow_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ControlArea; + class Terminal; -class Terminal; -class ControlArea; /* A flow specification in terms of location and direction for a control area. */ - class TieFlow: public BaseClass + class TieFlow : public BaseClass { - public: - CIMPP::Terminal* Terminal; /* The terminal to which this tie flow belongs. Default: 0 */ - CIMPP::ControlArea* ControlArea; /* The control area of the tie flows. Default: 0 */ - CIMPP::Boolean positiveFlowIn; /* True if the flow into the terminal (load convention) is also flow into the control area. For example, this attribute should be true if using the tie line terminal further away from the control area. For example to represent a tie to a shunt component (like a load or generator) in another area, this is the near end of a branch and this attribute would be specified as false. Default: false */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TieFlow(); - virtual ~TieFlow(); - + ~TieFlow() override; + + CIMPP::ControlArea* ControlArea; /* The control area of the tie flows. Default: 0 */ + CIMPP::Terminal* Terminal; /* The terminal to which this tie flow belongs. Default: 0 */ + CIMPP::Boolean positiveFlowIn; /* True if the flow into the terminal (load convention) is also flow into the control area. For example, this attribute should be true if using the tie line terminal further away from the control area. For example to represent a tie to a shunt component (like a load or generator) in another area, this is the near end of a branch and this attribute would be specified as false. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TieFlow_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TopologicalIsland.cpp b/CGMES_2.4.15_27JAN2020/TopologicalIsland.cpp index baf70c708..8ee4fba25 100644 --- a/CGMES_2.4.15_27JAN2020/TopologicalIsland.cpp +++ b/CGMES_2.4.15_27JAN2020/TopologicalIsland.cpp @@ -1,62 +1,76 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologicalIsland.hpp" +#include +#include + #include "TopologicalNode.hpp" #include "TopologicalNode.hpp" using namespace CIMPP; -TopologicalIsland::TopologicalIsland(): AngleRefTopologicalNode(nullptr) {}; - +TopologicalIsland::TopologicalIsland() : AngleRefTopologicalNode(nullptr) {}; TopologicalIsland::~TopologicalIsland() {}; + + + bool assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass*, BaseClass*); -bool assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalIsland* element = dynamic_cast(BaseClass_ptr1)) { - element->AngleRefTopologicalNode = dynamic_cast(BaseClass_ptr2); - if(element->AngleRefTopologicalNode != nullptr) - return assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalIsland* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AngleRefTopologicalNode != element2) + { + element->AngleRefTopologicalNode = element2; + return assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TopologicalIsland_TopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalIsland* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->TopologicalNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_TopologicalNode_TopologicalIsland(BaseClass*, BaseClass*); +bool assign_TopologicalIsland_TopologicalNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalIsland* element = dynamic_cast(BaseClass_ptr1); + TopologicalNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->TopologicalNodes.begin(), element->TopologicalNodes.end(), element2) == element->TopologicalNodes.end()) + { + element->TopologicalNodes.push_back(element2); + return assign_TopologicalNode_TopologicalIsland(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* TopologicalIsland_factory() { - return new TopologicalIsland; - } +const char TopologicalIsland::debugName[] = "TopologicalIsland"; +const char* TopologicalIsland::debugString() const +{ + return TopologicalIsland::debugName; } -void TopologicalIsland::addConstructToMap(std::unordered_map& factory_map) { +void TopologicalIsland::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologicalIsland"), &TopologicalIsland_factory)); } -void TopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void TopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.AngleRefTopologicalNode"), &assign_TopologicalIsland_AngleRefTopologicalNode)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.TopologicalNodes"), &assign_TopologicalIsland_TopologicalNodes)); +void TopologicalIsland::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TopologicalIsland::debugName[] = "TopologicalIsland"; -const char* TopologicalIsland::debugString() +void TopologicalIsland::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TopologicalIsland::debugName; + assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.AngleRefTopologicalNode"), &assign_TopologicalIsland_AngleRefTopologicalNode)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalIsland.TopologicalNodes"), &assign_TopologicalIsland_TopologicalNodes)); } const BaseClassDefiner TopologicalIsland::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner TopologicalIsland::declare() return BaseClassDefiner(TopologicalIsland::addConstructToMap, TopologicalIsland::addPrimitiveAssignFnsToMap, TopologicalIsland::addClassAssignFnsToMap, TopologicalIsland::debugName); } - +namespace CIMPP +{ + BaseClass* TopologicalIsland_factory() + { + return new TopologicalIsland; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TopologicalIsland.hpp b/CGMES_2.4.15_27JAN2020/TopologicalIsland.hpp index 74cbc0821..8ddaccfbc 100644 --- a/CGMES_2.4.15_27JAN2020/TopologicalIsland.hpp +++ b/CGMES_2.4.15_27JAN2020/TopologicalIsland.hpp @@ -1,39 +1,40 @@ #ifndef TopologicalIsland_H #define TopologicalIsland_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TopologicalNode; -class TopologicalNode; /* An electrically connected subset of the network. Topological islands can change as the current network state changes: e.g. due to - disconnect switches or breakers change state in a SCADA/EMS - manual creation, change or deletion of topological nodes in a planning tool. */ - class TopologicalIsland: public IdentifiedObject + class TopologicalIsland : public IdentifiedObject { - public: - CIMPP::TopologicalNode* AngleRefTopologicalNode; /* The angle reference for the island. Normally there is one TopologicalNode that is selected as the angle reference for each island. Other reference schemes exist, so the association is typically optional. Default: 0 */ - std::list TopologicalNodes; /* A topological node belongs to a topological island. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologicalIsland(); - virtual ~TopologicalIsland(); - + ~TopologicalIsland() override; + + CIMPP::TopologicalNode* AngleRefTopologicalNode; /* The angle reference for the island. Normally there is one TopologicalNode that is selected as the angle reference for each island. Other reference schemes exist, so the association is typically optional. Default: 0 */ + std::list TopologicalNodes; /* A topological node belongs to a topological island. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologicalIsland_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TopologicalNode.cpp b/CGMES_2.4.15_27JAN2020/TopologicalNode.cpp index 136773c57..6d4835b56 100644 --- a/CGMES_2.4.15_27JAN2020/TopologicalNode.cpp +++ b/CGMES_2.4.15_27JAN2020/TopologicalNode.cpp @@ -1,16 +1,20 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologicalNode.hpp" -#include "SvInjection.hpp" -#include "SvVoltage.hpp" -#include "TopologicalIsland.hpp" +#include +#include + #include "TopologicalIsland.hpp" #include "BaseVoltage.hpp" -#include "ConnectivityNode.hpp" #include "ConnectivityNodeContainer.hpp" +#include "ConnectivityNode.hpp" #include "ReportingGroup.hpp" +#include "SvInjection.hpp" +#include "SvVoltage.hpp" #include "Terminal.hpp" +#include "TopologicalIsland.hpp" #include "Boolean.hpp" #include "String.hpp" #include "String.hpp" @@ -21,97 +25,10 @@ using namespace CIMPP; -TopologicalNode::TopologicalNode(): SvInjection(nullptr), SvVoltage(nullptr), AngleRefTopologicalIsland(nullptr), TopologicalIsland(nullptr), BaseVoltage(nullptr), ConnectivityNodeContainer(nullptr), ReportingGroup(nullptr) {}; - +TopologicalNode::TopologicalNode() : AngleRefTopologicalIsland(nullptr), BaseVoltage(nullptr), ConnectivityNodeContainer(nullptr), ReportingGroup(nullptr), SvInjection(nullptr), SvVoltage(nullptr), TopologicalIsland(nullptr) {}; TopologicalNode::~TopologicalNode() {}; -bool assign_TopologicalNode_SvInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->SvInjection = dynamic_cast(BaseClass_ptr2); - if(element->SvInjection != nullptr) - return true; - } - return false; -} - -bool assign_TopologicalNode_SvVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->SvVoltage = dynamic_cast(BaseClass_ptr2); - if(element->SvVoltage != nullptr) - return true; - } - return false; -} - -bool assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->AngleRefTopologicalIsland = dynamic_cast(BaseClass_ptr2); - if(element->AngleRefTopologicalIsland != nullptr) - return true; - } - return false; -} - -bool assign_TopologicalNode_TopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->TopologicalIsland = dynamic_cast(BaseClass_ptr2); - if(element->TopologicalIsland != nullptr) - return true; - } - return false; -} - -bool assign_BaseVoltage_TopologicalNode(BaseClass*, BaseClass*); -bool assign_TopologicalNode_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TopologicalNode_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ConnectivityNodes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; - } - } - return false; -} - -bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass*, BaseClass*); -bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->ConnectivityNodeContainer = dynamic_cast(BaseClass_ptr2); - if(element->ConnectivityNodeContainer != nullptr) - return assign_ConnectivityNodeContainer_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_ReportingGroup_TopologicalNode(BaseClass*, BaseClass*); -bool assign_TopologicalNode_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - element->ReportingGroup = dynamic_cast(BaseClass_ptr2); - if(element->ReportingGroup != nullptr) - return assign_ReportingGroup_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TopologicalNode_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Terminal.push_back(dynamic_cast(BaseClass_ptr2)); - return true; - } - } - return false; -} - @@ -121,30 +38,25 @@ bool assign_TopologicalNode_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseC - - - - - - - - -bool assign_TopologicalNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->boundaryPoint; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_TopologicalNode_boundaryPoint(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->boundaryPoint; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_TopologicalNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -152,10 +64,12 @@ bool assign_TopologicalNode_fromEndIsoCode(std::stringstream &buffer, BaseClass* return false; } -bool assign_TopologicalNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_fromEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -163,10 +77,12 @@ bool assign_TopologicalNode_fromEndName(std::stringstream &buffer, BaseClass* Ba return false; } -bool assign_TopologicalNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_fromEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->fromEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -174,10 +90,12 @@ bool assign_TopologicalNode_fromEndNameTso(std::stringstream &buffer, BaseClass* return false; } -bool assign_TopologicalNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_toEndIsoCode(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndIsoCode = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -185,10 +103,12 @@ bool assign_TopologicalNode_toEndIsoCode(std::stringstream &buffer, BaseClass* B return false; } -bool assign_TopologicalNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_toEndName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -196,10 +116,12 @@ bool assign_TopologicalNode_toEndName(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_TopologicalNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologicalNode_toEndNameTso(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologicalNode* element = dynamic_cast(BaseClass_ptr1)) + { element->toEndNameTso = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -207,18 +129,181 @@ bool assign_TopologicalNode_toEndNameTso(std::stringstream &buffer, BaseClass* B return false; } -namespace CIMPP { - BaseClass* TopologicalNode_factory() { - return new TopologicalNode; + +bool assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_AngleRefTopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + TopologicalIsland* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AngleRefTopologicalIsland != element2) + { + element->AngleRefTopologicalIsland = element2; + return assign_TopologicalIsland_AngleRefTopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_BaseVoltage_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TopologicalNode::addConstructToMap(std::unordered_map& factory_map) { +bool assign_ConnectivityNodeContainer_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_ConnectivityNodeContainer(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNodeContainer* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ConnectivityNodeContainer != element2) + { + element->ConnectivityNodeContainer = element2; + return assign_ConnectivityNodeContainer_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_ConnectivityNode_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_ConnectivityNodes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + ConnectivityNode* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ConnectivityNodes.begin(), element->ConnectivityNodes.end(), element2) == element->ConnectivityNodes.end()) + { + element->ConnectivityNodes.push_back(element2); + return assign_ConnectivityNode_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_ReportingGroup_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_ReportingGroup(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + ReportingGroup* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ReportingGroup != element2) + { + element->ReportingGroup = element2; + return assign_ReportingGroup_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_SvInjection_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_SvInjection(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + SvInjection* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvInjection != element2) + { + element->SvInjection = element2; + return assign_SvInjection_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_SvVoltage_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_SvVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + SvVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->SvVoltage != element2) + { + element->SvVoltage = element2; + return assign_SvVoltage_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_Terminal_TopologicalNode(BaseClass*, BaseClass*); +bool assign_TopologicalNode_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Terminal.begin(), element->Terminal.end(), element2) == element->Terminal.end()) + { + element->Terminal.push_back(element2); + return assign_Terminal_TopologicalNode(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + +bool assign_TopologicalIsland_TopologicalNodes(BaseClass*, BaseClass*); +bool assign_TopologicalNode_TopologicalIsland(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TopologicalNode* element = dynamic_cast(BaseClass_ptr1); + TopologicalIsland* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TopologicalIsland != element2) + { + element->TopologicalIsland = element2; + return assign_TopologicalIsland_TopologicalNodes(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} + + + + + + + + +const char TopologicalNode::debugName[] = "TopologicalNode"; +const char* TopologicalNode::debugString() const +{ + return TopologicalNode::debugName; +} + +void TopologicalNode::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologicalNode"), &TopologicalNode_factory)); } -void TopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.boundaryPoint"), &assign_TopologicalNode_boundaryPoint)); +void TopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.boundaryPoint"), &assign_TopologicalNode_boundaryPoint)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.fromEndIsoCode"), &assign_TopologicalNode_fromEndIsoCode)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.fromEndName"), &assign_TopologicalNode_fromEndName)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.fromEndNameTso"), &assign_TopologicalNode_fromEndNameTso)); @@ -227,22 +312,17 @@ void TopologicalNode::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvInjection"), &assign_TopologicalNode_SvInjection)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvVoltage"), &assign_TopologicalNode_SvVoltage)); +void TopologicalNode::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.AngleRefTopologicalIsland"), &assign_TopologicalNode_AngleRefTopologicalIsland)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.TopologicalIsland"), &assign_TopologicalNode_TopologicalIsland)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.BaseVoltage"), &assign_TopologicalNode_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ConnectivityNodes"), &assign_TopologicalNode_ConnectivityNodes)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ConnectivityNodeContainer"), &assign_TopologicalNode_ConnectivityNodeContainer)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ConnectivityNodes"), &assign_TopologicalNode_ConnectivityNodes)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.ReportingGroup"), &assign_TopologicalNode_ReportingGroup)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvInjection"), &assign_TopologicalNode_SvInjection)); + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.SvVoltage"), &assign_TopologicalNode_SvVoltage)); assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.Terminal"), &assign_TopologicalNode_Terminal)); - } - -const char TopologicalNode::debugName[] = "TopologicalNode"; -const char* TopologicalNode::debugString() -{ - return TopologicalNode::debugName; + assign_map.insert(std::make_pair(std::string("cim:TopologicalNode.TopologicalIsland"), &assign_TopologicalNode_TopologicalIsland)); } const BaseClassDefiner TopologicalNode::declare() @@ -250,4 +330,10 @@ const BaseClassDefiner TopologicalNode::declare() return BaseClassDefiner(TopologicalNode::addConstructToMap, TopologicalNode::addPrimitiveAssignFnsToMap, TopologicalNode::addClassAssignFnsToMap, TopologicalNode::debugName); } - +namespace CIMPP +{ + BaseClass* TopologicalNode_factory() + { + return new TopologicalNode; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TopologicalNode.hpp b/CGMES_2.4.15_27JAN2020/TopologicalNode.hpp index 951fae0ba..035d4035d 100644 --- a/CGMES_2.4.15_27JAN2020/TopologicalNode.hpp +++ b/CGMES_2.4.15_27JAN2020/TopologicalNode.hpp @@ -1,62 +1,63 @@ #ifndef TopologicalNode_H #define TopologicalNode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "String.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class BaseVoltage; + class ConnectivityNode; + class ConnectivityNodeContainer; + class ReportingGroup; + class SvInjection; + class SvVoltage; + class Terminal; + class TopologicalIsland; -class SvInjection; -class SvVoltage; -class TopologicalIsland; -class BaseVoltage; -class ConnectivityNode; -class ConnectivityNodeContainer; -class ReportingGroup; -class Terminal; /* For a detailed substation model a topological node is a set of connectivity nodes that, in the current network state, are connected together through any type of closed switches, including jumpers. Topological nodes change as the current network state changes (i.e., switches, breakers, etc. change state). For a planning model, switch statuses are not used to form topological nodes. Instead they are manually created or deleted in a model builder tool. Topological nodes maintained this way are also called "busses". */ - class TopologicalNode: public IdentifiedObject + class TopologicalNode : public IdentifiedObject { - public: - CIMPP::SvInjection* SvInjection; /* The topological node associated with the flow injection state variable. Default: 0 */ - CIMPP::SvVoltage* SvVoltage; /* The topological node associated with the voltage state. Default: 0 */ - CIMPP::TopologicalIsland* AngleRefTopologicalIsland; /* The island for which the node is an angle reference. Normally there is one angle reference node for each island. Default: 0 */ - CIMPP::TopologicalIsland* TopologicalIsland; /* A topological node belongs to a topological island. Default: 0 */ - CIMPP::BaseVoltage* BaseVoltage; /* The base voltage of the topologocial node. Default: 0 */ - std::list ConnectivityNodes; /* The topological node to which this connectivity node is assigned. May depend on the current state of switches in the network. Default: 0 */ - CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* The connectivity node container to which the toplogical node belongs. Default: 0 */ - CIMPP::ReportingGroup* ReportingGroup; /* The topological nodes that belong to the reporting group. Default: 0 */ - std::list Terminal; /* The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connectivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ - CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ - CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologicalNode(); - virtual ~TopologicalNode(); - + ~TopologicalNode() override; + + CIMPP::TopologicalIsland* AngleRefTopologicalIsland; /* The island for which the node is an angle reference. Normally there is one angle reference node for each island. Default: 0 */ + CIMPP::BaseVoltage* BaseVoltage; /* The base voltage of the topologocial node. Default: 0 */ + CIMPP::ConnectivityNodeContainer* ConnectivityNodeContainer; /* The connectivity node container to which the toplogical node belongs. Default: 0 */ + std::list ConnectivityNodes; /* The connectivity nodes combine together to form this topological node. May depend on the current state of switches in the network. Default: 0 */ + CIMPP::ReportingGroup* ReportingGroup; /* The topological nodes that belong to the reporting group. Default: 0 */ + CIMPP::SvInjection* SvInjection; /* The topological node associated with the flow injection state variable. Default: 0 */ + CIMPP::SvVoltage* SvVoltage; /* The topological node associated with the voltage state. Default: 0 */ + std::list Terminal; /* The topological node associated with the terminal. This can be used as an alternative to the connectivity node path to topological node, thus making it unneccesary to model connectivity nodes in some cases. Note that the if connectivity nodes are in the model, this association would probably not be used as an input specification. Default: 0 */ + CIMPP::TopologicalIsland* TopologicalIsland; /* A topological node belongs to a topological island. Default: 0 */ + CIMPP::Boolean boundaryPoint; /* Identifies if a node is a BoundaryPoint. If boundaryPoint=true the ConnectivityNode or the TopologicalNode represents a BoundaryPoint. Default: false */ + CIMPP::String fromEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `From` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String fromEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `From` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndIsoCode; /* The attribute is used for an exchange of the ISO code of the region to which the `To` side of the Boundary point belongs to or it is connected to. The ISO code is two characters country code as defined by ISO 3166 (). The length of the string is 2 characters maximum. The attribute is a required for the Boundary Model Authority Set where this attribute is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndName; /* The attribute is used for an exchange of a human readable name with length of the string 32 characters maximum. The attribute covers two cases: The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + CIMPP::String toEndNameTso; /* The attribute is used for an exchange of the name of the TSO to which the `To` side of the Boundary point belongs to or it is connected to. The length of the string is 32 characters maximum. The attribute is required for the Boundary Model Authority Set where it is used only for the TopologicalNode in the Boundary Topology profile and ConnectivityNode in the Boundary Equipment profile. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologicalNode_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.cpp b/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.cpp index 5ceb28277..d0cfdd217 100644 --- a/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologyBoundaryVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -TopologyBoundaryVersion::TopologyBoundaryVersion(): date(nullptr) {}; - +TopologyBoundaryVersion::TopologyBoundaryVersion() {}; TopologyBoundaryVersion::~TopologyBoundaryVersion() {}; - - -bool assign_TopologyBoundaryVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_TopologyBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_TopologyBoundaryVersion_baseUML(std::stringstream &buffer, BaseClass return false; } -bool assign_TopologyBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_TopologyBoundaryVersion_baseURI(std::stringstream &buffer, BaseClass return false; } +bool assign_TopologyBoundaryVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologyBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_TopologyBoundaryVersion_differenceModelURI(std::stringstream &buffer return false; } -bool assign_TopologyBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_TopologyBoundaryVersion_entsoeUML(std::stringstream &buffer, BaseCla return false; } -bool assign_TopologyBoundaryVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_TopologyBoundaryVersion_entsoeURI(std::stringstream &buffer, BaseCla return false; } -bool assign_TopologyBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_TopologyBoundaryVersion_modelDescriptionURI(std::stringstream &buffe return false; } -bool assign_TopologyBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_TopologyBoundaryVersion_namespaceRDF(std::stringstream &buffer, Base return false; } -bool assign_TopologyBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_TopologyBoundaryVersion_namespaceUML(std::stringstream &buffer, Base return false; } -bool assign_TopologyBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyBoundaryVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyBoundaryVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_TopologyBoundaryVersion_shortName(std::stringstream &buffer, BaseCla return false; } -namespace CIMPP { - BaseClass* TopologyBoundaryVersion_factory() { - return new TopologyBoundaryVersion; - } + + + + + + + + + + + +const char TopologyBoundaryVersion::debugName[] = "TopologyBoundaryVersion"; +const char* TopologyBoundaryVersion::debugString() const +{ + return TopologyBoundaryVersion::debugName; } -void TopologyBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) { +void TopologyBoundaryVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion"), &TopologyBoundaryVersion_factory)); } -void TopologyBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TopologyBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.baseUML"), &assign_TopologyBoundaryVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.baseURI"), &assign_TopologyBoundaryVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.differenceModelURI"), &assign_TopologyBoundaryVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.date"), &assign_TopologyBoundaryVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.differenceModelURI"), &assign_TopologyBoundaryVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.entsoeUML"), &assign_TopologyBoundaryVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.entsoeURI"), &assign_TopologyBoundaryVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.modelDescriptionURI"), &assign_TopologyBoundaryVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void TopologyBoundaryVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologyBoundaryVersion.date"), &assign_TopologyBoundaryVersion_date)); - } - -const char TopologyBoundaryVersion::debugName[] = "TopologyBoundaryVersion"; -const char* TopologyBoundaryVersion::debugString() +void TopologyBoundaryVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TopologyBoundaryVersion::debugName; } const BaseClassDefiner TopologyBoundaryVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner TopologyBoundaryVersion::declare() return BaseClassDefiner(TopologyBoundaryVersion::addConstructToMap, TopologyBoundaryVersion::addPrimitiveAssignFnsToMap, TopologyBoundaryVersion::addClassAssignFnsToMap, TopologyBoundaryVersion::debugName); } - +namespace CIMPP +{ + BaseClass* TopologyBoundaryVersion_factory() + { + return new TopologyBoundaryVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.hpp b/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.hpp index 2dee1c50c..be3ffc37c 100644 --- a/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/TopologyBoundaryVersion.hpp @@ -1,48 +1,49 @@ #ifndef TopologyBoundaryVersion_H #define TopologyBoundaryVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class TopologyBoundaryVersion: public BaseClass + class TopologyBoundaryVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/TopologyBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologyBoundaryVersion(); - virtual ~TopologyBoundaryVersion(); - + ~TopologyBoundaryVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/TopologyBoundary/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologyBoundaryVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TopologyVersion.cpp b/CGMES_2.4.15_27JAN2020/TopologyVersion.cpp index cc87973a1..3e90c1136 100644 --- a/CGMES_2.4.15_27JAN2020/TopologyVersion.cpp +++ b/CGMES_2.4.15_27JAN2020/TopologyVersion.cpp @@ -1,7 +1,11 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TopologyVersion.hpp" +#include +#include + #include "String.hpp" #include "String.hpp" #include "Date.hpp" @@ -15,34 +19,16 @@ using namespace CIMPP; -TopologyVersion::TopologyVersion(): date(nullptr) {}; - +TopologyVersion::TopologyVersion() {}; TopologyVersion::~TopologyVersion() {}; - - -bool assign_TopologyVersion_date(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { - element->date = dynamic_cast(BaseClass_ptr2); - if(element->date != nullptr) - return true; - } - return false; -} - - - - - - - - - -bool assign_TopologyVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_baseUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -50,10 +36,12 @@ bool assign_TopologyVersion_baseUML(std::stringstream &buffer, BaseClass* BaseCl return false; } -bool assign_TopologyVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_baseURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->baseURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -61,11 +49,25 @@ bool assign_TopologyVersion_baseURI(std::stringstream &buffer, BaseClass* BaseCl return false; } +bool assign_TopologyVersion_date(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { + element->date = buffer.str(); + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TopologyVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_differenceModelURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->differenceModelURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -73,10 +75,12 @@ bool assign_TopologyVersion_differenceModelURI(std::stringstream &buffer, BaseCl return false; } -bool assign_TopologyVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_entsoeUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -84,10 +88,12 @@ bool assign_TopologyVersion_entsoeUML(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_TopologyVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_entsoeURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->entsoeURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -95,10 +101,12 @@ bool assign_TopologyVersion_entsoeURI(std::stringstream &buffer, BaseClass* Base return false; } -bool assign_TopologyVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_modelDescriptionURI(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->modelDescriptionURI = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -106,10 +114,12 @@ bool assign_TopologyVersion_modelDescriptionURI(std::stringstream &buffer, BaseC return false; } -bool assign_TopologyVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_namespaceRDF(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceRDF = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -117,10 +127,12 @@ bool assign_TopologyVersion_namespaceRDF(std::stringstream &buffer, BaseClass* B return false; } -bool assign_TopologyVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_namespaceUML(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->namespaceUML = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -128,10 +140,12 @@ bool assign_TopologyVersion_namespaceUML(std::stringstream &buffer, BaseClass* B return false; } -bool assign_TopologyVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) { +bool assign_TopologyVersion_shortName(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TopologyVersion* element = dynamic_cast(BaseClass_ptr1)) + { element->shortName = buffer.str(); - if(buffer.fail()) + if (buffer.fail()) return false; else return true; @@ -139,20 +153,34 @@ bool assign_TopologyVersion_shortName(std::stringstream &buffer, BaseClass* Base return false; } -namespace CIMPP { - BaseClass* TopologyVersion_factory() { - return new TopologyVersion; - } + + + + + + + + + + + +const char TopologyVersion::debugName[] = "TopologyVersion"; +const char* TopologyVersion::debugString() const +{ + return TopologyVersion::debugName; } -void TopologyVersion::addConstructToMap(std::unordered_map& factory_map) { +void TopologyVersion::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TopologyVersion"), &TopologyVersion_factory)); } -void TopologyVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TopologyVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.baseUML"), &assign_TopologyVersion_baseUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.baseURI"), &assign_TopologyVersion_baseURI)); - assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.differenceModelURI"), &assign_TopologyVersion_differenceModelURI)); + assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.date"), &assign_TopologyVersion_date)); + assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.differenceModelURI"), &assign_TopologyVersion_differenceModelURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.entsoeUML"), &assign_TopologyVersion_entsoeUML)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.entsoeURI"), &assign_TopologyVersion_entsoeURI)); assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.modelDescriptionURI"), &assign_TopologyVersion_modelDescriptionURI)); @@ -161,14 +189,8 @@ void TopologyVersion::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TopologyVersion.date"), &assign_TopologyVersion_date)); - } - -const char TopologyVersion::debugName[] = "TopologyVersion"; -const char* TopologyVersion::debugString() +void TopologyVersion::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TopologyVersion::debugName; } const BaseClassDefiner TopologyVersion::declare() @@ -176,4 +198,10 @@ const BaseClassDefiner TopologyVersion::declare() return BaseClassDefiner(TopologyVersion::addConstructToMap, TopologyVersion::addPrimitiveAssignFnsToMap, TopologyVersion::addClassAssignFnsToMap, TopologyVersion::debugName); } - +namespace CIMPP +{ + BaseClass* TopologyVersion_factory() + { + return new TopologyVersion; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TopologyVersion.hpp b/CGMES_2.4.15_27JAN2020/TopologyVersion.hpp index 179768214..4727fb972 100644 --- a/CGMES_2.4.15_27JAN2020/TopologyVersion.hpp +++ b/CGMES_2.4.15_27JAN2020/TopologyVersion.hpp @@ -1,48 +1,49 @@ #ifndef TopologyVersion_H #define TopologyVersion_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "BaseClass.hpp" +#include "BaseClassDefiner.hpp" +#include "Date.hpp" #include "String.hpp" -namespace CIMPP { +namespace CIMPP +{ - -class Date; /* Version details. */ - class TopologyVersion: public BaseClass + class TopologyVersion : public BaseClass { - public: - CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ - CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ - CIMPP::Date* date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ - CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ - CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ - CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Topology/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ - CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ - CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ - CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ - CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TopologyVersion(); - virtual ~TopologyVersion(); - + ~TopologyVersion() override; + + CIMPP::String baseUML; /* Base UML provided by CIM model manager. Default: '' */ + CIMPP::String baseURI; /* Profile URI used in the Model Exchange header and defined in IEC standards. It uniquely identifies the Profile and its version. It is given for information only and to identify the closest IEC profile to which this CGMES profile is based on. Default: '' */ + CIMPP::Date date; /* Profile creation date Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. Default: '' */ + CIMPP::String differenceModelURI; /* Difference model URI defined by IEC 61970-552. Default: '' */ + CIMPP::String entsoeUML; /* UML provided by ENTSO-E. Default: '' */ + CIMPP::String entsoeURI; /* Profile URI defined by ENTSO-E and used in the Model Exchange header. It uniquely identifies the Profile and its version. The last two elements in the URI (http://entsoe.eu/CIM/Topology/yy/zzz) indicate major and minor versions where: - yy - indicates a major version; - zzz - indicates a minor version. Default: '' */ + CIMPP::String modelDescriptionURI; /* Model Description URI defined by IEC 61970-552. Default: '' */ + CIMPP::String namespaceRDF; /* RDF namespace. Default: '' */ + CIMPP::String namespaceUML; /* CIM UML namespace. Default: '' */ + CIMPP::String shortName; /* The short name of the profile used in profile documentation. Default: '' */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TopologyVersion_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TransformerControlMode.cpp b/CGMES_2.4.15_27JAN2020/TransformerControlMode.cpp index 8b62218ec..3f49e0952 100644 --- a/CGMES_2.4.15_27JAN2020/TransformerControlMode.cpp +++ b/CGMES_2.4.15_27JAN2020/TransformerControlMode.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TransformerControlMode.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::TransformerControlMode& rop) +TransformerControlMode& TransformerControlMode::operator=(TransformerControlMode_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +TransformerControlMode::operator TransformerControlMode_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char TransformerControlMode::debugName[] = "TransformerControlMode"; +const char* TransformerControlMode::debugString() const +{ + return TransformerControlMode::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, TransformerControlMode& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const TransformerControlMode& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == TransformerControlMode::volt) + { + EnumSymbol = "volt"; + } + if (obj.value == TransformerControlMode::reactive) + { + EnumSymbol = "reactive"; + } + + if (!EnumSymbol.empty()) + { + os << "TransformerControlMode." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TransformerControlMode.hpp b/CGMES_2.4.15_27JAN2020/TransformerControlMode.hpp index 934a803c8..563b222e5 100644 --- a/CGMES_2.4.15_27JAN2020/TransformerControlMode.hpp +++ b/CGMES_2.4.15_27JAN2020/TransformerControlMode.hpp @@ -1,21 +1,46 @@ #ifndef TransformerControlMode_H #define TransformerControlMode_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Control modes for a transformer. */ - enum class TransformerControlMode + class TransformerControlMode { - /** - * Voltage control - */ - volt, - /** - * Reactive power flow control - */ - reactive, + public: + enum TransformerControlMode_ENUM + { + /** + * Voltage control + */ + volt, + /** + * Reactive power flow control + */ + reactive, + }; + + TransformerControlMode() : value(), initialized(false) {} + TransformerControlMode(TransformerControlMode_ENUM value) : value(value), initialized(true) {} + + TransformerControlMode& operator=(TransformerControlMode_ENUM rop); + operator TransformerControlMode_ENUM() const; + + TransformerControlMode_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, TransformerControlMode& rop); + friend std::ostream& operator<<(std::ostream& os, const TransformerControlMode& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::TransformerControlMode& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/TransformerEnd.cpp b/CGMES_2.4.15_27JAN2020/TransformerEnd.cpp index 1ec5a57d5..241deae09 100644 --- a/CGMES_2.4.15_27JAN2020/TransformerEnd.cpp +++ b/CGMES_2.4.15_27JAN2020/TransformerEnd.cpp @@ -1,146 +1,180 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TransformerEnd.hpp" +#include +#include + #include "BaseVoltage.hpp" -#include "Terminal.hpp" #include "PhaseTapChanger.hpp" #include "RatioTapChanger.hpp" +#include "Terminal.hpp" #include "Integer.hpp" -#include "Resistance.hpp" #include "Boolean.hpp" +#include "Resistance.hpp" #include "Reactance.hpp" using namespace CIMPP; -TransformerEnd::TransformerEnd(): BaseVoltage(nullptr), Terminal(nullptr), PhaseTapChanger(nullptr), RatioTapChanger(nullptr) {}; - +TransformerEnd::TransformerEnd() : BaseVoltage(nullptr), PhaseTapChanger(nullptr), RatioTapChanger(nullptr), Terminal(nullptr) {}; TransformerEnd::~TransformerEnd() {}; -bool assign_BaseVoltage_TransformerEnds(BaseClass*, BaseClass*); -bool assign_TransformerEnd_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_TransformerEnds(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_Terminal_TransformerEnd(BaseClass*, BaseClass*); -bool assign_TransformerEnd_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->Terminal = dynamic_cast(BaseClass_ptr2); - if(element->Terminal != nullptr) - return assign_Terminal_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_TransformerEnd_PhaseTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->PhaseTapChanger = dynamic_cast(BaseClass_ptr2); - if(element->PhaseTapChanger != nullptr) - return true; - } - return false; -} - -bool assign_TransformerEnd_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - element->RatioTapChanger = dynamic_cast(BaseClass_ptr2); - if(element->RatioTapChanger != nullptr) - return true; - } - return false; -} - +bool assign_TransformerEnd_endNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->endNumber; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TransformerEnd_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->grounded; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TransformerEnd_rground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rground; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TransformerEnd_xground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xground; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TransformerEnd_endNumber(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->endNumber; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_BaseVoltage_TransformerEnds(BaseClass*, BaseClass*); +bool assign_TransformerEnd_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_TransformerEnds(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TransformerEnd_rground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rground; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_PhaseTapChanger_TransformerEnd(BaseClass*, BaseClass*); +bool assign_TransformerEnd_PhaseTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + PhaseTapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PhaseTapChanger != element2) + { + element->PhaseTapChanger = element2; + return assign_PhaseTapChanger_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TransformerEnd_grounded(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->grounded; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_RatioTapChanger_TransformerEnd(BaseClass*, BaseClass*); +bool assign_TransformerEnd_RatioTapChanger(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + RatioTapChanger* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RatioTapChanger != element2) + { + element->RatioTapChanger = element2; + return assign_RatioTapChanger_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TransformerEnd_xground(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TransformerEnd* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xground; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Terminal_TransformerEnd(BaseClass*, BaseClass*); +bool assign_TransformerEnd_Terminal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TransformerEnd* element = dynamic_cast(BaseClass_ptr1); + Terminal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Terminal != element2) + { + element->Terminal = element2; + return assign_Terminal_TransformerEnd(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* TransformerEnd_factory() { - return new TransformerEnd; - } + + + + +const char TransformerEnd::debugName[] = "TransformerEnd"; +const char* TransformerEnd::debugString() const +{ + return TransformerEnd::debugName; } -void TransformerEnd::addConstructToMap(std::unordered_map& factory_map) { +void TransformerEnd::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TransformerEnd"), &TransformerEnd_factory)); } -void TransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.endNumber"), &assign_TransformerEnd_endNumber)); - assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.rground"), &assign_TransformerEnd_rground)); +void TransformerEnd::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.endNumber"), &assign_TransformerEnd_endNumber)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.grounded"), &assign_TransformerEnd_grounded)); + assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.rground"), &assign_TransformerEnd_rground)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.xground"), &assign_TransformerEnd_xground)); } -void TransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void TransformerEnd::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.BaseVoltage"), &assign_TransformerEnd_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.Terminal"), &assign_TransformerEnd_Terminal)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.PhaseTapChanger"), &assign_TransformerEnd_PhaseTapChanger)); assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.RatioTapChanger"), &assign_TransformerEnd_RatioTapChanger)); - } - -const char TransformerEnd::debugName[] = "TransformerEnd"; -const char* TransformerEnd::debugString() -{ - return TransformerEnd::debugName; + assign_map.insert(std::make_pair(std::string("cim:TransformerEnd.Terminal"), &assign_TransformerEnd_Terminal)); } const BaseClassDefiner TransformerEnd::declare() @@ -148,4 +182,10 @@ const BaseClassDefiner TransformerEnd::declare() return BaseClassDefiner(TransformerEnd::addConstructToMap, TransformerEnd::addPrimitiveAssignFnsToMap, TransformerEnd::addClassAssignFnsToMap, TransformerEnd::debugName); } - +namespace CIMPP +{ + BaseClass* TransformerEnd_factory() + { + return new TransformerEnd; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TransformerEnd.hpp b/CGMES_2.4.15_27JAN2020/TransformerEnd.hpp index 5096f9a06..93516d326 100644 --- a/CGMES_2.4.15_27JAN2020/TransformerEnd.hpp +++ b/CGMES_2.4.15_27JAN2020/TransformerEnd.hpp @@ -1,52 +1,53 @@ #ifndef TransformerEnd_H #define TransformerEnd_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Integer.hpp" -#include "Resistance.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "Integer.hpp" #include "Reactance.hpp" +#include "Resistance.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class BaseVoltage; + class PhaseTapChanger; + class RatioTapChanger; + class Terminal; -class BaseVoltage; -class Terminal; -class PhaseTapChanger; -class RatioTapChanger; /* A conducting connection point of a power transformer. It corresponds to a physical transformer winding terminal. In earlier CIM versions, the TransformerWinding class served a similar purpose, but this class is more flexible because it associates to terminal but is not a specialization of ConductingEquipment. */ - class TransformerEnd: public IdentifiedObject + class TransformerEnd : public IdentifiedObject { - public: - CIMPP::BaseVoltage* BaseVoltage; /* Base voltage of the transformer end. This is essential for PU calculation. Default: 0 */ - CIMPP::Terminal* Terminal; /* Terminal of the power transformer to which this transformer end belongs. Default: 0 */ - CIMPP::PhaseTapChanger* PhaseTapChanger; /* Transformer end to which this phase tap changer belongs. Default: 0 */ - CIMPP::RatioTapChanger* RatioTapChanger; /* Transformer end to which this ratio tap changer belongs. Default: 0 */ - CIMPP::Integer endNumber; /* Number for this transformer end, corresponding to the end`s order in the power transformer vector group or phase angle clock number. Highest voltage winding should be 1. Each end within a power transformer should have a unique subsequent end number. Note the transformer end number need not match the terminal sequence number. Default: 0 */ - CIMPP::Resistance rground; /* (for Yn and Zn connections) Resistance part of neutral impedance where `grounded` is true. Default: nullptr */ - CIMPP::Boolean grounded; /* (for Yn and Zn connections) True if the neutral is solidly grounded. Default: false */ - CIMPP::Reactance xground; /* (for Yn and Zn connections) Reactive part of neutral impedance where `grounded` is true. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TransformerEnd(); - virtual ~TransformerEnd(); - + ~TransformerEnd() override; + + CIMPP::BaseVoltage* BaseVoltage; /* Base voltage of the transformer end. This is essential for PU calculation. Default: 0 */ + CIMPP::PhaseTapChanger* PhaseTapChanger; /* Transformer end to which this phase tap changer belongs. Default: 0 */ + CIMPP::RatioTapChanger* RatioTapChanger; /* Transformer end to which this ratio tap changer belongs. Default: 0 */ + CIMPP::Terminal* Terminal; /* Terminal of the power transformer to which this transformer end belongs. Default: 0 */ + CIMPP::Integer endNumber; /* Number for this transformer end, corresponding to the end`s order in the power transformer vector group or phase angle clock number. Highest voltage winding should be 1. Each end within a power transformer should have a unique subsequent end number. Note the transformer end number need not match the terminal sequence number. Default: 0 */ + CIMPP::Boolean grounded; /* (for Yn and Zn connections) True if the neutral is solidly grounded. Default: false */ + CIMPP::Resistance rground; /* (for Yn and Zn connections) Resistance part of neutral impedance where `grounded` is true. Default: nullptr */ + CIMPP::Reactance xground; /* (for Yn and Zn connections) Reactive part of neutral impedance where `grounded` is true. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TransformerEnd_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TurbLCFB1.cpp b/CGMES_2.4.15_27JAN2020/TurbLCFB1.cpp index ea541863b..b5c4049d7 100644 --- a/CGMES_2.4.15_27JAN2020/TurbLCFB1.cpp +++ b/CGMES_2.4.15_27JAN2020/TurbLCFB1.cpp @@ -1,216 +1,228 @@ -#include -#include "TurbineLoadControllerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbLCFB1.hpp" -#include "ActivePower.hpp" -#include "Boolean.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Boolean.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "ActivePower.hpp" #include "Boolean.hpp" +#include "ActivePower.hpp" #include "Boolean.hpp" #include "Seconds.hpp" -#include "PU.hpp" -#include "ActivePower.hpp" using namespace CIMPP; TurbLCFB1::TurbLCFB1() {}; - TurbLCFB1::~TurbLCFB1() {}; +bool assign_TurbLCFB1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->db; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->emax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_fb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_irmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->irmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ki; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwbase; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_pbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pbf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_pmwset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pmwset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_speedReferenceGovernor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->speedReferenceGovernor; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_TurbLCFB1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpelec; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_TurbLCFB1_mwbase(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwbase; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TurbLCFB1_speedReferenceGovernor(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->speedReferenceGovernor; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TurbLCFB1_db(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->db; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_TurbLCFB1_emax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->emax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_fb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_kp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_ki(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ki; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_fbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_pbf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pbf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_tpelec(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpelec; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_irmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->irmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_TurbLCFB1_pmwset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbLCFB1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pmwset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* TurbLCFB1_factory() { - return new TurbLCFB1; - } + + + + + + + + + +const char TurbLCFB1::debugName[] = "TurbLCFB1"; +const char* TurbLCFB1::debugString() const +{ + return TurbLCFB1::debugName; } -void TurbLCFB1::addConstructToMap(std::unordered_map& factory_map) { +void TurbLCFB1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbLCFB1"), &TurbLCFB1_factory)); } -void TurbLCFB1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.mwbase"), &assign_TurbLCFB1_mwbase)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.speedReferenceGovernor"), &assign_TurbLCFB1_speedReferenceGovernor)); +void TurbLCFB1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.db"), &assign_TurbLCFB1_db)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.emax"), &assign_TurbLCFB1_emax)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.fb"), &assign_TurbLCFB1_fb)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.kp"), &assign_TurbLCFB1_kp)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.ki"), &assign_TurbLCFB1_ki)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.fbf"), &assign_TurbLCFB1_fbf)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.pbf"), &assign_TurbLCFB1_pbf)); - assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.tpelec"), &assign_TurbLCFB1_tpelec)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.irmax"), &assign_TurbLCFB1_irmax)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.ki"), &assign_TurbLCFB1_ki)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.kp"), &assign_TurbLCFB1_kp)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.mwbase"), &assign_TurbLCFB1_mwbase)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.pbf"), &assign_TurbLCFB1_pbf)); assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.pmwset"), &assign_TurbLCFB1_pmwset)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.speedReferenceGovernor"), &assign_TurbLCFB1_speedReferenceGovernor)); + assign_map.insert(std::make_pair(std::string("cim:TurbLCFB1.tpelec"), &assign_TurbLCFB1_tpelec)); } -void TurbLCFB1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char TurbLCFB1::debugName[] = "TurbLCFB1"; -const char* TurbLCFB1::debugString() +void TurbLCFB1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbLCFB1::debugName; } const BaseClassDefiner TurbLCFB1::declare() @@ -218,4 +230,10 @@ const BaseClassDefiner TurbLCFB1::declare() return BaseClassDefiner(TurbLCFB1::addConstructToMap, TurbLCFB1::addPrimitiveAssignFnsToMap, TurbLCFB1::addClassAssignFnsToMap, TurbLCFB1::debugName); } - +namespace CIMPP +{ + BaseClass* TurbLCFB1_factory() + { + return new TurbLCFB1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TurbLCFB1.hpp b/CGMES_2.4.15_27JAN2020/TurbLCFB1.hpp index ab3d7a698..b1f382324 100644 --- a/CGMES_2.4.15_27JAN2020/TurbLCFB1.hpp +++ b/CGMES_2.4.15_27JAN2020/TurbLCFB1.hpp @@ -1,52 +1,53 @@ #ifndef TurbLCFB1_H #define TurbLCFB1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineLoadControllerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineLoadControllerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "ActivePower.hpp" #include "Boolean.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Turbine Load Controller model developed in the WECC. This model represents a supervisory turbine load controller that acts to maintain turbine power at a set value by continuous adjustment of the turbine governor speed-load reference. This model is intended to represent slow reset 'outer loop' controllers managing the action of the turbine governor. */ - class TurbLCFB1: public TurbineLoadControllerDynamics + class TurbLCFB1 : public TurbineLoadControllerDynamics { - public: - CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ - CIMPP::Boolean speedReferenceGovernor; /* Type of turbine governor reference (Type). true = speed reference governor false = load reference governor. Typical Value = true. Default: false */ - CIMPP::PU db; /* Controller dead band (db). Typical Value = 0. Default: nullptr */ - CIMPP::PU emax; /* Maximum control error (Emax) (note 4). Typical Value = 0.02. Default: nullptr */ - CIMPP::PU fb; /* Frequency bias gain (Fb). Typical Value = 0. Default: nullptr */ - CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ - CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0. Default: nullptr */ - CIMPP::Boolean fbf; /* Frequency bias flag (Fbf). true = enable frequency bias false = disable frequency bias. Typical Value = false. Default: false */ - CIMPP::Boolean pbf; /* Power controller flag (Pbf). true = enable load controller false = disable load controller. Typical Value = false. Default: false */ - CIMPP::Seconds tpelec; /* Power transducer time constant (Tpelec). Typical Value = 0. Default: nullptr */ - CIMPP::PU irmax; /* Maximum turbine speed/load reference bias (Irmax) (note 3). Typical Value = 0. Default: nullptr */ - CIMPP::ActivePower pmwset; /* Power controller setpoint (Pmwset) (note 1). Unit = MW. Typical Value = 0. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbLCFB1(); - virtual ~TurbLCFB1(); - + ~TurbLCFB1() override; + + CIMPP::PU db; /* Controller dead band (db). Typical Value = 0. Default: nullptr */ + CIMPP::PU emax; /* Maximum control error (Emax) (note 4). Typical Value = 0.02. Default: nullptr */ + CIMPP::PU fb; /* Frequency bias gain (Fb). Typical Value = 0. Default: nullptr */ + CIMPP::Boolean fbf; /* Frequency bias flag (Fbf). true = enable frequency bias false = disable frequency bias. Typical Value = false. Default: false */ + CIMPP::PU irmax; /* Maximum turbine speed/load reference bias (Irmax) (note 3). Typical Value = 0. Default: nullptr */ + CIMPP::PU ki; /* Integral gain (Ki). Typical Value = 0. Default: nullptr */ + CIMPP::PU kp; /* Proportional gain (Kp). Typical Value = 0. Default: nullptr */ + CIMPP::ActivePower mwbase; /* Base for power values (MWbase) (>0). Unit = MW. Default: nullptr */ + CIMPP::Boolean pbf; /* Power controller flag (Pbf). true = enable load controller false = disable load controller. Typical Value = false. Default: false */ + CIMPP::ActivePower pmwset; /* Power controller setpoint (Pmwset) (note 1). Unit = MW. Typical Value = 0. Default: nullptr */ + CIMPP::Boolean speedReferenceGovernor; /* Type of turbine governor reference (Type). true = speed reference governor false = load reference governor. Typical Value = true. Default: false */ + CIMPP::Seconds tpelec; /* Power transducer time constant (Tpelec). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbLCFB1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.cpp b/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.cpp index b40191d87..a2bf98e5c 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.cpp @@ -1,74 +1,96 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineGovernorDynamics.hpp" -#include "SynchronousMachineDynamics.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" +#include "SynchronousMachineDynamics.hpp" #include "TurbineLoadControllerDynamics.hpp" using namespace CIMPP; -TurbineGovernorDynamics::TurbineGovernorDynamics(): AsynchronousMachineDynamics(nullptr), TurbineLoadControllerDynamics(nullptr) {}; - +TurbineGovernorDynamics::TurbineGovernorDynamics() : AsynchronousMachineDynamics(nullptr), TurbineLoadControllerDynamics(nullptr) {}; TurbineGovernorDynamics::~TurbineGovernorDynamics() {}; -bool assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->SynchronousMachineDynamics.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + +bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); +bool assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); -bool assign_TurbineGovernorDynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return assign_AsynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); +bool assign_TurbineGovernorDynamics_SynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1); + SynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->SynchronousMachineDynamics.begin(), element->SynchronousMachineDynamics.end(), element2) == element->SynchronousMachineDynamics.end()) + { + element->SynchronousMachineDynamics.push_back(element2); + return assign_SynchronousMachineDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineLoadControllerDynamics = dynamic_cast(BaseClass_ptr2); - if(element->TurbineLoadControllerDynamics != nullptr) - return true; - } - return false; +bool assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass*, BaseClass*); +bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineLoadControllerDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineLoadControllerDynamics != element2) + { + element->TurbineLoadControllerDynamics = element2; + return assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* TurbineGovernorDynamics_factory() { - return new TurbineGovernorDynamics; - } +const char TurbineGovernorDynamics::debugName[] = "TurbineGovernorDynamics"; +const char* TurbineGovernorDynamics::debugString() const +{ + return TurbineGovernorDynamics::debugName; } -void TurbineGovernorDynamics::addConstructToMap(std::unordered_map& factory_map) { +void TurbineGovernorDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics"), &TurbineGovernorDynamics_factory)); } -void TurbineGovernorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void TurbineGovernorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.SynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_SynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.AsynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_AsynchronousMachineDynamics)); - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.TurbineLoadControllerDynamics"), &assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics)); +void TurbineGovernorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TurbineGovernorDynamics::debugName[] = "TurbineGovernorDynamics"; -const char* TurbineGovernorDynamics::debugString() +void TurbineGovernorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineGovernorDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.AsynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_AsynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.SynchronousMachineDynamics"), &assign_TurbineGovernorDynamics_SynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorDynamics.TurbineLoadControllerDynamics"), &assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics)); } const BaseClassDefiner TurbineGovernorDynamics::declare() @@ -76,4 +98,10 @@ const BaseClassDefiner TurbineGovernorDynamics::declare() return BaseClassDefiner(TurbineGovernorDynamics::addConstructToMap, TurbineGovernorDynamics::addPrimitiveAssignFnsToMap, TurbineGovernorDynamics::addClassAssignFnsToMap, TurbineGovernorDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineGovernorDynamics_factory() + { + return new TurbineGovernorDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.hpp b/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.hpp index 900acdd9c..159723b38 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/TurbineGovernorDynamics.hpp @@ -1,42 +1,43 @@ #ifndef TurbineGovernorDynamics_H #define TurbineGovernorDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachineDynamics; + class SynchronousMachineDynamics; + class TurbineLoadControllerDynamics; -class SynchronousMachineDynamics; -class AsynchronousMachineDynamics; -class TurbineLoadControllerDynamics; /* Turbine-governor function block whose behavior is described by reference to a standard model */ - class TurbineGovernorDynamics: public DynamicsFunctionBlock + class TurbineGovernorDynamics : public DynamicsFunctionBlock { - public: - std::list SynchronousMachineDynamics; /* Turbine-governor model associated with this synchronous machine model. Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this turbine-governor model is associated. Default: 0 */ - CIMPP::TurbineLoadControllerDynamics* TurbineLoadControllerDynamics; /* Turbine load controller providing input to this turbine-governor. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineGovernorDynamics(); - virtual ~TurbineGovernorDynamics(); - + ~TurbineGovernorDynamics() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this turbine-governor model is associated. Default: 0 */ + std::list SynchronousMachineDynamics; /* Turbine-governor model associated with this synchronous machine model. Default: 0 */ + CIMPP::TurbineLoadControllerDynamics* TurbineLoadControllerDynamics; /* Turbine load controller providing input to this turbine-governor. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineGovernorDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.cpp b/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.cpp index dd1ca842b..8ebaeff3f 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "TurbineGovernorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineGovernorUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; TurbineGovernorUserDefined::TurbineGovernorUserDefined() {}; - TurbineGovernorUserDefined::~TurbineGovernorUserDefined() {}; -bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TurbineGovernorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_TurbineGovernorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass*, BaseClass*); +bool assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineGovernorUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_TurbineGovernorUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* TurbineGovernorUserDefined_factory() { - return new TurbineGovernorUserDefined; - } +const char TurbineGovernorUserDefined::debugName[] = "TurbineGovernorUserDefined"; +const char* TurbineGovernorUserDefined::debugString() const +{ + return TurbineGovernorUserDefined::debugName; } -void TurbineGovernorUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void TurbineGovernorUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined"), &TurbineGovernorUserDefined_factory)); } -void TurbineGovernorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TurbineGovernorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined.proprietary"), &assign_TurbineGovernorUserDefined_proprietary)); - } - -void TurbineGovernorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined.ProprietaryParameterDynamics"), &assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics)); } -const char TurbineGovernorUserDefined::debugName[] = "TurbineGovernorUserDefined"; -const char* TurbineGovernorUserDefined::debugString() +void TurbineGovernorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineGovernorUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineGovernorUserDefined.ProprietaryParameterDynamics"), &assign_TurbineGovernorUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner TurbineGovernorUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner TurbineGovernorUserDefined::declare() return BaseClassDefiner(TurbineGovernorUserDefined::addConstructToMap, TurbineGovernorUserDefined::addPrimitiveAssignFnsToMap, TurbineGovernorUserDefined::addClassAssignFnsToMap, TurbineGovernorUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineGovernorUserDefined_factory() + { + return new TurbineGovernorUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.hpp b/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.hpp index cf430d55a..522072b50 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/TurbineGovernorUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef TurbineGovernorUserDefined_H #define TurbineGovernorUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineGovernorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineGovernorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Turbine-governor function block whose dynamic behaviour is described by */ - class TurbineGovernorUserDefined: public TurbineGovernorDynamics + class TurbineGovernorUserDefined : public TurbineGovernorDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineGovernorUserDefined(); - virtual ~TurbineGovernorUserDefined(); - + ~TurbineGovernorUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineGovernorUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.cpp b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.cpp index c87fef90e..eac14ab44 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineLoadControllerDynamics.hpp" +#include +#include + #include "TurbineGovernorDynamics.hpp" using namespace CIMPP; -TurbineLoadControllerDynamics::TurbineLoadControllerDynamics(): TurbineGovernorDynamics(nullptr) {}; - +TurbineLoadControllerDynamics::TurbineLoadControllerDynamics() : TurbineGovernorDynamics(nullptr) {}; TurbineLoadControllerDynamics::~TurbineLoadControllerDynamics() {}; -bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass*, BaseClass*); -bool assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineLoadControllerDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->TurbineGovernorDynamics = dynamic_cast(BaseClass_ptr2); - if(element->TurbineGovernorDynamics != nullptr) - return assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* TurbineLoadControllerDynamics_factory() { - return new TurbineLoadControllerDynamics; +bool assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass*, BaseClass*); +bool assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineLoadControllerDynamics* element = dynamic_cast(BaseClass_ptr1); + TurbineGovernorDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->TurbineGovernorDynamics != element2) + { + element->TurbineGovernorDynamics = element2; + return assign_TurbineGovernorDynamics_TurbineLoadControllerDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void TurbineLoadControllerDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics"), &TurbineLoadControllerDynamics_factory)); +const char TurbineLoadControllerDynamics::debugName[] = "TurbineLoadControllerDynamics"; +const char* TurbineLoadControllerDynamics::debugString() const +{ + return TurbineLoadControllerDynamics::debugName; } -void TurbineLoadControllerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void TurbineLoadControllerDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics"), &TurbineLoadControllerDynamics_factory)); +} -void TurbineLoadControllerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics.TurbineGovernorDynamics"), &assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics)); +void TurbineLoadControllerDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char TurbineLoadControllerDynamics::debugName[] = "TurbineLoadControllerDynamics"; -const char* TurbineLoadControllerDynamics::debugString() +void TurbineLoadControllerDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineLoadControllerDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerDynamics.TurbineGovernorDynamics"), &assign_TurbineLoadControllerDynamics_TurbineGovernorDynamics)); } const BaseClassDefiner TurbineLoadControllerDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner TurbineLoadControllerDynamics::declare() return BaseClassDefiner(TurbineLoadControllerDynamics::addConstructToMap, TurbineLoadControllerDynamics::addPrimitiveAssignFnsToMap, TurbineLoadControllerDynamics::addClassAssignFnsToMap, TurbineLoadControllerDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineLoadControllerDynamics_factory() + { + return new TurbineLoadControllerDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.hpp b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.hpp index f7ce321c2..22756c038 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerDynamics.hpp @@ -1,38 +1,39 @@ #ifndef TurbineLoadControllerDynamics_H #define TurbineLoadControllerDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class TurbineGovernorDynamics; -class TurbineGovernorDynamics; /* Turbine load controller function block whose behavior is described by reference to a standard model */ - class TurbineLoadControllerDynamics: public DynamicsFunctionBlock + class TurbineLoadControllerDynamics : public DynamicsFunctionBlock { - public: - CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor controlled by this turbine load controller. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineLoadControllerDynamics(); - virtual ~TurbineLoadControllerDynamics(); - + ~TurbineLoadControllerDynamics() override; + + CIMPP::TurbineGovernorDynamics* TurbineGovernorDynamics; /* Turbine-governor controlled by this turbine load controller. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineLoadControllerDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.cpp b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.cpp index b2e2a832e..70752dcc4 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "TurbineLoadControllerDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "TurbineLoadControllerUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; TurbineLoadControllerUserDefined::TurbineLoadControllerUserDefined() {}; - TurbineLoadControllerUserDefined::~TurbineLoadControllerUserDefined() {}; -bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_TurbineLoadControllerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_TurbineLoadControllerUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass*, BaseClass*); +bool assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + TurbineLoadControllerUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_TurbineLoadControllerUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* TurbineLoadControllerUserDefined_factory() { - return new TurbineLoadControllerUserDefined; - } +const char TurbineLoadControllerUserDefined::debugName[] = "TurbineLoadControllerUserDefined"; +const char* TurbineLoadControllerUserDefined::debugString() const +{ + return TurbineLoadControllerUserDefined::debugName; } -void TurbineLoadControllerUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void TurbineLoadControllerUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined"), &TurbineLoadControllerUserDefined_factory)); } -void TurbineLoadControllerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void TurbineLoadControllerUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined.proprietary"), &assign_TurbineLoadControllerUserDefined_proprietary)); - } - -void TurbineLoadControllerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined.ProprietaryParameterDynamics"), &assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics)); } -const char TurbineLoadControllerUserDefined::debugName[] = "TurbineLoadControllerUserDefined"; -const char* TurbineLoadControllerUserDefined::debugString() +void TurbineLoadControllerUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return TurbineLoadControllerUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:TurbineLoadControllerUserDefined.ProprietaryParameterDynamics"), &assign_TurbineLoadControllerUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner TurbineLoadControllerUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner TurbineLoadControllerUserDefined::declare() return BaseClassDefiner(TurbineLoadControllerUserDefined::addConstructToMap, TurbineLoadControllerUserDefined::addPrimitiveAssignFnsToMap, TurbineLoadControllerUserDefined::addClassAssignFnsToMap, TurbineLoadControllerUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* TurbineLoadControllerUserDefined_factory() + { + return new TurbineLoadControllerUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.hpp b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.hpp index 45616aba3..d37fd76e1 100644 --- a/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/TurbineLoadControllerUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef TurbineLoadControllerUserDefined_H #define TurbineLoadControllerUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "TurbineLoadControllerDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "TurbineLoadControllerDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Turbine load controller function block whose dynamic behaviour is described by */ - class TurbineLoadControllerUserDefined: public TurbineLoadControllerDynamics + class TurbineLoadControllerUserDefined : public TurbineLoadControllerDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ TurbineLoadControllerUserDefined(); - virtual ~TurbineLoadControllerUserDefined(); - + ~TurbineLoadControllerUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* TurbineLoadControllerUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.cpp b/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.cpp index 659682375..c9798125d 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.cpp @@ -1,7 +1,11 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLim2Simplified.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -13,129 +17,132 @@ using namespace CIMPP; UnderexcLim2Simplified::UnderexcLim2Simplified() {}; - UnderexcLim2Simplified::~UnderexcLim2Simplified() {}; +bool assign_UnderexcLim2Simplified_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kui; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLim2Simplified_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLim2Simplified_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kui; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLim2Simplified_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLim2Simplified* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLim2Simplified_factory() { - return new UnderexcLim2Simplified; - } +const char UnderexcLim2Simplified::debugName[] = "UnderexcLim2Simplified"; +const char* UnderexcLim2Simplified::debugString() const +{ + return UnderexcLim2Simplified::debugName; } -void UnderexcLim2Simplified::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLim2Simplified::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified"), &UnderexcLim2Simplified_factory)); } -void UnderexcLim2Simplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q0"), &assign_UnderexcLim2Simplified_q0)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q1"), &assign_UnderexcLim2Simplified_q1)); +void UnderexcLim2Simplified::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.kui"), &assign_UnderexcLim2Simplified_kui)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.p0"), &assign_UnderexcLim2Simplified_p0)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.p1"), &assign_UnderexcLim2Simplified_p1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.kui"), &assign_UnderexcLim2Simplified_kui)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.vuimin"), &assign_UnderexcLim2Simplified_vuimin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q0"), &assign_UnderexcLim2Simplified_q0)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.q1"), &assign_UnderexcLim2Simplified_q1)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.vuimax"), &assign_UnderexcLim2Simplified_vuimax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLim2Simplified.vuimin"), &assign_UnderexcLim2Simplified_vuimin)); } -void UnderexcLim2Simplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLim2Simplified::debugName[] = "UnderexcLim2Simplified"; -const char* UnderexcLim2Simplified::debugString() +void UnderexcLim2Simplified::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLim2Simplified::debugName; } const BaseClassDefiner UnderexcLim2Simplified::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner UnderexcLim2Simplified::declare() return BaseClassDefiner(UnderexcLim2Simplified::addConstructToMap, UnderexcLim2Simplified::addPrimitiveAssignFnsToMap, UnderexcLim2Simplified::addClassAssignFnsToMap, UnderexcLim2Simplified::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLim2Simplified_factory() + { + return new UnderexcLim2Simplified; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.hpp b/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.hpp index cd0a3f9ca..8d1117474 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLim2Simplified.hpp @@ -1,44 +1,45 @@ #ifndef UnderexcLim2Simplified_H #define UnderexcLim2Simplified_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* This model can be derived from UnderexcLimIEEE2. The limit characteristic (look -up table) is a single straight-line, the same as UnderexcLimIEEE2 (see Figure 10.4 (p 32), IEEE 421.5-2005 Section 10.2). */ - class UnderexcLim2Simplified: public UnderexcitationLimiterDynamics + class UnderexcLim2Simplified : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU q0; /* Segment Q initial point (Q0). Typical Value = -0.31. Default: nullptr */ - CIMPP::PU q1; /* Segment Q end point (Q1). Typical Value = -0.1. Default: nullptr */ - CIMPP::PU p0; /* Segment P initial point (P0). Typical Value = 0. Default: nullptr */ - CIMPP::PU p1; /* Segment P end point (P1). Typical Value = 1. Default: nullptr */ - CIMPP::PU kui; /* Gain Under excitation limiter (Kui). Typical Value = 0.1. Default: nullptr */ - CIMPP::PU vuimin; /* Minimum error signal (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU vuimax; /* Maximum error signal (V). Typical Value = 1. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLim2Simplified(); - virtual ~UnderexcLim2Simplified(); - + ~UnderexcLim2Simplified() override; + + CIMPP::PU kui; /* Gain Under excitation limiter (Kui). Typical Value = 0.1. Default: nullptr */ + CIMPP::PU p0; /* Segment P initial point (P0). Typical Value = 0. Default: nullptr */ + CIMPP::PU p1; /* Segment P end point (P1). Typical Value = 1. Default: nullptr */ + CIMPP::PU q0; /* Segment Q initial point (Q0). Typical Value = -0.31. Default: nullptr */ + CIMPP::PU q1; /* Segment Q end point (Q1). Typical Value = -0.1. Default: nullptr */ + CIMPP::PU vuimax; /* Maximum error signal (V). Typical Value = 1. Default: nullptr */ + CIMPP::PU vuimin; /* Minimum error signal (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLim2Simplified_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.cpp b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.cpp index 713167cb8..e09b8a4fd 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.cpp @@ -1,11 +1,11 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimIEEE1.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -17,245 +17,260 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" +#include "PU.hpp" using namespace CIMPP; UnderexcLimIEEE1::UnderexcLimIEEE1() {}; - UnderexcLimIEEE1::~UnderexcLimIEEE1() {}; +bool assign_UnderexcLimIEEE1_kuc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kuc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kuf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kui; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_kur(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kur; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vucmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vucmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE1_vurmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vurmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimIEEE1_kur(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kur; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kuc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kuc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kuf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vurmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vurmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vucmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vucmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kui; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE1_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLimIEEE1_factory() { - return new UnderexcLimIEEE1; - } +const char UnderexcLimIEEE1::debugName[] = "UnderexcLimIEEE1"; +const char* UnderexcLimIEEE1::debugString() const +{ + return UnderexcLimIEEE1::debugName; } -void UnderexcLimIEEE1::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimIEEE1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1"), &UnderexcLimIEEE1_factory)); } -void UnderexcLimIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kur"), &assign_UnderexcLimIEEE1_kur)); +void UnderexcLimIEEE1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kuc"), &assign_UnderexcLimIEEE1_kuc)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kuf"), &assign_UnderexcLimIEEE1_kuf)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vurmax"), &assign_UnderexcLimIEEE1_vurmax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vucmax"), &assign_UnderexcLimIEEE1_vucmax)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kui"), &assign_UnderexcLimIEEE1_kui)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kul"), &assign_UnderexcLimIEEE1_kul)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimax"), &assign_UnderexcLimIEEE1_vuimax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimin"), &assign_UnderexcLimIEEE1_vuimin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.kur"), &assign_UnderexcLimIEEE1_kur)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu1"), &assign_UnderexcLimIEEE1_tu1)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu2"), &assign_UnderexcLimIEEE1_tu2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu3"), &assign_UnderexcLimIEEE1_tu3)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.tu4"), &assign_UnderexcLimIEEE1_tu4)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vucmax"), &assign_UnderexcLimIEEE1_vucmax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimax"), &assign_UnderexcLimIEEE1_vuimax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vuimin"), &assign_UnderexcLimIEEE1_vuimin)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vulmax"), &assign_UnderexcLimIEEE1_vulmax)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vulmin"), &assign_UnderexcLimIEEE1_vulmin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE1.vurmax"), &assign_UnderexcLimIEEE1_vurmax)); } -void UnderexcLimIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimIEEE1::debugName[] = "UnderexcLimIEEE1"; -const char* UnderexcLimIEEE1::debugString() +void UnderexcLimIEEE1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimIEEE1::debugName; } const BaseClassDefiner UnderexcLimIEEE1::declare() @@ -263,4 +278,10 @@ const BaseClassDefiner UnderexcLimIEEE1::declare() return BaseClassDefiner(UnderexcLimIEEE1::addConstructToMap, UnderexcLimIEEE1::addPrimitiveAssignFnsToMap, UnderexcLimIEEE1::addClassAssignFnsToMap, UnderexcLimIEEE1::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimIEEE1_factory() + { + return new UnderexcLimIEEE1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.hpp b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.hpp index f8bf85ce3..8d114d67e 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE1.hpp @@ -1,53 +1,54 @@ #ifndef UnderexcLimIEEE1_H #define UnderexcLimIEEE1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents the Type UEL1 model which has a circular limit boundary when plotted in terms of machine reactive power vs. real power output. Reference: IEEE UEL1 421.5-2005 Section 10.1. */ - class UnderexcLimIEEE1: public UnderexcitationLimiterDynamics + class UnderexcLimIEEE1 : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU kur; /* UEL radius setting (K). Typical Value = 1.95. Default: nullptr */ - CIMPP::PU kuc; /* UEL center setting (K). Typical Value = 1.38. Default: nullptr */ - CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 3.3. Default: nullptr */ - CIMPP::PU vurmax; /* UEL maximum limit for radius phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ - CIMPP::PU vucmax; /* UEL maximum limit for operating point phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ - CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 100. Default: nullptr */ - CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Default: nullptr */ - CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Default: nullptr */ - CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ - CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 18. Default: nullptr */ - CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = -18. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimIEEE1(); - virtual ~UnderexcLimIEEE1(); - + ~UnderexcLimIEEE1() override; + + CIMPP::PU kuc; /* UEL center setting (K). Typical Value = 1.38. Default: nullptr */ + CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 3.3. Default: nullptr */ + CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 100. Default: nullptr */ + CIMPP::PU kur; /* UEL radius setting (K). Typical Value = 1.95. Default: nullptr */ + CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0.05. Default: nullptr */ + CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::PU vucmax; /* UEL maximum limit for operating point phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ + CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Default: nullptr */ + CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Default: nullptr */ + CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 18. Default: nullptr */ + CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = -18. Default: nullptr */ + CIMPP::PU vurmax; /* UEL maximum limit for radius phasor magnitude (V). Typical Value = 5.8. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimIEEE1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.cpp b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.cpp index 3a58421dd..1fdffe52d 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.cpp @@ -1,21 +1,19 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimIEEE2.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" +#include +#include + +#include "Simple_Float.hpp" +#include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -36,601 +34,643 @@ #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" -#include "Simple_Float.hpp" using namespace CIMPP; UnderexcLimIEEE2::UnderexcLimIEEE2() {}; - UnderexcLimIEEE2::~UnderexcLimIEEE2() {}; +bool assign_UnderexcLimIEEE2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kfb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kfb; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kuf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kui; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_p9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->p9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q10; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q5; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q6; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q7; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q8; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_q9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->q9; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu3; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tu4; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tul; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tup; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_tuq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_tuv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vuimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_UnderexcLimIEEE2_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimIEEE2_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vulmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimIEEE2_tuv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_tup(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tup; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_tuq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_kui(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kui; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_kul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_vuimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimIEEE2_vuimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vuimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_kuf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kuf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_kfb(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kfb; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tul(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tul; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_tu4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tu4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_vulmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_vulmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vulmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q3(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q3; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q4(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q4; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q5(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q5; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q6(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q6; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q7(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q7; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q8(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q8; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q9(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q9; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_p10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->p10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_q10(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->q10; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_k1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_UnderexcLimIEEE2_k2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimIEEE2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* UnderexcLimIEEE2_factory() { - return new UnderexcLimIEEE2; - } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const char UnderexcLimIEEE2::debugName[] = "UnderexcLimIEEE2"; +const char* UnderexcLimIEEE2::debugString() const +{ + return UnderexcLimIEEE2::debugName; } -void UnderexcLimIEEE2::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimIEEE2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2"), &UnderexcLimIEEE2_factory)); } -void UnderexcLimIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuv"), &assign_UnderexcLimIEEE2_tuv)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tup"), &assign_UnderexcLimIEEE2_tup)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuq"), &assign_UnderexcLimIEEE2_tuq)); +void UnderexcLimIEEE2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k1"), &assign_UnderexcLimIEEE2_k1)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k2"), &assign_UnderexcLimIEEE2_k2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kfb"), &assign_UnderexcLimIEEE2_kfb)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kuf"), &assign_UnderexcLimIEEE2_kuf)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kui"), &assign_UnderexcLimIEEE2_kui)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kul"), &assign_UnderexcLimIEEE2_kul)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimax"), &assign_UnderexcLimIEEE2_vuimax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimin"), &assign_UnderexcLimIEEE2_vuimin)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kuf"), &assign_UnderexcLimIEEE2_kuf)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.kfb"), &assign_UnderexcLimIEEE2_kfb)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tul"), &assign_UnderexcLimIEEE2_tul)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu1"), &assign_UnderexcLimIEEE2_tu1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu2"), &assign_UnderexcLimIEEE2_tu2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu3"), &assign_UnderexcLimIEEE2_tu3)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu4"), &assign_UnderexcLimIEEE2_tu4)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmax"), &assign_UnderexcLimIEEE2_vulmax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmin"), &assign_UnderexcLimIEEE2_vulmin)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p0"), &assign_UnderexcLimIEEE2_p0)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q0"), &assign_UnderexcLimIEEE2_q0)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p1"), &assign_UnderexcLimIEEE2_p1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q1"), &assign_UnderexcLimIEEE2_q1)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p10"), &assign_UnderexcLimIEEE2_p10)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p2"), &assign_UnderexcLimIEEE2_p2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q2"), &assign_UnderexcLimIEEE2_q2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p3"), &assign_UnderexcLimIEEE2_p3)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q3"), &assign_UnderexcLimIEEE2_q3)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p4"), &assign_UnderexcLimIEEE2_p4)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q4"), &assign_UnderexcLimIEEE2_q4)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p5"), &assign_UnderexcLimIEEE2_p5)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q5"), &assign_UnderexcLimIEEE2_q5)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p6"), &assign_UnderexcLimIEEE2_p6)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q6"), &assign_UnderexcLimIEEE2_q6)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p7"), &assign_UnderexcLimIEEE2_p7)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q7"), &assign_UnderexcLimIEEE2_q7)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p8"), &assign_UnderexcLimIEEE2_p8)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q8"), &assign_UnderexcLimIEEE2_q8)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p9"), &assign_UnderexcLimIEEE2_p9)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q9"), &assign_UnderexcLimIEEE2_q9)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.p10"), &assign_UnderexcLimIEEE2_p10)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q0"), &assign_UnderexcLimIEEE2_q0)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q1"), &assign_UnderexcLimIEEE2_q1)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q10"), &assign_UnderexcLimIEEE2_q10)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k1"), &assign_UnderexcLimIEEE2_k1)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.k2"), &assign_UnderexcLimIEEE2_k2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q2"), &assign_UnderexcLimIEEE2_q2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q3"), &assign_UnderexcLimIEEE2_q3)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q4"), &assign_UnderexcLimIEEE2_q4)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q5"), &assign_UnderexcLimIEEE2_q5)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q6"), &assign_UnderexcLimIEEE2_q6)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q7"), &assign_UnderexcLimIEEE2_q7)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q8"), &assign_UnderexcLimIEEE2_q8)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.q9"), &assign_UnderexcLimIEEE2_q9)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu1"), &assign_UnderexcLimIEEE2_tu1)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu2"), &assign_UnderexcLimIEEE2_tu2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu3"), &assign_UnderexcLimIEEE2_tu3)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tu4"), &assign_UnderexcLimIEEE2_tu4)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tul"), &assign_UnderexcLimIEEE2_tul)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tup"), &assign_UnderexcLimIEEE2_tup)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuq"), &assign_UnderexcLimIEEE2_tuq)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.tuv"), &assign_UnderexcLimIEEE2_tuv)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimax"), &assign_UnderexcLimIEEE2_vuimax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vuimin"), &assign_UnderexcLimIEEE2_vuimin)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmax"), &assign_UnderexcLimIEEE2_vulmax)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimIEEE2.vulmin"), &assign_UnderexcLimIEEE2_vulmin)); } -void UnderexcLimIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimIEEE2::debugName[] = "UnderexcLimIEEE2"; -const char* UnderexcLimIEEE2::debugString() +void UnderexcLimIEEE2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimIEEE2::debugName; } const BaseClassDefiner UnderexcLimIEEE2::declare() @@ -638,4 +678,10 @@ const BaseClassDefiner UnderexcLimIEEE2::declare() return BaseClassDefiner(UnderexcLimIEEE2::addConstructToMap, UnderexcLimIEEE2::addPrimitiveAssignFnsToMap, UnderexcLimIEEE2::addClassAssignFnsToMap, UnderexcLimIEEE2::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimIEEE2_factory() + { + return new UnderexcLimIEEE2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.hpp b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.hpp index 94c021f10..c7a840649 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimIEEE2.hpp @@ -1,79 +1,80 @@ #ifndef UnderexcLimIEEE2_H #define UnderexcLimIEEE2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Seconds.hpp" +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents the Type UEL2 which has either a straight-line or multi-segment characteristic when plotted in terms of machine reactive power output vs. real power output. Reference: IEEE UEL2 421.5-2005 Section 10.2. (Limit characteristic lookup table shown in Figure 10.4 (p 32) of the standard). */ - class UnderexcLimIEEE2: public UnderexcitationLimiterDynamics + class UnderexcLimIEEE2 : public UnderexcitationLimiterDynamics { - public: - CIMPP::Seconds tuv; /* Voltage filter time constant (T). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tup; /* Real power filter time constant (T). Typical Value = 5. Default: nullptr */ - CIMPP::Seconds tuq; /* Reactive power filter time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0.5. Default: nullptr */ - CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 0.8. Default: nullptr */ - CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 0. Default: nullptr */ - CIMPP::PU kfb; /* Gain associated with optional integrator feedback input signal to UEL (K). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tul; /* Time constant associated with optional integrator feedback input signal to UEL (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ - CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 0.25. Default: nullptr */ - CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = 0. Default: nullptr */ - CIMPP::PU p0; /* Real power values for endpoints (P). Typical Value = 0. Default: nullptr */ - CIMPP::PU q0; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ - CIMPP::PU p1; /* Real power values for endpoints (P). Typical Value = 0.3. Default: nullptr */ - CIMPP::PU q1; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ - CIMPP::PU p2; /* Real power values for endpoints (P). Typical Value = 0.6. Default: nullptr */ - CIMPP::PU q2; /* Reactive power values for endpoints (Q). Typical Value = -0.28. Default: nullptr */ - CIMPP::PU p3; /* Real power values for endpoints (P). Typical Value = 0.9. Default: nullptr */ - CIMPP::PU q3; /* Reactive power values for endpoints (Q). Typical Value = -0.21. Default: nullptr */ - CIMPP::PU p4; /* Real power values for endpoints (P). Typical Value = 1.02. Default: nullptr */ - CIMPP::PU q4; /* Reactive power values for endpoints (Q). Typical Value = 0. Default: nullptr */ - CIMPP::PU p5; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q5; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p6; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q6; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p7; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q7; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p8; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q8; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p9; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q9; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::PU p10; /* Real power values for endpoints (P). Default: nullptr */ - CIMPP::PU q10; /* Reactive power values for endpoints (Q). Default: nullptr */ - CIMPP::Simple_Float k1; /* UEL terminal voltage exponent applied to real power input to UEL limit look-up table (k1). Typical Value = 2. Default: nullptr */ - CIMPP::Simple_Float k2; /* UEL terminal voltage exponent applied to reactive power output from UEL limit look-up table (k2). Typical Value = 2. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimIEEE2(); - virtual ~UnderexcLimIEEE2(); - + ~UnderexcLimIEEE2() override; + + CIMPP::Simple_Float k1; /* UEL terminal voltage exponent applied to real power input to UEL limit look-up table (k1). Typical Value = 2. Default: nullptr */ + CIMPP::Simple_Float k2; /* UEL terminal voltage exponent applied to reactive power output from UEL limit look-up table (k2). Typical Value = 2. Default: nullptr */ + CIMPP::PU kfb; /* Gain associated with optional integrator feedback input signal to UEL (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kuf; /* UEL excitation system stabilizer gain (K). Typical Value = 0. Default: nullptr */ + CIMPP::PU kui; /* UEL integral gain (K). Typical Value = 0.5. Default: nullptr */ + CIMPP::PU kul; /* UEL proportional gain (K). Typical Value = 0.8. Default: nullptr */ + CIMPP::PU p0; /* Real power values for endpoints (P). Typical Value = 0. Default: nullptr */ + CIMPP::PU p1; /* Real power values for endpoints (P). Typical Value = 0.3. Default: nullptr */ + CIMPP::PU p10; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p2; /* Real power values for endpoints (P). Typical Value = 0.6. Default: nullptr */ + CIMPP::PU p3; /* Real power values for endpoints (P). Typical Value = 0.9. Default: nullptr */ + CIMPP::PU p4; /* Real power values for endpoints (P). Typical Value = 1.02. Default: nullptr */ + CIMPP::PU p5; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p6; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p7; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p8; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU p9; /* Real power values for endpoints (P). Default: nullptr */ + CIMPP::PU q0; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ + CIMPP::PU q1; /* Reactive power values for endpoints (Q). Typical Value = -0.31. Default: nullptr */ + CIMPP::PU q10; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q2; /* Reactive power values for endpoints (Q). Typical Value = -0.28. Default: nullptr */ + CIMPP::PU q3; /* Reactive power values for endpoints (Q). Typical Value = -0.21. Default: nullptr */ + CIMPP::PU q4; /* Reactive power values for endpoints (Q). Typical Value = 0. Default: nullptr */ + CIMPP::PU q5; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q6; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q7; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q8; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::PU q9; /* Reactive power values for endpoints (Q). Default: nullptr */ + CIMPP::Seconds tu1; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu2; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu3; /* UEL lead time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tu4; /* UEL lag time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tul; /* Time constant associated with optional integrator feedback input signal to UEL (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tup; /* Real power filter time constant (T). Typical Value = 5. Default: nullptr */ + CIMPP::Seconds tuq; /* Reactive power filter time constant (T). Typical Value = 0. Default: nullptr */ + CIMPP::Seconds tuv; /* Voltage filter time constant (T). Typical Value = 5. Default: nullptr */ + CIMPP::PU vuimax; /* UEL integrator output maximum limit (V). Typical Value = 0.25. Default: nullptr */ + CIMPP::PU vuimin; /* UEL integrator output minimum limit (V). Typical Value = 0. Default: nullptr */ + CIMPP::PU vulmax; /* UEL output maximum limit (V). Typical Value = 0.25. Default: nullptr */ + CIMPP::PU vulmin; /* UEL output minimum limit (V). Typical Value = 0. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimIEEE2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimX1.cpp b/CGMES_2.4.15_27JAN2020/UnderexcLimX1.cpp index 63d2f2f3b..3d9a9b6e1 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimX1.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimX1.cpp @@ -1,126 +1,132 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimX1.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; UnderexcLimX1::UnderexcLimX1() {}; - UnderexcLimX1::~UnderexcLimX1() {}; +bool assign_UnderexcLimX1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->k; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->melmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX1_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimX1_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->melmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX1_k(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->k; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLimX1_factory() { - return new UnderexcLimX1; - } +const char UnderexcLimX1::debugName[] = "UnderexcLimX1"; +const char* UnderexcLimX1::debugString() const +{ + return UnderexcLimX1::debugName; } -void UnderexcLimX1::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimX1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimX1"), &UnderexcLimX1_factory)); } -void UnderexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void UnderexcLimX1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.k"), &assign_UnderexcLimX1_k)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.kf2"), &assign_UnderexcLimX1_kf2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tf2"), &assign_UnderexcLimX1_tf2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.km"), &assign_UnderexcLimX1_km)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tm"), &assign_UnderexcLimX1_tm)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.melmax"), &assign_UnderexcLimX1_melmax)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.k"), &assign_UnderexcLimX1_k)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tf2"), &assign_UnderexcLimX1_tf2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX1.tm"), &assign_UnderexcLimX1_tm)); } -void UnderexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimX1::debugName[] = "UnderexcLimX1"; -const char* UnderexcLimX1::debugString() +void UnderexcLimX1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimX1::debugName; } const BaseClassDefiner UnderexcLimX1::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner UnderexcLimX1::declare() return BaseClassDefiner(UnderexcLimX1::addConstructToMap, UnderexcLimX1::addPrimitiveAssignFnsToMap, UnderexcLimX1::addClassAssignFnsToMap, UnderexcLimX1::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimX1_factory() + { + return new UnderexcLimX1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimX1.hpp b/CGMES_2.4.15_27JAN2020/UnderexcLimX1.hpp index 0a28ebd83..f79ff24dd 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimX1.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimX1.hpp @@ -1,44 +1,42 @@ #ifndef UnderexcLimX1_H #define UnderexcLimX1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ - - /* - - */ - class UnderexcLimX1: public UnderexcitationLimiterDynamics + class UnderexcLimX1 : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ - CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ - CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ - CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ - CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ - CIMPP::PU k; /* Minimum excitation limit slope (K) (>0). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimX1(); - virtual ~UnderexcLimX1(); - + ~UnderexcLimX1() override; + + CIMPP::PU k; /* Minimum excitation limit slope (K) (>0). Default: nullptr */ + CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ + CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ + CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ + CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ + CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimX1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimX2.cpp b/CGMES_2.4.15_27JAN2020/UnderexcLimX2.cpp index 0a05e2ee8..9b6bc21c8 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimX2.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimX2.cpp @@ -1,141 +1,148 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcLimX2.hpp" +#include +#include + #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" -#include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" using namespace CIMPP; UnderexcLimX2::UnderexcLimX2() {}; - UnderexcLimX2::~UnderexcLimX2() {}; +bool assign_UnderexcLimX2_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->km; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->melmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_qo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qo; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->r; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tf2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_UnderexcLimX2_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tm; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_UnderexcLimX2_kf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_tf2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tf2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_km(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->km; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_tm(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tm; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_melmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->melmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_qo(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qo; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_UnderexcLimX2_r(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcLimX2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->r; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* UnderexcLimX2_factory() { - return new UnderexcLimX2; - } +const char UnderexcLimX2::debugName[] = "UnderexcLimX2"; +const char* UnderexcLimX2::debugString() const +{ + return UnderexcLimX2::debugName; } -void UnderexcLimX2::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcLimX2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcLimX2"), &UnderexcLimX2_factory)); } -void UnderexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void UnderexcLimX2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.kf2"), &assign_UnderexcLimX2_kf2)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tf2"), &assign_UnderexcLimX2_tf2)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.km"), &assign_UnderexcLimX2_km)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tm"), &assign_UnderexcLimX2_tm)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.melmax"), &assign_UnderexcLimX2_melmax)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.qo"), &assign_UnderexcLimX2_qo)); assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.r"), &assign_UnderexcLimX2_r)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tf2"), &assign_UnderexcLimX2_tf2)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcLimX2.tm"), &assign_UnderexcLimX2_tm)); } -void UnderexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char UnderexcLimX2::debugName[] = "UnderexcLimX2"; -const char* UnderexcLimX2::debugString() +void UnderexcLimX2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcLimX2::debugName; } const BaseClassDefiner UnderexcLimX2::declare() @@ -143,4 +150,10 @@ const BaseClassDefiner UnderexcLimX2::declare() return BaseClassDefiner(UnderexcLimX2::addConstructToMap, UnderexcLimX2::addPrimitiveAssignFnsToMap, UnderexcLimX2::addClassAssignFnsToMap, UnderexcLimX2::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcLimX2_factory() + { + return new UnderexcLimX2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcLimX2.hpp b/CGMES_2.4.15_27JAN2020/UnderexcLimX2.hpp index 9dde80c38..23ce6a21b 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcLimX2.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcLimX2.hpp @@ -1,45 +1,43 @@ #ifndef UnderexcLimX2_H #define UnderexcLimX2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ - - /* - - */ - class UnderexcLimX2: public UnderexcitationLimiterDynamics + class UnderexcLimX2 : public UnderexcitationLimiterDynamics { - public: - CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ - CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ - CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ - CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ - CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ - CIMPP::PU qo; /* Excitation center setting (Qo). Default: nullptr */ - CIMPP::PU r; /* Excitation radius (R). Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcLimX2(); - virtual ~UnderexcLimX2(); - + ~UnderexcLimX2() override; + + CIMPP::PU kf2; /* Differential gain (Kf2). Default: nullptr */ + CIMPP::PU km; /* Minimum excitation limit gain (Km). Default: nullptr */ + CIMPP::PU melmax; /* Minimum excitation limit value (MELMAX). Default: nullptr */ + CIMPP::PU qo; /* Excitation center setting (Qo). Default: nullptr */ + CIMPP::PU r; /* Excitation radius (R). Default: nullptr */ + CIMPP::Seconds tf2; /* Differential time constant (Tf2) (>0). Default: nullptr */ + CIMPP::Seconds tm; /* Minimum excitation limit time constant (Tm). Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcLimX2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.cpp b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.cpp index b12fed72e..131bea982 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.cpp @@ -1,61 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcitationLimiterDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -UnderexcitationLimiterDynamics::UnderexcitationLimiterDynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr) {}; - +UnderexcitationLimiterDynamics::UnderexcitationLimiterDynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr) {}; UnderexcitationLimiterDynamics::~UnderexcitationLimiterDynamics() {}; -bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass*, BaseClass*); -bool assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass*, BaseClass*); +bool assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_UnderexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* UnderexcitationLimiterDynamics_factory() { - return new UnderexcitationLimiterDynamics; +bool assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass*, BaseClass*); +bool assign_UnderexcitationLimiterDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + UnderexcitationLimiterDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_UnderexcitationLimiterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void UnderexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics"), &UnderexcitationLimiterDynamics_factory)); +const char UnderexcitationLimiterDynamics::debugName[] = "UnderexcitationLimiterDynamics"; +const char* UnderexcitationLimiterDynamics::debugString() const +{ + return UnderexcitationLimiterDynamics::debugName; } -void UnderexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void UnderexcitationLimiterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics"), &UnderexcitationLimiterDynamics_factory)); +} -void UnderexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.RemoteInputSignal"), &assign_UnderexcitationLimiterDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics)); +void UnderexcitationLimiterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char UnderexcitationLimiterDynamics::debugName[] = "UnderexcitationLimiterDynamics"; -const char* UnderexcitationLimiterDynamics::debugString() +void UnderexcitationLimiterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcitationLimiterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.ExcitationSystemDynamics"), &assign_UnderexcitationLimiterDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterDynamics.RemoteInputSignal"), &assign_UnderexcitationLimiterDynamics_RemoteInputSignal)); } const BaseClassDefiner UnderexcitationLimiterDynamics::declare() @@ -63,4 +78,10 @@ const BaseClassDefiner UnderexcitationLimiterDynamics::declare() return BaseClassDefiner(UnderexcitationLimiterDynamics::addConstructToMap, UnderexcitationLimiterDynamics::addPrimitiveAssignFnsToMap, UnderexcitationLimiterDynamics::addClassAssignFnsToMap, UnderexcitationLimiterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcitationLimiterDynamics_factory() + { + return new UnderexcitationLimiterDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.hpp b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.hpp index 1f6b6b2b6..1ad15fc65 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterDynamics.hpp @@ -1,40 +1,41 @@ #ifndef UnderexcitationLimiterDynamics_H #define UnderexcitationLimiterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Underexcitation limiter function block whose behaviour is described by reference to a standard model */ - class UnderexcitationLimiterDynamics: public DynamicsFunctionBlock + class UnderexcitationLimiterDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this underexcitation limiter model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this underexcitation limiter model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcitationLimiterDynamics(); - virtual ~UnderexcitationLimiterDynamics(); - + ~UnderexcitationLimiterDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this underexcitation limiter model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this underexcitation limiter model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcitationLimiterDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.cpp b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.cpp index 83d2787f9..6415389ab 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "UnderexcitationLimiterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnderexcitationLimiterUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; UnderexcitationLimiterUserDefined::UnderexcitationLimiterUserDefined() {}; - UnderexcitationLimiterUserDefined::~UnderexcitationLimiterUserDefined() {}; -bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_UnderexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_UnderexcitationLimiterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass*, BaseClass*); +bool assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + UnderexcitationLimiterUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_UnderexcitationLimiterUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* UnderexcitationLimiterUserDefined_factory() { - return new UnderexcitationLimiterUserDefined; - } +const char UnderexcitationLimiterUserDefined::debugName[] = "UnderexcitationLimiterUserDefined"; +const char* UnderexcitationLimiterUserDefined::debugString() const +{ + return UnderexcitationLimiterUserDefined::debugName; } -void UnderexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void UnderexcitationLimiterUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined"), &UnderexcitationLimiterUserDefined_factory)); } -void UnderexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void UnderexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined.proprietary"), &assign_UnderexcitationLimiterUserDefined_proprietary)); - } - -void UnderexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } -const char UnderexcitationLimiterUserDefined::debugName[] = "UnderexcitationLimiterUserDefined"; -const char* UnderexcitationLimiterUserDefined::debugString() +void UnderexcitationLimiterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return UnderexcitationLimiterUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:UnderexcitationLimiterUserDefined.ProprietaryParameterDynamics"), &assign_UnderexcitationLimiterUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner UnderexcitationLimiterUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner UnderexcitationLimiterUserDefined::declare() return BaseClassDefiner(UnderexcitationLimiterUserDefined::addConstructToMap, UnderexcitationLimiterUserDefined::addPrimitiveAssignFnsToMap, UnderexcitationLimiterUserDefined::addClassAssignFnsToMap, UnderexcitationLimiterUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* UnderexcitationLimiterUserDefined_factory() + { + return new UnderexcitationLimiterUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.hpp b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.hpp index fda986fbc..46f6cfdcb 100644 --- a/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/UnderexcitationLimiterUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef UnderexcitationLimiterUserDefined_H #define UnderexcitationLimiterUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "UnderexcitationLimiterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "UnderexcitationLimiterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Underexcitation limiter function block whose dynamic behaviour is described by */ - class UnderexcitationLimiterUserDefined: public UnderexcitationLimiterDynamics + class UnderexcitationLimiterUserDefined : public UnderexcitationLimiterDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ UnderexcitationLimiterUserDefined(); - virtual ~UnderexcitationLimiterUserDefined(); - + ~UnderexcitationLimiterUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* UnderexcitationLimiterUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/UnitMultiplier.cpp b/CGMES_2.4.15_27JAN2020/UnitMultiplier.cpp index 1c4e564c8..51e68a621 100644 --- a/CGMES_2.4.15_27JAN2020/UnitMultiplier.cpp +++ b/CGMES_2.4.15_27JAN2020/UnitMultiplier.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnitMultiplier.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::UnitMultiplier& rop) +UnitMultiplier& UnitMultiplier::operator=(UnitMultiplier_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +UnitMultiplier::operator UnitMultiplier_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char UnitMultiplier::debugName[] = "UnitMultiplier"; +const char* UnitMultiplier::debugString() const +{ + return UnitMultiplier::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, UnitMultiplier& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -78,5 +109,63 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const UnitMultiplier& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == UnitMultiplier::p) + { + EnumSymbol = "p"; + } + if (obj.value == UnitMultiplier::n) + { + EnumSymbol = "n"; + } + if (obj.value == UnitMultiplier::micro) + { + EnumSymbol = "micro"; + } + if (obj.value == UnitMultiplier::m) + { + EnumSymbol = "m"; + } + if (obj.value == UnitMultiplier::c) + { + EnumSymbol = "c"; + } + if (obj.value == UnitMultiplier::d) + { + EnumSymbol = "d"; + } + if (obj.value == UnitMultiplier::k) + { + EnumSymbol = "k"; + } + if (obj.value == UnitMultiplier::M) + { + EnumSymbol = "M"; + } + if (obj.value == UnitMultiplier::G) + { + EnumSymbol = "G"; + } + if (obj.value == UnitMultiplier::T) + { + EnumSymbol = "T"; + } + if (obj.value == UnitMultiplier::none) + { + EnumSymbol = "none"; + } + + if (!EnumSymbol.empty()) + { + os << "UnitMultiplier." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnitMultiplier.hpp b/CGMES_2.4.15_27JAN2020/UnitMultiplier.hpp index 8f4273089..710c6f153 100644 --- a/CGMES_2.4.15_27JAN2020/UnitMultiplier.hpp +++ b/CGMES_2.4.15_27JAN2020/UnitMultiplier.hpp @@ -1,57 +1,82 @@ #ifndef UnitMultiplier_H #define UnitMultiplier_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The unit multipliers defined for the CIM. */ - enum class UnitMultiplier + class UnitMultiplier { - /** - * Pico 10**-12. - */ - p, - /** - * Nano 10**-9. - */ - n, - /** - * Micro 10**-6. - */ - micro, - /** - * Milli 10**-3. - */ - m, - /** - * Centi 10**-2. - */ - c, - /** - * Deci 10**-1. - */ - d, - /** - * Kilo 10**3. - */ - k, - /** - * Mega 10**6. - */ - M, - /** - * Giga 10**9. - */ - G, - /** - * Tera 10**12. - */ - T, - /** - * No multiplier or equivalently multiply by 1. - */ - none, + public: + enum UnitMultiplier_ENUM + { + /** + * Pico 10**-12. + */ + p, + /** + * Nano 10**-9. + */ + n, + /** + * Micro 10**-6. + */ + micro, + /** + * Milli 10**-3. + */ + m, + /** + * Centi 10**-2. + */ + c, + /** + * Deci 10**-1. + */ + d, + /** + * Kilo 10**3. + */ + k, + /** + * Mega 10**6. + */ + M, + /** + * Giga 10**9. + */ + G, + /** + * Tera 10**12. + */ + T, + /** + * No multiplier or equivalently multiply by 1. + */ + none, + }; + + UnitMultiplier() : value(), initialized(false) {} + UnitMultiplier(UnitMultiplier_ENUM value) : value(value), initialized(true) {} + + UnitMultiplier& operator=(UnitMultiplier_ENUM rop); + operator UnitMultiplier_ENUM() const; + + UnitMultiplier_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, UnitMultiplier& rop); + friend std::ostream& operator<<(std::ostream& os, const UnitMultiplier& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::UnitMultiplier& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/UnitSymbol.cpp b/CGMES_2.4.15_27JAN2020/UnitSymbol.cpp index 2eafd7cdc..8812cdffb 100644 --- a/CGMES_2.4.15_27JAN2020/UnitSymbol.cpp +++ b/CGMES_2.4.15_27JAN2020/UnitSymbol.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "UnitSymbol.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::UnitSymbol& rop) +UnitSymbol& UnitSymbol::operator=(UnitSymbol_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +UnitSymbol::operator UnitSymbol_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char UnitSymbol::debugName[] = "UnitSymbol"; +const char* UnitSymbol::debugString() const +{ + return UnitSymbol::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, UnitSymbol& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -158,5 +189,127 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const UnitSymbol& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == UnitSymbol::VA) + { + EnumSymbol = "VA"; + } + if (obj.value == UnitSymbol::W) + { + EnumSymbol = "W"; + } + if (obj.value == UnitSymbol::VAr) + { + EnumSymbol = "VAr"; + } + if (obj.value == UnitSymbol::VAh) + { + EnumSymbol = "VAh"; + } + if (obj.value == UnitSymbol::Wh) + { + EnumSymbol = "Wh"; + } + if (obj.value == UnitSymbol::VArh) + { + EnumSymbol = "VArh"; + } + if (obj.value == UnitSymbol::V) + { + EnumSymbol = "V"; + } + if (obj.value == UnitSymbol::ohm) + { + EnumSymbol = "ohm"; + } + if (obj.value == UnitSymbol::A) + { + EnumSymbol = "A"; + } + if (obj.value == UnitSymbol::F) + { + EnumSymbol = "F"; + } + if (obj.value == UnitSymbol::H) + { + EnumSymbol = "H"; + } + if (obj.value == UnitSymbol::degC) + { + EnumSymbol = "degC"; + } + if (obj.value == UnitSymbol::s) + { + EnumSymbol = "s"; + } + if (obj.value == UnitSymbol::min) + { + EnumSymbol = "min"; + } + if (obj.value == UnitSymbol::h) + { + EnumSymbol = "h"; + } + if (obj.value == UnitSymbol::deg) + { + EnumSymbol = "deg"; + } + if (obj.value == UnitSymbol::rad) + { + EnumSymbol = "rad"; + } + if (obj.value == UnitSymbol::J) + { + EnumSymbol = "J"; + } + if (obj.value == UnitSymbol::N) + { + EnumSymbol = "N"; + } + if (obj.value == UnitSymbol::S) + { + EnumSymbol = "S"; + } + if (obj.value == UnitSymbol::none) + { + EnumSymbol = "none"; + } + if (obj.value == UnitSymbol::Hz) + { + EnumSymbol = "Hz"; + } + if (obj.value == UnitSymbol::g) + { + EnumSymbol = "g"; + } + if (obj.value == UnitSymbol::Pa) + { + EnumSymbol = "Pa"; + } + if (obj.value == UnitSymbol::m) + { + EnumSymbol = "m"; + } + if (obj.value == UnitSymbol::m2) + { + EnumSymbol = "m2"; + } + if (obj.value == UnitSymbol::m3) + { + EnumSymbol = "m3"; + } + + if (!EnumSymbol.empty()) + { + os << "UnitSymbol." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/UnitSymbol.hpp b/CGMES_2.4.15_27JAN2020/UnitSymbol.hpp index 536d56505..b63a20465 100644 --- a/CGMES_2.4.15_27JAN2020/UnitSymbol.hpp +++ b/CGMES_2.4.15_27JAN2020/UnitSymbol.hpp @@ -1,121 +1,146 @@ #ifndef UnitSymbol_H #define UnitSymbol_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* The units defined for usage in the CIM. */ - enum class UnitSymbol + class UnitSymbol { - /** - * Apparent power in volt ampere. - */ - VA, - /** - * Active power in watt. - */ - W, - /** - * Reactive power in volt ampere reactive. - */ - VAr, - /** - * Apparent energy in volt ampere hours. - */ - VAh, - /** - * Real energy in what hours. - */ - Wh, - /** - * Reactive energy in volt ampere reactive hours. - */ - VArh, - /** - * Voltage in volt. - */ - V, - /** - * Resistance in ohm. - */ - ohm, - /** - * Current in ampere. - */ - A, - /** - * Capacitance in farad. - */ - F, - /** - * Inductance in henry. - */ - H, - /** - * Relative temperature in degrees Celsius. In the SI unit system the symbol is [SYMBOL REMOVED]C. Electric charge is measured in coulomb that has the unit symbol C. To distinguish degree Celsius form coulomb the symbol used in the UML is degC. Reason for not using [SYMBOL REMOVED]C is the special character [SYMBOL REMOVED] is difficult to manage in software. - */ - degC, - /** - * Time in seconds. - */ - s, - /** - * Time in minutes. - */ - min, - /** - * Time in hours. - */ - h, - /** - * Plane angle in degrees. - */ - deg, - /** - * Plane angle in radians. - */ - rad, - /** - * Energy in joule. - */ - J, - /** - * Force in newton. - */ - N, - /** - * Conductance in siemens. - */ - S, - /** - * Dimension less quantity, e.g. count, per unit, etc. - */ - none, - /** - * Frequency in hertz. - */ - Hz, - /** - * Mass in gram. - */ - g, - /** - * Pressure in pascal (n/m2). - */ - Pa, - /** - * Length in meter. - */ - m, - /** - * Area in square meters. - */ - m2, - /** - * Volume in cubic meters. - */ - m3, + public: + enum UnitSymbol_ENUM + { + /** + * Apparent power in volt ampere. + */ + VA, + /** + * Active power in watt. + */ + W, + /** + * Reactive power in volt ampere reactive. + */ + VAr, + /** + * Apparent energy in volt ampere hours. + */ + VAh, + /** + * Real energy in what hours. + */ + Wh, + /** + * Reactive energy in volt ampere reactive hours. + */ + VArh, + /** + * Voltage in volt. + */ + V, + /** + * Resistance in ohm. + */ + ohm, + /** + * Current in ampere. + */ + A, + /** + * Capacitance in farad. + */ + F, + /** + * Inductance in henry. + */ + H, + /** + * Relative temperature in degrees Celsius. In the SI unit system the symbol is [SYMBOL REMOVED]C. Electric charge is measured in coulomb that has the unit symbol C. To distinguish degree Celsius form coulomb the symbol used in the UML is degC. Reason for not using [SYMBOL REMOVED]C is the special character [SYMBOL REMOVED] is difficult to manage in software. + */ + degC, + /** + * Time in seconds. + */ + s, + /** + * Time in minutes. + */ + min, + /** + * Time in hours. + */ + h, + /** + * Plane angle in degrees. + */ + deg, + /** + * Plane angle in radians. + */ + rad, + /** + * Energy in joule. + */ + J, + /** + * Force in newton. + */ + N, + /** + * Conductance in siemens. + */ + S, + /** + * Dimension less quantity, e.g. count, per unit, etc. + */ + none, + /** + * Frequency in hertz. + */ + Hz, + /** + * Mass in gram. + */ + g, + /** + * Pressure in pascal (n/m2). + */ + Pa, + /** + * Length in meter. + */ + m, + /** + * Area in square meters. + */ + m2, + /** + * Volume in cubic meters. + */ + m3, + }; + + UnitSymbol() : value(), initialized(false) {} + UnitSymbol(UnitSymbol_ENUM value) : value(value), initialized(true) {} + + UnitSymbol& operator=(UnitSymbol_ENUM rop); + operator UnitSymbol_ENUM() const; + + UnitSymbol_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, UnitSymbol& rop); + friend std::ostream& operator<<(std::ostream& os, const UnitSymbol& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::UnitSymbol& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/VAdjIEEE.cpp b/CGMES_2.4.15_27JAN2020/VAdjIEEE.cpp index 11850a91c..40cbde3f2 100644 --- a/CGMES_2.4.15_27JAN2020/VAdjIEEE.cpp +++ b/CGMES_2.4.15_27JAN2020/VAdjIEEE.cpp @@ -1,126 +1,132 @@ -#include -#include "VoltageAdjusterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VAdjIEEE.hpp" +#include +#include + #include "Simple_Float.hpp" +#include "Seconds.hpp" +#include "Seconds.hpp" #include "Simple_Float.hpp" #include "PU.hpp" #include "PU.hpp" -#include "Seconds.hpp" -#include "Seconds.hpp" using namespace CIMPP; VAdjIEEE::VAdjIEEE() {}; - VAdjIEEE::~VAdjIEEE() {}; +bool assign_VAdjIEEE_adjslew(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->adjslew; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_taoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->taoff; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_taon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->taon; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_vadjf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadjf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_vadjmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadjmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VAdjIEEE_vadjmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->vadjmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VAdjIEEE_vadjf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadjf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_adjslew(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->adjslew; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_vadjmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadjmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_vadjmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->vadjmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_taon(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->taon; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VAdjIEEE_taoff(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VAdjIEEE* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->taoff; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* VAdjIEEE_factory() { - return new VAdjIEEE; - } +const char VAdjIEEE::debugName[] = "VAdjIEEE"; +const char* VAdjIEEE::debugString() const +{ + return VAdjIEEE::debugName; } -void VAdjIEEE::addConstructToMap(std::unordered_map& factory_map) { +void VAdjIEEE::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VAdjIEEE"), &VAdjIEEE_factory)); } -void VAdjIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjf"), &assign_VAdjIEEE_vadjf)); +void VAdjIEEE::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.adjslew"), &assign_VAdjIEEE_adjslew)); + assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taoff"), &assign_VAdjIEEE_taoff)); + assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taon"), &assign_VAdjIEEE_taon)); + assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjf"), &assign_VAdjIEEE_vadjf)); assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjmax"), &assign_VAdjIEEE_vadjmax)); assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.vadjmin"), &assign_VAdjIEEE_vadjmin)); - assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taon"), &assign_VAdjIEEE_taon)); - assign_map.insert(std::make_pair(std::string("cim:VAdjIEEE.taoff"), &assign_VAdjIEEE_taoff)); } -void VAdjIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char VAdjIEEE::debugName[] = "VAdjIEEE"; -const char* VAdjIEEE::debugString() +void VAdjIEEE::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VAdjIEEE::debugName; } const BaseClassDefiner VAdjIEEE::declare() @@ -128,4 +134,10 @@ const BaseClassDefiner VAdjIEEE::declare() return BaseClassDefiner(VAdjIEEE::addConstructToMap, VAdjIEEE::addPrimitiveAssignFnsToMap, VAdjIEEE::addClassAssignFnsToMap, VAdjIEEE::debugName); } - +namespace CIMPP +{ + BaseClass* VAdjIEEE_factory() + { + return new VAdjIEEE; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VAdjIEEE.hpp b/CGMES_2.4.15_27JAN2020/VAdjIEEE.hpp index 29e19347e..dfbc75b3f 100644 --- a/CGMES_2.4.15_27JAN2020/VAdjIEEE.hpp +++ b/CGMES_2.4.15_27JAN2020/VAdjIEEE.hpp @@ -1,45 +1,46 @@ #ifndef VAdjIEEE_H #define VAdjIEEE_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageAdjusterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "VoltageAdjusterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* The class represents IEEE Voltage Adjuster which is used to represent the voltage adjuster in either a power factor or var control system. Reference: IEEE Standard 421.5-2005 Section 11.1. */ - class VAdjIEEE: public VoltageAdjusterDynamics + class VAdjIEEE : public VoltageAdjusterDynamics { - public: - CIMPP::Simple_Float vadjf; /* Set high to provide a continuous raise or lower (). Default: nullptr */ - CIMPP::Simple_Float adjslew; /* Rate at which output of adjuster changes (). Unit = sec./PU. Typical Value = 300. Default: nullptr */ - CIMPP::PU vadjmax; /* Maximum output of the adjuster (). Typical Value = 1.1. Default: nullptr */ - CIMPP::PU vadjmin; /* Minimum output of the adjuster (). Typical Value = 0.9. Default: nullptr */ - CIMPP::Seconds taon; /* Time that adjuster pulses are on (). Typical Value = 0.1. Default: nullptr */ - CIMPP::Seconds taoff; /* Time that adjuster pulses are off (). Typical Value = 0.5. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VAdjIEEE(); - virtual ~VAdjIEEE(); - + ~VAdjIEEE() override; + + CIMPP::Simple_Float adjslew; /* Rate at which output of adjuster changes (). Unit = sec./PU. Typical Value = 300. Default: nullptr */ + CIMPP::Seconds taoff; /* Time that adjuster pulses are off (). Typical Value = 0.5. Default: nullptr */ + CIMPP::Seconds taon; /* Time that adjuster pulses are on (). Typical Value = 0.1. Default: nullptr */ + CIMPP::Simple_Float vadjf; /* Set high to provide a continuous raise or lower (). Default: nullptr */ + CIMPP::PU vadjmax; /* Maximum output of the adjuster (). Typical Value = 1.1. Default: nullptr */ + CIMPP::PU vadjmin; /* Minimum output of the adjuster (). Typical Value = 0.9. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VAdjIEEE_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VCompIEEEType1.cpp b/CGMES_2.4.15_27JAN2020/VCompIEEEType1.cpp index ca9a4e20d..81a902412 100644 --- a/CGMES_2.4.15_27JAN2020/VCompIEEEType1.cpp +++ b/CGMES_2.4.15_27JAN2020/VCompIEEEType1.cpp @@ -1,81 +1,84 @@ -#include -#include "VoltageCompensatorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VCompIEEEType1.hpp" -#include "PU.hpp" +#include +#include + #include "PU.hpp" #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; VCompIEEEType1::VCompIEEEType1() {}; - VCompIEEEType1::~VCompIEEEType1() {}; +bool assign_VCompIEEEType1_rc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VCompIEEEType1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VCompIEEEType1_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VCompIEEEType1_rc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VCompIEEEType1_xc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VCompIEEEType1_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType1* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* VCompIEEEType1_factory() { - return new VCompIEEEType1; - } +const char VCompIEEEType1::debugName[] = "VCompIEEEType1"; +const char* VCompIEEEType1::debugString() const +{ + return VCompIEEEType1::debugName; } -void VCompIEEEType1::addConstructToMap(std::unordered_map& factory_map) { +void VCompIEEEType1::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VCompIEEEType1"), &VCompIEEEType1_factory)); } -void VCompIEEEType1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VCompIEEEType1::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.rc"), &assign_VCompIEEEType1_rc)); - assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.xc"), &assign_VCompIEEEType1_xc)); assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.tr"), &assign_VCompIEEEType1_tr)); + assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType1.xc"), &assign_VCompIEEEType1_xc)); } -void VCompIEEEType1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char VCompIEEEType1::debugName[] = "VCompIEEEType1"; -const char* VCompIEEEType1::debugString() +void VCompIEEEType1::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VCompIEEEType1::debugName; } const BaseClassDefiner VCompIEEEType1::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner VCompIEEEType1::declare() return BaseClassDefiner(VCompIEEEType1::addConstructToMap, VCompIEEEType1::addPrimitiveAssignFnsToMap, VCompIEEEType1::addClassAssignFnsToMap, VCompIEEEType1::debugName); } - +namespace CIMPP +{ + BaseClass* VCompIEEEType1_factory() + { + return new VCompIEEEType1; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VCompIEEEType1.hpp b/CGMES_2.4.15_27JAN2020/VCompIEEEType1.hpp index dba5bc5ba..3c20535b0 100644 --- a/CGMES_2.4.15_27JAN2020/VCompIEEEType1.hpp +++ b/CGMES_2.4.15_27JAN2020/VCompIEEEType1.hpp @@ -1,41 +1,42 @@ #ifndef VCompIEEEType1_H #define VCompIEEEType1_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageCompensatorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageCompensatorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Reference: IEEE Standard 421.5-2005 Section 4. */ - class VCompIEEEType1: public VoltageCompensatorDynamics + class VCompIEEEType1 : public VoltageCompensatorDynamics { - public: - CIMPP::PU rc; /* Default: nullptr */ - CIMPP::PU xc; /* Default: nullptr */ - CIMPP::Seconds tr; /* Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VCompIEEEType1(); - virtual ~VCompIEEEType1(); - + ~VCompIEEEType1() override; + + CIMPP::PU rc; /* Default: nullptr */ + CIMPP::Seconds tr; /* Default: nullptr */ + CIMPP::PU xc; /* Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VCompIEEEType1_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VCompIEEEType2.cpp b/CGMES_2.4.15_27JAN2020/VCompIEEEType2.cpp index 14daa99b2..828250e60 100644 --- a/CGMES_2.4.15_27JAN2020/VCompIEEEType2.cpp +++ b/CGMES_2.4.15_27JAN2020/VCompIEEEType2.cpp @@ -1,63 +1,72 @@ -#include -#include "VoltageCompensatorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VCompIEEEType2.hpp" -#include "Seconds.hpp" +#include +#include + #include "GenICompensationForGenJ.hpp" +#include "Seconds.hpp" using namespace CIMPP; -VCompIEEEType2::VCompIEEEType2(): GenICompensationForGenJ(nullptr) {}; - +VCompIEEEType2::VCompIEEEType2() {}; VCompIEEEType2::~VCompIEEEType2() {}; -bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1)) { - element->GenICompensationForGenJ = dynamic_cast(BaseClass_ptr2); - if(element->GenICompensationForGenJ != nullptr) - return true; - } - return false; +bool assign_VCompIEEEType2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tr; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_VCompIEEEType2_tr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass*, BaseClass*); +bool assign_VCompIEEEType2_GenICompensationForGenJ(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VCompIEEEType2* element = dynamic_cast(BaseClass_ptr1); + GenICompensationForGenJ* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->GenICompensationForGenJ.begin(), element->GenICompensationForGenJ.end(), element2) == element->GenICompensationForGenJ.end()) + { + element->GenICompensationForGenJ.push_back(element2); + return assign_GenICompensationForGenJ_VcompIEEEType2(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VCompIEEEType2_factory() { - return new VCompIEEEType2; - } +const char VCompIEEEType2::debugName[] = "VCompIEEEType2"; +const char* VCompIEEEType2::debugString() const +{ + return VCompIEEEType2::debugName; } -void VCompIEEEType2::addConstructToMap(std::unordered_map& factory_map) { +void VCompIEEEType2::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VCompIEEEType2"), &VCompIEEEType2_factory)); } -void VCompIEEEType2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VCompIEEEType2::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType2.tr"), &assign_VCompIEEEType2_tr)); - } - -void VCompIEEEType2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType2.GenICompensationForGenJ"), &assign_VCompIEEEType2_GenICompensationForGenJ)); } -const char VCompIEEEType2::debugName[] = "VCompIEEEType2"; -const char* VCompIEEEType2::debugString() +void VCompIEEEType2::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VCompIEEEType2::debugName; + assign_map.insert(std::make_pair(std::string("cim:VCompIEEEType2.GenICompensationForGenJ"), &assign_VCompIEEEType2_GenICompensationForGenJ)); } const BaseClassDefiner VCompIEEEType2::declare() @@ -65,4 +74,10 @@ const BaseClassDefiner VCompIEEEType2::declare() return BaseClassDefiner(VCompIEEEType2::addConstructToMap, VCompIEEEType2::addPrimitiveAssignFnsToMap, VCompIEEEType2::addClassAssignFnsToMap, VCompIEEEType2::debugName); } - +namespace CIMPP +{ + BaseClass* VCompIEEEType2_factory() + { + return new VCompIEEEType2; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VCompIEEEType2.hpp b/CGMES_2.4.15_27JAN2020/VCompIEEEType2.hpp index 14dd6d973..2eb1c729a 100644 --- a/CGMES_2.4.15_27JAN2020/VCompIEEEType2.hpp +++ b/CGMES_2.4.15_27JAN2020/VCompIEEEType2.hpp @@ -1,40 +1,38 @@ #ifndef VCompIEEEType2_H #define VCompIEEEType2_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageCompensatorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageCompensatorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class GenICompensationForGenJ; - -class GenICompensationForGenJ; - /* - - */ - class VCompIEEEType2: public VoltageCompensatorDynamics + class VCompIEEEType2 : public VoltageCompensatorDynamics { - public: - CIMPP::Seconds tr; /* Default: nullptr */ - CIMPP::GenICompensationForGenJ* GenICompensationForGenJ; /* Compensation of this voltage compensator`s generator for current flow out of another generator. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VCompIEEEType2(); - virtual ~VCompIEEEType2(); - + ~VCompIEEEType2() override; + + std::list GenICompensationForGenJ; /* Compensation of this voltage compensator`s generator for current flow out of another generator. Default: 0 */ + CIMPP::Seconds tr; /* Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VCompIEEEType2_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Validity.cpp b/CGMES_2.4.15_27JAN2020/Validity.cpp index be115cd76..9796a2efa 100644 --- a/CGMES_2.4.15_27JAN2020/Validity.cpp +++ b/CGMES_2.4.15_27JAN2020/Validity.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Validity.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::Validity& rop) +Validity& Validity::operator=(Validity_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +Validity::operator Validity_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char Validity::debugName[] = "Validity"; +const char* Validity::debugString() const +{ + return Validity::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Validity& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const Validity& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == Validity::GOOD) + { + EnumSymbol = "GOOD"; + } + if (obj.value == Validity::QUESTIONABLE) + { + EnumSymbol = "QUESTIONABLE"; + } + if (obj.value == Validity::INVALID) + { + EnumSymbol = "INVALID"; + } + + if (!EnumSymbol.empty()) + { + os << "Validity." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/Validity.hpp b/CGMES_2.4.15_27JAN2020/Validity.hpp index 5c66bbbc6..fb4d8ce56 100644 --- a/CGMES_2.4.15_27JAN2020/Validity.hpp +++ b/CGMES_2.4.15_27JAN2020/Validity.hpp @@ -1,25 +1,50 @@ #ifndef Validity_H #define Validity_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Validity for MeasurementValue. */ - enum class Validity + class Validity { - /** - * The value is marked good if no abnormal condition of the acquisition function or the information source is detected. - */ - GOOD, - /** - * The value is marked questionable if a supervision function detects an abnormal behaviour, however the value could still be valid. The client is responsible for determining whether or not values marked "questionable" should be used. - */ - QUESTIONABLE, - /** - * The value is marked invalid when a supervision function recognises abnormal conditions of the acquisition function or the information source (missing or non-operating updating devices). The value is not defined under this condition. The mark invalid is used to indicate to the client that the value may be incorrect and shall not be used. - */ - INVALID, + public: + enum Validity_ENUM + { + /** + * The value is marked good if no abnormal condition of the acquisition function or the information source is detected. + */ + GOOD, + /** + * The value is marked questionable if a supervision function detects an abnormal behaviour, however the value could still be valid. The client is responsible for determining whether or not values marked "questionable" should be used. + */ + QUESTIONABLE, + /** + * The value is marked invalid when a supervision function recognises abnormal conditions of the acquisition function or the information source (missing or non-operating updating devices). The value is not defined under this condition. The mark invalid is used to indicate to the client that the value may be incorrect and shall not be used. + */ + INVALID, + }; + + Validity() : value(), initialized(false) {} + Validity(Validity_ENUM value) : value(value), initialized(true) {} + + Validity& operator=(Validity_ENUM rop); + operator Validity_ENUM() const; + + Validity_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, Validity& rop); + friend std::ostream& operator<<(std::ostream& os, const Validity& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::Validity& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/ValueAliasSet.cpp b/CGMES_2.4.15_27JAN2020/ValueAliasSet.cpp index 0829d94cf..09cad7fd2 100644 --- a/CGMES_2.4.15_27JAN2020/ValueAliasSet.cpp +++ b/CGMES_2.4.15_27JAN2020/ValueAliasSet.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ValueAliasSet.hpp" +#include +#include + #include "Command.hpp" #include "Discrete.hpp" #include "RaiseLowerCommand.hpp" @@ -10,84 +14,114 @@ using namespace CIMPP; ValueAliasSet::ValueAliasSet() {}; - ValueAliasSet::~ValueAliasSet() {}; -bool assign_ValueAliasSet_Commands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Commands.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + + + + +bool assign_Command_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_Commands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + Command* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Commands.begin(), element->Commands.end(), element2) == element->Commands.end()) + { + element->Commands.push_back(element2); + return assign_Command_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ValueAliasSet_Discretes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Discretes.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_Discrete_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_Discretes(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + Discrete* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Discretes.begin(), element->Discretes.end(), element2) == element->Discretes.end()) + { + element->Discretes.push_back(element2); + return assign_Discrete_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->RaiseLowerCommands.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_RaiseLowerCommand_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_RaiseLowerCommands(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + RaiseLowerCommand* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->RaiseLowerCommands.begin(), element->RaiseLowerCommands.end(), element2) == element->RaiseLowerCommands.end()) + { + element->RaiseLowerCommands.push_back(element2); + return assign_RaiseLowerCommand_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_ValueAliasSet_Values(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueAliasSet* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Values.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_ValueToAlias_ValueAliasSet(BaseClass*, BaseClass*); +bool assign_ValueAliasSet_Values(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueAliasSet* element = dynamic_cast(BaseClass_ptr1); + ValueToAlias* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Values.begin(), element->Values.end(), element2) == element->Values.end()) + { + element->Values.push_back(element2); + return assign_ValueToAlias_ValueAliasSet(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - - - -namespace CIMPP { - BaseClass* ValueAliasSet_factory() { - return new ValueAliasSet; - } +const char ValueAliasSet::debugName[] = "ValueAliasSet"; +const char* ValueAliasSet::debugString() const +{ + return ValueAliasSet::debugName; } -void ValueAliasSet::addConstructToMap(std::unordered_map& factory_map) { +void ValueAliasSet::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ValueAliasSet"), &ValueAliasSet_factory)); } -void ValueAliasSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void ValueAliasSet::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void ValueAliasSet::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void ValueAliasSet::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.Commands"), &assign_ValueAliasSet_Commands)); assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.Discretes"), &assign_ValueAliasSet_Discretes)); assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.RaiseLowerCommands"), &assign_ValueAliasSet_RaiseLowerCommands)); assign_map.insert(std::make_pair(std::string("cim:ValueAliasSet.Values"), &assign_ValueAliasSet_Values)); } -const char ValueAliasSet::debugName[] = "ValueAliasSet"; -const char* ValueAliasSet::debugString() -{ - return ValueAliasSet::debugName; -} - const BaseClassDefiner ValueAliasSet::declare() { return BaseClassDefiner(ValueAliasSet::addConstructToMap, ValueAliasSet::addPrimitiveAssignFnsToMap, ValueAliasSet::addClassAssignFnsToMap, ValueAliasSet::debugName); } - +namespace CIMPP +{ + BaseClass* ValueAliasSet_factory() + { + return new ValueAliasSet; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ValueAliasSet.hpp b/CGMES_2.4.15_27JAN2020/ValueAliasSet.hpp index f0cafcbee..5cf4ee926 100644 --- a/CGMES_2.4.15_27JAN2020/ValueAliasSet.hpp +++ b/CGMES_2.4.15_27JAN2020/ValueAliasSet.hpp @@ -1,44 +1,45 @@ #ifndef ValueAliasSet_H #define ValueAliasSet_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class Command; + class Discrete; + class RaiseLowerCommand; + class ValueToAlias; -class Command; -class Discrete; -class RaiseLowerCommand; -class ValueToAlias; /* Describes the translation of a set of values into a name and is intendend to facilitate cusom translations. Each ValueAliasSet has a name, description etc. A specific Measurement may represent a discrete state like Open, Closed, Intermediate etc. This requires a translation from the MeasurementValue.value number to a string, e.g. 0->"Invalid", 1->"Open", 2->"Closed", 3->"Intermediate". Each ValueToAlias member in ValueAliasSet.Value describe a mapping for one particular value to a name. */ - class ValueAliasSet: public IdentifiedObject + class ValueAliasSet : public IdentifiedObject { - public: - std::list Commands; /* The Commands using the set for translation. Default: 0 */ - std::list Discretes; /* The Measurements using the set for translation. Default: 0 */ - std::list RaiseLowerCommands; /* The Commands using the set for translation. Default: 0 */ - std::list Values; /* The ValueAliasSet having the ValueToAlias mappings. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ValueAliasSet(); - virtual ~ValueAliasSet(); - + ~ValueAliasSet() override; + + std::list Commands; /* The Commands using the set for translation. Default: 0 */ + std::list Discretes; /* The Measurements using the set for translation. Default: 0 */ + std::list RaiseLowerCommands; /* The Commands using the set for translation. Default: 0 */ + std::list Values; /* The ValueAliasSet having the ValueToAlias mappings. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ValueAliasSet_factory(); diff --git a/CGMES_2.4.15_27JAN2020/ValueToAlias.cpp b/CGMES_2.4.15_27JAN2020/ValueToAlias.cpp index a5e24988e..6472d61b0 100644 --- a/CGMES_2.4.15_27JAN2020/ValueToAlias.cpp +++ b/CGMES_2.4.15_27JAN2020/ValueToAlias.cpp @@ -1,64 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "ValueToAlias.hpp" +#include +#include + #include "ValueAliasSet.hpp" #include "Integer.hpp" using namespace CIMPP; -ValueToAlias::ValueToAlias(): ValueAliasSet(nullptr) {}; - +ValueToAlias::ValueToAlias() : ValueAliasSet(nullptr) {}; ValueToAlias::~ValueToAlias() {}; -bool assign_ValueAliasSet_Values(BaseClass*, BaseClass*); -bool assign_ValueToAlias_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(ValueToAlias* element = dynamic_cast(BaseClass_ptr1)) { - element->ValueAliasSet = dynamic_cast(BaseClass_ptr2); - if(element->ValueAliasSet != nullptr) - return assign_ValueAliasSet_Values(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - +bool assign_ValueToAlias_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (ValueToAlias* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_ValueToAlias_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(ValueToAlias* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ValueAliasSet_Values(BaseClass*, BaseClass*); +bool assign_ValueToAlias_ValueAliasSet(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + ValueToAlias* element = dynamic_cast(BaseClass_ptr1); + ValueAliasSet* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ValueAliasSet != element2) + { + element->ValueAliasSet = element2; + return assign_ValueAliasSet_Values(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* ValueToAlias_factory() { - return new ValueToAlias; - } + +const char ValueToAlias::debugName[] = "ValueToAlias"; +const char* ValueToAlias::debugString() const +{ + return ValueToAlias::debugName; } -void ValueToAlias::addConstructToMap(std::unordered_map& factory_map) { +void ValueToAlias::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:ValueToAlias"), &ValueToAlias_factory)); } -void ValueToAlias::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.value"), &assign_ValueToAlias_value)); +void ValueToAlias::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.value"), &assign_ValueToAlias_value)); } -void ValueToAlias::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.ValueAliasSet"), &assign_ValueToAlias_ValueAliasSet)); - } - -const char ValueToAlias::debugName[] = "ValueToAlias"; -const char* ValueToAlias::debugString() +void ValueToAlias::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return ValueToAlias::debugName; + assign_map.insert(std::make_pair(std::string("cim:ValueToAlias.ValueAliasSet"), &assign_ValueToAlias_ValueAliasSet)); } const BaseClassDefiner ValueToAlias::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner ValueToAlias::declare() return BaseClassDefiner(ValueToAlias::addConstructToMap, ValueToAlias::addPrimitiveAssignFnsToMap, ValueToAlias::addClassAssignFnsToMap, ValueToAlias::debugName); } - +namespace CIMPP +{ + BaseClass* ValueToAlias_factory() + { + return new ValueToAlias; + } +} diff --git a/CGMES_2.4.15_27JAN2020/ValueToAlias.hpp b/CGMES_2.4.15_27JAN2020/ValueToAlias.hpp index fcdd8316a..6cb282164 100644 --- a/CGMES_2.4.15_27JAN2020/ValueToAlias.hpp +++ b/CGMES_2.4.15_27JAN2020/ValueToAlias.hpp @@ -1,40 +1,41 @@ #ifndef ValueToAlias_H #define ValueToAlias_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class ValueAliasSet; - -class ValueAliasSet; /* Describes the translation of one particular value into a name, e.g. 1 as "Open". */ - class ValueToAlias: public IdentifiedObject + class ValueToAlias : public IdentifiedObject { - public: - CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueToAlias mappings included in the set. Default: 0 */ - CIMPP::Integer value; /* The value that is mapped. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ ValueToAlias(); - virtual ~ValueToAlias(); - + ~ValueToAlias() override; + + CIMPP::ValueAliasSet* ValueAliasSet; /* The ValueToAlias mappings included in the set. Default: 0 */ + CIMPP::Integer value; /* The value that is mapped. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* ValueToAlias_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VisibilityLayer.cpp b/CGMES_2.4.15_27JAN2020/VisibilityLayer.cpp index cc031b8ae..f08a78d66 100644 --- a/CGMES_2.4.15_27JAN2020/VisibilityLayer.cpp +++ b/CGMES_2.4.15_27JAN2020/VisibilityLayer.cpp @@ -1,64 +1,72 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VisibilityLayer.hpp" +#include +#include + #include "DiagramObject.hpp" #include "Integer.hpp" using namespace CIMPP; VisibilityLayer::VisibilityLayer() {}; - VisibilityLayer::~VisibilityLayer() {}; -bool assign_VisibilityLayer_VisibleObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VisibilityLayer* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VisibleObjects.push_back(dynamic_cast(BaseClass_ptr2)); + +bool assign_VisibilityLayer_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VisibilityLayer* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->drawingOrder; + if (buffer.fail()) + return false; + else return true; - } } return false; } - - -bool assign_VisibilityLayer_drawingOrder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VisibilityLayer* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->drawingOrder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_DiagramObject_VisibilityLayers(BaseClass*, BaseClass*); +bool assign_VisibilityLayer_VisibleObjects(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VisibilityLayer* element = dynamic_cast(BaseClass_ptr1); + DiagramObject* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VisibleObjects.begin(), element->VisibleObjects.end(), element2) == element->VisibleObjects.end()) + { + element->VisibleObjects.push_back(element2); + return assign_DiagramObject_VisibilityLayers(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VisibilityLayer_factory() { - return new VisibilityLayer; - } + +const char VisibilityLayer::debugName[] = "VisibilityLayer"; +const char* VisibilityLayer::debugString() const +{ + return VisibilityLayer::debugName; } -void VisibilityLayer::addConstructToMap(std::unordered_map& factory_map) { +void VisibilityLayer::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VisibilityLayer"), &VisibilityLayer_factory)); } -void VisibilityLayer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.drawingOrder"), &assign_VisibilityLayer_drawingOrder)); +void VisibilityLayer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.drawingOrder"), &assign_VisibilityLayer_drawingOrder)); } -void VisibilityLayer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.VisibleObjects"), &assign_VisibilityLayer_VisibleObjects)); - } - -const char VisibilityLayer::debugName[] = "VisibilityLayer"; -const char* VisibilityLayer::debugString() +void VisibilityLayer::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VisibilityLayer::debugName; + assign_map.insert(std::make_pair(std::string("cim:VisibilityLayer.VisibleObjects"), &assign_VisibilityLayer_VisibleObjects)); } const BaseClassDefiner VisibilityLayer::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner VisibilityLayer::declare() return BaseClassDefiner(VisibilityLayer::addConstructToMap, VisibilityLayer::addPrimitiveAssignFnsToMap, VisibilityLayer::addClassAssignFnsToMap, VisibilityLayer::debugName); } - +namespace CIMPP +{ + BaseClass* VisibilityLayer_factory() + { + return new VisibilityLayer; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VisibilityLayer.hpp b/CGMES_2.4.15_27JAN2020/VisibilityLayer.hpp index 97805d650..3df88871d 100644 --- a/CGMES_2.4.15_27JAN2020/VisibilityLayer.hpp +++ b/CGMES_2.4.15_27JAN2020/VisibilityLayer.hpp @@ -1,40 +1,41 @@ #ifndef VisibilityLayer_H #define VisibilityLayer_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Integer.hpp" -namespace CIMPP { +namespace CIMPP +{ + class DiagramObject; - -class DiagramObject; /* Layers are typically used for grouping diagram objects according to themes and scales. Themes are used to display or hide certain information (e.g., lakes, borders), while scales are used for hiding or displaying information depending on the current zoom level (hide text when it is too small to be read, or when it exceeds the screen size). This is also called de-cluttering. CIM based graphics exchange will support an m:n relationship between diagram objects and layers. It will be the task of the importing system to convert an m:n case into an appropriate 1:n representation if the importing system does not support m:n. */ - class VisibilityLayer: public IdentifiedObject + class VisibilityLayer : public IdentifiedObject { - public: - std::list VisibleObjects; /* A visibility layer can contain one or more diagram objects. Default: 0 */ - CIMPP::Integer drawingOrder; /* The drawing order for this layer. The higher the number, the later the layer and the objects within it are rendered. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VisibilityLayer(); - virtual ~VisibilityLayer(); - + ~VisibilityLayer() override; + + std::list VisibleObjects; /* A visibility layer can contain one or more diagram objects. Default: 0 */ + CIMPP::Integer drawingOrder; /* The drawing order for this layer. The higher the number, the later the layer and the objects within it are rendered. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VisibilityLayer_factory(); diff --git a/CGMES_2.4.15_27JAN2020/Voltage.cpp b/CGMES_2.4.15_27JAN2020/Voltage.cpp index 7675f6208..3f7992f4e 100644 --- a/CGMES_2.4.15_27JAN2020/Voltage.cpp +++ b/CGMES_2.4.15_27JAN2020/Voltage.cpp @@ -1,70 +1,77 @@ +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "Voltage.hpp" -#include "../src/CIMExceptions.hpp" - -using namespace CIMPP; - -Voltage::Voltage() {} -Voltage::~Voltage(){} +#include -Voltage::Voltage(long double value) : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -void Voltage::addConstructToMap(std::unordered_map& factory_map) {} +using namespace CIMPP; -void Voltage::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +Voltage& Voltage::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; +} -void Voltage::addClassAssignFnsToMap(std::unordered_map& assign_map) {} +Voltage::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} const char Voltage::debugName[] = "Voltage"; -const char* Voltage::debugString() { +const char* Voltage::debugString() const +{ return Voltage::debugName; } - -const BaseClassDefiner Voltage::declare() { - return BaseClassDefiner(Voltage::addConstructToMap, Voltage::addPrimitiveAssignFnsToMap, Voltage::addClassAssignFnsToMap, Voltage::debugName); +Voltage& Voltage::operator+=(const Voltage& rhs) +{ + value += rhs.value; + return *this; } -namespace CIMPP { - Voltage& Voltage::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; - } - - Voltage& Voltage::operator-=(const Voltage& rhs) { - value -= rhs.value; - return *this; - } - - Voltage& Voltage::operator*=(const Voltage& rhs) { - value *= rhs.value; - return *this; - } - - Voltage& Voltage::operator/=(const Voltage& rhs) { - value /= rhs.value; - return *this; - } +Voltage& Voltage::operator-=(const Voltage& rhs) +{ + value -= rhs.value; + return *this; +} - Voltage& Voltage::operator+=(const Voltage& rhs) { - value += rhs.value; - return *this; - } +Voltage& Voltage::operator*=(const Voltage& rhs) +{ + value *= rhs.value; + return *this; +} - Voltage::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Voltage& Voltage::operator/=(const Voltage& rhs) +{ + value /= rhs.value; + return *this; +} - std::istream& operator>>(std::istream& lop, Voltage& rop) { +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, Voltage& rop) + { std::string tmp; lop >> tmp; rop.value = stold(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Voltage& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/CGMES_2.4.15_27JAN2020/Voltage.hpp b/CGMES_2.4.15_27JAN2020/Voltage.hpp index ffef540d3..12eb87179 100644 --- a/CGMES_2.4.15_27JAN2020/Voltage.hpp +++ b/CGMES_2.4.15_27JAN2020/Voltage.hpp @@ -1,38 +1,39 @@ #ifndef Voltage_H #define Voltage_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include #include - -#include "BaseClass.hpp" +#include namespace CIMPP { - class Voltage : public BaseClass + /* + Electrical voltage, can be both AC and DC. + */ + class Voltage { - public: - Voltage(); - virtual ~Voltage(); - Voltage(long double value); - static const BaseClassDefiner declare(); - Voltage& operator=(long double &rop); + Voltage() : value(0.0), initialized(false) {} + Voltage(long double value) : value(value), initialized(true) {} + + Voltage& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + Voltage& operator+=(const Voltage& rhs); Voltage& operator-=(const Voltage& rhs); Voltage& operator*=(const Voltage& rhs); Voltage& operator/=(const Voltage& rhs); + friend std::istream& operator>>(std::istream& lop, Voltage& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::ostream& operator<<(std::ostream& os, const Voltage& obj); }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.cpp b/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.cpp index 5e9077a68..fbd1e515e 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.cpp @@ -1,49 +1,56 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageAdjusterDynamics.hpp" +#include +#include + #include "PFVArControllerType1Dynamics.hpp" using namespace CIMPP; -VoltageAdjusterDynamics::VoltageAdjusterDynamics(): PFVArControllerType1Dynamics(nullptr) {}; - +VoltageAdjusterDynamics::VoltageAdjusterDynamics() : PFVArControllerType1Dynamics(nullptr) {}; VoltageAdjusterDynamics::~VoltageAdjusterDynamics() {}; -bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass*, BaseClass*); -bool assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageAdjusterDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->PFVArControllerType1Dynamics = dynamic_cast(BaseClass_ptr2); - if(element->PFVArControllerType1Dynamics != nullptr) - return assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* VoltageAdjusterDynamics_factory() { - return new VoltageAdjusterDynamics; +bool assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass*, BaseClass*); +bool assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageAdjusterDynamics* element = dynamic_cast(BaseClass_ptr1); + PFVArControllerType1Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->PFVArControllerType1Dynamics != element2) + { + element->PFVArControllerType1Dynamics = element2; + return assign_PFVArControllerType1Dynamics_VoltageAdjusterDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void VoltageAdjusterDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics"), &VoltageAdjusterDynamics_factory)); +const char VoltageAdjusterDynamics::debugName[] = "VoltageAdjusterDynamics"; +const char* VoltageAdjusterDynamics::debugString() const +{ + return VoltageAdjusterDynamics::debugName; } -void VoltageAdjusterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void VoltageAdjusterDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics"), &VoltageAdjusterDynamics_factory)); +} -void VoltageAdjusterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics.PFVArControllerType1Dynamics"), &assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics)); +void VoltageAdjusterDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char VoltageAdjusterDynamics::debugName[] = "VoltageAdjusterDynamics"; -const char* VoltageAdjusterDynamics::debugString() +void VoltageAdjusterDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageAdjusterDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterDynamics.PFVArControllerType1Dynamics"), &assign_VoltageAdjusterDynamics_PFVArControllerType1Dynamics)); } const BaseClassDefiner VoltageAdjusterDynamics::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner VoltageAdjusterDynamics::declare() return BaseClassDefiner(VoltageAdjusterDynamics::addConstructToMap, VoltageAdjusterDynamics::addPrimitiveAssignFnsToMap, VoltageAdjusterDynamics::addClassAssignFnsToMap, VoltageAdjusterDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageAdjusterDynamics_factory() + { + return new VoltageAdjusterDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.hpp b/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.hpp index 9786dd22c..9f64ce933 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltageAdjusterDynamics.hpp @@ -1,38 +1,39 @@ #ifndef VoltageAdjusterDynamics_H #define VoltageAdjusterDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class PFVArControllerType1Dynamics; -class PFVArControllerType1Dynamics; /* Voltage adjuster function block whose behaviour is described by reference to a standard model */ - class VoltageAdjusterDynamics: public DynamicsFunctionBlock + class VoltageAdjusterDynamics : public DynamicsFunctionBlock { - public: - CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model with which this voltage adjuster is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageAdjusterDynamics(); - virtual ~VoltageAdjusterDynamics(); - + ~VoltageAdjusterDynamics() override; + + CIMPP::PFVArControllerType1Dynamics* PFVArControllerType1Dynamics; /* Power Factor or VAr controller Type I model with which this voltage adjuster is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageAdjusterDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.cpp b/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.cpp index 74edd01de..b41599c4a 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "VoltageAdjusterDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageAdjusterUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; VoltageAdjusterUserDefined::VoltageAdjusterUserDefined() {}; - VoltageAdjusterUserDefined::~VoltageAdjusterUserDefined() {}; -bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_VoltageAdjusterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_VoltageAdjusterUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass*, BaseClass*); +bool assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageAdjusterUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_VoltageAdjusterUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VoltageAdjusterUserDefined_factory() { - return new VoltageAdjusterUserDefined; - } +const char VoltageAdjusterUserDefined::debugName[] = "VoltageAdjusterUserDefined"; +const char* VoltageAdjusterUserDefined::debugString() const +{ + return VoltageAdjusterUserDefined::debugName; } -void VoltageAdjusterUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void VoltageAdjusterUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined"), &VoltageAdjusterUserDefined_factory)); } -void VoltageAdjusterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VoltageAdjusterUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined.proprietary"), &assign_VoltageAdjusterUserDefined_proprietary)); - } - -void VoltageAdjusterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined.ProprietaryParameterDynamics"), &assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics)); } -const char VoltageAdjusterUserDefined::debugName[] = "VoltageAdjusterUserDefined"; -const char* VoltageAdjusterUserDefined::debugString() +void VoltageAdjusterUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageAdjusterUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageAdjusterUserDefined.ProprietaryParameterDynamics"), &assign_VoltageAdjusterUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner VoltageAdjusterUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner VoltageAdjusterUserDefined::declare() return BaseClassDefiner(VoltageAdjusterUserDefined::addConstructToMap, VoltageAdjusterUserDefined::addPrimitiveAssignFnsToMap, VoltageAdjusterUserDefined::addClassAssignFnsToMap, VoltageAdjusterUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageAdjusterUserDefined_factory() + { + return new VoltageAdjusterUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.hpp b/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.hpp index 34cc6a4dd..85173e315 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltageAdjusterUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef VoltageAdjusterUserDefined_H #define VoltageAdjusterUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageAdjusterDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageAdjusterDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* function block whose dynamic behaviour is described by */ - class VoltageAdjusterUserDefined: public VoltageAdjusterDynamics + class VoltageAdjusterUserDefined : public VoltageAdjusterDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageAdjusterUserDefined(); - virtual ~VoltageAdjusterUserDefined(); - + ~VoltageAdjusterUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageAdjusterUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.cpp b/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.cpp index f17bd2e98..283d81921 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.cpp @@ -1,61 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageCompensatorDynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "ExcitationSystemDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -VoltageCompensatorDynamics::VoltageCompensatorDynamics(): RemoteInputSignal(nullptr), ExcitationSystemDynamics(nullptr) {}; - +VoltageCompensatorDynamics::VoltageCompensatorDynamics() : ExcitationSystemDynamics(nullptr), RemoteInputSignal(nullptr) {}; VoltageCompensatorDynamics::~VoltageCompensatorDynamics() {}; -bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return true; - } - return false; -} - -bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass*, BaseClass*); -bool assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->ExcitationSystemDynamics = dynamic_cast(BaseClass_ptr2); - if(element->ExcitationSystemDynamics != nullptr) - return assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass*, BaseClass*); +bool assign_VoltageCompensatorDynamics_ExcitationSystemDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1); + ExcitationSystemDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->ExcitationSystemDynamics != element2) + { + element->ExcitationSystemDynamics = element2; + return assign_ExcitationSystemDynamics_VoltageCompensatorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* VoltageCompensatorDynamics_factory() { - return new VoltageCompensatorDynamics; +bool assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass*, BaseClass*); +bool assign_VoltageCompensatorDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageCompensatorDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_VoltageCompensatorDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void VoltageCompensatorDynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics"), &VoltageCompensatorDynamics_factory)); +const char VoltageCompensatorDynamics::debugName[] = "VoltageCompensatorDynamics"; +const char* VoltageCompensatorDynamics::debugString() const +{ + return VoltageCompensatorDynamics::debugName; } -void VoltageCompensatorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void VoltageCompensatorDynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics"), &VoltageCompensatorDynamics_factory)); +} -void VoltageCompensatorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.RemoteInputSignal"), &assign_VoltageCompensatorDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.ExcitationSystemDynamics"), &assign_VoltageCompensatorDynamics_ExcitationSystemDynamics)); +void VoltageCompensatorDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char VoltageCompensatorDynamics::debugName[] = "VoltageCompensatorDynamics"; -const char* VoltageCompensatorDynamics::debugString() +void VoltageCompensatorDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageCompensatorDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.ExcitationSystemDynamics"), &assign_VoltageCompensatorDynamics_ExcitationSystemDynamics)); + assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorDynamics.RemoteInputSignal"), &assign_VoltageCompensatorDynamics_RemoteInputSignal)); } const BaseClassDefiner VoltageCompensatorDynamics::declare() @@ -63,4 +78,10 @@ const BaseClassDefiner VoltageCompensatorDynamics::declare() return BaseClassDefiner(VoltageCompensatorDynamics::addConstructToMap, VoltageCompensatorDynamics::addPrimitiveAssignFnsToMap, VoltageCompensatorDynamics::addClassAssignFnsToMap, VoltageCompensatorDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageCompensatorDynamics_factory() + { + return new VoltageCompensatorDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.hpp b/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.hpp index 2d280101e..d49ec9fa9 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltageCompensatorDynamics.hpp @@ -1,40 +1,41 @@ #ifndef VoltageCompensatorDynamics_H #define VoltageCompensatorDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class ExcitationSystemDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class ExcitationSystemDynamics; /* Voltage compensator function block whose behaviour is described by reference to a standard model */ - class VoltageCompensatorDynamics: public DynamicsFunctionBlock + class VoltageCompensatorDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this voltage compensator model. Default: 0 */ - CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this voltage compensator is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageCompensatorDynamics(); - virtual ~VoltageCompensatorDynamics(); - + ~VoltageCompensatorDynamics() override; + + CIMPP::ExcitationSystemDynamics* ExcitationSystemDynamics; /* Excitation system model with which this voltage compensator is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this voltage compensator model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageCompensatorDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.cpp b/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.cpp index c7b3db0b1..7c74de428 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "VoltageCompensatorDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageCompensatorUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; VoltageCompensatorUserDefined::VoltageCompensatorUserDefined() {}; - VoltageCompensatorUserDefined::~VoltageCompensatorUserDefined() {}; -bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_VoltageCompensatorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_VoltageCompensatorUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass*, BaseClass*); +bool assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageCompensatorUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_VoltageCompensatorUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VoltageCompensatorUserDefined_factory() { - return new VoltageCompensatorUserDefined; - } +const char VoltageCompensatorUserDefined::debugName[] = "VoltageCompensatorUserDefined"; +const char* VoltageCompensatorUserDefined::debugString() const +{ + return VoltageCompensatorUserDefined::debugName; } -void VoltageCompensatorUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void VoltageCompensatorUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined"), &VoltageCompensatorUserDefined_factory)); } -void VoltageCompensatorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VoltageCompensatorUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined.proprietary"), &assign_VoltageCompensatorUserDefined_proprietary)); - } - -void VoltageCompensatorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined.ProprietaryParameterDynamics"), &assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics)); } -const char VoltageCompensatorUserDefined::debugName[] = "VoltageCompensatorUserDefined"; -const char* VoltageCompensatorUserDefined::debugString() +void VoltageCompensatorUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageCompensatorUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageCompensatorUserDefined.ProprietaryParameterDynamics"), &assign_VoltageCompensatorUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner VoltageCompensatorUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner VoltageCompensatorUserDefined::declare() return BaseClassDefiner(VoltageCompensatorUserDefined::addConstructToMap, VoltageCompensatorUserDefined::addPrimitiveAssignFnsToMap, VoltageCompensatorUserDefined::addClassAssignFnsToMap, VoltageCompensatorUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageCompensatorUserDefined_factory() + { + return new VoltageCompensatorUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.hpp b/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.hpp index 99718ea81..5ffa1b065 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltageCompensatorUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef VoltageCompensatorUserDefined_H #define VoltageCompensatorUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "VoltageCompensatorDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "VoltageCompensatorDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Voltage compensator function block whose dynamic behaviour is described by */ - class VoltageCompensatorUserDefined: public VoltageCompensatorDynamics + class VoltageCompensatorUserDefined : public VoltageCompensatorDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageCompensatorUserDefined(); - virtual ~VoltageCompensatorUserDefined(); - + ~VoltageCompensatorUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageCompensatorUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VoltageLevel.cpp b/CGMES_2.4.15_27JAN2020/VoltageLevel.cpp index 9fe3a778e..4fa8006ee 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageLevel.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltageLevel.cpp @@ -1,105 +1,128 @@ -#include -#include "EquipmentContainer.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageLevel.hpp" +#include +#include + #include "BaseVoltage.hpp" +#include "Bay.hpp" #include "Substation.hpp" #include "Voltage.hpp" #include "Voltage.hpp" -#include "Bay.hpp" using namespace CIMPP; -VoltageLevel::VoltageLevel(): BaseVoltage(nullptr), Substation(nullptr) {}; - +VoltageLevel::VoltageLevel() : BaseVoltage(nullptr), Substation(nullptr) {}; VoltageLevel::~VoltageLevel() {}; -bool assign_BaseVoltage_VoltageLevel(BaseClass*, BaseClass*); -bool assign_VoltageLevel_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - element->BaseVoltage = dynamic_cast(BaseClass_ptr2); - if(element->BaseVoltage != nullptr) - return assign_BaseVoltage_VoltageLevel(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_Substation_VoltageLevels(BaseClass*, BaseClass*); -bool assign_VoltageLevel_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - element->Substation = dynamic_cast(BaseClass_ptr2); - if(element->Substation != nullptr) - return assign_Substation_VoltageLevels(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_VoltageLevel_Bays(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->Bays.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_VoltageLevel_highVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->highVoltageLimit; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_VoltageLevel_lowVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lowVoltageLimit; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_BaseVoltage_VoltageLevel(BaseClass*, BaseClass*); +bool assign_VoltageLevel_BaseVoltage(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageLevel* element = dynamic_cast(BaseClass_ptr1); + BaseVoltage* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->BaseVoltage != element2) + { + element->BaseVoltage = element2; + return assign_BaseVoltage_VoltageLevel(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_VoltageLevel_highVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->highVoltageLimit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Bay_VoltageLevel(BaseClass*, BaseClass*); +bool assign_VoltageLevel_Bays(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageLevel* element = dynamic_cast(BaseClass_ptr1); + Bay* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->Bays.begin(), element->Bays.end(), element2) == element->Bays.end()) + { + element->Bays.push_back(element2); + return assign_Bay_VoltageLevel(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_VoltageLevel_lowVoltageLimit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageLevel* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lowVoltageLimit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_Substation_VoltageLevels(BaseClass*, BaseClass*); +bool assign_VoltageLevel_Substation(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VoltageLevel* element = dynamic_cast(BaseClass_ptr1); + Substation* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->Substation != element2) + { + element->Substation = element2; + return assign_Substation_VoltageLevels(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* VoltageLevel_factory() { - return new VoltageLevel; - } + +const char VoltageLevel::debugName[] = "VoltageLevel"; +const char* VoltageLevel::debugString() const +{ + return VoltageLevel::debugName; } -void VoltageLevel::addConstructToMap(std::unordered_map& factory_map) { +void VoltageLevel::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageLevel"), &VoltageLevel_factory)); } -void VoltageLevel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.highVoltageLimit"), &assign_VoltageLevel_highVoltageLimit)); +void VoltageLevel::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.highVoltageLimit"), &assign_VoltageLevel_highVoltageLimit)); assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.lowVoltageLimit"), &assign_VoltageLevel_lowVoltageLimit)); - } - -void VoltageLevel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.BaseVoltage"), &assign_VoltageLevel_BaseVoltage)); - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Substation"), &assign_VoltageLevel_Substation)); - assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Bays"), &assign_VoltageLevel_Bays)); } -const char VoltageLevel::debugName[] = "VoltageLevel"; -const char* VoltageLevel::debugString() +void VoltageLevel::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageLevel::debugName; + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.BaseVoltage"), &assign_VoltageLevel_BaseVoltage)); + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Bays"), &assign_VoltageLevel_Bays)); + assign_map.insert(std::make_pair(std::string("cim:VoltageLevel.Substation"), &assign_VoltageLevel_Substation)); } const BaseClassDefiner VoltageLevel::declare() @@ -107,4 +130,10 @@ const BaseClassDefiner VoltageLevel::declare() return BaseClassDefiner(VoltageLevel::addConstructToMap, VoltageLevel::addPrimitiveAssignFnsToMap, VoltageLevel::addClassAssignFnsToMap, VoltageLevel::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageLevel_factory() + { + return new VoltageLevel; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltageLevel.hpp b/CGMES_2.4.15_27JAN2020/VoltageLevel.hpp index 1fb4ada16..7d22565db 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageLevel.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltageLevel.hpp @@ -1,45 +1,46 @@ #ifndef VoltageLevel_H #define VoltageLevel_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "EquipmentContainer.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "EquipmentContainer.hpp" +#include "BaseClassDefiner.hpp" #include "Voltage.hpp" -namespace CIMPP { +namespace CIMPP +{ + class BaseVoltage; + class Bay; + class Substation; - -class BaseVoltage; -class Substation; -class Bay; /* A collection of equipment at one common system voltage forming a switchgear. The equipment typically consist of breakers, busbars, instrumentation, control, regulation and protection devices as well as assemblies of all these. */ - class VoltageLevel: public EquipmentContainer + class VoltageLevel : public EquipmentContainer { - public: - CIMPP::BaseVoltage* BaseVoltage; /* The base voltage used for all equipment within the voltage level. Default: 0 */ - CIMPP::Substation* Substation; /* The substation of the voltage level. Default: 0 */ - CIMPP::Voltage highVoltageLimit; /* The bus bar`s high voltage limit Default: nullptr */ - CIMPP::Voltage lowVoltageLimit; /* The bus bar`s low voltage limit Default: nullptr */ - std::list Bays; /* The bays within this voltage level. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageLevel(); - virtual ~VoltageLevel(); - + ~VoltageLevel() override; + + CIMPP::BaseVoltage* BaseVoltage; /* The base voltage used for all equipment within the voltage level. Default: 0 */ + std::list Bays; /* The bays within this voltage level. Default: 0 */ + CIMPP::Substation* Substation; /* The substation of the voltage level. Default: 0 */ + CIMPP::Voltage highVoltageLimit; /* The bus bar`s high voltage limit Default: nullptr */ + CIMPP::Voltage lowVoltageLimit; /* The bus bar`s low voltage limit Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageLevel_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VoltageLimit.cpp b/CGMES_2.4.15_27JAN2020/VoltageLimit.cpp index fdc3a7ba8..f03b3f928 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageLimit.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltageLimit.cpp @@ -1,51 +1,52 @@ -#include -#include "OperationalLimit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltageLimit.hpp" +#include +#include + #include "Voltage.hpp" using namespace CIMPP; VoltageLimit::VoltageLimit() {}; - VoltageLimit::~VoltageLimit() {}; +bool assign_VoltageLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VoltageLimit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->value; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_VoltageLimit_value(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltageLimit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->value; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* VoltageLimit_factory() { - return new VoltageLimit; - } +const char VoltageLimit::debugName[] = "VoltageLimit"; +const char* VoltageLimit::debugString() const +{ + return VoltageLimit::debugName; } -void VoltageLimit::addConstructToMap(std::unordered_map& factory_map) { +void VoltageLimit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VoltageLimit"), &VoltageLimit_factory)); } -void VoltageLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void VoltageLimit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:VoltageLimit.value"), &assign_VoltageLimit_value)); } -void VoltageLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char VoltageLimit::debugName[] = "VoltageLimit"; -const char* VoltageLimit::debugString() +void VoltageLimit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VoltageLimit::debugName; } const BaseClassDefiner VoltageLimit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner VoltageLimit::declare() return BaseClassDefiner(VoltageLimit::addConstructToMap, VoltageLimit::addPrimitiveAssignFnsToMap, VoltageLimit::addClassAssignFnsToMap, VoltageLimit::debugName); } - +namespace CIMPP +{ + BaseClass* VoltageLimit_factory() + { + return new VoltageLimit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltageLimit.hpp b/CGMES_2.4.15_27JAN2020/VoltageLimit.hpp index 7814a40b1..4dd2c2588 100644 --- a/CGMES_2.4.15_27JAN2020/VoltageLimit.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltageLimit.hpp @@ -1,38 +1,39 @@ #ifndef VoltageLimit_H #define VoltageLimit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "OperationalLimit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "OperationalLimit.hpp" +#include "BaseClassDefiner.hpp" #include "Voltage.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* Operational limit applied to voltage. */ - class VoltageLimit: public OperationalLimit + class VoltageLimit : public OperationalLimit { - public: - CIMPP::Voltage value; /* Limit on voltage. High or low limit nature of the limit depends upon the properties of the operational limit type. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VoltageLimit(); - virtual ~VoltageLimit(); - + ~VoltageLimit() override; + + CIMPP::Voltage value; /* Limit on voltage. High or low limit nature of the limit depends upon the properties of the operational limit type. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VoltageLimit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.cpp b/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.cpp index 119b3c228..70718a915 100644 --- a/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.cpp +++ b/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VoltagePerReactivePower.hpp" -#include "Float.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" +#include -using namespace CIMPP; - -VoltagePerReactivePower::VoltagePerReactivePower(): value(nullptr) {}; - -VoltagePerReactivePower::~VoltagePerReactivePower() {}; - - -bool assign_VoltagePerReactivePower_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - - - - - - -bool assign_VoltagePerReactivePower_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VoltagePerReactivePower_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +#include "../src/CIMExceptions.hpp" -bool assign_VoltagePerReactivePower_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} +using namespace CIMPP; -bool assign_VoltagePerReactivePower_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VoltagePerReactivePower* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +VoltagePerReactivePower& VoltagePerReactivePower::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } -namespace CIMPP { - BaseClass* VoltagePerReactivePower_factory() { - return new VoltagePerReactivePower; +VoltagePerReactivePower::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void VoltagePerReactivePower::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower"), &VoltagePerReactivePower_factory)); +const char VoltagePerReactivePower::debugName[] = "VoltagePerReactivePower"; +const char* VoltagePerReactivePower::debugString() const +{ + return VoltagePerReactivePower::debugName; } -void VoltagePerReactivePower::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.unit"), &assign_VoltagePerReactivePower_unit)); - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.denominatorMultiplier"), &assign_VoltagePerReactivePower_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.multiplier"), &assign_VoltagePerReactivePower_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.denominatorUnit"), &assign_VoltagePerReactivePower_denominatorUnit)); +VoltagePerReactivePower& VoltagePerReactivePower::operator+=(const VoltagePerReactivePower& rhs) +{ + value += rhs.value; + return *this; } -void VoltagePerReactivePower::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VoltagePerReactivePower.value"), &assign_VoltagePerReactivePower_value)); - } +VoltagePerReactivePower& VoltagePerReactivePower::operator-=(const VoltagePerReactivePower& rhs) +{ + value -= rhs.value; + return *this; +} -const char VoltagePerReactivePower::debugName[] = "VoltagePerReactivePower"; -const char* VoltagePerReactivePower::debugString() +VoltagePerReactivePower& VoltagePerReactivePower::operator*=(const VoltagePerReactivePower& rhs) { - return VoltagePerReactivePower::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner VoltagePerReactivePower::declare() +VoltagePerReactivePower& VoltagePerReactivePower::operator/=(const VoltagePerReactivePower& rhs) { - return BaseClassDefiner(VoltagePerReactivePower::addConstructToMap, VoltagePerReactivePower::addPrimitiveAssignFnsToMap, VoltagePerReactivePower::addClassAssignFnsToMap, VoltagePerReactivePower::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VoltagePerReactivePower& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const VoltagePerReactivePower& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.hpp b/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.hpp index bb831cfc9..51ef9b955 100644 --- a/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.hpp +++ b/CGMES_2.4.15_27JAN2020/VoltagePerReactivePower.hpp @@ -1,46 +1,39 @@ #ifndef VoltagePerReactivePower_H #define VoltagePerReactivePower_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Voltage variation with reactive power. */ - class VoltagePerReactivePower: public BaseClass + class VoltagePerReactivePower { - public: - CIMPP::Float* value; /* Default: nullptr */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - + VoltagePerReactivePower() : value(0.0), initialized(false) {} + VoltagePerReactivePower(long double value) : value(value), initialized(true) {} + + VoltagePerReactivePower& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - VoltagePerReactivePower(); - virtual ~VoltagePerReactivePower(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + VoltagePerReactivePower& operator+=(const VoltagePerReactivePower& rhs); + VoltagePerReactivePower& operator-=(const VoltagePerReactivePower& rhs); + VoltagePerReactivePower& operator*=(const VoltagePerReactivePower& rhs); + VoltagePerReactivePower& operator/=(const VoltagePerReactivePower& rhs); - BaseClass* VoltagePerReactivePower_factory(); + friend std::istream& operator>>(std::istream& lop, VoltagePerReactivePower& rop); + friend std::ostream& operator<<(std::ostream& os, const VoltagePerReactivePower& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/VolumeFlowRate.cpp b/CGMES_2.4.15_27JAN2020/VolumeFlowRate.cpp index e46015960..4ccbb5db3 100644 --- a/CGMES_2.4.15_27JAN2020/VolumeFlowRate.cpp +++ b/CGMES_2.4.15_27JAN2020/VolumeFlowRate.cpp @@ -1,113 +1,77 @@ -#include -#include "BaseClass.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VolumeFlowRate.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" -#include "Float.hpp" - -using namespace CIMPP; - -VolumeFlowRate::VolumeFlowRate(): value(nullptr) {}; - -VolumeFlowRate::~VolumeFlowRate() {}; - +#include +#include "../src/CIMExceptions.hpp" +using namespace CIMPP; - - -bool assign_VolumeFlowRate_value(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - element->value = dynamic_cast(BaseClass_ptr2); - if(element->value != nullptr) - return true; - } - return false; -} - - -bool assign_VolumeFlowRate_denominatorMultiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorMultiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VolumeFlowRate_denominatorUnit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->denominatorUnit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VolumeFlowRate_multiplier(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->multiplier; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VolumeFlowRate_unit(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VolumeFlowRate* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->unit; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +VolumeFlowRate& VolumeFlowRate::operator=(long double rop) +{ + value = rop; + initialized = true; + return *this; } - -namespace CIMPP { - BaseClass* VolumeFlowRate_factory() { - return new VolumeFlowRate; +VolumeFlowRate::operator long double() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); } + return value; } -void VolumeFlowRate::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:VolumeFlowRate"), &VolumeFlowRate_factory)); +const char VolumeFlowRate::debugName[] = "VolumeFlowRate"; +const char* VolumeFlowRate::debugString() const +{ + return VolumeFlowRate::debugName; } -void VolumeFlowRate::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.denominatorMultiplier"), &assign_VolumeFlowRate_denominatorMultiplier)); - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.denominatorUnit"), &assign_VolumeFlowRate_denominatorUnit)); - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.multiplier"), &assign_VolumeFlowRate_multiplier)); - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.unit"), &assign_VolumeFlowRate_unit)); - } +VolumeFlowRate& VolumeFlowRate::operator+=(const VolumeFlowRate& rhs) +{ + value += rhs.value; + return *this; +} -void VolumeFlowRate::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VolumeFlowRate.value"), &assign_VolumeFlowRate_value)); +VolumeFlowRate& VolumeFlowRate::operator-=(const VolumeFlowRate& rhs) +{ + value -= rhs.value; + return *this; } -const char VolumeFlowRate::debugName[] = "VolumeFlowRate"; -const char* VolumeFlowRate::debugString() +VolumeFlowRate& VolumeFlowRate::operator*=(const VolumeFlowRate& rhs) { - return VolumeFlowRate::debugName; + value *= rhs.value; + return *this; } -const BaseClassDefiner VolumeFlowRate::declare() +VolumeFlowRate& VolumeFlowRate::operator/=(const VolumeFlowRate& rhs) { - return BaseClassDefiner(VolumeFlowRate::addConstructToMap, VolumeFlowRate::addPrimitiveAssignFnsToMap, VolumeFlowRate::addClassAssignFnsToMap, VolumeFlowRate::debugName); + value /= rhs.value; + return *this; } +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VolumeFlowRate& rop) + { + std::string tmp; + lop >> tmp; + rop.value = stold(tmp); + rop.initialized = true; + return lop; + } + std::ostream& operator<<(std::ostream& os, const VolumeFlowRate& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VolumeFlowRate.hpp b/CGMES_2.4.15_27JAN2020/VolumeFlowRate.hpp index db8b06c43..256cf7e18 100644 --- a/CGMES_2.4.15_27JAN2020/VolumeFlowRate.hpp +++ b/CGMES_2.4.15_27JAN2020/VolumeFlowRate.hpp @@ -1,46 +1,39 @@ #ifndef VolumeFlowRate_H #define VolumeFlowRate_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "BaseClass.hpp" -#include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "UnitMultiplier.hpp" -#include "UnitSymbol.hpp" - -namespace CIMPP { - - -class Float; +namespace CIMPP +{ /* Volume per time. */ - class VolumeFlowRate: public BaseClass + class VolumeFlowRate { - public: - CIMPP::UnitMultiplier denominatorMultiplier; /* Default: 0 */ - CIMPP::UnitSymbol denominatorUnit; /* Default: 0 */ - CIMPP::UnitMultiplier multiplier; /* Default: 0 */ - CIMPP::UnitSymbol unit; /* Default: 0 */ - CIMPP::Float* value; /* Default: nullptr */ - + VolumeFlowRate() : value(0.0), initialized(false) {} + VolumeFlowRate(long double value) : value(value), initialized(true) {} + + VolumeFlowRate& operator=(long double rop); + operator long double() const; + + long double value; + bool initialized; + static const char debugName[]; - virtual const char* debugString(); - - /* constructor initialising all attributes to null */ - VolumeFlowRate(); - virtual ~VolumeFlowRate(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - static const BaseClassDefiner declare(); + const char* debugString() const; - }; + VolumeFlowRate& operator+=(const VolumeFlowRate& rhs); + VolumeFlowRate& operator-=(const VolumeFlowRate& rhs); + VolumeFlowRate& operator*=(const VolumeFlowRate& rhs); + VolumeFlowRate& operator/=(const VolumeFlowRate& rhs); - BaseClass* VolumeFlowRate_factory(); + friend std::istream& operator>>(std::istream& lop, VolumeFlowRate& rop); + friend std::ostream& operator<<(std::ostream& os, const VolumeFlowRate& obj); + }; } #endif diff --git a/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.cpp b/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.cpp index e6ccbe7d3..ada4fd1b3 100644 --- a/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.cpp +++ b/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.cpp @@ -1,49 +1,56 @@ -#include -#include "Curve.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsCapabilityCurve.hpp" +#include +#include + #include "VsConverter.hpp" using namespace CIMPP; VsCapabilityCurve::VsCapabilityCurve() {}; - VsCapabilityCurve::~VsCapabilityCurve() {}; -bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VsCapabilityCurve* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->VsConverterDCSides.push_back(dynamic_cast(BaseClass_ptr2)); - return true; + + +bool assign_VsConverter_CapabilityCurve(BaseClass*, BaseClass*); +bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VsCapabilityCurve* element = dynamic_cast(BaseClass_ptr1); + VsConverter* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->VsConverterDCSides.begin(), element->VsConverterDCSides.end(), element2) == element->VsConverterDCSides.end()) + { + element->VsConverterDCSides.push_back(element2); + return assign_VsConverter_CapabilityCurve(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - -namespace CIMPP { - BaseClass* VsCapabilityCurve_factory() { - return new VsCapabilityCurve; - } +const char VsCapabilityCurve::debugName[] = "VsCapabilityCurve"; +const char* VsCapabilityCurve::debugString() const +{ + return VsCapabilityCurve::debugName; } -void VsCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) { +void VsCapabilityCurve::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VsCapabilityCurve"), &VsCapabilityCurve_factory)); } -void VsCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void VsCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VsCapabilityCurve.VsConverterDCSides"), &assign_VsCapabilityCurve_VsConverterDCSides)); +void VsCapabilityCurve::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char VsCapabilityCurve::debugName[] = "VsCapabilityCurve"; -const char* VsCapabilityCurve::debugString() +void VsCapabilityCurve::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VsCapabilityCurve::debugName; + assign_map.insert(std::make_pair(std::string("cim:VsCapabilityCurve.VsConverterDCSides"), &assign_VsCapabilityCurve_VsConverterDCSides)); } const BaseClassDefiner VsCapabilityCurve::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner VsCapabilityCurve::declare() return BaseClassDefiner(VsCapabilityCurve::addConstructToMap, VsCapabilityCurve::addPrimitiveAssignFnsToMap, VsCapabilityCurve::addClassAssignFnsToMap, VsCapabilityCurve::debugName); } - +namespace CIMPP +{ + BaseClass* VsCapabilityCurve_factory() + { + return new VsCapabilityCurve; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.hpp b/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.hpp index c05a8641c..d1720fd0e 100644 --- a/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.hpp +++ b/CGMES_2.4.15_27JAN2020/VsCapabilityCurve.hpp @@ -1,38 +1,39 @@ #ifndef VsCapabilityCurve_H #define VsCapabilityCurve_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "Curve.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "Curve.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class VsConverter; -class VsConverter; /* The P-Q capability curve for a voltage source converter, with P on x-axis and Qmin and Qmax on y1-axis and y2-axis. */ - class VsCapabilityCurve: public Curve + class VsCapabilityCurve : public Curve { - public: - std::list VsConverterDCSides; /* Capability curve of this converter. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VsCapabilityCurve(); - virtual ~VsCapabilityCurve(); - + ~VsCapabilityCurve() override; + + std::list VsConverterDCSides; /* Capability curve of this converter. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VsCapabilityCurve_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VsConverter.cpp b/CGMES_2.4.15_27JAN2020/VsConverter.cpp index 9e7d32481..e61483f2f 100644 --- a/CGMES_2.4.15_27JAN2020/VsConverter.cpp +++ b/CGMES_2.4.15_27JAN2020/VsConverter.cpp @@ -1,40 +1,191 @@ -#include -#include "ACDCConverter.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsConverter.hpp" +#include +#include + #include "VsCapabilityCurve.hpp" -#include "Simple_Float.hpp" -#include "CurrentFlow.hpp" +#include "AngleDegrees.hpp" #include "PU.hpp" #include "Resistance.hpp" +#include "Simple_Float.hpp" +#include "CurrentFlow.hpp" #include "VsPpccControlKind.hpp" #include "VsQpccControlKind.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" #include "Voltage.hpp" -#include "AngleDegrees.hpp" #include "Voltage.hpp" using namespace CIMPP; -VsConverter::VsConverter(): CapabilityCurve(nullptr) {}; - +VsConverter::VsConverter() : CapabilityCurve(nullptr) {}; VsConverter::~VsConverter() {}; -bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass*, BaseClass*); -bool assign_VsConverter_CapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - element->CapabilityCurve = dynamic_cast(BaseClass_ptr2); - if(element->CapabilityCurve != nullptr) - return assign_VsCapabilityCurve_VsConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); - } - return false; + +bool assign_VsConverter_delta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->delta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_droop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->droop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_droopCompensation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->droopCompensation; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_maxModulationIndex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxModulationIndex; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_maxValveCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->maxValveCurrent; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pPccControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_qPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qPccControl; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_qShare(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qShare; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_VsConverter_targetQpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetQpcc; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_VsConverter_targetUpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->targetUpcc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsConverter_uf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (VsConverter* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uf; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_VsCapabilityCurve_VsConverterDCSides(BaseClass*, BaseClass*); +bool assign_VsConverter_CapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + VsConverter* element = dynamic_cast(BaseClass_ptr1); + VsCapabilityCurve* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->CapabilityCurve != element2) + { + element->CapabilityCurve = element2; + return assign_VsCapabilityCurve_VsConverterDCSides(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} @@ -45,170 +196,37 @@ bool assign_VsConverter_CapabilityCurve(BaseClass* BaseClass_ptr1, BaseClass* Ba -bool assign_VsConverter_maxModulationIndex(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxModulationIndex; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VsConverter_maxValveCurrent(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->maxValveCurrent; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_droop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->droop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_droopCompensation(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->droopCompensation; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_pPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pPccControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_qPccControl(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qPccControl; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_qShare(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qShare; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_VsConverter_targetQpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetQpcc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_targetUpcc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->targetUpcc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_delta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->delta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_VsConverter_uf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(VsConverter* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* VsConverter_factory() { - return new VsConverter; - } +const char VsConverter::debugName[] = "VsConverter"; +const char* VsConverter::debugString() const +{ + return VsConverter::debugName; } -void VsConverter::addConstructToMap(std::unordered_map& factory_map) { +void VsConverter::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:VsConverter"), &VsConverter_factory)); } -void VsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxModulationIndex"), &assign_VsConverter_maxModulationIndex)); - assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxValveCurrent"), &assign_VsConverter_maxValveCurrent)); +void VsConverter::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:VsConverter.delta"), &assign_VsConverter_delta)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.droop"), &assign_VsConverter_droop)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.droopCompensation"), &assign_VsConverter_droopCompensation)); + assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxModulationIndex"), &assign_VsConverter_maxModulationIndex)); + assign_map.insert(std::make_pair(std::string("cim:VsConverter.maxValveCurrent"), &assign_VsConverter_maxValveCurrent)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.pPccControl"), &assign_VsConverter_pPccControl)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.qPccControl"), &assign_VsConverter_qPccControl)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.qShare"), &assign_VsConverter_qShare)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.targetQpcc"), &assign_VsConverter_targetQpcc)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.targetUpcc"), &assign_VsConverter_targetUpcc)); - assign_map.insert(std::make_pair(std::string("cim:VsConverter.delta"), &assign_VsConverter_delta)); assign_map.insert(std::make_pair(std::string("cim:VsConverter.uf"), &assign_VsConverter_uf)); } -void VsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:VsConverter.CapabilityCurve"), &assign_VsConverter_CapabilityCurve)); - } - -const char VsConverter::debugName[] = "VsConverter"; -const char* VsConverter::debugString() +void VsConverter::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return VsConverter::debugName; + assign_map.insert(std::make_pair(std::string("cim:VsConverter.CapabilityCurve"), &assign_VsConverter_CapabilityCurve)); } const BaseClassDefiner VsConverter::declare() @@ -216,4 +234,10 @@ const BaseClassDefiner VsConverter::declare() return BaseClassDefiner(VsConverter::addConstructToMap, VsConverter::addPrimitiveAssignFnsToMap, VsConverter::addClassAssignFnsToMap, VsConverter::debugName); } - +namespace CIMPP +{ + BaseClass* VsConverter_factory() + { + return new VsConverter; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VsConverter.hpp b/CGMES_2.4.15_27JAN2020/VsConverter.hpp index 740aaaf0e..f3a2be60e 100644 --- a/CGMES_2.4.15_27JAN2020/VsConverter.hpp +++ b/CGMES_2.4.15_27JAN2020/VsConverter.hpp @@ -1,59 +1,60 @@ #ifndef VsConverter_H #define VsConverter_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "ACDCConverter.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "ACDCConverter.hpp" +#include "BaseClassDefiner.hpp" +#include "AngleDegrees.hpp" #include "CurrentFlow.hpp" #include "PU.hpp" -#include "Resistance.hpp" -#include "VsPpccControlKind.hpp" -#include "VsQpccControlKind.hpp" #include "PerCent.hpp" #include "ReactivePower.hpp" +#include "Resistance.hpp" +#include "Simple_Float.hpp" #include "Voltage.hpp" -#include "AngleDegrees.hpp" - -namespace CIMPP { +#include "VsPpccControlKind.hpp" +#include "VsQpccControlKind.hpp" +namespace CIMPP +{ + class VsCapabilityCurve; -class VsCapabilityCurve; /* DC side of the voltage source converter (VSC). */ - class VsConverter: public ACDCConverter + class VsConverter : public ACDCConverter { - public: - CIMPP::VsCapabilityCurve* CapabilityCurve; /* All converters with this capability curve. Default: 0 */ - CIMPP::Simple_Float maxModulationIndex; /* The max quotient between the AC converter voltage (Uc) and DC voltage (Ud). A factor typically less than 1. VSC configuration data used in power flow. Default: nullptr */ - CIMPP::CurrentFlow maxValveCurrent; /* The maximum current through a valve. This current limit is the basis for calculating the capability diagram. VSC configuration data. Default: nullptr */ - CIMPP::PU droop; /* Droop constant; pu value is obtained as D [kV^2 / MW] x Sb / Ubdc^2. Default: nullptr */ - CIMPP::Resistance droopCompensation; /* Compensation (resistance) constant. Used to compensate for voltage drop when controlling voltage at a distant bus. Default: nullptr */ - CIMPP::VsPpccControlKind pPccControl; /* Kind of control of real power and/or DC voltage. Default: 0 */ - CIMPP::VsQpccControlKind qPccControl; /* Default: 0 */ - CIMPP::PerCent qShare; /* Reactive power sharing factor among parallel converters on Uac control. Default: nullptr */ - CIMPP::ReactivePower targetQpcc; /* Reactive power injection target in AC grid, at point of common coupling. Default: nullptr */ - CIMPP::Voltage targetUpcc; /* Voltage target in AC grid, at point of common coupling. Default: nullptr */ - CIMPP::AngleDegrees delta; /* Angle between uf and uc. Converter state variable used in power flow. Default: nullptr */ - CIMPP::Voltage uf; /* Filter bus voltage. Converter state variable, result from power flow. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ VsConverter(); - virtual ~VsConverter(); - + ~VsConverter() override; + + CIMPP::VsCapabilityCurve* CapabilityCurve; /* All converters with this capability curve. Default: 0 */ + CIMPP::AngleDegrees delta; /* Angle between uf and uc. Converter state variable used in power flow. Default: nullptr */ + CIMPP::PU droop; /* Droop constant; pu value is obtained as D [kV^2 / MW] x Sb / Ubdc^2. Default: nullptr */ + CIMPP::Resistance droopCompensation; /* Compensation (resistance) constant. Used to compensate for voltage drop when controlling voltage at a distant bus. Default: nullptr */ + CIMPP::Simple_Float maxModulationIndex; /* The max quotient between the AC converter voltage (Uc) and DC voltage (Ud). A factor typically less than 1. VSC configuration data used in power flow. Default: nullptr */ + CIMPP::CurrentFlow maxValveCurrent; /* The maximum current through a valve. This current limit is the basis for calculating the capability diagram. VSC configuration data. Default: nullptr */ + CIMPP::VsPpccControlKind pPccControl; /* Kind of control of real power and/or DC voltage. Default: 0 */ + CIMPP::VsQpccControlKind qPccControl; /* Default: 0 */ + CIMPP::PerCent qShare; /* Reactive power sharing factor among parallel converters on Uac control. Default: nullptr */ + CIMPP::ReactivePower targetQpcc; /* Reactive power injection target in AC grid, at point of common coupling. Default: nullptr */ + CIMPP::Voltage targetUpcc; /* Voltage target in AC grid, at point of common coupling. Default: nullptr */ + CIMPP::Voltage uf; /* Filter bus voltage. Converter state variable, result from power flow. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* VsConverter_factory(); diff --git a/CGMES_2.4.15_27JAN2020/VsPpccControlKind.cpp b/CGMES_2.4.15_27JAN2020/VsPpccControlKind.cpp index 981bf6ba8..bc8b2d84a 100644 --- a/CGMES_2.4.15_27JAN2020/VsPpccControlKind.cpp +++ b/CGMES_2.4.15_27JAN2020/VsPpccControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsPpccControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::VsPpccControlKind& rop) +VsPpccControlKind& VsPpccControlKind::operator=(VsPpccControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +VsPpccControlKind::operator VsPpccControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char VsPpccControlKind::debugName[] = "VsPpccControlKind"; +const char* VsPpccControlKind::debugString() const +{ + return VsPpccControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VsPpccControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -48,5 +79,39 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const VsPpccControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == VsPpccControlKind::pPcc) + { + EnumSymbol = "pPcc"; + } + if (obj.value == VsPpccControlKind::udc) + { + EnumSymbol = "udc"; + } + if (obj.value == VsPpccControlKind::pPccAndUdcDroop) + { + EnumSymbol = "pPccAndUdcDroop"; + } + if (obj.value == VsPpccControlKind::pPccAndUdcDroopWithCompensation) + { + EnumSymbol = "pPccAndUdcDroopWithCompensation"; + } + if (obj.value == VsPpccControlKind::pPccAndUdcDroopPilot) + { + EnumSymbol = "pPccAndUdcDroopPilot"; + } + + if (!EnumSymbol.empty()) + { + os << "VsPpccControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VsPpccControlKind.hpp b/CGMES_2.4.15_27JAN2020/VsPpccControlKind.hpp index 2ee70f715..3aec56bb0 100644 --- a/CGMES_2.4.15_27JAN2020/VsPpccControlKind.hpp +++ b/CGMES_2.4.15_27JAN2020/VsPpccControlKind.hpp @@ -1,33 +1,58 @@ #ifndef VsPpccControlKind_H #define VsPpccControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Types applicable to the control of real power and/or DC voltage by voltage source converter. */ - enum class VsPpccControlKind + class VsPpccControlKind { - /** - * Control variable (target) is real power at PCC bus. - */ - pPcc, - /** - * Control variable (target) is DC voltage and real power at PCC bus is derived. - */ - udc, - /** - * Control variables (targets) are both active power at point of common coupling and local DC voltage, with the droop. - */ - pPccAndUdcDroop, - /** - * Control variables (targets) are both active power at point of common coupling and compensated DC voltage, with the droop; compensation factor is the resistance, as an approximation of the DC voltage of a common (real or virtual) node in the DC network. - */ - pPccAndUdcDroopWithCompensation, - /** - * Control variables (targets) are both active power at point of common coupling and the pilot DC voltage, with the droop. - */ - pPccAndUdcDroopPilot, + public: + enum VsPpccControlKind_ENUM + { + /** + * Control variable (target) is real power at PCC bus. + */ + pPcc, + /** + * Control variable (target) is DC voltage and real power at PCC bus is derived. + */ + udc, + /** + * Control variables (targets) are both active power at point of common coupling and local DC voltage, with the droop. + */ + pPccAndUdcDroop, + /** + * Control variables (targets) are both active power at point of common coupling and compensated DC voltage, with the droop; compensation factor is the resistance, as an approximation of the DC voltage of a common (real or virtual) node in the DC network. + */ + pPccAndUdcDroopWithCompensation, + /** + * Control variables (targets) are both active power at point of common coupling and the pilot DC voltage, with the droop. + */ + pPccAndUdcDroopPilot, + }; + + VsPpccControlKind() : value(), initialized(false) {} + VsPpccControlKind(VsPpccControlKind_ENUM value) : value(value), initialized(true) {} + + VsPpccControlKind& operator=(VsPpccControlKind_ENUM rop); + operator VsPpccControlKind_ENUM() const; + + VsPpccControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, VsPpccControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const VsPpccControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::VsPpccControlKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/VsQpccControlKind.cpp b/CGMES_2.4.15_27JAN2020/VsQpccControlKind.cpp index d279d97e2..7f438e41c 100644 --- a/CGMES_2.4.15_27JAN2020/VsQpccControlKind.cpp +++ b/CGMES_2.4.15_27JAN2020/VsQpccControlKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "VsQpccControlKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::VsQpccControlKind& rop) +VsQpccControlKind& VsQpccControlKind::operator=(VsQpccControlKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +VsQpccControlKind::operator VsQpccControlKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char VsQpccControlKind::debugName[] = "VsQpccControlKind"; +const char* VsQpccControlKind::debugString() const +{ + return VsQpccControlKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, VsQpccControlKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const VsQpccControlKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == VsQpccControlKind::reactivePcc) + { + EnumSymbol = "reactivePcc"; + } + if (obj.value == VsQpccControlKind::voltagePcc) + { + EnumSymbol = "voltagePcc"; + } + if (obj.value == VsQpccControlKind::powerFactorPcc) + { + EnumSymbol = "powerFactorPcc"; + } + + if (!EnumSymbol.empty()) + { + os << "VsQpccControlKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/VsQpccControlKind.hpp b/CGMES_2.4.15_27JAN2020/VsQpccControlKind.hpp index d3f545d91..cc10bbf78 100644 --- a/CGMES_2.4.15_27JAN2020/VsQpccControlKind.hpp +++ b/CGMES_2.4.15_27JAN2020/VsQpccControlKind.hpp @@ -1,25 +1,38 @@ #ifndef VsQpccControlKind_H #define VsQpccControlKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { - /* - - */ - enum class VsQpccControlKind +#include +#include + +namespace CIMPP +{ + class VsQpccControlKind { - /** - * - */ - reactivePcc, - /** - * - */ - voltagePcc, - /** - * - */ - powerFactorPcc, + public: + enum VsQpccControlKind_ENUM + { + reactivePcc, + voltagePcc, + powerFactorPcc, + }; + + VsQpccControlKind() : value(), initialized(false) {} + VsQpccControlKind(VsQpccControlKind_ENUM value) : value(value), initialized(true) {} + + VsQpccControlKind& operator=(VsQpccControlKind_ENUM rop); + operator VsQpccControlKind_ENUM() const; + + VsQpccControlKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, VsQpccControlKind& rop); + friend std::ostream& operator<<(std::ostream& os, const VsQpccControlKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::VsQpccControlKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.cpp b/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.cpp index 15045d5a6..af5ebf4d2 100644 --- a/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.cpp @@ -1,48 +1,56 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindAeroConstIEC.hpp" +#include +#include + #include "WindGenTurbineType1IEC.hpp" using namespace CIMPP; -WindAeroConstIEC::WindAeroConstIEC(): WindGenTurbineType1IEC(nullptr) {}; - +WindAeroConstIEC::WindAeroConstIEC() : WindGenTurbineType1IEC(nullptr) {}; WindAeroConstIEC::~WindAeroConstIEC() {}; -bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindAeroConstIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType1IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType1IEC != nullptr) - return true; - } - return false; -} - -namespace CIMPP { - BaseClass* WindAeroConstIEC_factory() { - return new WindAeroConstIEC; +bool assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass*, BaseClass*); +bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindAeroConstIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType1IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType1IEC != element2) + { + element->WindGenTurbineType1IEC = element2; + return assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindAeroConstIEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC"), &WindAeroConstIEC_factory)); +const char WindAeroConstIEC::debugName[] = "WindAeroConstIEC"; +const char* WindAeroConstIEC::debugString() const +{ + return WindAeroConstIEC::debugName; } -void WindAeroConstIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindAeroConstIEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC"), &WindAeroConstIEC_factory)); +} -void WindAeroConstIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC.WindGenTurbineType1IEC"), &assign_WindAeroConstIEC_WindGenTurbineType1IEC)); +void WindAeroConstIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindAeroConstIEC::debugName[] = "WindAeroConstIEC"; -const char* WindAeroConstIEC::debugString() +void WindAeroConstIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindAeroConstIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindAeroConstIEC.WindGenTurbineType1IEC"), &assign_WindAeroConstIEC_WindGenTurbineType1IEC)); } const BaseClassDefiner WindAeroConstIEC::declare() @@ -50,4 +58,10 @@ const BaseClassDefiner WindAeroConstIEC::declare() return BaseClassDefiner(WindAeroConstIEC::addConstructToMap, WindAeroConstIEC::addPrimitiveAssignFnsToMap, WindAeroConstIEC::addClassAssignFnsToMap, WindAeroConstIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindAeroConstIEC_factory() + { + return new WindAeroConstIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.hpp b/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.hpp index 9538d248c..ad46f30a6 100644 --- a/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindAeroConstIEC.hpp @@ -1,38 +1,39 @@ #ifndef WindAeroConstIEC_H #define WindAeroConstIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindGenTurbineType1IEC; -class WindGenTurbineType1IEC; /* The constant aerodynamic torque model assumes that the aerodynamic torque is constant. Reference: IEC Standard 61400-27-1 Section 6.6.1.1. */ - class WindAeroConstIEC: public IdentifiedObject + class WindAeroConstIEC : public IdentifiedObject { - public: - CIMPP::WindGenTurbineType1IEC* WindGenTurbineType1IEC; /* Wind turbine type 1 model with which this wind aerodynamic model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindAeroConstIEC(); - virtual ~WindAeroConstIEC(); - + ~WindAeroConstIEC() override; + + CIMPP::WindGenTurbineType1IEC* WindGenTurbineType1IEC; /* Wind turbine type 1 model with which this wind aerodynamic model is associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindAeroConstIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.cpp b/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.cpp index a54aa0e59..4f2b018a5 100644 --- a/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.cpp @@ -1,123 +1,136 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindAeroLinearIEC.hpp" +#include +#include + +#include "WindGenTurbineType3IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" #include "AngleDegrees.hpp" -#include "WindGenTurbineType3IEC.hpp" using namespace CIMPP; -WindAeroLinearIEC::WindAeroLinearIEC(): WindGenTurbineType3IEC(nullptr) {}; - +WindAeroLinearIEC::WindAeroLinearIEC() : WindGenTurbineType3IEC(nullptr) {}; WindAeroLinearIEC::~WindAeroLinearIEC() {}; +bool assign_WindAeroLinearIEC_dpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpomega; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_dptheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dptheta; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_omegazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omegazero; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_pavail(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pavail; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; +bool assign_WindAeroLinearIEC_thetazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetazero; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindAeroLinearIEC_dpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpomega; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass*, BaseClass*); +bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindAeroLinearIEC_dptheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dptheta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindAeroLinearIEC_omegazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omegazero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindAeroLinearIEC_pavail(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pavail; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindAeroLinearIEC_thetazero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindAeroLinearIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetazero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindAeroLinearIEC_factory() { - return new WindAeroLinearIEC; - } +const char WindAeroLinearIEC::debugName[] = "WindAeroLinearIEC"; +const char* WindAeroLinearIEC::debugString() const +{ + return WindAeroLinearIEC::debugName; } -void WindAeroLinearIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindAeroLinearIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC"), &WindAeroLinearIEC_factory)); } -void WindAeroLinearIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindAeroLinearIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.dpomega"), &assign_WindAeroLinearIEC_dpomega)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.dptheta"), &assign_WindAeroLinearIEC_dptheta)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.omegazero"), &assign_WindAeroLinearIEC_omegazero)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.pavail"), &assign_WindAeroLinearIEC_pavail)); assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.thetazero"), &assign_WindAeroLinearIEC_thetazero)); - } - -void WindAeroLinearIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.WindGenTurbineType3IEC"), &assign_WindAeroLinearIEC_WindGenTurbineType3IEC)); } -const char WindAeroLinearIEC::debugName[] = "WindAeroLinearIEC"; -const char* WindAeroLinearIEC::debugString() +void WindAeroLinearIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindAeroLinearIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindAeroLinearIEC.WindGenTurbineType3IEC"), &assign_WindAeroLinearIEC_WindGenTurbineType3IEC)); } const BaseClassDefiner WindAeroLinearIEC::declare() @@ -125,4 +138,10 @@ const BaseClassDefiner WindAeroLinearIEC::declare() return BaseClassDefiner(WindAeroLinearIEC::addConstructToMap, WindAeroLinearIEC::addPrimitiveAssignFnsToMap, WindAeroLinearIEC::addClassAssignFnsToMap, WindAeroLinearIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindAeroLinearIEC_factory() + { + return new WindAeroLinearIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.hpp b/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.hpp index 6b15e7e05..5556cf924 100644 --- a/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindAeroLinearIEC.hpp @@ -1,45 +1,46 @@ #ifndef WindAeroLinearIEC_H #define WindAeroLinearIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" +#include "PU.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindGenTurbineType3IEC; -class WindGenTurbineType3IEC; /* The linearised aerodynamic model. Reference: IEC Standard 614000-27-1 Section 6.6.1.2. */ - class WindAeroLinearIEC: public IdentifiedObject + class WindAeroLinearIEC : public IdentifiedObject { - public: - CIMPP::PU dpomega; /* Partial derivative of aerodynamic power with respect to changes in WTR speed (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU dptheta; /* Partial derivative of aerodynamic power with respect to changes in pitch angle (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU omegazero; /* Rotor speed if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pavail; /* Available aerodynamic power (). It is case dependent parameter. Default: nullptr */ - CIMPP::AngleDegrees thetazero; /* Pitch angle if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind generator type 3 model with which this wind aerodynamic model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindAeroLinearIEC(); - virtual ~WindAeroLinearIEC(); - + ~WindAeroLinearIEC() override; + + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind generator type 3 model with which this wind aerodynamic model is associated. Default: 0 */ + CIMPP::PU dpomega; /* Partial derivative of aerodynamic power with respect to changes in WTR speed (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU dptheta; /* Partial derivative of aerodynamic power with respect to changes in pitch angle (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU omegazero; /* Rotor speed if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pavail; /* Available aerodynamic power (). It is case dependent parameter. Default: nullptr */ + CIMPP::AngleDegrees thetazero; /* Pitch angle if the wind turbine is not derated (). It is case dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindAeroLinearIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.cpp b/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.cpp index 7498409c3..b1b64d199 100644 --- a/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.cpp @@ -1,136 +1,156 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContCurrLimIEC.hpp" +#include +#include + +#include "WindDynamicsLookupTable.hpp" +#include "WindTurbineType3or4IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "Boolean.hpp" #include "Boolean.hpp" #include "Seconds.hpp" -#include "WindTurbineType3or4IEC.hpp" -#include "WindDynamicsLookupTable.hpp" using namespace CIMPP; -WindContCurrLimIEC::WindContCurrLimIEC(): WindTurbineType3or4IEC(nullptr) {}; - +WindContCurrLimIEC::WindContCurrLimIEC() : WindTurbineType3or4IEC(nullptr) {}; WindContCurrLimIEC::~WindContCurrLimIEC() {}; +bool assign_WindContCurrLimIEC_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContCurrLimIEC_imaxdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->imaxdip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContCurrLimIEC_mdfslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mdfslim; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4IEC != nullptr) - return true; - } - return false; +bool assign_WindContCurrLimIEC_mqpri(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mqpri; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindDynamicsLookupTable.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindContCurrLimIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindContCurrLimIEC_imax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass*, BaseClass*); +bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContCurrLimIEC_imaxdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->imaxdip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass*, BaseClass*); +bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4IEC != element2) + { + element->WindTurbineType3or4IEC = element2; + return assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContCurrLimIEC_mdfslim(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mdfslim; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContCurrLimIEC_mqpri(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mqpri; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContCurrLimIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContCurrLimIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContCurrLimIEC_factory() { - return new WindContCurrLimIEC; - } +const char WindContCurrLimIEC::debugName[] = "WindContCurrLimIEC"; +const char* WindContCurrLimIEC::debugString() const +{ + return WindContCurrLimIEC::debugName; } -void WindContCurrLimIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContCurrLimIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC"), &WindContCurrLimIEC_factory)); } -void WindContCurrLimIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContCurrLimIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.imax"), &assign_WindContCurrLimIEC_imax)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.imaxdip"), &assign_WindContCurrLimIEC_imaxdip)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.mdfslim"), &assign_WindContCurrLimIEC_mdfslim)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.mqpri"), &assign_WindContCurrLimIEC_mqpri)); assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.tufilt"), &assign_WindContCurrLimIEC_tufilt)); - } - -void WindContCurrLimIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindTurbineType3or4IEC"), &assign_WindContCurrLimIEC_WindTurbineType3or4IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindDynamicsLookupTable"), &assign_WindContCurrLimIEC_WindDynamicsLookupTable)); } -const char WindContCurrLimIEC::debugName[] = "WindContCurrLimIEC"; -const char* WindContCurrLimIEC::debugString() +void WindContCurrLimIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContCurrLimIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindDynamicsLookupTable"), &assign_WindContCurrLimIEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindContCurrLimIEC.WindTurbineType3or4IEC"), &assign_WindContCurrLimIEC_WindTurbineType3or4IEC)); } const BaseClassDefiner WindContCurrLimIEC::declare() @@ -138,4 +158,10 @@ const BaseClassDefiner WindContCurrLimIEC::declare() return BaseClassDefiner(WindContCurrLimIEC::addConstructToMap, WindContCurrLimIEC::addPrimitiveAssignFnsToMap, WindContCurrLimIEC::addClassAssignFnsToMap, WindContCurrLimIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContCurrLimIEC_factory() + { + return new WindContCurrLimIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.hpp b/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.hpp index 6d75b61e8..071ff806d 100644 --- a/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContCurrLimIEC.hpp @@ -1,48 +1,49 @@ #ifndef WindContCurrLimIEC_H #define WindContCurrLimIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindTurbineType3or4IEC; -class WindTurbineType3or4IEC; -class WindDynamicsLookupTable; /* Current limitation model. The current limitation model combines the physical limits. Reference: IEC Standard 61400-27-1 Section 6.6.5.7. */ - class WindContCurrLimIEC: public IdentifiedObject + class WindContCurrLimIEC : public IdentifiedObject { - public: - CIMPP::PU imax; /* Maximum continuous current at the wind turbine terminals (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU imaxdip; /* Maximum current during voltage dip at the wind turbine terminals (). It is project dependent parameter. Default: nullptr */ - CIMPP::Boolean mdfslim; /* Limitation of type 3 stator current (): - false=0: total current limitation, - true=1: stator current limitation). It is type dependent parameter. Default: false */ - CIMPP::Boolean mqpri; /* Prioritisation of q control during LVRT (): - true = 1: reactive power priority, - false = 0: active power priority. It is project dependent parameter. Default: false */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this wind control current limitation model is associated. Default: 0 */ - std::list WindDynamicsLookupTable; /* The current control limitation model with which this wind dynamics lookup table is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContCurrLimIEC(); - virtual ~WindContCurrLimIEC(); - + ~WindContCurrLimIEC() override; + + std::list WindDynamicsLookupTable; /* The current control limitation model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this wind control current limitation model is associated. Default: 0 */ + CIMPP::PU imax; /* Maximum continuous current at the wind turbine terminals (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU imaxdip; /* Maximum current during voltage dip at the wind turbine terminals (). It is project dependent parameter. Default: nullptr */ + CIMPP::Boolean mdfslim; /* Limitation of type 3 stator current (): - false=0: total current limitation, - true=1: stator current limitation). It is type dependent parameter. Default: false */ + CIMPP::Boolean mqpri; /* Prioritisation of q control during LVRT (): - true = 1: reactive power priority, - false = 0: active power priority. It is project dependent parameter. Default: false */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContCurrLimIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContPType3IEC.cpp b/CGMES_2.4.15_27JAN2020/WindContPType3IEC.cpp index 97dc2c67c..841bebeea 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPType3IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContPType3IEC.cpp @@ -1,7 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPType3IEC.hpp" +#include +#include + +#include "WindDynamicsLookupTable.hpp" +#include "WindGenTurbineType3IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -23,321 +29,357 @@ #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" -#include "WindGenTurbineType3IEC.hpp" -#include "WindDynamicsLookupTable.hpp" using namespace CIMPP; -WindContPType3IEC::WindContPType3IEC(): WindGenTurbineType3IEC(nullptr), WindDynamicsLookupTable(nullptr) {}; - +WindContPType3IEC::WindContPType3IEC() : WindGenTurbineType3IEC(nullptr) {}; WindContPType3IEC::~WindContPType3IEC() {}; +bool assign_WindContPType3IEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_dtrisemaxlvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dtrisemaxlvrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_kdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdtd; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_mplvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mplvrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_omegaoffset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omegaoffset; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_pdtdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pdtdmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_rramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rramp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tdvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tdvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_temin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->temin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tomegafilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_tuscale(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuscale; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_twref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_udvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udvs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType3IEC_updip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->updip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; +bool assign_WindContPType3IEC_wdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->wdtd; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindDynamicsLookupTable = dynamic_cast(BaseClass_ptr2); - if(element->WindDynamicsLookupTable != nullptr) - return true; - } - return false; +bool assign_WindContPType3IEC_zeta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->zeta; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType3IEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass*, BaseClass*); +bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType3IEC_dtrisemaxlvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dtrisemaxlvrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass*, BaseClass*); +bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType3IEC_kdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdtd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_kip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_kpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_mplvrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mplvrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_omegaoffset(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omegaoffset; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_pdtdmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pdtdmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_rramp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rramp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tdvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tdvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_temin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->temin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tomegafilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_tuscale(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuscale; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_twref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_udvs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udvs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_updip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->updip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_wdtd(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->wdtd; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType3IEC_zeta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->zeta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContPType3IEC_factory() { - return new WindContPType3IEC; - } +const char WindContPType3IEC::debugName[] = "WindContPType3IEC"; +const char* WindContPType3IEC::debugString() const +{ + return WindContPType3IEC::debugName; } -void WindContPType3IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPType3IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPType3IEC"), &WindContPType3IEC_factory)); } -void WindContPType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.dpmax"), &assign_WindContPType3IEC_dpmax)); assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.dtrisemaxlvrt"), &assign_WindContPType3IEC_dtrisemaxlvrt)); assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.kdtd"), &assign_WindContPType3IEC_kdtd)); @@ -359,17 +401,12 @@ void WindContPType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindGenTurbineType3IEC"), &assign_WindContPType3IEC_WindGenTurbineType3IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindDynamicsLookupTable"), &assign_WindContPType3IEC_WindDynamicsLookupTable)); } -const char WindContPType3IEC::debugName[] = "WindContPType3IEC"; -const char* WindContPType3IEC::debugString() +void WindContPType3IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPType3IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindDynamicsLookupTable"), &assign_WindContPType3IEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindContPType3IEC.WindGenTurbineType3IEC"), &assign_WindContPType3IEC_WindGenTurbineType3IEC)); } const BaseClassDefiner WindContPType3IEC::declare() @@ -377,4 +414,10 @@ const BaseClassDefiner WindContPType3IEC::declare() return BaseClassDefiner(WindContPType3IEC::addConstructToMap, WindContPType3IEC::addPrimitiveAssignFnsToMap, WindContPType3IEC::addClassAssignFnsToMap, WindContPType3IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPType3IEC_factory() + { + return new WindContPType3IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContPType3IEC.hpp b/CGMES_2.4.15_27JAN2020/WindContPType3IEC.hpp index 938abe5d2..5dc2f994e 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPType3IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContPType3IEC.hpp @@ -1,65 +1,66 @@ #ifndef WindContPType3IEC_H #define WindContPType3IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" #include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindGenTurbineType3IEC; -class WindGenTurbineType3IEC; -class WindDynamicsLookupTable; /* P control model Type 3. Reference: IEC Standard 61400-27-1 Section 6.6.5.3. */ - class WindContPType3IEC: public IdentifiedObject + class WindContPType3IEC : public IdentifiedObject { - public: - CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU dtrisemaxlvrt; /* Limitation of torque rise rate during LVRT for S (d). It is project dependent parameter. Default: nullptr */ - CIMPP::PU kdtd; /* Gain for active drive train damping (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kip; /* PI controller integration parameter (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpp; /* PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::Boolean mplvrt; /* Enable LVRT power control mode (M true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ - CIMPP::PU omegaoffset; /* Offset to reference value that limits controller action during rotor speed changes (omega). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pdtdmax; /* Maximum active drive train damping power (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rramp; /* Ramp limitation of torque, required in some grid codes (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tdvs; /* Timedelay after deep voltage sags (T). It is project dependent parameter. Default: nullptr */ - CIMPP::PU temin; /* Minimum electrical generator torque (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU tuscale; /* Voltage scaling factor of reset-torque (T). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds twref; /* Time constant in speed reference filter (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU udvs; /* Voltage limit for hold LVRT status after deep voltage sags (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU updip; /* Voltage dip threshold for P-control (). Part of turbine control, often different (e.g 0.8) from converter thresholds. It is project dependent parameter. Default: nullptr */ - CIMPP::PU wdtd; /* Active drive train damping frequency (omega). It can be calculated from two mass model parameters. It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float zeta; /* Coefficient for active drive train damping (zeta). It is type dependent parameter. Default: nullptr */ - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this Wind control P type 3 model is associated. Default: 0 */ - CIMPP::WindDynamicsLookupTable* WindDynamicsLookupTable; /* The P control type 3 model with which this wind dynamics lookup table is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPType3IEC(); - virtual ~WindContPType3IEC(); - + ~WindContPType3IEC() override; + + std::list WindDynamicsLookupTable; /* The P control type 3 model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this Wind control P type 3 model is associated. Default: 0 */ + CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU dtrisemaxlvrt; /* Limitation of torque rise rate during LVRT for S (d). It is project dependent parameter. Default: nullptr */ + CIMPP::PU kdtd; /* Gain for active drive train damping (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kip; /* PI controller integration parameter (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpp; /* PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::Boolean mplvrt; /* Enable LVRT power control mode (M true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ + CIMPP::PU omegaoffset; /* Offset to reference value that limits controller action during rotor speed changes (omega). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pdtdmax; /* Maximum active drive train damping power (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rramp; /* Ramp limitation of torque, required in some grid codes (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tdvs; /* Timedelay after deep voltage sags (T). It is project dependent parameter. Default: nullptr */ + CIMPP::PU temin; /* Minimum electrical generator torque (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU tuscale; /* Voltage scaling factor of reset-torque (T). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds twref; /* Time constant in speed reference filter (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU udvs; /* Voltage limit for hold LVRT status after deep voltage sags (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU updip; /* Voltage dip threshold for P-control (). Part of turbine control, often different (e.g 0.8) from converter thresholds. It is project dependent parameter. Default: nullptr */ + CIMPP::PU wdtd; /* Active drive train damping frequency (omega). It can be calculated from two mass model parameters. It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float zeta; /* Coefficient for active drive train damping (zeta). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPType3IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.cpp b/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.cpp index 451eeb6f5..abd8f9dab 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.cpp @@ -1,93 +1,104 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPType4aIEC.hpp" +#include +#include + +#include "WindTurbineType4aIEC.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindTurbineType4aIEC.hpp" using namespace CIMPP; -WindContPType4aIEC::WindContPType4aIEC(): WindTurbineType4aIEC(nullptr) {}; - +WindContPType4aIEC::WindContPType4aIEC() : WindTurbineType4aIEC(nullptr) {}; WindContPType4aIEC::~WindContPType4aIEC() {}; +bool assign_WindContPType4aIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType4aIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType4aIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType4aIEC != nullptr) - return true; - } - return false; +bool assign_WindContPType4aIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType4aIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass*, BaseClass*); +bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType4aIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType4aIEC != element2) + { + element->WindTurbineType4aIEC = element2; + return assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType4aIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType4aIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContPType4aIEC_factory() { - return new WindContPType4aIEC; - } +const char WindContPType4aIEC::debugName[] = "WindContPType4aIEC"; +const char* WindContPType4aIEC::debugString() const +{ + return WindContPType4aIEC::debugName; } -void WindContPType4aIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPType4aIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC"), &WindContPType4aIEC_factory)); } -void WindContPType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.dpmax"), &assign_WindContPType4aIEC_dpmax)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.tpord"), &assign_WindContPType4aIEC_tpord)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.tufilt"), &assign_WindContPType4aIEC_tufilt)); - } - -void WindContPType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.WindTurbineType4aIEC"), &assign_WindContPType4aIEC_WindTurbineType4aIEC)); } -const char WindContPType4aIEC::debugName[] = "WindContPType4aIEC"; -const char* WindContPType4aIEC::debugString() +void WindContPType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPType4aIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPType4aIEC.WindTurbineType4aIEC"), &assign_WindContPType4aIEC_WindTurbineType4aIEC)); } const BaseClassDefiner WindContPType4aIEC::declare() @@ -95,4 +106,10 @@ const BaseClassDefiner WindContPType4aIEC::declare() return BaseClassDefiner(WindContPType4aIEC::addConstructToMap, WindContPType4aIEC::addPrimitiveAssignFnsToMap, WindContPType4aIEC::addClassAssignFnsToMap, WindContPType4aIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPType4aIEC_factory() + { + return new WindContPType4aIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.hpp b/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.hpp index 6bea47516..c95a2af05 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContPType4aIEC.hpp @@ -1,43 +1,44 @@ #ifndef WindContPType4aIEC_H #define WindContPType4aIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType4aIEC; - -class WindTurbineType4aIEC; /* P control model Type 4A. Reference: IEC Standard 61400-27-1 Section 6.6.5.4. */ - class WindContPType4aIEC: public IdentifiedObject + class WindContPType4aIEC : public IdentifiedObject { - public: - CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType4aIEC* WindTurbineType4aIEC; /* Wind turbine type 4A model with which this wind control P type 4A model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPType4aIEC(); - virtual ~WindContPType4aIEC(); - + ~WindContPType4aIEC() override; + + CIMPP::WindTurbineType4aIEC* WindTurbineType4aIEC; /* Wind turbine type 4A model with which this wind control P type 4A model is associated. Default: 0 */ + CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPType4aIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.cpp b/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.cpp index 099407b5b..25670919f 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.cpp @@ -1,108 +1,120 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPType4bIEC.hpp" +#include +#include + +#include "WindTurbineType4bIEC.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindTurbineType4bIEC.hpp" using namespace CIMPP; -WindContPType4bIEC::WindContPType4bIEC(): WindTurbineType4bIEC(nullptr) {}; - +WindContPType4bIEC::WindContPType4bIEC() : WindTurbineType4bIEC(nullptr) {}; WindContPType4bIEC::~WindContPType4bIEC() {}; +bool assign_WindContPType4bIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dpmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType4bIEC_tpaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpaero; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPType4bIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType4bIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType4bIEC != nullptr) - return true; - } - return false; +bool assign_WindContPType4bIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPType4bIEC_dpmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dpmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass*, BaseClass*); +bool assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType4bIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType4bIEC != element2) + { + element->WindTurbineType4bIEC = element2; + return assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPType4bIEC_tpaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpaero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType4bIEC_tpord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPType4bIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindContPType4bIEC_factory() { - return new WindContPType4bIEC; - } +const char WindContPType4bIEC::debugName[] = "WindContPType4bIEC"; +const char* WindContPType4bIEC::debugString() const +{ + return WindContPType4bIEC::debugName; } -void WindContPType4bIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPType4bIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC"), &WindContPType4bIEC_factory)); } -void WindContPType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.dpmax"), &assign_WindContPType4bIEC_dpmax)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.tpaero"), &assign_WindContPType4bIEC_tpaero)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.tpord"), &assign_WindContPType4bIEC_tpord)); assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.tufilt"), &assign_WindContPType4bIEC_tufilt)); - } - -void WindContPType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.WindTurbineType4bIEC"), &assign_WindContPType4bIEC_WindTurbineType4bIEC)); } -const char WindContPType4bIEC::debugName[] = "WindContPType4bIEC"; -const char* WindContPType4bIEC::debugString() +void WindContPType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPType4bIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPType4bIEC.WindTurbineType4bIEC"), &assign_WindContPType4bIEC_WindTurbineType4bIEC)); } const BaseClassDefiner WindContPType4bIEC::declare() @@ -110,4 +122,10 @@ const BaseClassDefiner WindContPType4bIEC::declare() return BaseClassDefiner(WindContPType4bIEC::addConstructToMap, WindContPType4bIEC::addPrimitiveAssignFnsToMap, WindContPType4bIEC::addClassAssignFnsToMap, WindContPType4bIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPType4bIEC_factory() + { + return new WindContPType4bIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.hpp b/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.hpp index 586daf965..c2f174f9b 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContPType4bIEC.hpp @@ -1,44 +1,45 @@ #ifndef WindContPType4bIEC_H #define WindContPType4bIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType4bIEC; - -class WindTurbineType4bIEC; /* P control model Type 4B. Reference: IEC Standard 61400-27-1 Section 6.6.5.5. */ - class WindContPType4bIEC: public IdentifiedObject + class WindContPType4bIEC : public IdentifiedObject { - public: - CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tpaero; /* Time constant in aerodynamic power response (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind control P type 4B model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPType4bIEC(); - virtual ~WindContPType4bIEC(); - + ~WindContPType4bIEC() override; + + CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind control P type 4B model is associated. Default: 0 */ + CIMPP::PU dpmax; /* Maximum wind turbine power ramp rate (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tpaero; /* Time constant in aerodynamic power response (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpord; /* Time constant in power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPType4bIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.cpp b/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.cpp index 0e74abd50..1abd36c2c 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.cpp @@ -1,7 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContPitchAngleIEC.hpp" +#include +#include + +#include "WindGenTurbineType3IEC.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" #include "PU.hpp" @@ -12,167 +17,185 @@ #include "AngleDegrees.hpp" #include "AngleDegrees.hpp" #include "Seconds.hpp" -#include "WindGenTurbineType3IEC.hpp" using namespace CIMPP; -WindContPitchAngleIEC::WindContPitchAngleIEC(): WindGenTurbineType3IEC(nullptr) {}; - +WindContPitchAngleIEC::WindContPitchAngleIEC() : WindGenTurbineType3IEC(nullptr) {}; WindContPitchAngleIEC::~WindContPitchAngleIEC() {}; +bool assign_WindContPitchAngleIEC_dthetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dthetamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_dthetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dthetamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kiomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiomega; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpomega; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_kpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_thetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetamax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContPitchAngleIEC_thetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->thetamin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; +bool assign_WindContPitchAngleIEC_ttheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->ttheta; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContPitchAngleIEC_dthetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dthetamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass*, BaseClass*); +bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContPitchAngleIEC_dthetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dthetamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kiomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiomega; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kpomega(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpomega; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContPitchAngleIEC_kpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContPitchAngleIEC_thetamax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetamax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContPitchAngleIEC_thetamin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->thetamin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContPitchAngleIEC_ttheta(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContPitchAngleIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->ttheta; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* WindContPitchAngleIEC_factory() { - return new WindContPitchAngleIEC; - } + + + + + +const char WindContPitchAngleIEC::debugName[] = "WindContPitchAngleIEC"; +const char* WindContPitchAngleIEC::debugString() const +{ + return WindContPitchAngleIEC::debugName; } -void WindContPitchAngleIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContPitchAngleIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC"), &WindContPitchAngleIEC_factory)); } -void WindContPitchAngleIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContPitchAngleIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.dthetamax"), &assign_WindContPitchAngleIEC_dthetamax)); assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.dthetamin"), &assign_WindContPitchAngleIEC_dthetamin)); assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.kic"), &assign_WindContPitchAngleIEC_kic)); @@ -183,16 +206,11 @@ void WindContPitchAngleIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.WindGenTurbineType3IEC"), &assign_WindContPitchAngleIEC_WindGenTurbineType3IEC)); } -const char WindContPitchAngleIEC::debugName[] = "WindContPitchAngleIEC"; -const char* WindContPitchAngleIEC::debugString() +void WindContPitchAngleIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContPitchAngleIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContPitchAngleIEC.WindGenTurbineType3IEC"), &assign_WindContPitchAngleIEC_WindGenTurbineType3IEC)); } const BaseClassDefiner WindContPitchAngleIEC::declare() @@ -200,4 +218,10 @@ const BaseClassDefiner WindContPitchAngleIEC::declare() return BaseClassDefiner(WindContPitchAngleIEC::addConstructToMap, WindContPitchAngleIEC::addPrimitiveAssignFnsToMap, WindContPitchAngleIEC::addClassAssignFnsToMap, WindContPitchAngleIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContPitchAngleIEC_factory() + { + return new WindContPitchAngleIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.hpp b/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.hpp index dbd8fb229..c1f015f98 100644 --- a/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContPitchAngleIEC.hpp @@ -1,52 +1,53 @@ #ifndef WindContPitchAngleIEC_H #define WindContPitchAngleIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "AngleDegrees.hpp" +#include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindGenTurbineType3IEC; -class WindGenTurbineType3IEC; /* Pitch angle control model. Reference: IEC Standard 61400-27-1 Section 6.6.5.8. */ - class WindContPitchAngleIEC: public IdentifiedObject + class WindContPitchAngleIEC : public IdentifiedObject { - public: - CIMPP::Simple_Float dthetamax; /* Maximum pitch positive ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ - CIMPP::Simple_Float dthetamin; /* Maximum pitch negative ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ - CIMPP::PU kic; /* Power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kiomega; /* Speed PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpc; /* Power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpomega; /* Speed PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpx; /* Pitch cross coupling gain (K). It is type dependent parameter. Default: nullptr */ - CIMPP::AngleDegrees thetamax; /* Maximum pitch angle (). It is type dependent parameter. Default: nullptr */ - CIMPP::AngleDegrees thetamin; /* Minimum pitch angle (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds ttheta; /* Pitch time constant (t). It is type dependent parameter. Default: nullptr */ - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this pitch control model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContPitchAngleIEC(); - virtual ~WindContPitchAngleIEC(); - + ~WindContPitchAngleIEC() override; + + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine type 3 model with which this pitch control model is associated. Default: 0 */ + CIMPP::Simple_Float dthetamax; /* Maximum pitch positive ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ + CIMPP::Simple_Float dthetamin; /* Maximum pitch negative ramp rate (d). It is type dependent parameter. Unit = degrees/sec. Default: nullptr */ + CIMPP::PU kic; /* Power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kiomega; /* Speed PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpc; /* Power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpomega; /* Speed PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpx; /* Pitch cross coupling gain (K). It is type dependent parameter. Default: nullptr */ + CIMPP::AngleDegrees thetamax; /* Maximum pitch angle (). It is type dependent parameter. Default: nullptr */ + CIMPP::AngleDegrees thetamin; /* Minimum pitch angle (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds ttheta; /* Pitch time constant (t). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContPitchAngleIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContQIEC.cpp b/CGMES_2.4.15_27JAN2020/WindContQIEC.cpp index 8c85dc09e..60df4e0e3 100644 --- a/CGMES_2.4.15_27JAN2020/WindContQIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContQIEC.cpp @@ -1,7 +1,12 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContQIEC.hpp" +#include +#include + +#include "WindTurbineType3or4IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -28,375 +33,409 @@ #include "WindLVRTQcontrolModesKind.hpp" #include "WindQcontrolModesKind.hpp" #include "PU.hpp" -#include "WindTurbineType3or4IEC.hpp" using namespace CIMPP; -WindContQIEC::WindContQIEC(): WindTurbineType3or4IEC(nullptr) {}; - +WindContQIEC::WindContQIEC() : WindTurbineType3or4IEC(nullptr) {}; WindContQIEC::~WindContQIEC() {}; +bool assign_WindContQIEC_iqh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqh1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_iqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_iqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_iqpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->iqpost; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kiu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kpq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_kqv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kqv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_qmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_qmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->qmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_rdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tiq; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpost; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tqord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tqord; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_udb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udb1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_udb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->udb2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_umax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->umax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_umin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->umin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_uqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uqdip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_uref0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uref0; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_windLVRTQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windLVRTQcontrolModesType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContQIEC_windQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windQcontrolModesType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4IEC != nullptr) - return true; - } - return false; +bool assign_WindContQIEC_xdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindContQIEC_iqh1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqh1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass*, BaseClass*); +bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContQIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4IEC != element2) + { + element->WindTurbineType3or4IEC = element2; + return assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindContQIEC_iqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_iqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_iqpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->iqpost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_kiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_kiu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindContQIEC_kpq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_kpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_kqv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kqv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_qmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_qmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->qmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_rdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tiq(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tiq; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tpost(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpost; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tqord(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tqord; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_tufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_udb1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udb1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_udb2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->udb2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_umax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->umax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_umin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->umin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_uqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uqdip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_uref0(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uref0; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_windLVRTQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windLVRTQcontrolModesType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_windQcontrolModesType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windQcontrolModesType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContQIEC_xdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContQIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* WindContQIEC_factory() { - return new WindContQIEC; - } + + + + + + + + + + + + + + + + + + + + + +const char WindContQIEC::debugName[] = "WindContQIEC"; +const char* WindContQIEC::debugString() const +{ + return WindContQIEC::debugName; } -void WindContQIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContQIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContQIEC"), &WindContQIEC_factory)); } -void WindContQIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContQIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.iqh1"), &assign_WindContQIEC_iqh1)); assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.iqmax"), &assign_WindContQIEC_iqmax)); assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.iqmin"), &assign_WindContQIEC_iqmin)); @@ -423,16 +462,11 @@ void WindContQIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.WindTurbineType3or4IEC"), &assign_WindContQIEC_WindTurbineType3or4IEC)); } -const char WindContQIEC::debugName[] = "WindContQIEC"; -const char* WindContQIEC::debugString() +void WindContQIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContQIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContQIEC.WindTurbineType3or4IEC"), &assign_WindContQIEC_WindTurbineType3or4IEC)); } const BaseClassDefiner WindContQIEC::declare() @@ -440,4 +474,10 @@ const BaseClassDefiner WindContQIEC::declare() return BaseClassDefiner(WindContQIEC::addConstructToMap, WindContQIEC::addPrimitiveAssignFnsToMap, WindContQIEC::addClassAssignFnsToMap, WindContQIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContQIEC_factory() + { + return new WindContQIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContQIEC.hpp b/CGMES_2.4.15_27JAN2020/WindContQIEC.hpp index 36c3bc452..eb9e06da8 100644 --- a/CGMES_2.4.15_27JAN2020/WindContQIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContQIEC.hpp @@ -1,68 +1,69 @@ #ifndef WindContQIEC_H #define WindContQIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "WindLVRTQcontrolModesKind.hpp" #include "WindQcontrolModesKind.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType3or4IEC; - -class WindTurbineType3or4IEC; /* Q control model. Reference: IEC Standard 61400-27-1 Section 6.6.5.6. */ - class WindContQIEC: public IdentifiedObject + class WindContQIEC : public IdentifiedObject { - public: - CIMPP::PU iqh1; /* Maximum reactive current injection during dip (i). It is type dependent parameter. Default: nullptr */ - CIMPP::PU iqmax; /* Maximum reactive current injection (i). It is type dependent parameter. Default: nullptr */ - CIMPP::PU iqmin; /* Minimum reactive current injection (i). It is type dependent parameter. Default: nullptr */ - CIMPP::PU iqpost; /* Post fault reactive current injection (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU kiq; /* Reactive power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kiu; /* Voltage PI controller integration gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpq; /* Reactive power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kpu; /* Voltage PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kqv; /* Voltage scaling factor for LVRT current (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU qmax; /* Maximum reactive power (q). It is type dependent parameter. Default: nullptr */ - CIMPP::PU qmin; /* Minimum reactive power (q). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rdroop; /* Resistive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tiq; /* Time constant in reactive current lag (T). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfilt; /* Power measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpost; /* Length of time period where post fault reactive power is injected (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tqord; /* Time constant in reactive power order lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU udb1; /* Voltage dead band lower limit (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU udb2; /* Voltage dead band upper limit (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU umax; /* Maximum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ - CIMPP::PU umin; /* Minimum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ - CIMPP::PU uqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU uref0; /* User defined bias in voltage reference (), used when =. It is case dependent parameter. Default: nullptr */ - CIMPP::WindLVRTQcontrolModesKind windLVRTQcontrolModesType; /* Types of LVRT Q control modes (). It is project dependent parameter. Default: 0 */ - CIMPP::WindQcontrolModesKind windQcontrolModesType; /* Types of general wind turbine Q control modes (). It is project dependent parameter. Default: 0 */ - CIMPP::PU xdroop; /* Inductive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this reactive control mode is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContQIEC(); - virtual ~WindContQIEC(); - + ~WindContQIEC() override; + + CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind turbine type 3 or 4 model with which this reactive control mode is associated. Default: 0 */ + CIMPP::PU iqh1; /* Maximum reactive current injection during dip (i). It is type dependent parameter. Default: nullptr */ + CIMPP::PU iqmax; /* Maximum reactive current injection (i). It is type dependent parameter. Default: nullptr */ + CIMPP::PU iqmin; /* Minimum reactive current injection (i). It is type dependent parameter. Default: nullptr */ + CIMPP::PU iqpost; /* Post fault reactive current injection (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU kiq; /* Reactive power PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kiu; /* Voltage PI controller integration gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpq; /* Reactive power PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kpu; /* Voltage PI controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kqv; /* Voltage scaling factor for LVRT current (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU qmax; /* Maximum reactive power (q). It is type dependent parameter. Default: nullptr */ + CIMPP::PU qmin; /* Minimum reactive power (q). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rdroop; /* Resistive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tiq; /* Time constant in reactive current lag (T). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfilt; /* Power measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpost; /* Length of time period where post fault reactive power is injected (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tqord; /* Time constant in reactive power order lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tufilt; /* Voltage measurement filter time constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU udb1; /* Voltage dead band lower limit (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU udb2; /* Voltage dead band upper limit (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU umax; /* Maximum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ + CIMPP::PU umin; /* Minimum voltage in voltage PI controller integral term (u). It is type dependent parameter. Default: nullptr */ + CIMPP::PU uqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU uref0; /* User defined bias in voltage reference (), used when =. It is case dependent parameter. Default: nullptr */ + CIMPP::WindLVRTQcontrolModesKind windLVRTQcontrolModesType; /* Types of LVRT Q control modes (). It is project dependent parameter. Default: 0 */ + CIMPP::WindQcontrolModesKind windQcontrolModesType; /* Types of general wind turbine Q control modes (). It is project dependent parameter. Default: 0 */ + CIMPP::PU xdroop; /* Inductive component of voltage drop impedance (). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContQIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.cpp b/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.cpp index 0bd845bc4..59dfd4868 100644 --- a/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.cpp @@ -1,7 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindContRotorRIEC.hpp" +#include +#include + +#include "WindDynamicsLookupTable.hpp" +#include "WindGenTurbineType2IEC.hpp" #include "PU.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -10,153 +16,175 @@ #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindDynamicsLookupTable.hpp" -#include "WindGenTurbineType2IEC.hpp" using namespace CIMPP; -WindContRotorRIEC::WindContRotorRIEC(): WindGenTurbineType2IEC(nullptr) {}; - +WindContRotorRIEC::WindContRotorRIEC() : WindGenTurbineType2IEC(nullptr) {}; WindContRotorRIEC::~WindContRotorRIEC() {}; +bool assign_WindContRotorRIEC_kirr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kirr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_komegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->komegafilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_kpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_kprr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kprr; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindContRotorRIEC_rmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->rmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindDynamicsLookupTable.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindContRotorRIEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tomegafilt; + if (buffer.fail()) + return false; + else return true; + } + return false; +} + +bool assign_WindContRotorRIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + + +bool assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass*, BaseClass*); +bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } -bool assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType2IEC != nullptr) - return true; - } - return false; -} - - -bool assign_WindContRotorRIEC_kirr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kirr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_komegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->komegafilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_kpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_kprr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kprr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_rmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_rmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->rmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_tomegafilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tomegafilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindContRotorRIEC_tpfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - -namespace CIMPP { - BaseClass* WindContRotorRIEC_factory() { - return new WindContRotorRIEC; +bool assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass*, BaseClass*); +bool assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindContRotorRIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType2IEC != element2) + { + element->WindGenTurbineType2IEC = element2; + return assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; +} + + + + + + + + + +const char WindContRotorRIEC::debugName[] = "WindContRotorRIEC"; +const char* WindContRotorRIEC::debugString() const +{ + return WindContRotorRIEC::debugName; } -void WindContRotorRIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindContRotorRIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC"), &WindContRotorRIEC_factory)); } -void WindContRotorRIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindContRotorRIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.kirr"), &assign_WindContRotorRIEC_kirr)); assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.komegafilt"), &assign_WindContRotorRIEC_komegafilt)); assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.kpfilt"), &assign_WindContRotorRIEC_kpfilt)); @@ -165,17 +193,12 @@ void WindContRotorRIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindDynamicsLookupTable"), &assign_WindContRotorRIEC_WindDynamicsLookupTable)); - assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindGenTurbineType2IEC"), &assign_WindContRotorRIEC_WindGenTurbineType2IEC)); } -const char WindContRotorRIEC::debugName[] = "WindContRotorRIEC"; -const char* WindContRotorRIEC::debugString() +void WindContRotorRIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindContRotorRIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindDynamicsLookupTable"), &assign_WindContRotorRIEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindContRotorRIEC.WindGenTurbineType2IEC"), &assign_WindContRotorRIEC_WindGenTurbineType2IEC)); } const BaseClassDefiner WindContRotorRIEC::declare() @@ -183,4 +206,10 @@ const BaseClassDefiner WindContRotorRIEC::declare() return BaseClassDefiner(WindContRotorRIEC::addConstructToMap, WindContRotorRIEC::addPrimitiveAssignFnsToMap, WindContRotorRIEC::addClassAssignFnsToMap, WindContRotorRIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindContRotorRIEC_factory() + { + return new WindContRotorRIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.hpp b/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.hpp index 33d92613b..cfecbb5d1 100644 --- a/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindContRotorRIEC.hpp @@ -1,51 +1,52 @@ #ifndef WindContRotorRIEC_H #define WindContRotorRIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindGenTurbineType2IEC; -class WindDynamicsLookupTable; -class WindGenTurbineType2IEC; /* Rotor resistance control model. Reference: IEC Standard 61400-27-1 Section 6.6.5.2. */ - class WindContRotorRIEC: public IdentifiedObject + class WindContRotorRIEC : public IdentifiedObject { - public: - CIMPP::PU kirr; /* Integral gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float komegafilt; /* Filter gain for generator speed measurement (K). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kpfilt; /* Filter gain for power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kprr; /* Proportional gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rmax; /* Maximum rotor resistance (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU rmin; /* Minimum rotor resistance (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ - std::list WindDynamicsLookupTable; /* The wind dynamics lookup table associated with this rotor resistance control model. Default: 0 */ - CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with whitch this wind control rotor resistance model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindContRotorRIEC(); - virtual ~WindContRotorRIEC(); - + ~WindContRotorRIEC() override; + + std::list WindDynamicsLookupTable; /* The wind dynamics lookup table associated with this rotor resistance control model. Default: 0 */ + CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with whitch this wind control rotor resistance model is associated. Default: 0 */ + CIMPP::PU kirr; /* Integral gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float komegafilt; /* Filter gain for generator speed measurement (K). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kpfilt; /* Filter gain for power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kprr; /* Proportional gain in rotor resistance PI controller (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rmax; /* Maximum rotor resistance (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU rmin; /* Minimum rotor resistance (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tomegafilt; /* Filter time constant for generator speed measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfilt; /* Filter time constant for power measurement (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindContRotorRIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.cpp b/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.cpp index 26c365097..16f28bf01 100644 --- a/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.cpp +++ b/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.cpp @@ -1,148 +1,180 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindDynamicsLookupTable.hpp" +#include +#include + #include "WindContCurrLimIEC.hpp" #include "WindContPType3IEC.hpp" #include "WindContRotorRIEC.hpp" +#include "WindPlantFreqPcontrolIEC.hpp" #include "Simple_Float.hpp" #include "WindLookupTableFunctionKind.hpp" #include "Simple_Float.hpp" #include "Integer.hpp" -#include "WindPlantFreqPcontrolIEC.hpp" using namespace CIMPP; -WindDynamicsLookupTable::WindDynamicsLookupTable(): WindContCurrLimIEC(nullptr), WindContPType3IEC(nullptr), WindContRotorRIEC(nullptr), WindPlantFreqPcontrolIEC(nullptr) {}; - +WindDynamicsLookupTable::WindDynamicsLookupTable() : WindContCurrLimIEC(nullptr), WindContPType3IEC(nullptr), WindContRotorRIEC(nullptr), WindPlantFreqPcontrolIEC(nullptr) {}; WindDynamicsLookupTable::~WindDynamicsLookupTable() {}; -bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContCurrLimIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContCurrLimIEC != nullptr) - return assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType3IEC != nullptr) - return assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContRotorRIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContRotorRIEC != nullptr) - return assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); -bool assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantFreqPcontrolIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantFreqPcontrolIEC != nullptr) - return assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindDynamicsLookupTable_input(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->input; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindDynamicsLookupTable_lookupTableFunctionType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->lookupTableFunctionType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindDynamicsLookupTable_output(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->output; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindDynamicsLookupTable_sequence(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->sequence; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindDynamicsLookupTable_input(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->input; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindContCurrLimIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContCurrLimIEC != element2) + { + element->WindContCurrLimIEC = element2; + return assign_WindContCurrLimIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindDynamicsLookupTable_lookupTableFunctionType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->lookupTableFunctionType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindContPType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType3IEC != element2) + { + element->WindContPType3IEC = element2; + return assign_WindContPType3IEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindDynamicsLookupTable_output(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->output; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindContRotorRIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContRotorRIEC != element2) + { + element->WindContRotorRIEC = element2; + return assign_WindContRotorRIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindDynamicsLookupTable_sequence(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->sequence; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass*, BaseClass*); +bool assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindDynamicsLookupTable* element = dynamic_cast(BaseClass_ptr1); + WindPlantFreqPcontrolIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantFreqPcontrolIEC != element2) + { + element->WindPlantFreqPcontrolIEC = element2; + return assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindDynamicsLookupTable_factory() { - return new WindDynamicsLookupTable; - } + + + +const char WindDynamicsLookupTable::debugName[] = "WindDynamicsLookupTable"; +const char* WindDynamicsLookupTable::debugString() const +{ + return WindDynamicsLookupTable::debugName; } -void WindDynamicsLookupTable::addConstructToMap(std::unordered_map& factory_map) { +void WindDynamicsLookupTable::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable"), &WindDynamicsLookupTable_factory)); } -void WindDynamicsLookupTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.input"), &assign_WindDynamicsLookupTable_input)); +void WindDynamicsLookupTable::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.input"), &assign_WindDynamicsLookupTable_input)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.lookupTableFunctionType"), &assign_WindDynamicsLookupTable_lookupTableFunctionType)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.output"), &assign_WindDynamicsLookupTable_output)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.sequence"), &assign_WindDynamicsLookupTable_sequence)); - } +} -void WindDynamicsLookupTable::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void WindDynamicsLookupTable::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindContCurrLimIEC"), &assign_WindDynamicsLookupTable_WindContCurrLimIEC)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindContPType3IEC"), &assign_WindDynamicsLookupTable_WindContPType3IEC)); assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindContRotorRIEC"), &assign_WindDynamicsLookupTable_WindContRotorRIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindPlantFreqPcontrolIEC"), &assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC)); -} - -const char WindDynamicsLookupTable::debugName[] = "WindDynamicsLookupTable"; -const char* WindDynamicsLookupTable::debugString() -{ - return WindDynamicsLookupTable::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindDynamicsLookupTable.WindPlantFreqPcontrolIEC"), &assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC)); } const BaseClassDefiner WindDynamicsLookupTable::declare() @@ -150,4 +182,10 @@ const BaseClassDefiner WindDynamicsLookupTable::declare() return BaseClassDefiner(WindDynamicsLookupTable::addConstructToMap, WindDynamicsLookupTable::addPrimitiveAssignFnsToMap, WindDynamicsLookupTable::addClassAssignFnsToMap, WindDynamicsLookupTable::debugName); } - +namespace CIMPP +{ + BaseClass* WindDynamicsLookupTable_factory() + { + return new WindDynamicsLookupTable; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.hpp b/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.hpp index a2de32ef2..2ed62aca5 100644 --- a/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.hpp +++ b/CGMES_2.4.15_27JAN2020/WindDynamicsLookupTable.hpp @@ -1,51 +1,52 @@ #ifndef WindDynamicsLookupTable_H #define WindDynamicsLookupTable_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" +#include "Integer.hpp" #include "Simple_Float.hpp" #include "WindLookupTableFunctionKind.hpp" -#include "Integer.hpp" - -namespace CIMPP { +namespace CIMPP +{ + class WindContCurrLimIEC; + class WindContPType3IEC; + class WindContRotorRIEC; + class WindPlantFreqPcontrolIEC; -class WindContCurrLimIEC; -class WindContPType3IEC; -class WindContRotorRIEC; -class WindPlantFreqPcontrolIEC; /* The class models a look up table for the purpose of wind standard models. */ - class WindDynamicsLookupTable: public IdentifiedObject + class WindDynamicsLookupTable : public IdentifiedObject { - public: - CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* The wind dynamics lookup table associated with this current control limitation model. Default: 0 */ - CIMPP::WindContPType3IEC* WindContPType3IEC; /* The wind dynamics lookup table associated with this P control type 3 model. Default: 0 */ - CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* The rotor resistance control model with which this wind dynamics lookup table is associated. Default: 0 */ - CIMPP::Simple_Float input; /* Input value (x) for the lookup table function. Default: nullptr */ - CIMPP::WindLookupTableFunctionKind lookupTableFunctionType; /* Type of the lookup table function. Default: 0 */ - CIMPP::Simple_Float output; /* Output value (y) for the lookup table function. Default: nullptr */ - CIMPP::Integer sequence; /* Sequence numbers of the pairs of the input (x) and the output (y) of the lookup table function. Default: 0 */ - CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* The wind dynamics lookup table associated with this frequency and active power wind plant model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindDynamicsLookupTable(); - virtual ~WindDynamicsLookupTable(); - + ~WindDynamicsLookupTable() override; + + CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* The wind dynamics lookup table associated with this current control limitation model. Default: 0 */ + CIMPP::WindContPType3IEC* WindContPType3IEC; /* The wind dynamics lookup table associated with this P control type 3 model. Default: 0 */ + CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* The rotor resistance control model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* The wind dynamics lookup table associated with this frequency and active power wind plant model. Default: 0 */ + CIMPP::Simple_Float input; /* Input value (x) for the lookup table function. Default: nullptr */ + CIMPP::WindLookupTableFunctionKind lookupTableFunctionType; /* Type of the lookup table function. Default: 0 */ + CIMPP::Simple_Float output; /* Output value (y) for the lookup table function. Default: nullptr */ + CIMPP::Integer sequence; /* Sequence numbers of the pairs of the input (x) and the output (y) of the lookup table function. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindDynamicsLookupTable_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.cpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.cpp index 90be7036b..42758de0c 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.cpp @@ -1,49 +1,56 @@ -#include -#include "WindTurbineType1or2IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType1IEC.hpp" +#include +#include + #include "WindAeroConstIEC.hpp" using namespace CIMPP; -WindGenTurbineType1IEC::WindGenTurbineType1IEC(): WindAeroConstIEC(nullptr) {}; - +WindGenTurbineType1IEC::WindGenTurbineType1IEC() : WindAeroConstIEC(nullptr) {}; WindGenTurbineType1IEC::~WindGenTurbineType1IEC() {}; -bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType1IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindAeroConstIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindAeroConstIEC != nullptr) - return assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* WindGenTurbineType1IEC_factory() { - return new WindGenTurbineType1IEC; +bool assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType1IEC_WindAeroConstIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType1IEC* element = dynamic_cast(BaseClass_ptr1); + WindAeroConstIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindAeroConstIEC != element2) + { + element->WindAeroConstIEC = element2; + return assign_WindAeroConstIEC_WindGenTurbineType1IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindGenTurbineType1IEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC"), &WindGenTurbineType1IEC_factory)); +const char WindGenTurbineType1IEC::debugName[] = "WindGenTurbineType1IEC"; +const char* WindGenTurbineType1IEC::debugString() const +{ + return WindGenTurbineType1IEC::debugName; } -void WindGenTurbineType1IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindGenTurbineType1IEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC"), &WindGenTurbineType1IEC_factory)); +} -void WindGenTurbineType1IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC.WindAeroConstIEC"), &assign_WindGenTurbineType1IEC_WindAeroConstIEC)); +void WindGenTurbineType1IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindGenTurbineType1IEC::debugName[] = "WindGenTurbineType1IEC"; -const char* WindGenTurbineType1IEC::debugString() +void WindGenTurbineType1IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType1IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType1IEC.WindAeroConstIEC"), &assign_WindGenTurbineType1IEC_WindAeroConstIEC)); } const BaseClassDefiner WindGenTurbineType1IEC::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner WindGenTurbineType1IEC::declare() return BaseClassDefiner(WindGenTurbineType1IEC::addConstructToMap, WindGenTurbineType1IEC::addPrimitiveAssignFnsToMap, WindGenTurbineType1IEC::addClassAssignFnsToMap, WindGenTurbineType1IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType1IEC_factory() + { + return new WindGenTurbineType1IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.hpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.hpp index b1460e321..e25b25c4e 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType1IEC.hpp @@ -1,38 +1,39 @@ #ifndef WindGenTurbineType1IEC_H #define WindGenTurbineType1IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType1or2IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindAeroConstIEC; -class WindAeroConstIEC; /* Wind turbine IEC Type 1. Reference: IEC Standard 61400-27-1, section 6.5.2. */ - class WindGenTurbineType1IEC: public WindTurbineType1or2IEC + class WindGenTurbineType1IEC : public WindTurbineType1or2IEC { - public: - CIMPP::WindAeroConstIEC* WindAeroConstIEC; /* Wind aerodynamic model associated with this wind turbine type 1 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType1IEC(); - virtual ~WindGenTurbineType1IEC(); - + ~WindGenTurbineType1IEC() override; + + CIMPP::WindAeroConstIEC* WindAeroConstIEC; /* Wind aerodynamic model associated with this wind turbine type 1 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType1IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.cpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.cpp index 4bdcadf22..a0472c038 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindTurbineType1or2IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType2IEC.hpp" +#include +#include + #include "WindContRotorRIEC.hpp" #include "WindPitchContEmulIEC.hpp" using namespace CIMPP; -WindGenTurbineType2IEC::WindGenTurbineType2IEC(): WindContRotorRIEC(nullptr), WindPitchContEmulIEC(nullptr) {}; - +WindGenTurbineType2IEC::WindGenTurbineType2IEC() : WindContRotorRIEC(nullptr), WindPitchContEmulIEC(nullptr) {}; WindGenTurbineType2IEC::~WindGenTurbineType2IEC() {}; + + + bool assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContRotorRIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContRotorRIEC != nullptr) - return assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindGenTurbineType2IEC_WindContRotorRIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1); + WindContRotorRIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContRotorRIEC != element2) + { + element->WindContRotorRIEC = element2; + return assign_WindContRotorRIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPitchContEmulIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPitchContEmulIEC != nullptr) - return assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType2IEC* element = dynamic_cast(BaseClass_ptr1); + WindPitchContEmulIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPitchContEmulIEC != element2) + { + element->WindPitchContEmulIEC = element2; + return assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindGenTurbineType2IEC_factory() { - return new WindGenTurbineType2IEC; - } +const char WindGenTurbineType2IEC::debugName[] = "WindGenTurbineType2IEC"; +const char* WindGenTurbineType2IEC::debugString() const +{ + return WindGenTurbineType2IEC::debugName; } -void WindGenTurbineType2IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType2IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC"), &WindGenTurbineType2IEC_factory)); } -void WindGenTurbineType2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindGenTurbineType2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindContRotorRIEC"), &assign_WindGenTurbineType2IEC_WindContRotorRIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindPitchContEmulIEC"), &assign_WindGenTurbineType2IEC_WindPitchContEmulIEC)); +void WindGenTurbineType2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindGenTurbineType2IEC::debugName[] = "WindGenTurbineType2IEC"; -const char* WindGenTurbineType2IEC::debugString() +void WindGenTurbineType2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType2IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindContRotorRIEC"), &assign_WindGenTurbineType2IEC_WindContRotorRIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType2IEC.WindPitchContEmulIEC"), &assign_WindGenTurbineType2IEC_WindPitchContEmulIEC)); } const BaseClassDefiner WindGenTurbineType2IEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindGenTurbineType2IEC::declare() return BaseClassDefiner(WindGenTurbineType2IEC::addConstructToMap, WindGenTurbineType2IEC::addPrimitiveAssignFnsToMap, WindGenTurbineType2IEC::addClassAssignFnsToMap, WindGenTurbineType2IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType2IEC_factory() + { + return new WindGenTurbineType2IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.hpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.hpp index 89485480a..92b0a595b 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType2IEC.hpp @@ -1,40 +1,41 @@ #ifndef WindGenTurbineType2IEC_H #define WindGenTurbineType2IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType1or2IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContRotorRIEC; + class WindPitchContEmulIEC; -class WindContRotorRIEC; -class WindPitchContEmulIEC; /* Wind turbine IEC Type 2. Reference: IEC Standard 61400-27-1, section 6.5.3. */ - class WindGenTurbineType2IEC: public WindTurbineType1or2IEC + class WindGenTurbineType2IEC : public WindTurbineType1or2IEC { - public: - CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* Wind control rotor resistance model associated with wind turbine type 2 model. Default: 0 */ - CIMPP::WindPitchContEmulIEC* WindPitchContEmulIEC; /* Pitch control emulator model associated with this wind turbine type 2 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType2IEC(); - virtual ~WindGenTurbineType2IEC(); - + ~WindGenTurbineType2IEC() override; + + CIMPP::WindContRotorRIEC* WindContRotorRIEC; /* Wind control rotor resistance model associated with wind turbine type 2 model. Default: 0 */ + CIMPP::WindPitchContEmulIEC* WindPitchContEmulIEC; /* Pitch control emulator model associated with this wind turbine type 2 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType2IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.cpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.cpp index bf8cee136..7395215bf 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.cpp @@ -1,118 +1,148 @@ -#include -#include "WindTurbineType3or4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType3IEC.hpp" +#include +#include + #include "WindAeroLinearIEC.hpp" -#include "WindContPitchAngleIEC.hpp" #include "WindContPType3IEC.hpp" +#include "WindContPitchAngleIEC.hpp" +#include "WindMechIEC.hpp" #include "PU.hpp" #include "PU.hpp" -#include "WindMechIEC.hpp" using namespace CIMPP; -WindGenTurbineType3IEC::WindGenTurbineType3IEC(): WindAeroLinearIEC(nullptr), WindContPitchAngleIEC(nullptr), WindContPType3IEC(nullptr), WindMechIEC(nullptr) {}; - +WindGenTurbineType3IEC::WindGenTurbineType3IEC() : WindAeroLinearIEC(nullptr), WindContPType3IEC(nullptr), WindContPitchAngleIEC(nullptr), WindMechIEC(nullptr) {}; WindGenTurbineType3IEC::~WindGenTurbineType3IEC() {}; -bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindAeroLinearIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindAeroLinearIEC != nullptr) - return assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPitchAngleIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPitchAngleIEC != nullptr) - return assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType3IEC != nullptr) - return assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); -bool assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindMechIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindMechIEC != nullptr) - return assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindGenTurbineType3IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dipmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindGenTurbineType3IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->diqmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindAeroLinearIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindAeroLinearIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindAeroLinearIEC != element2) + { + element->WindAeroLinearIEC = element2; + return assign_WindAeroLinearIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindContPType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindContPType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType3IEC != element2) + { + element->WindContPType3IEC = element2; + return assign_WindContPType3IEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_WindGenTurbineType3IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dipmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindContPitchAngleIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindContPitchAngleIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPitchAngleIEC != element2) + { + element->WindContPitchAngleIEC = element2; + return assign_WindContPitchAngleIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindGenTurbineType3IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->diqmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass*, BaseClass*); +bool assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindGenTurbineType3IEC* element = dynamic_cast(BaseClass_ptr1); + WindMechIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindMechIEC != element2) + { + element->WindMechIEC = element2; + return assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindGenTurbineType3IEC_factory() { - return new WindGenTurbineType3IEC; - } + +const char WindGenTurbineType3IEC::debugName[] = "WindGenTurbineType3IEC"; +const char* WindGenTurbineType3IEC::debugString() const +{ + return WindGenTurbineType3IEC::debugName; } -void WindGenTurbineType3IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType3IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC"), &WindGenTurbineType3IEC_factory)); } -void WindGenTurbineType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.dipmax"), &assign_WindGenTurbineType3IEC_dipmax)); +void WindGenTurbineType3IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.dipmax"), &assign_WindGenTurbineType3IEC_dipmax)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.diqmax"), &assign_WindGenTurbineType3IEC_diqmax)); - } - -void WindGenTurbineType3IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindAeroLinearIEC"), &assign_WindGenTurbineType3IEC_WindAeroLinearIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPitchAngleIEC"), &assign_WindGenTurbineType3IEC_WindContPitchAngleIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPType3IEC"), &assign_WindGenTurbineType3IEC_WindContPType3IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindMechIEC"), &assign_WindGenTurbineType3IEC_WindMechIEC)); } -const char WindGenTurbineType3IEC::debugName[] = "WindGenTurbineType3IEC"; -const char* WindGenTurbineType3IEC::debugString() +void WindGenTurbineType3IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType3IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindAeroLinearIEC"), &assign_WindGenTurbineType3IEC_WindAeroLinearIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPType3IEC"), &assign_WindGenTurbineType3IEC_WindContPType3IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindContPitchAngleIEC"), &assign_WindGenTurbineType3IEC_WindContPitchAngleIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3IEC.WindMechIEC"), &assign_WindGenTurbineType3IEC_WindMechIEC)); } const BaseClassDefiner WindGenTurbineType3IEC::declare() @@ -120,4 +150,10 @@ const BaseClassDefiner WindGenTurbineType3IEC::declare() return BaseClassDefiner(WindGenTurbineType3IEC::addConstructToMap, WindGenTurbineType3IEC::addPrimitiveAssignFnsToMap, WindGenTurbineType3IEC::addClassAssignFnsToMap, WindGenTurbineType3IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType3IEC_factory() + { + return new WindGenTurbineType3IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.hpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.hpp index 222fca906..4060364f3 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3IEC.hpp @@ -1,47 +1,48 @@ #ifndef WindGenTurbineType3IEC_H #define WindGenTurbineType3IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType3or4IEC.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindAeroLinearIEC; + class WindContPType3IEC; + class WindContPitchAngleIEC; + class WindMechIEC; - -class WindAeroLinearIEC; -class WindContPitchAngleIEC; -class WindContPType3IEC; -class WindMechIEC; /* Generator model for wind turbines of IEC type 3A and 3B. */ - class WindGenTurbineType3IEC: public WindTurbineType3or4IEC + class WindGenTurbineType3IEC : public WindTurbineType3or4IEC { - public: - CIMPP::WindAeroLinearIEC* WindAeroLinearIEC; /* Wind aerodynamic model associated with this wind generator type 3 model. Default: 0 */ - CIMPP::WindContPitchAngleIEC* WindContPitchAngleIEC; /* Wind control pitch angle model associated with this wind turbine type 3. Default: 0 */ - CIMPP::WindContPType3IEC* WindContPType3IEC; /* Wind control P type 3 model associated with this wind turbine type 3 model. Default: 0 */ - CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 3 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType3IEC(); - virtual ~WindGenTurbineType3IEC(); - + ~WindGenTurbineType3IEC() override; + + CIMPP::WindAeroLinearIEC* WindAeroLinearIEC; /* Wind aerodynamic model associated with this wind generator type 3 model. Default: 0 */ + CIMPP::WindContPType3IEC* WindContPType3IEC; /* Wind control P type 3 model associated with this wind turbine type 3 model. Default: 0 */ + CIMPP::WindContPitchAngleIEC* WindContPitchAngleIEC; /* Wind control pitch angle model associated with this wind turbine type 3. Default: 0 */ + CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 3 model. Default: 0 */ + CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ + CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType3IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.cpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.cpp index 08ea8a858..a665f7def 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.cpp @@ -1,81 +1,84 @@ -#include -#include "WindGenTurbineType3IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType3aIEC.hpp" +#include +#include + #include "Simple_Float.hpp" -#include "PU.hpp" #include "Seconds.hpp" +#include "PU.hpp" using namespace CIMPP; WindGenTurbineType3aIEC::WindGenTurbineType3aIEC() {}; - WindGenTurbineType3aIEC::~WindGenTurbineType3aIEC() {}; +bool assign_WindGenTurbineType3aIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpc; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3aIEC_tic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tic; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3aIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGenTurbineType3aIEC_kpc(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpc; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3aIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3aIEC_tic(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3aIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tic; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGenTurbineType3aIEC_factory() { - return new WindGenTurbineType3aIEC; - } +const char WindGenTurbineType3aIEC::debugName[] = "WindGenTurbineType3aIEC"; +const char* WindGenTurbineType3aIEC::debugString() const +{ + return WindGenTurbineType3aIEC::debugName; } -void WindGenTurbineType3aIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType3aIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC"), &WindGenTurbineType3aIEC_factory)); } -void WindGenTurbineType3aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGenTurbineType3aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.kpc"), &assign_WindGenTurbineType3aIEC_kpc)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.xs"), &assign_WindGenTurbineType3aIEC_xs)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.tic"), &assign_WindGenTurbineType3aIEC_tic)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3aIEC.xs"), &assign_WindGenTurbineType3aIEC_xs)); } -void WindGenTurbineType3aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGenTurbineType3aIEC::debugName[] = "WindGenTurbineType3aIEC"; -const char* WindGenTurbineType3aIEC::debugString() +void WindGenTurbineType3aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType3aIEC::debugName; } const BaseClassDefiner WindGenTurbineType3aIEC::declare() @@ -83,4 +86,10 @@ const BaseClassDefiner WindGenTurbineType3aIEC::declare() return BaseClassDefiner(WindGenTurbineType3aIEC::addConstructToMap, WindGenTurbineType3aIEC::addPrimitiveAssignFnsToMap, WindGenTurbineType3aIEC::addClassAssignFnsToMap, WindGenTurbineType3aIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType3aIEC_factory() + { + return new WindGenTurbineType3aIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.hpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.hpp index d48b002c6..d803c1dd5 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3aIEC.hpp @@ -1,42 +1,43 @@ #ifndef WindGenTurbineType3aIEC_H #define WindGenTurbineType3aIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenTurbineType3IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "WindGenTurbineType3IEC.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEC Type 3A generator set model. Reference: IEC Standard 61400-27-1 Section 6.6.3.2. */ - class WindGenTurbineType3aIEC: public WindGenTurbineType3IEC + class WindGenTurbineType3aIEC : public WindGenTurbineType3IEC { - public: - CIMPP::Simple_Float kpc; /* Current PI controller proportional gain (K). It is type dependent parameter. Default: nullptr */ - CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tic; /* Current PI controller integration time constant (T). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType3aIEC(); - virtual ~WindGenTurbineType3aIEC(); - + ~WindGenTurbineType3aIEC() override; + + CIMPP::Simple_Float kpc; /* Current PI controller proportional gain (K). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tic; /* Current PI controller integration time constant (T). It is type dependent parameter. Default: nullptr */ + CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType3aIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.cpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.cpp index 9421974c8..6bc10880c 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.cpp @@ -1,111 +1,116 @@ -#include -#include "WindGenTurbineType3IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenTurbineType3bIEC.hpp" +#include +#include + #include "Simple_Float.hpp" +#include "Boolean.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "Boolean.hpp" #include "PU.hpp" using namespace CIMPP; WindGenTurbineType3bIEC::WindGenTurbineType3bIEC() {}; - WindGenTurbineType3bIEC::~WindGenTurbineType3bIEC() {}; +bool assign_WindGenTurbineType3bIEC_fducw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fducw; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_mwtcwp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwtcwp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_two(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->two; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType3bIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xs; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGenTurbineType3bIEC_fducw(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fducw; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_two(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->two; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_mwtcwp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwtcwp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenTurbineType3bIEC_xs(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenTurbineType3bIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xs; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGenTurbineType3bIEC_factory() { - return new WindGenTurbineType3bIEC; - } +const char WindGenTurbineType3bIEC::debugName[] = "WindGenTurbineType3bIEC"; +const char* WindGenTurbineType3bIEC::debugString() const +{ + return WindGenTurbineType3bIEC::debugName; } -void WindGenTurbineType3bIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenTurbineType3bIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC"), &WindGenTurbineType3bIEC_factory)); } -void WindGenTurbineType3bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGenTurbineType3bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.fducw"), &assign_WindGenTurbineType3bIEC_fducw)); + assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.mwtcwp"), &assign_WindGenTurbineType3bIEC_mwtcwp)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.tg"), &assign_WindGenTurbineType3bIEC_tg)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.two"), &assign_WindGenTurbineType3bIEC_two)); - assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.mwtcwp"), &assign_WindGenTurbineType3bIEC_mwtcwp)); assign_map.insert(std::make_pair(std::string("cim:WindGenTurbineType3bIEC.xs"), &assign_WindGenTurbineType3bIEC_xs)); } -void WindGenTurbineType3bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGenTurbineType3bIEC::debugName[] = "WindGenTurbineType3bIEC"; -const char* WindGenTurbineType3bIEC::debugString() +void WindGenTurbineType3bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenTurbineType3bIEC::debugName; } const BaseClassDefiner WindGenTurbineType3bIEC::declare() @@ -113,4 +118,10 @@ const BaseClassDefiner WindGenTurbineType3bIEC::declare() return BaseClassDefiner(WindGenTurbineType3bIEC::addConstructToMap, WindGenTurbineType3bIEC::addPrimitiveAssignFnsToMap, WindGenTurbineType3bIEC::addClassAssignFnsToMap, WindGenTurbineType3bIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenTurbineType3bIEC_factory() + { + return new WindGenTurbineType3bIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.hpp b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.hpp index cf278976c..49e1153e3 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenTurbineType3bIEC.hpp @@ -1,45 +1,46 @@ #ifndef WindGenTurbineType3bIEC_H #define WindGenTurbineType3bIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenTurbineType3IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" -#include "Seconds.hpp" +#include "WindGenTurbineType3IEC.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" #include "PU.hpp" +#include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEC Type 3B generator set model. Reference: IEC Standard 61400-27-1 Section 6.6.3.3. */ - class WindGenTurbineType3bIEC: public WindGenTurbineType3IEC + class WindGenTurbineType3bIEC : public WindGenTurbineType3IEC { - public: - CIMPP::Simple_Float fducw; /* Crowbar duration versus voltage variation look-up table (f()). It is case dependent parameter. Default: nullptr */ - CIMPP::Seconds tg; /* Current generation Time constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds two; /* Time constant for crowbar washout filter (). It is case dependent parameter. Default: nullptr */ - CIMPP::Boolean mwtcwp; /* Crowbar control mode (). The parameter is case dependent parameter. Default: false */ - CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenTurbineType3bIEC(); - virtual ~WindGenTurbineType3bIEC(); - + ~WindGenTurbineType3bIEC() override; + + CIMPP::Simple_Float fducw; /* Crowbar duration versus voltage variation look-up table (f()). It is case dependent parameter. Default: nullptr */ + CIMPP::Boolean mwtcwp; /* Crowbar control mode (). The parameter is case dependent parameter. Default: false */ + CIMPP::Seconds tg; /* Current generation Time constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds two; /* Time constant for crowbar washout filter (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU xs; /* Electromagnetic transient reactance (x). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenTurbineType3bIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenType4IEC.cpp b/CGMES_2.4.15_27JAN2020/WindGenType4IEC.cpp index caa28226c..1553cc490 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenType4IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenType4IEC.cpp @@ -1,7 +1,11 @@ -#include -#include "WindTurbineType3or4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenType4IEC.hpp" +#include +#include + #include "PU.hpp" #include "PU.hpp" #include "PU.hpp" @@ -10,87 +14,87 @@ using namespace CIMPP; WindGenType4IEC::WindGenType4IEC() {}; - WindGenType4IEC::~WindGenType4IEC() {}; +bool assign_WindGenType4IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dipmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenType4IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->diqmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenType4IEC_diqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->diqmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenType4IEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tg; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGenType4IEC_dipmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dipmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenType4IEC_diqmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->diqmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenType4IEC_diqmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->diqmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindGenType4IEC_tg(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGenType4IEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tg; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGenType4IEC_factory() { - return new WindGenType4IEC; - } +const char WindGenType4IEC::debugName[] = "WindGenType4IEC"; +const char* WindGenType4IEC::debugString() const +{ + return WindGenType4IEC::debugName; } -void WindGenType4IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindGenType4IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGenType4IEC"), &WindGenType4IEC_factory)); } -void WindGenType4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGenType4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.dipmax"), &assign_WindGenType4IEC_dipmax)); - assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.diqmin"), &assign_WindGenType4IEC_diqmin)); assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.diqmax"), &assign_WindGenType4IEC_diqmax)); + assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.diqmin"), &assign_WindGenType4IEC_diqmin)); assign_map.insert(std::make_pair(std::string("cim:WindGenType4IEC.tg"), &assign_WindGenType4IEC_tg)); } -void WindGenType4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGenType4IEC::debugName[] = "WindGenType4IEC"; -const char* WindGenType4IEC::debugString() +void WindGenType4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGenType4IEC::debugName; } const BaseClassDefiner WindGenType4IEC::declare() @@ -98,4 +102,10 @@ const BaseClassDefiner WindGenType4IEC::declare() return BaseClassDefiner(WindGenType4IEC::addConstructToMap, WindGenType4IEC::addPrimitiveAssignFnsToMap, WindGenType4IEC::addClassAssignFnsToMap, WindGenType4IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindGenType4IEC_factory() + { + return new WindGenType4IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenType4IEC.hpp b/CGMES_2.4.15_27JAN2020/WindGenType4IEC.hpp index 8c926e691..b969138e3 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenType4IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenType4IEC.hpp @@ -1,42 +1,43 @@ #ifndef WindGenType4IEC_H #define WindGenType4IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType3or4IEC.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* IEC Type 4 generator set model. Reference: IEC Standard 61400-27-1 Section 6.6.3.4. */ - class WindGenType4IEC: public WindTurbineType3or4IEC + class WindGenType4IEC : public WindTurbineType3or4IEC { - public: - CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::PU diqmin; /* Minimum reactive current ramp rate (d). It is case dependent parameter. Default: nullptr */ - CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tg; /* Time constant (T). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGenType4IEC(); - virtual ~WindGenType4IEC(); - + ~WindGenType4IEC() override; + + CIMPP::PU dipmax; /* Maximum active current ramp rate (di). It is project dependent parameter. Default: nullptr */ + CIMPP::PU diqmax; /* Maximum reactive current ramp rate (di). It is project dependent parameter. Default: nullptr */ + CIMPP::PU diqmin; /* Minimum reactive current ramp rate (d). It is case dependent parameter. Default: nullptr */ + CIMPP::Seconds tg; /* Time constant (T). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGenType4IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindGenUnitKind.cpp b/CGMES_2.4.15_27JAN2020/WindGenUnitKind.cpp index 097470d2e..f92814598 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenUnitKind.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGenUnitKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGenUnitKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindGenUnitKind& rop) +WindGenUnitKind& WindGenUnitKind::operator=(WindGenUnitKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindGenUnitKind::operator WindGenUnitKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindGenUnitKind::debugName[] = "WindGenUnitKind"; +const char* WindGenUnitKind::debugString() const +{ + return WindGenUnitKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindGenUnitKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -33,5 +64,27 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindGenUnitKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindGenUnitKind::offshore) + { + EnumSymbol = "offshore"; + } + if (obj.value == WindGenUnitKind::onshore) + { + EnumSymbol = "onshore"; + } + + if (!EnumSymbol.empty()) + { + os << "WindGenUnitKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGenUnitKind.hpp b/CGMES_2.4.15_27JAN2020/WindGenUnitKind.hpp index a05e1b754..4aa57c46c 100644 --- a/CGMES_2.4.15_27JAN2020/WindGenUnitKind.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGenUnitKind.hpp @@ -1,21 +1,46 @@ #ifndef WindGenUnitKind_H #define WindGenUnitKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Kind of wind generating unit. */ - enum class WindGenUnitKind + class WindGenUnitKind { - /** - * The wind generating unit is located offshore. - */ - offshore, - /** - * The wind generating unit is located onshore. - */ - onshore, + public: + enum WindGenUnitKind_ENUM + { + /** + * The wind generating unit is located offshore. + */ + offshore, + /** + * The wind generating unit is located onshore. + */ + onshore, + }; + + WindGenUnitKind() : value(), initialized(false) {} + WindGenUnitKind(WindGenUnitKind_ENUM value) : value(value), initialized(true) {} + + WindGenUnitKind& operator=(WindGenUnitKind_ENUM rop); + operator WindGenUnitKind_ENUM() const; + + WindGenUnitKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindGenUnitKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindGenUnitKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindGenUnitKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.cpp b/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.cpp index c3728f0bf..b07a7b82d 100644 --- a/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.cpp +++ b/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.cpp @@ -1,51 +1,52 @@ -#include -#include "GeneratingUnit.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindGeneratingUnit.hpp" +#include +#include + #include "WindGenUnitKind.hpp" using namespace CIMPP; WindGeneratingUnit::WindGeneratingUnit() {}; - WindGeneratingUnit::~WindGeneratingUnit() {}; +bool assign_WindGeneratingUnit_windGenUnitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->windGenUnitType; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindGeneratingUnit_windGenUnitType(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindGeneratingUnit* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->windGenUnitType; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindGeneratingUnit_factory() { - return new WindGeneratingUnit; - } +const char WindGeneratingUnit::debugName[] = "WindGeneratingUnit"; +const char* WindGeneratingUnit::debugString() const +{ + return WindGeneratingUnit::debugName; } -void WindGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) { +void WindGeneratingUnit::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindGeneratingUnit"), &WindGeneratingUnit_factory)); } -void WindGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindGeneratingUnit::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindGeneratingUnit.windGenUnitType"), &assign_WindGeneratingUnit_windGenUnitType)); } -void WindGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - } - -const char WindGeneratingUnit::debugName[] = "WindGeneratingUnit"; -const char* WindGeneratingUnit::debugString() +void WindGeneratingUnit::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindGeneratingUnit::debugName; } const BaseClassDefiner WindGeneratingUnit::declare() @@ -53,4 +54,10 @@ const BaseClassDefiner WindGeneratingUnit::declare() return BaseClassDefiner(WindGeneratingUnit::addConstructToMap, WindGeneratingUnit::addPrimitiveAssignFnsToMap, WindGeneratingUnit::addClassAssignFnsToMap, WindGeneratingUnit::debugName); } - +namespace CIMPP +{ + BaseClass* WindGeneratingUnit_factory() + { + return new WindGeneratingUnit; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.hpp b/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.hpp index caa29762f..9ab3810cd 100644 --- a/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.hpp +++ b/CGMES_2.4.15_27JAN2020/WindGeneratingUnit.hpp @@ -1,38 +1,39 @@ #ifndef WindGeneratingUnit_H #define WindGeneratingUnit_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "GeneratingUnit.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "GeneratingUnit.hpp" +#include "BaseClassDefiner.hpp" #include "WindGenUnitKind.hpp" -namespace CIMPP { - +namespace CIMPP +{ /* A wind driven generating unit. May be used to represent a single turbine or an aggregation. */ - class WindGeneratingUnit: public GeneratingUnit + class WindGeneratingUnit : public GeneratingUnit { - public: - CIMPP::WindGenUnitKind windGenUnitType; /* The kind of wind generating unit Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindGeneratingUnit(); - virtual ~WindGeneratingUnit(); - + ~WindGeneratingUnit() override; + + CIMPP::WindGenUnitKind windGenUnitType; /* The kind of wind generating unit Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindGeneratingUnit_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.cpp b/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.cpp index eb9d181ef..1cd506474 100644 --- a/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.cpp +++ b/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindLVRTQcontrolModesKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindLVRTQcontrolModesKind& rop) +WindLVRTQcontrolModesKind& WindLVRTQcontrolModesKind::operator=(WindLVRTQcontrolModesKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindLVRTQcontrolModesKind::operator WindLVRTQcontrolModesKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindLVRTQcontrolModesKind::debugName[] = "WindLVRTQcontrolModesKind"; +const char* WindLVRTQcontrolModesKind::debugString() const +{ + return WindLVRTQcontrolModesKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindLVRTQcontrolModesKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -38,5 +69,31 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindLVRTQcontrolModesKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindLVRTQcontrolModesKind::mode1) + { + EnumSymbol = "mode1"; + } + if (obj.value == WindLVRTQcontrolModesKind::mode2) + { + EnumSymbol = "mode2"; + } + if (obj.value == WindLVRTQcontrolModesKind::mode3) + { + EnumSymbol = "mode3"; + } + + if (!EnumSymbol.empty()) + { + os << "WindLVRTQcontrolModesKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.hpp b/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.hpp index 59fb40515..7b731082a 100644 --- a/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.hpp +++ b/CGMES_2.4.15_27JAN2020/WindLVRTQcontrolModesKind.hpp @@ -1,25 +1,50 @@ #ifndef WindLVRTQcontrolModesKind_H #define WindLVRTQcontrolModesKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* LVRT Q control modes . */ - enum class WindLVRTQcontrolModesKind + class WindLVRTQcontrolModesKind { - /** - * Voltage dependent reactive current injection (). - */ - mode1, - /** - * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection (). - */ - mode2, - /** - * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection during fault, and as the pre-fault value plus an additional constant reactive current injection post fault (). - */ - mode3, + public: + enum WindLVRTQcontrolModesKind_ENUM + { + /** + * Voltage dependent reactive current injection (). + */ + mode1, + /** + * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection (). + */ + mode2, + /** + * Reactive current injection controlled as the pre-fault value plus an additional voltage dependent reactive current injection during fault, and as the pre-fault value plus an additional constant reactive current injection post fault (). + */ + mode3, + }; + + WindLVRTQcontrolModesKind() : value(), initialized(false) {} + WindLVRTQcontrolModesKind(WindLVRTQcontrolModesKind_ENUM value) : value(value), initialized(true) {} + + WindLVRTQcontrolModesKind& operator=(WindLVRTQcontrolModesKind_ENUM rop); + operator WindLVRTQcontrolModesKind_ENUM() const; + + WindLVRTQcontrolModesKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindLVRTQcontrolModesKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindLVRTQcontrolModesKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindLVRTQcontrolModesKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.cpp b/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.cpp index 3ccd6b9ee..e6d94391f 100644 --- a/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.cpp +++ b/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindLookupTableFunctionKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindLookupTableFunctionKind& rop) +WindLookupTableFunctionKind& WindLookupTableFunctionKind::operator=(WindLookupTableFunctionKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindLookupTableFunctionKind::operator WindLookupTableFunctionKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindLookupTableFunctionKind::debugName[] = "WindLookupTableFunctionKind"; +const char* WindLookupTableFunctionKind::debugString() const +{ + return WindLookupTableFunctionKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindLookupTableFunctionKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -48,5 +79,39 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindLookupTableFunctionKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindLookupTableFunctionKind::fpslip) + { + EnumSymbol = "fpslip"; + } + if (obj.value == WindLookupTableFunctionKind::fpomega) + { + EnumSymbol = "fpomega"; + } + if (obj.value == WindLookupTableFunctionKind::ipvdl) + { + EnumSymbol = "ipvdl"; + } + if (obj.value == WindLookupTableFunctionKind::iqvdl) + { + EnumSymbol = "iqvdl"; + } + if (obj.value == WindLookupTableFunctionKind::fdpf) + { + EnumSymbol = "fdpf"; + } + + if (!EnumSymbol.empty()) + { + os << "WindLookupTableFunctionKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.hpp b/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.hpp index 415886431..98f42e4fa 100644 --- a/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.hpp +++ b/CGMES_2.4.15_27JAN2020/WindLookupTableFunctionKind.hpp @@ -1,33 +1,58 @@ #ifndef WindLookupTableFunctionKind_H #define WindLookupTableFunctionKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Function of the lookup table. */ - enum class WindLookupTableFunctionKind + class WindLookupTableFunctionKind { - /** - * Power versus slip lookup table (f()). It is used for rotor resistance control model, IEC 61400-27-1, section 6.6.5.2. - */ - fpslip, - /** - * Power vs. speed lookup table (f()). It is used for P control model type 3, IEC 61400-27-1, section 6.6.5.3. - */ - fpomega, - /** - * Lookup table for voltage dependency of active current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. - */ - ipvdl, - /** - * Lookup table for voltage dependency of reactive current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. - */ - iqvdl, - /** - * Power vs. frequency lookup table (()). It is used for wind power plant frequency and active power control model, IEC 61400-27-1, Annex E. - */ - fdpf, + public: + enum WindLookupTableFunctionKind_ENUM + { + /** + * Power versus slip lookup table (f()). It is used for rotor resistance control model, IEC 61400-27-1, section 6.6.5.2. + */ + fpslip, + /** + * Power vs. speed lookup table (f()). It is used for P control model type 3, IEC 61400-27-1, section 6.6.5.3. + */ + fpomega, + /** + * Lookup table for voltage dependency of active current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. + */ + ipvdl, + /** + * Lookup table for voltage dependency of reactive current limits (i()). It is used for current limitation model, IEC 61400-27-1, section 6.6.5.7. + */ + iqvdl, + /** + * Power vs. frequency lookup table (()). It is used for wind power plant frequency and active power control model, IEC 61400-27-1, Annex E. + */ + fdpf, + }; + + WindLookupTableFunctionKind() : value(), initialized(false) {} + WindLookupTableFunctionKind(WindLookupTableFunctionKind_ENUM value) : value(value), initialized(true) {} + + WindLookupTableFunctionKind& operator=(WindLookupTableFunctionKind_ENUM rop); + operator WindLookupTableFunctionKind_ENUM() const; + + WindLookupTableFunctionKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindLookupTableFunctionKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindLookupTableFunctionKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindLookupTableFunctionKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/WindMechIEC.cpp b/CGMES_2.4.15_27JAN2020/WindMechIEC.cpp index 8340c48f5..baaf7aa19 100644 --- a/CGMES_2.4.15_27JAN2020/WindMechIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindMechIEC.cpp @@ -1,132 +1,160 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindMechIEC.hpp" +#include +#include + #include "WindGenTurbineType3IEC.hpp" +#include "WindTurbineType1or2IEC.hpp" +#include "WindTurbineType4bIEC.hpp" #include "PU.hpp" #include "Seconds.hpp" #include "Seconds.hpp" #include "PU.hpp" -#include "WindTurbineType4bIEC.hpp" -#include "WindTurbineType1or2IEC.hpp" using namespace CIMPP; -WindMechIEC::WindMechIEC(): WindGenTurbineType3IEC(nullptr), WindTurbineType4bIEC(nullptr), WindTurbineType1or2IEC(nullptr) {}; - +WindMechIEC::WindMechIEC() : WindGenTurbineType3IEC(nullptr), WindTurbineType1or2IEC(nullptr), WindTurbineType4bIEC(nullptr) {}; WindMechIEC::~WindMechIEC() {}; -bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType3IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType3IEC != nullptr) - return true; - } - return false; -} - +bool assign_WindMechIEC_cdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->cdrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindMechIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType4bIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType4bIEC != nullptr) - return true; - } - return false; +bool assign_WindMechIEC_hgen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hgen; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2IEC != nullptr) - return true; - } - return false; +bool assign_WindMechIEC_hwtr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->hwtr; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindMechIEC_kdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdrt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindMechIEC_cdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->cdrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass*, BaseClass*); +bool assign_WindMechIEC_WindGenTurbineType3IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindMechIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType3IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType3IEC != element2) + { + element->WindGenTurbineType3IEC = element2; + return assign_WindGenTurbineType3IEC_WindMechIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindMechIEC_hgen(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hgen; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass*, BaseClass*); +bool assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindMechIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2IEC != element2) + { + element->WindTurbineType1or2IEC = element2; + return assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindMechIEC_hwtr(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->hwtr; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType4bIEC_WindMechIEC(BaseClass*, BaseClass*); +bool assign_WindMechIEC_WindTurbineType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindMechIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType4bIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType4bIEC != element2) + { + element->WindTurbineType4bIEC = element2; + return assign_WindTurbineType4bIEC_WindMechIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindMechIEC_kdrt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindMechIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdrt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -namespace CIMPP { - BaseClass* WindMechIEC_factory() { - return new WindMechIEC; - } + +const char WindMechIEC::debugName[] = "WindMechIEC"; +const char* WindMechIEC::debugString() const +{ + return WindMechIEC::debugName; } -void WindMechIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindMechIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindMechIEC"), &WindMechIEC_factory)); } -void WindMechIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.cdrt"), &assign_WindMechIEC_cdrt)); +void WindMechIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.cdrt"), &assign_WindMechIEC_cdrt)); assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.hgen"), &assign_WindMechIEC_hgen)); assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.hwtr"), &assign_WindMechIEC_hwtr)); assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.kdrt"), &assign_WindMechIEC_kdrt)); - } - -void WindMechIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindGenTurbineType3IEC"), &assign_WindMechIEC_WindGenTurbineType3IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType4bIEC"), &assign_WindMechIEC_WindTurbineType4bIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType1or2IEC"), &assign_WindMechIEC_WindTurbineType1or2IEC)); } -const char WindMechIEC::debugName[] = "WindMechIEC"; -const char* WindMechIEC::debugString() +void WindMechIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindMechIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindGenTurbineType3IEC"), &assign_WindMechIEC_WindGenTurbineType3IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType1or2IEC"), &assign_WindMechIEC_WindTurbineType1or2IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindMechIEC.WindTurbineType4bIEC"), &assign_WindMechIEC_WindTurbineType4bIEC)); } const BaseClassDefiner WindMechIEC::declare() @@ -134,4 +162,10 @@ const BaseClassDefiner WindMechIEC::declare() return BaseClassDefiner(WindMechIEC::addConstructToMap, WindMechIEC::addPrimitiveAssignFnsToMap, WindMechIEC::addClassAssignFnsToMap, WindMechIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindMechIEC_factory() + { + return new WindMechIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindMechIEC.hpp b/CGMES_2.4.15_27JAN2020/WindMechIEC.hpp index d64412485..ae94d37e0 100644 --- a/CGMES_2.4.15_27JAN2020/WindMechIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindMechIEC.hpp @@ -1,48 +1,49 @@ #ifndef WindMechIEC_H #define WindMechIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindGenTurbineType3IEC; + class WindTurbineType1or2IEC; + class WindTurbineType4bIEC; - -class WindGenTurbineType3IEC; -class WindTurbineType4bIEC; -class WindTurbineType1or2IEC; /* Two mass model. Reference: IEC Standard 61400-27-1 Section 6.6.2.1. */ - class WindMechIEC: public IdentifiedObject + class WindMechIEC : public IdentifiedObject { - public: - CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine Type 3 model with which this wind mechanical model is associated. Default: 0 */ - CIMPP::PU cdrt; /* Drive train damping (. It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds hgen; /* Inertia constant of generator (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds hwtr; /* Inertia constant of wind turbine rotor (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kdrt; /* Drive train stiffness (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind mechanical model is associated. Default: 0 */ - CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind mechanical model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindMechIEC(); - virtual ~WindMechIEC(); - + ~WindMechIEC() override; + + CIMPP::WindGenTurbineType3IEC* WindGenTurbineType3IEC; /* Wind turbine Type 3 model with which this wind mechanical model is associated. Default: 0 */ + CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind mechanical model is associated. Default: 0 */ + CIMPP::WindTurbineType4bIEC* WindTurbineType4bIEC; /* Wind turbine type 4B model with which this wind mechanical model is associated. Default: 0 */ + CIMPP::PU cdrt; /* Drive train damping (. It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds hgen; /* Inertia constant of generator (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds hwtr; /* Inertia constant of wind turbine rotor (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kdrt; /* Drive train stiffness (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindMechIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.cpp b/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.cpp index 333eb56b9..560b23032 100644 --- a/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPitchContEmulIEC.hpp" +#include +#include + #include "WindGenTurbineType2IEC.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -16,164 +20,183 @@ using namespace CIMPP; -WindPitchContEmulIEC::WindPitchContEmulIEC(): WindGenTurbineType2IEC(nullptr) {}; - +WindPitchContEmulIEC::WindPitchContEmulIEC() : WindGenTurbineType2IEC(nullptr) {}; WindPitchContEmulIEC::~WindPitchContEmulIEC() {}; -bool assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindGenTurbineType2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindGenTurbineType2IEC != nullptr) - return true; - } - return false; + +bool assign_WindPitchContEmulIEC_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kdroop; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindPitchContEmulIEC_kipce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kipce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_komegaaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->komegaaero; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_kppce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kppce; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_omegaref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->omegaref; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_pimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pimax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_pimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->pimin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPitchContEmulIEC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t1; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPitchContEmulIEC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->t2; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPitchContEmulIEC_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpe; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass*, BaseClass*); +bool assign_WindPitchContEmulIEC_WindGenTurbineType2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1); + WindGenTurbineType2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindGenTurbineType2IEC != element2) + { + element->WindGenTurbineType2IEC = element2; + return assign_WindGenTurbineType2IEC_WindPitchContEmulIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_WindPitchContEmulIEC_kdroop(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kdroop; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_kipce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kipce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_komegaaero(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->komegaaero; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_kppce(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kppce; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_omegaref(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->omegaref; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_pimax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pimax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_pimin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->pimin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPitchContEmulIEC_t1(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t1; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPitchContEmulIEC_t2(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->t2; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPitchContEmulIEC_tpe(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPitchContEmulIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpe; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* WindPitchContEmulIEC_factory() { - return new WindPitchContEmulIEC; - } +const char WindPitchContEmulIEC::debugName[] = "WindPitchContEmulIEC"; +const char* WindPitchContEmulIEC::debugString() const +{ + return WindPitchContEmulIEC::debugName; } -void WindPitchContEmulIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPitchContEmulIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC"), &WindPitchContEmulIEC_factory)); } -void WindPitchContEmulIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kdroop"), &assign_WindPitchContEmulIEC_kdroop)); +void WindPitchContEmulIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kdroop"), &assign_WindPitchContEmulIEC_kdroop)); assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kipce"), &assign_WindPitchContEmulIEC_kipce)); assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.komegaaero"), &assign_WindPitchContEmulIEC_komegaaero)); assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.kppce"), &assign_WindPitchContEmulIEC_kppce)); @@ -185,14 +208,9 @@ void WindPitchContEmulIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.WindGenTurbineType2IEC"), &assign_WindPitchContEmulIEC_WindGenTurbineType2IEC)); - } - -const char WindPitchContEmulIEC::debugName[] = "WindPitchContEmulIEC"; -const char* WindPitchContEmulIEC::debugString() +void WindPitchContEmulIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPitchContEmulIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPitchContEmulIEC.WindGenTurbineType2IEC"), &assign_WindPitchContEmulIEC_WindGenTurbineType2IEC)); } const BaseClassDefiner WindPitchContEmulIEC::declare() @@ -200,4 +218,10 @@ const BaseClassDefiner WindPitchContEmulIEC::declare() return BaseClassDefiner(WindPitchContEmulIEC::addConstructToMap, WindPitchContEmulIEC::addPrimitiveAssignFnsToMap, WindPitchContEmulIEC::addClassAssignFnsToMap, WindPitchContEmulIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPitchContEmulIEC_factory() + { + return new WindPitchContEmulIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.hpp b/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.hpp index aa4b94b58..d8a52e704 100644 --- a/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindPitchContEmulIEC.hpp @@ -1,51 +1,52 @@ #ifndef WindPitchContEmulIEC_H #define WindPitchContEmulIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include -#include "Simple_Float.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindGenTurbineType2IEC; -class WindGenTurbineType2IEC; /* Pitch control emulator model. Reference: IEC Standard 61400-27-1 Section 6.6.5.1. */ - class WindPitchContEmulIEC: public IdentifiedObject + class WindPitchContEmulIEC : public IdentifiedObject { - public: - CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with which this Pitch control emulator model is associated. Default: 0 */ - CIMPP::Simple_Float kdroop; /* Power error gain (). It is case dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kipce; /* Pitch control emulator integral constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU komegaaero; /* Aerodynamic power change vs. omegachange (). It is case dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kppce; /* Pitch control emulator proportional constant (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU omegaref; /* Rotor speed in initial steady state (omega). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pimax; /* Maximum steady state power (). It is case dependent parameter. Default: nullptr */ - CIMPP::PU pimin; /* Minimum steady state power (). It is case dependent parameter. Default: nullptr */ - CIMPP::Seconds t1; /* First time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds t2; /* Second time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpe; /* Time constant in generator air gap power lag (). It is type dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPitchContEmulIEC(); - virtual ~WindPitchContEmulIEC(); - + ~WindPitchContEmulIEC() override; + + CIMPP::WindGenTurbineType2IEC* WindGenTurbineType2IEC; /* Wind turbine type 2 model with which this Pitch control emulator model is associated. Default: 0 */ + CIMPP::Simple_Float kdroop; /* Power error gain (). It is case dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kipce; /* Pitch control emulator integral constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU komegaaero; /* Aerodynamic power change vs. omegachange (). It is case dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kppce; /* Pitch control emulator proportional constant (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU omegaref; /* Rotor speed in initial steady state (omega). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pimax; /* Maximum steady state power (). It is case dependent parameter. Default: nullptr */ + CIMPP::PU pimin; /* Minimum steady state power (). It is case dependent parameter. Default: nullptr */ + CIMPP::Seconds t1; /* First time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds t2; /* Second time constant in pitch control lag (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpe; /* Time constant in generator air gap power lag (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPitchContEmulIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindPlantDynamics.cpp b/CGMES_2.4.15_27JAN2020/WindPlantDynamics.cpp index dc3d72c03..8234ab546 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantDynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantDynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantDynamics.hpp" +#include +#include + #include "RemoteInputSignal.hpp" #include "WindTurbineType3or4Dynamics.hpp" using namespace CIMPP; -WindPlantDynamics::WindPlantDynamics(): RemoteInputSignal(nullptr) {}; - +WindPlantDynamics::WindPlantDynamics() : RemoteInputSignal(nullptr) {}; WindPlantDynamics::~WindPlantDynamics() {}; + + + bool assign_RemoteInputSignal_WindPlantDynamics(BaseClass*, BaseClass*); -bool assign_WindPlantDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return assign_RemoteInputSignal_WindPlantDynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindPlantDynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_WindPlantDynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindTurbineType3or4Dynamics.push_back(dynamic_cast(BaseClass_ptr2)); - return true; +bool assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass*, BaseClass*); +bool assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantDynamics* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4Dynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindTurbineType3or4Dynamics.begin(), element->WindTurbineType3or4Dynamics.end(), element2) == element->WindTurbineType3or4Dynamics.end()) + { + element->WindTurbineType3or4Dynamics.push_back(element2); + return assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass_ptr2, BaseClass_ptr1); } + return true; } return false; } - - - -namespace CIMPP { - BaseClass* WindPlantDynamics_factory() { - return new WindPlantDynamics; - } +const char WindPlantDynamics::debugName[] = "WindPlantDynamics"; +const char* WindPlantDynamics::debugString() const +{ + return WindPlantDynamics::debugName; } -void WindPlantDynamics::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantDynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantDynamics"), &WindPlantDynamics_factory)); } -void WindPlantDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindPlantDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.RemoteInputSignal"), &assign_WindPlantDynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.WindTurbineType3or4Dynamics"), &assign_WindPlantDynamics_WindTurbineType3or4Dynamics)); +void WindPlantDynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindPlantDynamics::debugName[] = "WindPlantDynamics"; -const char* WindPlantDynamics::debugString() +void WindPlantDynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantDynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.RemoteInputSignal"), &assign_WindPlantDynamics_RemoteInputSignal)); + assign_map.insert(std::make_pair(std::string("cim:WindPlantDynamics.WindTurbineType3or4Dynamics"), &assign_WindPlantDynamics_WindTurbineType3or4Dynamics)); } const BaseClassDefiner WindPlantDynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindPlantDynamics::declare() return BaseClassDefiner(WindPlantDynamics::addConstructToMap, WindPlantDynamics::addPrimitiveAssignFnsToMap, WindPlantDynamics::addClassAssignFnsToMap, WindPlantDynamics::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantDynamics_factory() + { + return new WindPlantDynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindPlantDynamics.hpp b/CGMES_2.4.15_27JAN2020/WindPlantDynamics.hpp index c8106fb45..a0931f253 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantDynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantDynamics.hpp @@ -1,40 +1,41 @@ #ifndef WindPlantDynamics_H #define WindPlantDynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class RemoteInputSignal; + class WindTurbineType3or4Dynamics; -class RemoteInputSignal; -class WindTurbineType3or4Dynamics; /* Parent class supporting relationships to wind turbines Type 3 and 4 and wind plant IEC and user defined wind plants including their control models. */ - class WindPlantDynamics: public DynamicsFunctionBlock + class WindPlantDynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* The wind plant using the remote signal. Default: 0 */ - std::list WindTurbineType3or4Dynamics; /* The wind turbine type 3 or 4 associated with this wind plant. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantDynamics(); - virtual ~WindPlantDynamics(); - + ~WindPlantDynamics() override; + + CIMPP::RemoteInputSignal* RemoteInputSignal; /* The wind plant using the remote signal. Default: 0 */ + std::list WindTurbineType3or4Dynamics; /* The wind turbine type 3 or 4 associated with this wind plant. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantDynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.cpp b/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.cpp index acc30e152..8340a1e1b 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.cpp @@ -1,8 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantFreqPcontrolIEC.hpp" +#include +#include + #include "WindDynamicsLookupTable.hpp" +#include "WindPlantIEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "Simple_Float.hpp" @@ -13,179 +18,204 @@ #include "Seconds.hpp" #include "Seconds.hpp" #include "Seconds.hpp" -#include "WindPlantIEC.hpp" using namespace CIMPP; -WindPlantFreqPcontrolIEC::WindPlantFreqPcontrolIEC(): WindPlantIEC(nullptr) {}; - +WindPlantFreqPcontrolIEC::WindPlantFreqPcontrolIEC() : WindPlantIEC(nullptr) {}; WindPlantFreqPcontrolIEC::~WindPlantFreqPcontrolIEC() {}; -bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->WindDynamicsLookupTable.push_back(dynamic_cast(BaseClass_ptr2)); + + +bool assign_WindPlantFreqPcontrolIEC_dprefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dprefmax; + if (buffer.fail()) + return false; + else return true; - } } return false; } +bool assign_WindPlantFreqPcontrolIEC_dprefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->dprefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_kiwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiwpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_kpwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpwpp; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_prefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prefmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_prefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->prefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_tpft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpft; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_tpfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tpfv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_twpffilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twpffilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantFreqPcontrolIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twppfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantIEC != nullptr) - return true; - } - return false; +bool assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass*, BaseClass*); +bool assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1); + WindDynamicsLookupTable* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->WindDynamicsLookupTable.begin(), element->WindDynamicsLookupTable.end(), element2) == element->WindDynamicsLookupTable.end()) + { + element->WindDynamicsLookupTable.push_back(element2); + return assign_WindDynamicsLookupTable_WindPlantFreqPcontrolIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } +bool assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass*, BaseClass*); +bool assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantIEC != element2) + { + element->WindPlantIEC = element2; + return assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -bool assign_WindPlantFreqPcontrolIEC_dprefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dprefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_dprefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->dprefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_kiwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiwpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_kpwpp(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpwpp; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_prefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_prefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->prefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantFreqPcontrolIEC_tpft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpft; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_tpfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tpfv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_twpffilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twpffilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantFreqPcontrolIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantFreqPcontrolIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twppfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - -namespace CIMPP { - BaseClass* WindPlantFreqPcontrolIEC_factory() { - return new WindPlantFreqPcontrolIEC; - } + + + +const char WindPlantFreqPcontrolIEC::debugName[] = "WindPlantFreqPcontrolIEC"; +const char* WindPlantFreqPcontrolIEC::debugString() const +{ + return WindPlantFreqPcontrolIEC::debugName; } -void WindPlantFreqPcontrolIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantFreqPcontrolIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC"), &WindPlantFreqPcontrolIEC_factory)); } -void WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.dprefmax"), &assign_WindPlantFreqPcontrolIEC_dprefmax)); +void WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.dprefmax"), &assign_WindPlantFreqPcontrolIEC_dprefmax)); assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.dprefmin"), &assign_WindPlantFreqPcontrolIEC_dprefmin)); assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.kiwpp"), &assign_WindPlantFreqPcontrolIEC_kiwpp)); assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.kpwpp"), &assign_WindPlantFreqPcontrolIEC_kpwpp)); @@ -195,17 +225,12 @@ void WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindDynamicsLookupTable"), &assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable)); - assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindPlantIEC"), &assign_WindPlantFreqPcontrolIEC_WindPlantIEC)); } -const char WindPlantFreqPcontrolIEC::debugName[] = "WindPlantFreqPcontrolIEC"; -const char* WindPlantFreqPcontrolIEC::debugString() +void WindPlantFreqPcontrolIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantFreqPcontrolIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindDynamicsLookupTable"), &assign_WindPlantFreqPcontrolIEC_WindDynamicsLookupTable)); + assign_map.insert(std::make_pair(std::string("cim:WindPlantFreqPcontrolIEC.WindPlantIEC"), &assign_WindPlantFreqPcontrolIEC_WindPlantIEC)); } const BaseClassDefiner WindPlantFreqPcontrolIEC::declare() @@ -213,4 +238,10 @@ const BaseClassDefiner WindPlantFreqPcontrolIEC::declare() return BaseClassDefiner(WindPlantFreqPcontrolIEC::addConstructToMap, WindPlantFreqPcontrolIEC::addPrimitiveAssignFnsToMap, WindPlantFreqPcontrolIEC::addClassAssignFnsToMap, WindPlantFreqPcontrolIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantFreqPcontrolIEC_factory() + { + return new WindPlantFreqPcontrolIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.hpp b/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.hpp index a9dece8c9..5e3c327c9 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantFreqPcontrolIEC.hpp @@ -1,53 +1,54 @@ #ifndef WindPlantFreqPcontrolIEC_H #define WindPlantFreqPcontrolIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" -#include "Simple_Float.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindDynamicsLookupTable; + class WindPlantIEC; -class WindDynamicsLookupTable; -class WindPlantIEC; /* Frequency and active power controller model. Reference: IEC Standard 61400-27-1 Annex E. */ - class WindPlantFreqPcontrolIEC: public IdentifiedObject + class WindPlantFreqPcontrolIEC : public IdentifiedObject { - public: - std::list WindDynamicsLookupTable; /* The frequency and active power wind plant control model with which this wind dynamics lookup table is associated. Default: 0 */ - CIMPP::PU dprefmax; /* Maximum ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU dprefmin; /* Minimum (negative) ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kiwpp; /* Plant P controller integral gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kpwpp; /* Plant P controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU prefmax; /* Maximum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU prefmin; /* Minimum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds tpfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twpffilt; /* Filter time constant for frequency measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind plant frequency and active power control is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantFreqPcontrolIEC(); - virtual ~WindPlantFreqPcontrolIEC(); - + ~WindPlantFreqPcontrolIEC() override; + + std::list WindDynamicsLookupTable; /* The frequency and active power wind plant control model with which this wind dynamics lookup table is associated. Default: 0 */ + CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind plant frequency and active power control is associated. Default: 0 */ + CIMPP::PU dprefmax; /* Maximum ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU dprefmin; /* Minimum (negative) ramp rate of request from the plant controller to the wind turbines (). It is project dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kiwpp; /* Plant P controller integral gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kpwpp; /* Plant P controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU prefmax; /* Maximum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU prefmin; /* Minimum request from the plant controller to the wind turbines (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds tpfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twpffilt; /* Filter time constant for frequency measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantFreqPcontrolIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindPlantIEC.cpp b/CGMES_2.4.15_27JAN2020/WindPlantIEC.cpp index 15cb96b46..d05195c27 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantIEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindPlantDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantIEC.hpp" +#include +#include + #include "WindPlantFreqPcontrolIEC.hpp" #include "WindPlantReactiveControlIEC.hpp" using namespace CIMPP; -WindPlantIEC::WindPlantIEC(): WindPlantFreqPcontrolIEC(nullptr), WindPlantReactiveControlIEC(nullptr) {}; - +WindPlantIEC::WindPlantIEC() : WindPlantFreqPcontrolIEC(nullptr), WindPlantReactiveControlIEC(nullptr) {}; WindPlantIEC::~WindPlantIEC() {}; + + + bool assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass*, BaseClass*); -bool assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantFreqPcontrolIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantFreqPcontrolIEC != nullptr) - return assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindPlantIEC_WindPlantFreqPcontrolIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantFreqPcontrolIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantFreqPcontrolIEC != element2) + { + element->WindPlantFreqPcontrolIEC = element2; + return assign_WindPlantFreqPcontrolIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass*, BaseClass*); -bool assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantReactiveControlIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantReactiveControlIEC != nullptr) - return assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantReactiveControlIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantReactiveControlIEC != element2) + { + element->WindPlantReactiveControlIEC = element2; + return assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindPlantIEC_factory() { - return new WindPlantIEC; - } +const char WindPlantIEC::debugName[] = "WindPlantIEC"; +const char* WindPlantIEC::debugString() const +{ + return WindPlantIEC::debugName; } -void WindPlantIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantIEC"), &WindPlantIEC_factory)); } -void WindPlantIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindPlantIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantFreqPcontrolIEC"), &assign_WindPlantIEC_WindPlantFreqPcontrolIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantReactiveControlIEC"), &assign_WindPlantIEC_WindPlantReactiveControlIEC)); +void WindPlantIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindPlantIEC::debugName[] = "WindPlantIEC"; -const char* WindPlantIEC::debugString() +void WindPlantIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantFreqPcontrolIEC"), &assign_WindPlantIEC_WindPlantFreqPcontrolIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindPlantIEC.WindPlantReactiveControlIEC"), &assign_WindPlantIEC_WindPlantReactiveControlIEC)); } const BaseClassDefiner WindPlantIEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindPlantIEC::declare() return BaseClassDefiner(WindPlantIEC::addConstructToMap, WindPlantIEC::addPrimitiveAssignFnsToMap, WindPlantIEC::addClassAssignFnsToMap, WindPlantIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantIEC_factory() + { + return new WindPlantIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindPlantIEC.hpp b/CGMES_2.4.15_27JAN2020/WindPlantIEC.hpp index b72e8a539..28e9bf1d6 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantIEC.hpp @@ -1,40 +1,41 @@ #ifndef WindPlantIEC_H #define WindPlantIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindPlantDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindPlantDynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindPlantFreqPcontrolIEC; + class WindPlantReactiveControlIEC; -class WindPlantFreqPcontrolIEC; -class WindPlantReactiveControlIEC; /* Simplified IEC type plant level model. Reference: IEC 61400-27-1, AnnexE. */ - class WindPlantIEC: public WindPlantDynamics + class WindPlantIEC : public WindPlantDynamics { - public: - CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* Wind plant frequency and active power control model associated with this wind plant. Default: 0 */ - CIMPP::WindPlantReactiveControlIEC* WindPlantReactiveControlIEC; /* Wind plant reactive control model associated with this wind plant. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantIEC(); - virtual ~WindPlantIEC(); - + ~WindPlantIEC() override; + + CIMPP::WindPlantFreqPcontrolIEC* WindPlantFreqPcontrolIEC; /* Wind plant frequency and active power control model associated with this wind plant. Default: 0 */ + CIMPP::WindPlantReactiveControlIEC* WindPlantReactiveControlIEC; /* Wind plant reactive control model associated with this wind plant. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.cpp b/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.cpp index 2ac16c68e..8c885fe24 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.cpp @@ -1,7 +1,11 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantReactiveControlIEC.hpp" +#include +#include + #include "WindPlantIEC.hpp" #include "Simple_Float.hpp" #include "Simple_Float.hpp" @@ -19,26 +23,197 @@ using namespace CIMPP; -WindPlantReactiveControlIEC::WindPlantReactiveControlIEC(): WindPlantIEC(nullptr) {}; - +WindPlantReactiveControlIEC::WindPlantReactiveControlIEC() : WindPlantIEC(nullptr) {}; WindPlantReactiveControlIEC::~WindPlantReactiveControlIEC() {}; -bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantIEC != nullptr) - return true; - } - return false; + +bool assign_WindPlantReactiveControlIEC_kiwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kiwpx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_kpwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kpwpx; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_kwpqu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->kwpqu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_mwppf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwppf; + if (buffer.fail()) + return false; + else + return true; + } + return false; } +bool assign_WindPlantReactiveControlIEC_mwpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->mwpu; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twppfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_twpqfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twpqfilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_twpufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->twpufilt; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} + +bool assign_WindPlantReactiveControlIEC_txft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->txft; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_txfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->txfv; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_uwpqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uwpqdip; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_xrefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xrefmax; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantReactiveControlIEC_xrefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->xrefmin; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass*, BaseClass*); +bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1); + WindPlantIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantIEC != element2) + { + element->WindPlantIEC = element2; + return assign_WindPlantIEC_WindPlantReactiveControlIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} @@ -48,174 +223,25 @@ bool assign_WindPlantReactiveControlIEC_WindPlantIEC(BaseClass* BaseClass_ptr1, -bool assign_WindPlantReactiveControlIEC_kiwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kiwpx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_kpwpx(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kpwpx; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_kwpqu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->kwpqu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_mwppf(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwppf; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_mwpu(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->mwpu; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_twppfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twppfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_twpqfilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twpqfilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindPlantReactiveControlIEC_twpufilt(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->twpufilt; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_txft(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->txft; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_txfv(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->txfv; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_uwpqdip(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uwpqdip; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_xrefmax(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xrefmax; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindPlantReactiveControlIEC_xrefmin(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantReactiveControlIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->xrefmin; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -namespace CIMPP { - BaseClass* WindPlantReactiveControlIEC_factory() { - return new WindPlantReactiveControlIEC; - } +const char WindPlantReactiveControlIEC::debugName[] = "WindPlantReactiveControlIEC"; +const char* WindPlantReactiveControlIEC::debugString() const +{ + return WindPlantReactiveControlIEC::debugName; } -void WindPlantReactiveControlIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantReactiveControlIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC"), &WindPlantReactiveControlIEC_factory)); } -void WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kiwpx"), &assign_WindPlantReactiveControlIEC_kiwpx)); +void WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ + assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kiwpx"), &assign_WindPlantReactiveControlIEC_kiwpx)); assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kpwpx"), &assign_WindPlantReactiveControlIEC_kpwpx)); assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.kwpqu"), &assign_WindPlantReactiveControlIEC_kwpqu)); assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.mwppf"), &assign_WindPlantReactiveControlIEC_mwppf)); @@ -230,14 +256,9 @@ void WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap(std::unordered_map< assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.xrefmin"), &assign_WindPlantReactiveControlIEC_xrefmin)); } -void WindPlantReactiveControlIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.WindPlantIEC"), &assign_WindPlantReactiveControlIEC_WindPlantIEC)); - } - -const char WindPlantReactiveControlIEC::debugName[] = "WindPlantReactiveControlIEC"; -const char* WindPlantReactiveControlIEC::debugString() +void WindPlantReactiveControlIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantReactiveControlIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantReactiveControlIEC.WindPlantIEC"), &assign_WindPlantReactiveControlIEC_WindPlantIEC)); } const BaseClassDefiner WindPlantReactiveControlIEC::declare() @@ -245,4 +266,10 @@ const BaseClassDefiner WindPlantReactiveControlIEC::declare() return BaseClassDefiner(WindPlantReactiveControlIEC::addConstructToMap, WindPlantReactiveControlIEC::addPrimitiveAssignFnsToMap, WindPlantReactiveControlIEC::addClassAssignFnsToMap, WindPlantReactiveControlIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantReactiveControlIEC_factory() + { + return new WindPlantReactiveControlIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.hpp b/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.hpp index 5ed10385c..cb72971bb 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantReactiveControlIEC.hpp @@ -1,55 +1,56 @@ #ifndef WindPlantReactiveControlIEC_H #define WindPlantReactiveControlIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" +#include +#include - -#include "Simple_Float.hpp" -#include "PU.hpp" +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" +#include "PU.hpp" #include "Seconds.hpp" +#include "Simple_Float.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class WindPlantIEC; -class WindPlantIEC; /* Simplified plant voltage and reactive power control model for use with type 3 and type 4 wind turbine models. Reference: IEC Standard 61400-27-1 Annex E. */ - class WindPlantReactiveControlIEC: public IdentifiedObject + class WindPlantReactiveControlIEC : public IdentifiedObject { - public: - CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind reactive control is associated. Default: 0 */ - CIMPP::Simple_Float kiwpx; /* Plant Q controller integral gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::Simple_Float kpwpx; /* Plant Q controller proportional gain (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU kwpqu; /* Plant voltage control droop (). It is project dependent parameter. Default: nullptr */ - CIMPP::Boolean mwppf; /* Power factor control modes selector (). Used only if mwpu is set to false. true = 1: power factor control false = 0: reactive power control. It is project dependent parameter. Default: false */ - CIMPP::Boolean mwpu; /* Reactive power control modes selector (). true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ - CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twpqfilt; /* Filter time constant for reactive power measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds twpufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds txft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::Seconds txfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU uwpqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ - CIMPP::PU xrefmax; /* Maximum ( or delta ) request from the plant controller (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU xrefmin; /* Minimum ( or delta) request from the plant controller (). It is project dependent parameter. Default: nullptr */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantReactiveControlIEC(); - virtual ~WindPlantReactiveControlIEC(); - + ~WindPlantReactiveControlIEC() override; + + CIMPP::WindPlantIEC* WindPlantIEC; /* Wind plant model with which this wind reactive control is associated. Default: 0 */ + CIMPP::Simple_Float kiwpx; /* Plant Q controller integral gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::Simple_Float kpwpx; /* Plant Q controller proportional gain (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU kwpqu; /* Plant voltage control droop (). It is project dependent parameter. Default: nullptr */ + CIMPP::Boolean mwppf; /* Power factor control modes selector (). Used only if mwpu is set to false. true = 1: power factor control false = 0: reactive power control. It is project dependent parameter. Default: false */ + CIMPP::Boolean mwpu; /* Reactive power control modes selector (). true = 1: voltage control false = 0: reactive power control. It is project dependent parameter. Default: false */ + CIMPP::Seconds twppfilt; /* Filter time constant for active power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twpqfilt; /* Filter time constant for reactive power measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds twpufilt; /* Filter time constant for voltage measurement (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds txft; /* Lead time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::Seconds txfv; /* Lag time constant in reference value transfer function (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU uwpqdip; /* Voltage threshold for LVRT detection in q control (). It is type dependent parameter. Default: nullptr */ + CIMPP::PU xrefmax; /* Maximum ( or delta ) request from the plant controller (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU xrefmin; /* Minimum ( or delta) request from the plant controller (). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantReactiveControlIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.cpp b/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.cpp index ad5a9c42f..443180339 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "WindPlantDynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindPlantUserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; WindPlantUserDefined::WindPlantUserDefined() {}; - WindPlantUserDefined::~WindPlantUserDefined() {}; -bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindPlantUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindPlantUserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass*, BaseClass*); +bool assign_WindPlantUserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindPlantUserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_WindPlantUserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindPlantUserDefined_factory() { - return new WindPlantUserDefined; - } +const char WindPlantUserDefined::debugName[] = "WindPlantUserDefined"; +const char* WindPlantUserDefined::debugString() const +{ + return WindPlantUserDefined::debugName; } -void WindPlantUserDefined::addConstructToMap(std::unordered_map& factory_map) { +void WindPlantUserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined"), &WindPlantUserDefined_factory)); } -void WindPlantUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindPlantUserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined.proprietary"), &assign_WindPlantUserDefined_proprietary)); - } - -void WindPlantUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined.ProprietaryParameterDynamics"), &assign_WindPlantUserDefined_ProprietaryParameterDynamics)); } -const char WindPlantUserDefined::debugName[] = "WindPlantUserDefined"; -const char* WindPlantUserDefined::debugString() +void WindPlantUserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindPlantUserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindPlantUserDefined.ProprietaryParameterDynamics"), &assign_WindPlantUserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner WindPlantUserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner WindPlantUserDefined::declare() return BaseClassDefiner(WindPlantUserDefined::addConstructToMap, WindPlantUserDefined::addPrimitiveAssignFnsToMap, WindPlantUserDefined::addClassAssignFnsToMap, WindPlantUserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* WindPlantUserDefined_factory() + { + return new WindPlantUserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.hpp b/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.hpp index 679f975f9..c4afa108d 100644 --- a/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/WindPlantUserDefined.hpp @@ -1,40 +1,41 @@ #ifndef WindPlantUserDefined_H #define WindPlantUserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindPlantDynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindPlantDynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Wind plant function block whose dynamic behaviour is described by */ - class WindPlantUserDefined: public WindPlantDynamics + class WindPlantUserDefined : public WindPlantDynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindPlantUserDefined(); - virtual ~WindPlantUserDefined(); - + ~WindPlantUserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindPlantUserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindProtectionIEC.cpp b/CGMES_2.4.15_27JAN2020/WindProtectionIEC.cpp index 9a38edbfb..88873297f 100644 --- a/CGMES_2.4.15_27JAN2020/WindProtectionIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindProtectionIEC.cpp @@ -1,7 +1,13 @@ -#include -#include "IdentifiedObject.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindProtectionIEC.hpp" +#include +#include + +#include "WindTurbineType1or2IEC.hpp" +#include "WindTurbineType3or4IEC.hpp" #include "PU.hpp" #include "PU.hpp" #include "Seconds.hpp" @@ -10,152 +16,175 @@ #include "Seconds.hpp" #include "PU.hpp" #include "PU.hpp" -#include "WindTurbineType3or4IEC.hpp" -#include "WindTurbineType1or2IEC.hpp" using namespace CIMPP; -WindProtectionIEC::WindProtectionIEC(): WindTurbineType3or4IEC(nullptr), WindTurbineType1or2IEC(nullptr) {}; - +WindProtectionIEC::WindProtectionIEC() : WindTurbineType1or2IEC(nullptr), WindTurbineType3or4IEC(nullptr) {}; WindProtectionIEC::~WindProtectionIEC() {}; +bool assign_WindProtectionIEC_fover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->fover; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_funder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->funder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tfover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfover; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tfunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tfunder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tuover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuover; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} +bool assign_WindProtectionIEC_tuunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->tuunder; + if (buffer.fail()) + return false; + else + return true; + } + return false; +} -bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType3or4IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType3or4IEC != nullptr) - return true; - } - return false; +bool assign_WindProtectionIEC_uover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uover; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindTurbineType1or2IEC = dynamic_cast(BaseClass_ptr2); - if(element->WindTurbineType1or2IEC != nullptr) - return true; - } - return false; +bool assign_WindProtectionIEC_uunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->uunder; + if (buffer.fail()) + return false; + else + return true; + } + return false; } -bool assign_WindProtectionIEC_fover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->fover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass*, BaseClass*); +bool assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType1or2IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType1or2IEC != element2) + { + element->WindTurbineType1or2IEC = element2; + return assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindProtectionIEC_funder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->funder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass*, BaseClass*); +bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1); + WindTurbineType3or4IEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindTurbineType3or4IEC != element2) + { + element->WindTurbineType3or4IEC = element2; + return assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -bool assign_WindProtectionIEC_tfover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_tfunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tfunder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_tuover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_tuunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->tuunder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} -bool assign_WindProtectionIEC_uover(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uover; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - -bool assign_WindProtectionIEC_uunder(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindProtectionIEC* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->uunder; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; -} - - - -namespace CIMPP { - BaseClass* WindProtectionIEC_factory() { - return new WindProtectionIEC; - } + + + + +const char WindProtectionIEC::debugName[] = "WindProtectionIEC"; +const char* WindProtectionIEC::debugString() const +{ + return WindProtectionIEC::debugName; } -void WindProtectionIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindProtectionIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindProtectionIEC"), &WindProtectionIEC_factory)); } -void WindProtectionIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindProtectionIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.fover"), &assign_WindProtectionIEC_fover)); assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.funder"), &assign_WindProtectionIEC_funder)); assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.tfover"), &assign_WindProtectionIEC_tfover)); @@ -164,17 +193,12 @@ void WindProtectionIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType3or4IEC"), &assign_WindProtectionIEC_WindTurbineType3or4IEC)); - assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType1or2IEC"), &assign_WindProtectionIEC_WindTurbineType1or2IEC)); } -const char WindProtectionIEC::debugName[] = "WindProtectionIEC"; -const char* WindProtectionIEC::debugString() +void WindProtectionIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindProtectionIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType1or2IEC"), &assign_WindProtectionIEC_WindTurbineType1or2IEC)); + assign_map.insert(std::make_pair(std::string("cim:WindProtectionIEC.WindTurbineType3or4IEC"), &assign_WindProtectionIEC_WindTurbineType3or4IEC)); } const BaseClassDefiner WindProtectionIEC::declare() @@ -182,4 +206,10 @@ const BaseClassDefiner WindProtectionIEC::declare() return BaseClassDefiner(WindProtectionIEC::addConstructToMap, WindProtectionIEC::addPrimitiveAssignFnsToMap, WindProtectionIEC::addClassAssignFnsToMap, WindProtectionIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindProtectionIEC_factory() + { + return new WindProtectionIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindProtectionIEC.hpp b/CGMES_2.4.15_27JAN2020/WindProtectionIEC.hpp index a56220bee..aff760adf 100644 --- a/CGMES_2.4.15_27JAN2020/WindProtectionIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindProtectionIEC.hpp @@ -1,50 +1,51 @@ #ifndef WindProtectionIEC_H #define WindProtectionIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "IdentifiedObject.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "IdentifiedObject.hpp" +#include "BaseClassDefiner.hpp" #include "PU.hpp" #include "Seconds.hpp" -namespace CIMPP { +namespace CIMPP +{ + class WindTurbineType1or2IEC; + class WindTurbineType3or4IEC; - -class WindTurbineType3or4IEC; -class WindTurbineType1or2IEC; /* The grid protection model includes protection against over and under voltage, and against over and under frequency. Reference: IEC Standard 614000-27-1 Section 6.6.6. */ - class WindProtectionIEC: public IdentifiedObject + class WindProtectionIEC : public IdentifiedObject { - public: - CIMPP::PU fover; /* Set of wind turbine over frequency protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU funder; /* Set of wind turbine under frequency protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tfover; /* Set of corresponding wind turbine over frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tfunder; /* Set of corresponding wind turbine under frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tuover; /* Set of corresponding wind turbine over voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::Seconds tuunder; /* Set of corresponding wind turbine under voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU uover; /* Set of wind turbine over voltage protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::PU uunder; /* Set of wind turbine under voltage protection levels (). It is project dependent parameter. Default: nullptr */ - CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind generator type 3 or 4 model with which this wind turbine protection model is associated. Default: 0 */ - CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind turbine protection model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindProtectionIEC(); - virtual ~WindProtectionIEC(); - + ~WindProtectionIEC() override; + + CIMPP::WindTurbineType1or2IEC* WindTurbineType1or2IEC; /* Wind generator type 1 or 2 model with which this wind turbine protection model is associated. Default: 0 */ + CIMPP::WindTurbineType3or4IEC* WindTurbineType3or4IEC; /* Wind generator type 3 or 4 model with which this wind turbine protection model is associated. Default: 0 */ + CIMPP::PU fover; /* Set of wind turbine over frequency protection levels (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU funder; /* Set of wind turbine under frequency protection levels (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tfover; /* Set of corresponding wind turbine over frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tfunder; /* Set of corresponding wind turbine under frequency protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tuover; /* Set of corresponding wind turbine over voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::Seconds tuunder; /* Set of corresponding wind turbine under voltage protection disconnection times (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU uover; /* Set of wind turbine over voltage protection levels (). It is project dependent parameter. Default: nullptr */ + CIMPP::PU uunder; /* Set of wind turbine under voltage protection levels (). It is project dependent parameter. Default: nullptr */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindProtectionIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.cpp b/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.cpp index b45e7cd66..b5c887e96 100644 --- a/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.cpp +++ b/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindQcontrolModesKind.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindQcontrolModesKind& rop) +WindQcontrolModesKind& WindQcontrolModesKind::operator=(WindQcontrolModesKind_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindQcontrolModesKind::operator WindQcontrolModesKind_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindQcontrolModesKind::debugName[] = "WindQcontrolModesKind"; +const char* WindQcontrolModesKind::debugString() const +{ + return WindQcontrolModesKind::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindQcontrolModesKind& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -43,5 +74,35 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindQcontrolModesKind& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindQcontrolModesKind::voltage) + { + EnumSymbol = "voltage"; + } + if (obj.value == WindQcontrolModesKind::reactivePower) + { + EnumSymbol = "reactivePower"; + } + if (obj.value == WindQcontrolModesKind::openLoopReactivePower) + { + EnumSymbol = "openLoopReactivePower"; + } + if (obj.value == WindQcontrolModesKind::powerFactor) + { + EnumSymbol = "powerFactor"; + } + + if (!EnumSymbol.empty()) + { + os << "WindQcontrolModesKind." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.hpp b/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.hpp index c74042607..770a20720 100644 --- a/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.hpp +++ b/CGMES_2.4.15_27JAN2020/WindQcontrolModesKind.hpp @@ -1,29 +1,54 @@ #ifndef WindQcontrolModesKind_H #define WindQcontrolModesKind_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* General wind turbine Q control modes . */ - enum class WindQcontrolModesKind + class WindQcontrolModesKind { - /** - * Voltage control (). - */ - voltage, - /** - * Reactive power control (). - */ - reactivePower, - /** - * Open loop reactive power control (only used with closed loop at plant level) (). - */ - openLoopReactivePower, - /** - * Power factor control (). - */ - powerFactor, + public: + enum WindQcontrolModesKind_ENUM + { + /** + * Voltage control (). + */ + voltage, + /** + * Reactive power control (). + */ + reactivePower, + /** + * Open loop reactive power control (only used with closed loop at plant level) (). + */ + openLoopReactivePower, + /** + * Power factor control (). + */ + powerFactor, + }; + + WindQcontrolModesKind() : value(), initialized(false) {} + WindQcontrolModesKind(WindQcontrolModesKind_ENUM value) : value(value), initialized(true) {} + + WindQcontrolModesKind& operator=(WindQcontrolModesKind_ENUM rop); + operator WindQcontrolModesKind_ENUM() const; + + WindQcontrolModesKind_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindQcontrolModesKind& rop); + friend std::ostream& operator<<(std::ostream& os, const WindQcontrolModesKind& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindQcontrolModesKind& rop); } #endif diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.cpp b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.cpp index 21a534207..e406e4c7c 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.cpp @@ -1,62 +1,76 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType1or2Dynamics.hpp" -#include "RemoteInputSignal.hpp" +#include +#include + #include "AsynchronousMachineDynamics.hpp" +#include "RemoteInputSignal.hpp" using namespace CIMPP; -WindTurbineType1or2Dynamics::WindTurbineType1or2Dynamics(): RemoteInputSignal(nullptr), AsynchronousMachineDynamics(nullptr) {}; - +WindTurbineType1or2Dynamics::WindTurbineType1or2Dynamics() : AsynchronousMachineDynamics(nullptr), RemoteInputSignal(nullptr) {}; WindTurbineType1or2Dynamics::~WindTurbineType1or2Dynamics() {}; -bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->AsynchronousMachineDynamics = dynamic_cast(BaseClass_ptr2); - if(element->AsynchronousMachineDynamics != nullptr) - return assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); +bool assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1); + AsynchronousMachineDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->AsynchronousMachineDynamics != element2) + { + element->AsynchronousMachineDynamics = element2; + return assign_AsynchronousMachineDynamics_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* WindTurbineType1or2Dynamics_factory() { - return new WindTurbineType1or2Dynamics; +bool assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass*, BaseClass*); +bool assign_WindTurbineType1or2Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2Dynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_WindTurbineType1or2Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindTurbineType1or2Dynamics::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics"), &WindTurbineType1or2Dynamics_factory)); +const char WindTurbineType1or2Dynamics::debugName[] = "WindTurbineType1or2Dynamics"; +const char* WindTurbineType1or2Dynamics::debugString() const +{ + return WindTurbineType1or2Dynamics::debugName; } -void WindTurbineType1or2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType1or2Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics"), &WindTurbineType1or2Dynamics_factory)); +} -void WindTurbineType1or2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.RemoteInputSignal"), &assign_WindTurbineType1or2Dynamics_RemoteInputSignal)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.AsynchronousMachineDynamics"), &assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics)); +void WindTurbineType1or2Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType1or2Dynamics::debugName[] = "WindTurbineType1or2Dynamics"; -const char* WindTurbineType1or2Dynamics::debugString() +void WindTurbineType1or2Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType1or2Dynamics::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.AsynchronousMachineDynamics"), &assign_WindTurbineType1or2Dynamics_AsynchronousMachineDynamics)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2Dynamics.RemoteInputSignal"), &assign_WindTurbineType1or2Dynamics_RemoteInputSignal)); } const BaseClassDefiner WindTurbineType1or2Dynamics::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindTurbineType1or2Dynamics::declare() return BaseClassDefiner(WindTurbineType1or2Dynamics::addConstructToMap, WindTurbineType1or2Dynamics::addPrimitiveAssignFnsToMap, WindTurbineType1or2Dynamics::addClassAssignFnsToMap, WindTurbineType1or2Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType1or2Dynamics_factory() + { + return new WindTurbineType1or2Dynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.hpp b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.hpp index 2d7b85a52..7376d2de7 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2Dynamics.hpp @@ -1,40 +1,41 @@ #ifndef WindTurbineType1or2Dynamics_H #define WindTurbineType1or2Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class AsynchronousMachineDynamics; + class RemoteInputSignal; -class RemoteInputSignal; -class AsynchronousMachineDynamics; /* Parent class supporting relationships to wind turbines Type 1 and 2 and their control models. */ - class WindTurbineType1or2Dynamics: public DynamicsFunctionBlock + class WindTurbineType1or2Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this wind generator Type 1 or Type 2 model. Default: 0 */ - CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this wind generator type 1 or 2 model is associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType1or2Dynamics(); - virtual ~WindTurbineType1or2Dynamics(); - + ~WindTurbineType1or2Dynamics() override; + + CIMPP::AsynchronousMachineDynamics* AsynchronousMachineDynamics; /* Asynchronous machine model with which this wind generator type 1 or 2 model is associated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Remote input signal used by this wind generator Type 1 or Type 2 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType1or2Dynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.cpp b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.cpp index 69e37a1c6..5b28517df 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindTurbineType1or2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType1or2IEC.hpp" +#include +#include + #include "WindMechIEC.hpp" #include "WindProtectionIEC.hpp" using namespace CIMPP; -WindTurbineType1or2IEC::WindTurbineType1or2IEC(): WindMechIEC(nullptr), WindProtectionIEC(nullptr) {}; - +WindTurbineType1or2IEC::WindTurbineType1or2IEC() : WindMechIEC(nullptr), WindProtectionIEC(nullptr) {}; WindTurbineType1or2IEC::~WindTurbineType1or2IEC() {}; + + + bool assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindMechIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindMechIEC != nullptr) - return assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType1or2IEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1); + WindMechIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindMechIEC != element2) + { + element->WindMechIEC = element2; + return assign_WindMechIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindProtectionIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindProtectionIEC != nullptr) - return assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType1or2IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType1or2IEC* element = dynamic_cast(BaseClass_ptr1); + WindProtectionIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindProtectionIEC != element2) + { + element->WindProtectionIEC = element2; + return assign_WindProtectionIEC_WindTurbineType1or2IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindTurbineType1or2IEC_factory() { - return new WindTurbineType1or2IEC; - } +const char WindTurbineType1or2IEC::debugName[] = "WindTurbineType1or2IEC"; +const char* WindTurbineType1or2IEC::debugString() const +{ + return WindTurbineType1or2IEC::debugName; } -void WindTurbineType1or2IEC::addConstructToMap(std::unordered_map& factory_map) { +void WindTurbineType1or2IEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC"), &WindTurbineType1or2IEC_factory)); } -void WindTurbineType1or2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindTurbineType1or2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindMechIEC"), &assign_WindTurbineType1or2IEC_WindMechIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindProtectionIEC"), &assign_WindTurbineType1or2IEC_WindProtectionIEC)); +void WindTurbineType1or2IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType1or2IEC::debugName[] = "WindTurbineType1or2IEC"; -const char* WindTurbineType1or2IEC::debugString() +void WindTurbineType1or2IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType1or2IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindMechIEC"), &assign_WindTurbineType1or2IEC_WindMechIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType1or2IEC.WindProtectionIEC"), &assign_WindTurbineType1or2IEC_WindProtectionIEC)); } const BaseClassDefiner WindTurbineType1or2IEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindTurbineType1or2IEC::declare() return BaseClassDefiner(WindTurbineType1or2IEC::addConstructToMap, WindTurbineType1or2IEC::addPrimitiveAssignFnsToMap, WindTurbineType1or2IEC::addClassAssignFnsToMap, WindTurbineType1or2IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType1or2IEC_factory() + { + return new WindTurbineType1or2IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.hpp b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.hpp index ec4ea8b84..fa28cd1a6 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType1or2IEC.hpp @@ -1,40 +1,41 @@ #ifndef WindTurbineType1or2IEC_H #define WindTurbineType1or2IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType1or2Dynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindMechIEC; + class WindProtectionIEC; -class WindMechIEC; -class WindProtectionIEC; /* Generator model for wind turbine of IEC Type 1 or Type 2 is a standard asynchronous generator model. Reference: IEC Standard 614000-27-1 Section 6.6.3.1. */ - class WindTurbineType1or2IEC: public WindTurbineType1or2Dynamics + class WindTurbineType1or2IEC : public WindTurbineType1or2Dynamics { - public: - CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind generator type 1 or 2 model. Default: 0 */ - CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 1 or 2 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType1or2IEC(); - virtual ~WindTurbineType1or2IEC(); - + ~WindTurbineType1or2IEC() override; + + CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind generator type 1 or 2 model. Default: 0 */ + CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 1 or 2 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType1or2IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.cpp b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.cpp index 408a19da5..c07dc9b09 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.cpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.cpp @@ -1,80 +1,107 @@ -#include -#include "DynamicsFunctionBlock.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType3or4Dynamics.hpp" +#include +#include + #include "EnergySource.hpp" #include "RemoteInputSignal.hpp" #include "WindPlantDynamics.hpp" using namespace CIMPP; -WindTurbineType3or4Dynamics::WindTurbineType3or4Dynamics(): EnergySource(nullptr), RemoteInputSignal(nullptr), WindPlantDynamics(nullptr) {}; - +WindTurbineType3or4Dynamics::WindTurbineType3or4Dynamics() : EnergySource(nullptr), RemoteInputSignal(nullptr), WindPlantDynamics(nullptr) {}; WindTurbineType3or4Dynamics::~WindTurbineType3or4Dynamics() {}; + + + + bool assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->EnergySource = dynamic_cast(BaseClass_ptr2); - if(element->EnergySource != nullptr) - return assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType3or4Dynamics_EnergySource(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1); + EnergySource* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->EnergySource != element2) + { + element->EnergySource = element2; + return assign_EnergySource_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->RemoteInputSignal = dynamic_cast(BaseClass_ptr2); - if(element->RemoteInputSignal != nullptr) - return assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType3or4Dynamics_RemoteInputSignal(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1); + RemoteInputSignal* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->RemoteInputSignal != element2) + { + element->RemoteInputSignal = element2; + return assign_RemoteInputSignal_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1)) { - element->WindPlantDynamics = dynamic_cast(BaseClass_ptr2); - if(element->WindPlantDynamics != nullptr) - return assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType3or4Dynamics_WindPlantDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4Dynamics* element = dynamic_cast(BaseClass_ptr1); + WindPlantDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindPlantDynamics != element2) + { + element->WindPlantDynamics = element2; + return assign_WindPlantDynamics_WindTurbineType3or4Dynamics(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - - -namespace CIMPP { - BaseClass* WindTurbineType3or4Dynamics_factory() { - return new WindTurbineType3or4Dynamics; - } +const char WindTurbineType3or4Dynamics::debugName[] = "WindTurbineType3or4Dynamics"; +const char* WindTurbineType3or4Dynamics::debugString() const +{ + return WindTurbineType3or4Dynamics::debugName; } -void WindTurbineType3or4Dynamics::addConstructToMap(std::unordered_map& factory_map) { +void WindTurbineType3or4Dynamics::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics"), &WindTurbineType3or4Dynamics_factory)); } -void WindTurbineType3or4Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType3or4Dynamics::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ +} -void WindTurbineType3or4Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) { +void WindTurbineType3or4Dynamics::addClassAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics.EnergySource"), &assign_WindTurbineType3or4Dynamics_EnergySource)); assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics.RemoteInputSignal"), &assign_WindTurbineType3or4Dynamics_RemoteInputSignal)); assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4Dynamics.WindPlantDynamics"), &assign_WindTurbineType3or4Dynamics_WindPlantDynamics)); } -const char WindTurbineType3or4Dynamics::debugName[] = "WindTurbineType3or4Dynamics"; -const char* WindTurbineType3or4Dynamics::debugString() -{ - return WindTurbineType3or4Dynamics::debugName; -} - const BaseClassDefiner WindTurbineType3or4Dynamics::declare() { return BaseClassDefiner(WindTurbineType3or4Dynamics::addConstructToMap, WindTurbineType3or4Dynamics::addPrimitiveAssignFnsToMap, WindTurbineType3or4Dynamics::addClassAssignFnsToMap, WindTurbineType3or4Dynamics::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType3or4Dynamics_factory() + { + return new WindTurbineType3or4Dynamics; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.hpp b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.hpp index e06840403..9f217f08c 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.hpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4Dynamics.hpp @@ -1,42 +1,43 @@ #ifndef WindTurbineType3or4Dynamics_H #define WindTurbineType3or4Dynamics_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "DynamicsFunctionBlock.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "DynamicsFunctionBlock.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class EnergySource; + class RemoteInputSignal; + class WindPlantDynamics; -class EnergySource; -class RemoteInputSignal; -class WindPlantDynamics; /* Parent class supporting relationships to wind turbines Type 3 and 4 and wind plant including their control models. */ - class WindTurbineType3or4Dynamics: public DynamicsFunctionBlock + class WindTurbineType3or4Dynamics : public DynamicsFunctionBlock { - public: - CIMPP::EnergySource* EnergySource; /* Energy Source (current source) with which this wind Type 3 or 4 dynamics model is asoociated. Default: 0 */ - CIMPP::RemoteInputSignal* RemoteInputSignal; /* Wind turbine Type 3 or 4 models using this remote input signal. Default: 0 */ - CIMPP::WindPlantDynamics* WindPlantDynamics; /* The wind plant with which the wind turbines type 3 or 4 are associated. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType3or4Dynamics(); - virtual ~WindTurbineType3or4Dynamics(); - + ~WindTurbineType3or4Dynamics() override; + + CIMPP::EnergySource* EnergySource; /* Energy Source (current source) with which this wind Type 3 or 4 dynamics model is asoociated. Default: 0 */ + CIMPP::RemoteInputSignal* RemoteInputSignal; /* Wind turbine Type 3 or 4 models using this remote input signal. Default: 0 */ + CIMPP::WindPlantDynamics* WindPlantDynamics; /* The wind plant with which the wind turbines type 3 or 4 are associated. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType3or4Dynamics_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.cpp b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.cpp index 3bb18fb7b..0b04e8254 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.cpp @@ -1,75 +1,96 @@ -#include -#include "WindTurbineType3or4Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType3or4IEC.hpp" -#include "WindContCurrLimIEC.hpp" +#include +#include + #include "WindContQIEC.hpp" +#include "WindContCurrLimIEC.hpp" #include "WindProtectionIEC.hpp" using namespace CIMPP; -WindTurbineType3or4IEC::WindTurbineType3or4IEC(): WindContCurrLimIEC(nullptr), WIndContQIEC(nullptr), WindProtectionIEC(nullptr) {}; - +WindTurbineType3or4IEC::WindTurbineType3or4IEC() : WIndContQIEC(nullptr), WindContCurrLimIEC(nullptr), WindProtectionIEC(nullptr) {}; WindTurbineType3or4IEC::~WindTurbineType3or4IEC() {}; -bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContCurrLimIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContCurrLimIEC != nullptr) - return assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} -bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WIndContQIEC = dynamic_cast(BaseClass_ptr2); - if(element->WIndContQIEC != nullptr) - return assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindProtectionIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindProtectionIEC != nullptr) - return assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} +bool assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType3or4IEC_WIndContQIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1); + WindContQIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WIndContQIEC != element2) + { + element->WIndContQIEC = element2; + return assign_WindContQIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} +bool assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType3or4IEC_WindContCurrLimIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1); + WindContCurrLimIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContCurrLimIEC != element2) + { + element->WindContCurrLimIEC = element2; + return assign_WindContCurrLimIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; +} -namespace CIMPP { - BaseClass* WindTurbineType3or4IEC_factory() { - return new WindTurbineType3or4IEC; +bool assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType3or4IEC_WindProtectionIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType3or4IEC* element = dynamic_cast(BaseClass_ptr1); + WindProtectionIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindProtectionIEC != element2) + { + element->WindProtectionIEC = element2; + return assign_WindProtectionIEC_WindTurbineType3or4IEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindTurbineType3or4IEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC"), &WindTurbineType3or4IEC_factory)); +const char WindTurbineType3or4IEC::debugName[] = "WindTurbineType3or4IEC"; +const char* WindTurbineType3or4IEC::debugString() const +{ + return WindTurbineType3or4IEC::debugName; } -void WindTurbineType3or4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType3or4IEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC"), &WindTurbineType3or4IEC_factory)); +} -void WindTurbineType3or4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindContCurrLimIEC"), &assign_WindTurbineType3or4IEC_WindContCurrLimIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WIndContQIEC"), &assign_WindTurbineType3or4IEC_WIndContQIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindProtectionIEC"), &assign_WindTurbineType3or4IEC_WindProtectionIEC)); +void WindTurbineType3or4IEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType3or4IEC::debugName[] = "WindTurbineType3or4IEC"; -const char* WindTurbineType3or4IEC::debugString() +void WindTurbineType3or4IEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType3or4IEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WIndContQIEC"), &assign_WindTurbineType3or4IEC_WIndContQIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindContCurrLimIEC"), &assign_WindTurbineType3or4IEC_WindContCurrLimIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType3or4IEC.WindProtectionIEC"), &assign_WindTurbineType3or4IEC_WindProtectionIEC)); } const BaseClassDefiner WindTurbineType3or4IEC::declare() @@ -77,4 +98,10 @@ const BaseClassDefiner WindTurbineType3or4IEC::declare() return BaseClassDefiner(WindTurbineType3or4IEC::addConstructToMap, WindTurbineType3or4IEC::addPrimitiveAssignFnsToMap, WindTurbineType3or4IEC::addClassAssignFnsToMap, WindTurbineType3or4IEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType3or4IEC_factory() + { + return new WindTurbineType3or4IEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.hpp b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.hpp index 5334a32ce..b85ecab14 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType3or4IEC.hpp @@ -1,42 +1,43 @@ #ifndef WindTurbineType3or4IEC_H #define WindTurbineType3or4IEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindTurbineType3or4Dynamics.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContCurrLimIEC; + class WindContQIEC; + class WindProtectionIEC; -class WindContCurrLimIEC; -class WindContQIEC; -class WindProtectionIEC; /* Parent class supporting relationships to IEC wind turbines Type 3 and 4 and wind plant including their control models. */ - class WindTurbineType3or4IEC: public WindTurbineType3or4Dynamics + class WindTurbineType3or4IEC : public WindTurbineType3or4Dynamics { - public: - CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* Wind control current limitation model associated with this wind turbine type 3 or 4 model. Default: 0 */ - CIMPP::WindContQIEC* WIndContQIEC; /* Wind control Q model associated with this wind turbine type 3 or 4 model. Default: 0 */ - CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 3 or 4 model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType3or4IEC(); - virtual ~WindTurbineType3or4IEC(); - + ~WindTurbineType3or4IEC() override; + + CIMPP::WindContQIEC* WIndContQIEC; /* Wind control Q model associated with this wind turbine type 3 or 4 model. Default: 0 */ + CIMPP::WindContCurrLimIEC* WindContCurrLimIEC; /* Wind control current limitation model associated with this wind turbine type 3 or 4 model. Default: 0 */ + CIMPP::WindProtectionIEC* WindProtectionIEC; /* Wind turbune protection model associated with this wind generator type 3 or 4 model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType3or4IEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.cpp b/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.cpp index 901bcea9a..ed87fb457 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.cpp @@ -1,49 +1,56 @@ -#include -#include "WindGenType4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType4aIEC.hpp" +#include +#include + #include "WindContPType4aIEC.hpp" using namespace CIMPP; -WindTurbineType4aIEC::WindTurbineType4aIEC(): WindContPType4aIEC(nullptr) {}; - +WindTurbineType4aIEC::WindTurbineType4aIEC() : WindContPType4aIEC(nullptr) {}; WindTurbineType4aIEC::~WindTurbineType4aIEC() {}; -bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType4aIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType4aIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType4aIEC != nullptr) - return assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; -} - -namespace CIMPP { - BaseClass* WindTurbineType4aIEC_factory() { - return new WindTurbineType4aIEC; +bool assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass*, BaseClass*); +bool assign_WindTurbineType4aIEC_WindContPType4aIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType4aIEC* element = dynamic_cast(BaseClass_ptr1); + WindContPType4aIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType4aIEC != element2) + { + element->WindContPType4aIEC = element2; + return assign_WindContPType4aIEC_WindTurbineType4aIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; } + return false; } -void WindTurbineType4aIEC::addConstructToMap(std::unordered_map& factory_map) { - factory_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC"), &WindTurbineType4aIEC_factory)); +const char WindTurbineType4aIEC::debugName[] = "WindTurbineType4aIEC"; +const char* WindTurbineType4aIEC::debugString() const +{ + return WindTurbineType4aIEC::debugName; } -void WindTurbineType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } +void WindTurbineType4aIEC::addConstructToMap(std::unordered_map& factory_map) +{ + factory_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC"), &WindTurbineType4aIEC_factory)); +} -void WindTurbineType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC.WindContPType4aIEC"), &assign_WindTurbineType4aIEC_WindContPType4aIEC)); +void WindTurbineType4aIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType4aIEC::debugName[] = "WindTurbineType4aIEC"; -const char* WindTurbineType4aIEC::debugString() +void WindTurbineType4aIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType4aIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4aIEC.WindContPType4aIEC"), &assign_WindTurbineType4aIEC_WindContPType4aIEC)); } const BaseClassDefiner WindTurbineType4aIEC::declare() @@ -51,4 +58,10 @@ const BaseClassDefiner WindTurbineType4aIEC::declare() return BaseClassDefiner(WindTurbineType4aIEC::addConstructToMap, WindTurbineType4aIEC::addPrimitiveAssignFnsToMap, WindTurbineType4aIEC::addClassAssignFnsToMap, WindTurbineType4aIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType4aIEC_factory() + { + return new WindTurbineType4aIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.hpp b/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.hpp index e60180f30..d8365200e 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType4aIEC.hpp @@ -1,38 +1,39 @@ #ifndef WindTurbineType4aIEC_H #define WindTurbineType4aIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenType4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindGenType4IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContPType4aIEC; -class WindContPType4aIEC; /* Wind turbine IEC Type 4A. Reference: IEC Standard 61400-27-1, section 6.5.5.2. */ - class WindTurbineType4aIEC: public WindGenType4IEC + class WindTurbineType4aIEC : public WindGenType4IEC { - public: - CIMPP::WindContPType4aIEC* WindContPType4aIEC; /* Wind control P type 4A model associated with this wind turbine type 4A model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType4aIEC(); - virtual ~WindTurbineType4aIEC(); - + ~WindTurbineType4aIEC() override; + + CIMPP::WindContPType4aIEC* WindContPType4aIEC; /* Wind control P type 4A model associated with this wind turbine type 4A model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType4aIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.cpp b/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.cpp index e04f05b99..d0d665581 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.cpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.cpp @@ -1,62 +1,76 @@ -#include -#include "WindGenType4IEC.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindTurbineType4bIEC.hpp" +#include +#include + #include "WindContPType4bIEC.hpp" #include "WindMechIEC.hpp" using namespace CIMPP; -WindTurbineType4bIEC::WindTurbineType4bIEC(): WindContPType4bIEC(nullptr), WindMechIEC(nullptr) {}; - +WindTurbineType4bIEC::WindTurbineType4bIEC() : WindContPType4bIEC(nullptr), WindMechIEC(nullptr) {}; WindTurbineType4bIEC::~WindTurbineType4bIEC() {}; + + + bool assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindContPType4bIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindContPType4bIEC != nullptr) - return assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType4bIEC_WindContPType4bIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1); + WindContPType4bIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindContPType4bIEC != element2) + { + element->WindContPType4bIEC = element2; + return assign_WindContPType4bIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } bool assign_WindMechIEC_WindTurbineType4bIEC(BaseClass*, BaseClass*); -bool assign_WindTurbineType4bIEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1)) { - element->WindMechIEC = dynamic_cast(BaseClass_ptr2); - if(element->WindMechIEC != nullptr) - return assign_WindMechIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); - } - return false; +bool assign_WindTurbineType4bIEC_WindMechIEC(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindTurbineType4bIEC* element = dynamic_cast(BaseClass_ptr1); + WindMechIEC* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (element->WindMechIEC != element2) + { + element->WindMechIEC = element2; + return assign_WindMechIEC_WindTurbineType4bIEC(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } - - - -namespace CIMPP { - BaseClass* WindTurbineType4bIEC_factory() { - return new WindTurbineType4bIEC; - } +const char WindTurbineType4bIEC::debugName[] = "WindTurbineType4bIEC"; +const char* WindTurbineType4bIEC::debugString() const +{ + return WindTurbineType4bIEC::debugName; } -void WindTurbineType4bIEC::addConstructToMap(std::unordered_map& factory_map) { +void WindTurbineType4bIEC::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC"), &WindTurbineType4bIEC_factory)); } -void WindTurbineType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { - } - -void WindTurbineType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindContPType4bIEC"), &assign_WindTurbineType4bIEC_WindContPType4bIEC)); - assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindMechIEC"), &assign_WindTurbineType4bIEC_WindMechIEC)); +void WindTurbineType4bIEC::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ } -const char WindTurbineType4bIEC::debugName[] = "WindTurbineType4bIEC"; -const char* WindTurbineType4bIEC::debugString() +void WindTurbineType4bIEC::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindTurbineType4bIEC::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindContPType4bIEC"), &assign_WindTurbineType4bIEC_WindContPType4bIEC)); + assign_map.insert(std::make_pair(std::string("cim:WindTurbineType4bIEC.WindMechIEC"), &assign_WindTurbineType4bIEC_WindMechIEC)); } const BaseClassDefiner WindTurbineType4bIEC::declare() @@ -64,4 +78,10 @@ const BaseClassDefiner WindTurbineType4bIEC::declare() return BaseClassDefiner(WindTurbineType4bIEC::addConstructToMap, WindTurbineType4bIEC::addPrimitiveAssignFnsToMap, WindTurbineType4bIEC::addClassAssignFnsToMap, WindTurbineType4bIEC::debugName); } - +namespace CIMPP +{ + BaseClass* WindTurbineType4bIEC_factory() + { + return new WindTurbineType4bIEC; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.hpp b/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.hpp index 77ce794fb..d7f049f14 100644 --- a/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.hpp +++ b/CGMES_2.4.15_27JAN2020/WindTurbineType4bIEC.hpp @@ -1,40 +1,41 @@ #ifndef WindTurbineType4bIEC_H #define WindTurbineType4bIEC_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindGenType4IEC.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - - +#include +#include -namespace CIMPP { +#include "WindGenType4IEC.hpp" +#include "BaseClassDefiner.hpp" +namespace CIMPP +{ + class WindContPType4bIEC; + class WindMechIEC; -class WindContPType4bIEC; -class WindMechIEC; /* Wind turbine IEC Type 4A. Reference: IEC Standard 61400-27-1, section 6.5.5.3. */ - class WindTurbineType4bIEC: public WindGenType4IEC + class WindTurbineType4bIEC : public WindGenType4IEC { - public: - CIMPP::WindContPType4bIEC* WindContPType4bIEC; /* Wind control P type 4B model associated with this wind turbine type 4B model. Default: 0 */ - CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 4B model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindTurbineType4bIEC(); - virtual ~WindTurbineType4bIEC(); - + ~WindTurbineType4bIEC() override; + + CIMPP::WindContPType4bIEC* WindContPType4bIEC; /* Wind control P type 4B model associated with this wind turbine type 4B model. Default: 0 */ + CIMPP::WindMechIEC* WindMechIEC; /* Wind mechanical model associated with this wind turbine Type 4B model. Default: 0 */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindTurbineType4bIEC_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.cpp b/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.cpp index 830489779..d17ab6680 100644 --- a/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "WindTurbineType1or2Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindType1or2UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; WindType1or2UserDefined::WindType1or2UserDefined() {}; - WindType1or2UserDefined::~WindType1or2UserDefined() {}; -bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindType1or2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindType1or2UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass*, BaseClass*); +bool assign_WindType1or2UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindType1or2UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_WindType1or2UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindType1or2UserDefined_factory() { - return new WindType1or2UserDefined; - } +const char WindType1or2UserDefined::debugName[] = "WindType1or2UserDefined"; +const char* WindType1or2UserDefined::debugString() const +{ + return WindType1or2UserDefined::debugName; } -void WindType1or2UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void WindType1or2UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined"), &WindType1or2UserDefined_factory)); } -void WindType1or2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindType1or2UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined.proprietary"), &assign_WindType1or2UserDefined_proprietary)); - } - -void WindType1or2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined.ProprietaryParameterDynamics"), &assign_WindType1or2UserDefined_ProprietaryParameterDynamics)); } -const char WindType1or2UserDefined::debugName[] = "WindType1or2UserDefined"; -const char* WindType1or2UserDefined::debugString() +void WindType1or2UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindType1or2UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindType1or2UserDefined.ProprietaryParameterDynamics"), &assign_WindType1or2UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner WindType1or2UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner WindType1or2UserDefined::declare() return BaseClassDefiner(WindType1or2UserDefined::addConstructToMap, WindType1or2UserDefined::addPrimitiveAssignFnsToMap, WindType1or2UserDefined::addClassAssignFnsToMap, WindType1or2UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* WindType1or2UserDefined_factory() + { + return new WindType1or2UserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.hpp b/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.hpp index 5acd4b697..e411af40e 100644 --- a/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/WindType1or2UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef WindType1or2UserDefined_H #define WindType1or2UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType1or2Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType1or2Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Wind Type 1 or Type 2 function block whose dynamic behaviour is described by */ - class WindType1or2UserDefined: public WindTurbineType1or2Dynamics + class WindType1or2UserDefined : public WindTurbineType1or2Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindType1or2UserDefined(); - virtual ~WindType1or2UserDefined(); - + ~WindType1or2UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindType1or2UserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.cpp b/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.cpp index 7c3abd134..1224d7233 100644 --- a/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.cpp +++ b/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.cpp @@ -1,64 +1,72 @@ -#include -#include "WindTurbineType3or4Dynamics.hpp" +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindType3or4UserDefined.hpp" -#include "Boolean.hpp" +#include +#include + #include "ProprietaryParameterDynamics.hpp" +#include "Boolean.hpp" using namespace CIMPP; WindType3or4UserDefined::WindType3or4UserDefined() {}; - WindType3or4UserDefined::~WindType3or4UserDefined() {}; -bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) { - if(WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - if(dynamic_cast(BaseClass_ptr2) != nullptr) { - element->ProprietaryParameterDynamics.push_back(dynamic_cast(BaseClass_ptr2)); +bool assign_WindType3or4UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) +{ + if (WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1)) + { + buffer >> element->proprietary; + if (buffer.fail()) + return false; + else return true; - } } return false; } -bool assign_WindType3or4UserDefined_proprietary(std::stringstream &buffer, BaseClass* BaseClass_ptr1) { - if(WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1)) { - buffer >> element->proprietary; - if(buffer.fail()) - return false; - else - return true; - } - else - return false; +bool assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass*, BaseClass*); +bool assign_WindType3or4UserDefined_ProprietaryParameterDynamics(BaseClass* BaseClass_ptr1, BaseClass* BaseClass_ptr2) +{ + WindType3or4UserDefined* element = dynamic_cast(BaseClass_ptr1); + ProprietaryParameterDynamics* element2 = dynamic_cast(BaseClass_ptr2); + if (element != nullptr && element2 != nullptr) + { + if (std::find(element->ProprietaryParameterDynamics.begin(), element->ProprietaryParameterDynamics.end(), element2) == element->ProprietaryParameterDynamics.end()) + { + element->ProprietaryParameterDynamics.push_back(element2); + return assign_ProprietaryParameterDynamics_WindType3or4UserDefined(BaseClass_ptr2, BaseClass_ptr1); + } + return true; + } + return false; } -namespace CIMPP { - BaseClass* WindType3or4UserDefined_factory() { - return new WindType3or4UserDefined; - } +const char WindType3or4UserDefined::debugName[] = "WindType3or4UserDefined"; +const char* WindType3or4UserDefined::debugString() const +{ + return WindType3or4UserDefined::debugName; } -void WindType3or4UserDefined::addConstructToMap(std::unordered_map& factory_map) { +void WindType3or4UserDefined::addConstructToMap(std::unordered_map& factory_map) +{ factory_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined"), &WindType3or4UserDefined_factory)); } -void WindType3or4UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) { +void WindType3or4UserDefined::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) +{ assign_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined.proprietary"), &assign_WindType3or4UserDefined_proprietary)); - } - -void WindType3or4UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - assign_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined.ProprietaryParameterDynamics"), &assign_WindType3or4UserDefined_ProprietaryParameterDynamics)); } -const char WindType3or4UserDefined::debugName[] = "WindType3or4UserDefined"; -const char* WindType3or4UserDefined::debugString() +void WindType3or4UserDefined::addClassAssignFnsToMap(std::unordered_map& assign_map) { - return WindType3or4UserDefined::debugName; + assign_map.insert(std::make_pair(std::string("cim:WindType3or4UserDefined.ProprietaryParameterDynamics"), &assign_WindType3or4UserDefined_ProprietaryParameterDynamics)); } const BaseClassDefiner WindType3or4UserDefined::declare() @@ -66,4 +74,10 @@ const BaseClassDefiner WindType3or4UserDefined::declare() return BaseClassDefiner(WindType3or4UserDefined::addConstructToMap, WindType3or4UserDefined::addPrimitiveAssignFnsToMap, WindType3or4UserDefined::addClassAssignFnsToMap, WindType3or4UserDefined::debugName); } - +namespace CIMPP +{ + BaseClass* WindType3or4UserDefined_factory() + { + return new WindType3or4UserDefined; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.hpp b/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.hpp index 48b9d891e..32737770c 100644 --- a/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.hpp +++ b/CGMES_2.4.15_27JAN2020/WindType3or4UserDefined.hpp @@ -1,40 +1,41 @@ #ifndef WindType3or4UserDefined_H #define WindType3or4UserDefined_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -#include "WindTurbineType3or4Dynamics.hpp" #include -#include "Boolean.hpp" -#include "Float.hpp" - +#include +#include +#include "WindTurbineType3or4Dynamics.hpp" +#include "BaseClassDefiner.hpp" #include "Boolean.hpp" -namespace CIMPP { - +namespace CIMPP +{ + class ProprietaryParameterDynamics; -class ProprietaryParameterDynamics; /* Wind Type 3 or Type 4 function block whose dynamic behaviour is described by */ - class WindType3or4UserDefined: public WindTurbineType3or4Dynamics + class WindType3or4UserDefined : public WindTurbineType3or4Dynamics { - public: - CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ - std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ - - static const char debugName[]; - virtual const char* debugString(); - /* constructor initialising all attributes to null */ WindType3or4UserDefined(); - virtual ~WindType3or4UserDefined(); - + ~WindType3or4UserDefined() override; + + std::list ProprietaryParameterDynamics; /* Parameter of this proprietary user-defined model. Default: 0 */ + CIMPP::Boolean proprietary; /* Behaviour is based on proprietary model as opposed to detailed model. true = user-defined model is proprietary with behaviour mutually understood by sending and receiving applications and parameters passed as general attributes false = user-defined model is explicitly defined in terms of control blocks and their input and output signals. Default: false */ + + static const char debugName[]; + const char* debugString() const override; + static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); static const BaseClassDefiner declare(); - }; BaseClass* WindType3or4UserDefined_factory(); diff --git a/CGMES_2.4.15_27JAN2020/WindingConnection.cpp b/CGMES_2.4.15_27JAN2020/WindingConnection.cpp index 680cd9da2..498dcbe94 100644 --- a/CGMES_2.4.15_27JAN2020/WindingConnection.cpp +++ b/CGMES_2.4.15_27JAN2020/WindingConnection.cpp @@ -1,12 +1,43 @@ -#include -#include +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ #include "WindingConnection.hpp" +#include +#include + +#include "../src/CIMExceptions.hpp" + using namespace CIMPP; -namespace CIMPP { - std::istream& operator>>(std::istream& lop, CIMPP::WindingConnection& rop) +WindingConnection& WindingConnection::operator=(WindingConnection_ENUM rop) +{ + value = rop; + initialized = true; + return *this; +} + +WindingConnection::operator WindingConnection_ENUM() const +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; +} + +const char WindingConnection::debugName[] = "WindingConnection"; +const char* WindingConnection::debugString() const +{ + return WindingConnection::debugName; +} + +namespace CIMPP +{ + std::istream& operator>>(std::istream& lop, WindingConnection& rop) { + rop.initialized = false; + std::string EnumSymbol; lop >> EnumSymbol; @@ -58,5 +89,47 @@ namespace CIMPP { lop.setstate(std::ios::failbit); return lop; } -} + std::ostream& operator<<(std::ostream& os, const WindingConnection& obj) + { + if (obj.initialized) + { + std::string EnumSymbol; + + if (obj.value == WindingConnection::D) + { + EnumSymbol = "D"; + } + if (obj.value == WindingConnection::Y) + { + EnumSymbol = "Y"; + } + if (obj.value == WindingConnection::Z) + { + EnumSymbol = "Z"; + } + if (obj.value == WindingConnection::Yn) + { + EnumSymbol = "Yn"; + } + if (obj.value == WindingConnection::Zn) + { + EnumSymbol = "Zn"; + } + if (obj.value == WindingConnection::A) + { + EnumSymbol = "A"; + } + if (obj.value == WindingConnection::I) + { + EnumSymbol = "I"; + } + + if (!EnumSymbol.empty()) + { + os << "WindingConnection." << EnumSymbol; + } + } + return os; + } +} diff --git a/CGMES_2.4.15_27JAN2020/WindingConnection.hpp b/CGMES_2.4.15_27JAN2020/WindingConnection.hpp index ba7c40617..398f89ecf 100644 --- a/CGMES_2.4.15_27JAN2020/WindingConnection.hpp +++ b/CGMES_2.4.15_27JAN2020/WindingConnection.hpp @@ -1,41 +1,66 @@ #ifndef WindingConnection_H #define WindingConnection_H +/* +Generated from the CGMES files via cimgen: https://github.com/sogno-platform/cimgen +*/ -namespace CIMPP { +#include +#include + +namespace CIMPP +{ /* Winding connection type. */ - enum class WindingConnection + class WindingConnection { - /** - * Delta - */ - D, - /** - * Wye - */ - Y, - /** - * ZigZag - */ - Z, - /** - * Wye, with neutral brought out for grounding. - */ - Yn, - /** - * ZigZag, with neutral brought out for grounding. - */ - Zn, - /** - * Autotransformer common winding - */ - A, - /** - * Independent winding, for single-phase connections - */ - I, + public: + enum WindingConnection_ENUM + { + /** + * Delta + */ + D, + /** + * Wye + */ + Y, + /** + * ZigZag + */ + Z, + /** + * Wye, with neutral brought out for grounding. + */ + Yn, + /** + * ZigZag, with neutral brought out for grounding. + */ + Zn, + /** + * Autotransformer common winding + */ + A, + /** + * Independent winding, for single-phase connections + */ + I, + }; + + WindingConnection() : value(), initialized(false) {} + WindingConnection(WindingConnection_ENUM value) : value(value), initialized(true) {} + + WindingConnection& operator=(WindingConnection_ENUM rop); + operator WindingConnection_ENUM() const; + + WindingConnection_ENUM value; + bool initialized; + + static const char debugName[]; + const char* debugString() const; + + friend std::istream& operator>>(std::istream& lop, WindingConnection& rop); + friend std::ostream& operator<<(std::ostream& os, const WindingConnection& obj); }; - std::istream& operator>>(std::istream& lop, CIMPP::WindingConnection& rop); } #endif diff --git a/src/Aliases.hpp b/src/Aliases.hpp deleted file mode 100644 index 08aaf742a..000000000 --- a/src/Aliases.hpp +++ /dev/null @@ -1,106 +0,0 @@ -#ifndef ALIASES_HPP -#define ALIASES_HPP - -#include -#include -#include -#include -#include - -#include "IEC61970/IEC61970CIMVersion.h" - -static std::list search_paths = { - "./", - "${CIMPP_ALIASDIR}/", -#ifdef __linux__ - "/usr/share/cimpp/", - "/usr/local/share/cimpp/", - "/usr/share/cimpp/${CIM_VERSION}/", - "/usr/local/share/cimpp/${CIM_VERSION}/", - "${HOME}/.cimpp/" -#elif defined(_WIN32) - "${APPDATA}\\CIMpp\\", - "${APPDATA}\\CIMpp\\${CIM_VERSION}\\" -#endif -}; - -// Update the input string. -static std::string expand_env_variables(std::string str) -{ - static std::regex env("\\$\\{([^}]+)\\}"); - std::smatch match; - while (std::regex_search(str, match, env)) { -#if defined(__linux__) || defined(__APPLE__) - const char *s = getenv(match[1].str().c_str()); -#elif defined(_WIN32) - char *s; - size_t len; - _dupenv_s(&s, &len, match[1].str().c_str()); -#else - #error Unsupported platform -#endif - - const std::string var(s == NULL ? "" : s); - str.replace(match.position(0), match.length(0) , var); - } - - return str; -} - -static std::ifstream find_aliases(const std::string &filename) -{ - std::ifstream file; - std::string path; - std::string::size_type pos; - - // Set CIM_DIR variable if not set - std::string cim_dir = IEC61970::IEC61970CIMVersion::version; - - pos = cim_dir.find("IEC61970CIM"); - if (pos == 0) - cim_dir.erase(0, 11); -#ifdef __linux__ - setenv("CIM_VERSION", cim_dir.c_str(), 1); -#elif defined(_WIN32) - std::string cim_version = "CIM_VERSION=" + cim_dir; - _putenv(cim_version.c_str()); -#endif - - for (std::string &path : search_paths) { - std::string expanded_path = expand_env_variables(path); - - file.open(expanded_path + filename); - if (file.good()) - return file; - } - - return file; -} - -template -void load_aliases(std::unordered_map &map, const std::string &filename) -{ - std::ifstream file = find_aliases(filename); - - if(file.good() && file.is_open()) - { - std::string line; - std::regex expr("^([a-zA-Z0-9:.]*)[\t ,;]+([a-zA-Z0-9:.]*)$"); - std::smatch m; - typename std::unordered_map::iterator it; - - while (std::getline(file, line)) - { - if(std::regex_match(line, m, expr)) - { - it = map.find(m[1]); - if(it != map.end()) - { - map.insert(std::make_pair(m[2], it->second)); - } - } - } - } -} - -#endif // ALIASES_HPP diff --git a/src/AliasesAssignment.hpp b/src/AliasesAssignment.hpp deleted file mode 100644 index 77059f547..000000000 --- a/src/AliasesAssignment.hpp +++ /dev/null @@ -1,2 +0,0 @@ -dynamic_switch.insert(std::make_pair("cim:Terminal.sequenceNumber", &assign_ACDCTerminal_sequenceNumber)); -dynamic_switch.insert(std::make_pair("cim:Terminal.connected", &assign_ACDCTerminal_connected)); diff --git a/src/AliasesTask.hpp b/src/AliasesTask.hpp deleted file mode 100644 index 932fa29c0..000000000 --- a/src/AliasesTask.hpp +++ /dev/null @@ -1,10 +0,0 @@ -map.insert(std::make_pair("cim:VoltageLevel.Substation", &assign_Substation_VoltageLevels)); -map.insert(std::make_pair("cim:SubGeographicalRegion.Region", &assign_GeographicalRegion_Regions)); -map.insert(std::make_pair("cim:Equipment.EquipmentContainer", &assign_EquipmentContainer_Equipments)); -map.insert(std::make_pair("cim:DiagramObject.IdentifiedObject", &assign_IdentifiedObject_DiagramObjects)); -map.insert(std::make_pair("cim:DiagramObjectPoint.DiagramObject", &assign_DiagramObject_DiagramObjectPoints)); -map.insert(std::make_pair("cim:Substation.Region", &assign_SubGeographicalRegion_Substations)); -map.insert(std::make_pair("cim:OperationalLimit.OperationalLimitSet", &assign_OperationalLimitSet_OperationalLimitValue)); -map.insert(std::make_pair("cim:ConformLoad.LoadGroup", &assign_ConformLoadGroup_EnergyConsumers)); -map.insert(std::make_pair("cim:LoadGroup.SubLoadArea", &assign_SubLoadArea_LoadGroups)); -map.insert(std::make_pair("cim:SubLoadArea.LoadArea", &assign_LoadArea_SubLoadAreas)); \ No newline at end of file diff --git a/src/CIMContentHandler.cpp b/src/CIMContentHandler.cpp index 5aa026ae5..036b3823c 100644 --- a/src/CIMContentHandler.cpp +++ b/src/CIMContentHandler.cpp @@ -1,19 +1,12 @@ #include "CIMContentHandler.hpp" + #include -#include #include -#include - -#include "Folders.hpp" #include "CIMFactory.hpp" #include "assignments.hpp" #include "CIMExceptions.hpp" -#ifndef CGMES_BUILD -#include "CIMNamespaces.hpp" -#endif - CIMContentHandler::CIMContentHandler() : Objects(nullptr), RDFMap(nullptr) { } @@ -133,7 +126,7 @@ void CIMContentHandler::startElement(const std::string &namespaceURI, const std: } // Create a task if the XML element is no CIM class and contains a RDF ID std::string rdf_id = get_rdf_resource(atts); - if(!rdf_id.empty()) + if (!rdf_id.empty()) { taskQueue.push_back(Task(objectStack.top(), qName, rdf_id)); return; diff --git a/src/CIMExceptions.cpp b/src/CIMExceptions.cpp index 51eb8f8de..2903b3dc9 100644 --- a/src/CIMExceptions.cpp +++ b/src/CIMExceptions.cpp @@ -54,4 +54,3 @@ ReadingUninitializedField::ReadingUninitializedField() { message = "Error: Uninitialized Field"; } - diff --git a/src/CIMExceptions.hpp b/src/CIMExceptions.hpp index 99877b5aa..bd49150b2 100644 --- a/src/CIMExceptions.hpp +++ b/src/CIMExceptions.hpp @@ -10,7 +10,7 @@ class ModelDescriptionHandler; class CIMContentHandler; class CIMException : public std::exception -{ +{ public: CIMException(); protected: diff --git a/src/ModelDescriptionHandler.cpp b/src/ModelDescriptionHandler.cpp index da9243948..be0bdb1ab 100644 --- a/src/ModelDescriptionHandler.cpp +++ b/src/ModelDescriptionHandler.cpp @@ -1,18 +1,10 @@ #include "ModelDescriptionHandler.hpp" -#include "IEC61970/IEC61970CIMVersion.h" - -#ifndef CGMES_BUILD -#include "IEC61970/Base/Domain/String.h" -#include "CIMNamespaces.hpp" -#else -#include "String.hpp" -#endif -#include #include #include #include "CIMExceptions.hpp" +#include "IEC61970/IEC61970CIMVersion.h" using CIMPP::IEC61970CIMVersion; @@ -36,8 +28,9 @@ void ModelDescriptionHandler::startPrefixMapping(const std::string &prefix, cons { if(prefix == "cim") { - std::size_t pos = IEC61970CIMVersion::version.find("CIM"); - std::string versionParser = IEC61970CIMVersion::version.substr(pos+3,2); + std::string version = IEC61970CIMVersion::version; + std::size_t pos = version.find("CIM"); + std::string versionParser = version.substr(pos+3, 2); pos = uri.find("cim"); std::string versionFile = uri.substr(pos+3,2); @@ -132,26 +125,26 @@ void ModelDescriptionHandler::skippedEntity(const std::string &name) std::string ModelDescriptionHandler::get_rdf_id(const AttributesT &attributes) { - for(int i = 0; i < attributes.getLength(); i++) - { - if(attributes.getQName(i) == "rdf:ID") - return attributes.getValue(i); - if(attributes.getQName(i) == "rdf:about") - return attributes.getValue(i).substr(0); - } - return std::string(); + for(int i = 0; i < attributes.getLength(); i++) + { + if(attributes.getQName(i) == "rdf:ID") + return attributes.getValue(i); + if(attributes.getQName(i) == "rdf:about") + return attributes.getValue(i).substr(0); + } + return std::string(); } std::string ModelDescriptionHandler::get_rdf_resource(const AttributesT &attributes) //TODO: Resource in get_rdf_id ? { for(int i = 0; i < attributes.getLength(); i++) - { - if(attributes.getQName(i) == "rdf:resource") - { - return attributes.getValue(i).substr(0); - } - } - return std::string(); + { + if(attributes.getQName(i) == "rdf:resource") + { + return attributes.getValue(i).substr(0); + } + } + return std::string(); } void ModelDescriptionHandler::setModelDescription(ModelDescription* mDesc) diff --git a/src/ModelDescriptionHandler.hpp b/src/ModelDescriptionHandler.hpp index dbb1bf81d..3291fb486 100644 --- a/src/ModelDescriptionHandler.hpp +++ b/src/ModelDescriptionHandler.hpp @@ -31,9 +31,9 @@ class ModelDescriptionHandler : public Arabica::SAX::ContentHandler static std::string get_rdf_id(const AttributesT &properties); static std::string get_rdf_resource(const AttributesT &properties); -private: +private: ModelDescription* modelDescription; - + std::stack tagStack; }; diff --git a/static/BaseClass.cpp b/static/BaseClass.cpp index 20dc2088d..ff3a94a5a 100644 --- a/static/BaseClass.cpp +++ b/static/BaseClass.cpp @@ -1,22 +1,20 @@ - #include "BaseClass.hpp" using namespace CIMPP; BaseClass::~BaseClass() {} -void BaseClass::addConstructToMap(std::unordered_map& factory_map) {} - -void BaseClass::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void BaseClass::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - const char BaseClass::debugName[] = "BaseClass"; -const char* BaseClass::debugString() +const char* BaseClass::debugString() const { return BaseClass::debugName; } -CIMPP::BaseClassDefiner BaseClass::declare() { +void BaseClass::addConstructToMap(std::unordered_map& factory_map) {} +void BaseClass::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} +void BaseClass::addClassAssignFnsToMap(std::unordered_map& assign_map) {} + +const BaseClassDefiner BaseClass::declare() +{ return BaseClassDefiner(BaseClass::addConstructToMap, BaseClass::addPrimitiveAssignFnsToMap, BaseClass::addClassAssignFnsToMap, BaseClass::debugName); } diff --git a/static/BaseClass.hpp b/static/BaseClass.hpp index a7cd61294..7af998c6b 100644 --- a/static/BaseClass.hpp +++ b/static/BaseClass.hpp @@ -5,18 +5,23 @@ #define CGMES_BUILD #endif +#include #include + #include "BaseClassDefiner.hpp" -class BaseClass { +class BaseClass +{ public: enum cgmesProfile {EQ = 0, SSH = 1, TP = 2, SV = 3, DY = 4, GL = 5, DI = 6}; virtual ~BaseClass(); - static CIMPP::BaseClassDefiner declare(); - static void addConstructToMap(std::unordered_map&); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - const static char debugName[]; - virtual const char* debugString(); + + static const char debugName[]; + virtual const char* debugString() const; + + static void addConstructToMap(std::unordered_map& factory_map); + static void addPrimitiveAssignFnsToMap(std::unordered_map& assign_map); + static void addClassAssignFnsToMap(std::unordered_map& assign_map); + static const CIMPP::BaseClassDefiner declare(); }; #endif // BASECLASS_HPP diff --git a/static/Boolean.cpp b/static/Boolean.cpp index 35f7fa9a1..1818ab8a1 100644 --- a/static/Boolean.cpp +++ b/static/Boolean.cpp @@ -1,21 +1,13 @@ #include "Boolean.hpp" -#include "CIMExceptions.hpp" -using namespace CIMPP; - -Boolean::Boolean(){} - -Boolean::~Boolean(){} +#include +#include -Boolean::Boolean(bool value) - : value(value), initialized(true) {} +#include "../src/CIMExceptions.hpp" -const BaseClassDefiner Boolean::declare() -{ - return BaseClassDefiner(Boolean::addConstructToMap, Boolean::addPrimitiveAssignFnsToMap, Boolean::addClassAssignFnsToMap, Boolean::debugName); -} +using namespace CIMPP; -Boolean& Boolean::operator=(bool &rop) +Boolean& Boolean::operator=(bool rop) { value = rop; initialized = true; @@ -24,56 +16,57 @@ Boolean& Boolean::operator=(bool &rop) Boolean::operator bool() { - if(!initialized) + if (!initialized) { throw new ReadingUninitializedField(); } return value; } -void Boolean::addConstructToMap(std::unordered_map& factory_map) {} - -void Boolean::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Boolean::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - const char Boolean::debugName[] = "Boolean"; -const char* Boolean::debugString() +const char* Boolean::debugString() const { return Boolean::debugName; } -namespace CIMPP { +namespace CIMPP +{ std::istream& operator>>(std::istream& lop, Boolean& rop) { + rop.initialized = false; + std::string tmp; lop >> tmp; - if(tmp == "true" || tmp == "True" || tmp == "TRUE") + + if (tmp == "true" || tmp == "True" || tmp == "TRUE") { rop.value = true; rop.initialized = true; return lop; } - if(tmp == "false" || tmp == "False" || tmp == "FALSE") + if (tmp == "false" || tmp == "False" || tmp == "FALSE") { rop.value = false; rop.initialized = true; return lop; } - else - { - lop.setstate(std::ios::failbit); - return lop; - } + + lop.setstate(std::ios::failbit); + return lop; } - std::ostream& operator<<(std::ostream& os, Boolean& rop) + std::ostream& operator<<(std::ostream& os, const Boolean& obj) { - if (rop) { - os << "true"; - } - else { - os << "false"; + if (obj.initialized) + { + if (obj.value) + { + os << "true"; + } + else + { + os << "false"; + } } return os; } diff --git a/static/Boolean.hpp b/static/Boolean.hpp index 34e30d18a..9dc8d09c2 100644 --- a/static/Boolean.hpp +++ b/static/Boolean.hpp @@ -1,38 +1,31 @@ #ifndef BOOLEAN_H #define BOOLEAN_H -#include -#include #include +#include -#include "BaseClass.hpp" - -namespace CIMPP { +namespace CIMPP +{ /** * A type with the value space "true" and "false". */ class Boolean { public: - Boolean(); - virtual ~Boolean(); - static const BaseClassDefiner declare(); + Boolean() : value(false), initialized(false) {} + Boolean(bool value) : value(value), initialized(true) {} - Boolean(bool value); - Boolean& operator=(bool &rop); - friend std::istream& operator>>(std::istream& lop, Boolean& rop); - friend std::ostream& operator<<(std::ostream& os, Boolean& rop); + Boolean& operator=(bool rop); operator bool(); - bool value = false; - bool initialized = false; + bool value; + bool initialized; static const char debugName[]; - virtual const char* debugString(); + const char* debugString() const; - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + friend std::istream& operator>>(std::istream& lop, Boolean& rop); + friend std::ostream& operator<<(std::ostream& os, const Boolean& obj); }; } -#endif +#endif // BOOLEAN_H diff --git a/static/Date.cpp b/static/Date.cpp deleted file mode 100644 index 79a800c86..000000000 --- a/static/Date.cpp +++ /dev/null @@ -1,20 +0,0 @@ - -#include "BaseClass.hpp" -#include "Date.hpp" -#include "String.hpp" - -using namespace CIMPP; - -Date::Date() {} - -Date::Date(String s) -{ - value=s; -} - -Date::~Date() {} - -BaseClass* Date_factory() -{ - return new Date; -} diff --git a/static/Date.hpp b/static/Date.hpp deleted file mode 100644 index 6027d6e09..000000000 --- a/static/Date.hpp +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef Date_H -#define Date_H - -#include "BaseClass.hpp" -#include "String.hpp" - - -/* -Date as "yyyy-mm-dd", which conforms with ISO 8601. UTC time zone is specified as "yyyy-mm-ddZ". A local timezone relative UTC is specified as "yyyy-mm-dd(+/-)hh:mm". -*/ -namespace CIMPP { - - class Date: public BaseClass - { - public: - Date(); - Date(String); - virtual ~Date(); - - private: - String value; - }; - - BaseClass* Date_factory(); -} -#endif diff --git a/static/Float.cpp b/static/Float.cpp deleted file mode 100644 index c264cee83..000000000 --- a/static/Float.cpp +++ /dev/null @@ -1,67 +0,0 @@ -#include "Float.hpp" -#include "CIMExceptions.hpp" - -using namespace CIMPP; - -Float::Float(){} - -Float::~Float(){} - -Float::Float(long double value) : value(value), initialized(true) {} - -void Float::addConstructToMap(std::unordered_map& factory_map) {} - -void Float::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Float::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -const char Float::debugName[] = "Float"; -const char* Float::debugString() { - return Float::debugName; -} - -const BaseClassDefiner Float::declare() { - return BaseClassDefiner(Float::addConstructToMap, Float::addPrimitiveAssignFnsToMap, Float::addClassAssignFnsToMap, Float::debugName); -} - -Float& Float::operator=(long double &rop) { - value = rop; - initialized = true; - return *this; -} - -Float& Float::operator-=(const Float& rhs) { - value -= rhs.value; - return *this; -} - -Float& Float::operator*=(const Float& rhs) { - value *= rhs.value; - return *this; -} - -Float& Float::operator/=(const Float& rhs) { - value /= rhs.value; - return *this; -} - -Float& Float::operator+=(const Float& rhs) { - value += rhs.value; - return *this; -} - -Float::operator long double() { - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; -} - -std::istream& operator>>(std::istream& lop, Float& rop) { - std::string tmp; - lop >> tmp; - rop.value = stold(tmp); - rop.initialized = true; - return lop; -} diff --git a/static/Float.hpp b/static/Float.hpp deleted file mode 100644 index ab30f43d6..000000000 --- a/static/Float.hpp +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef FLOAT_H -#define FLOAT_H - -#include -#include -#include - -#include "BaseClass.hpp" - -namespace CIMPP { - - /** - * A floating point number. The range is unspecified and not limited. - */ - class Float : public BaseClass - { - - public: - Float(); - virtual ~Float(); - Float(long double value); - static const BaseClassDefiner declare(); - Float& operator=(long double &rop); - Float& operator+=(const Float& rhs); - Float& operator-=(const Float& rhs); - Float& operator*=(const Float& rhs); - Float& operator/=(const Float& rhs); - friend std::istream& operator>>(std::istream& lop, Float& rop); - operator long double(); - - long double value = 0.0; - bool initialized = false; - - static const char debugName[]; - virtual const char* debugString(); - - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); - }; -} -#endif // FLOAT_H diff --git a/static/IEC61970/IEC61970CIMVersion.cpp b/static/IEC61970/IEC61970CIMVersion.cpp index c769c5282..8cda241ab 100644 --- a/static/IEC61970/IEC61970CIMVersion.cpp +++ b/static/IEC61970/IEC61970CIMVersion.cpp @@ -7,9 +7,5 @@ using namespace CIMPP; -IEC61970CIMVersion::IEC61970CIMVersion(){} - -IEC61970CIMVersion::~IEC61970CIMVersion(){} - const Date IEC61970CIMVersion::date = Date("2017-07-26"); -const String IEC61970CIMVersion::version = "IEC61970CIM17v23"; +const String IEC61970CIMVersion::version = String("IEC61970CIM17v23"); diff --git a/static/IEC61970/IEC61970CIMVersion.h b/static/IEC61970/IEC61970CIMVersion.h index 61a9e2910..5860ce018 100644 --- a/static/IEC61970/IEC61970CIMVersion.h +++ b/static/IEC61970/IEC61970CIMVersion.h @@ -1,31 +1,27 @@ +#ifndef IEC61970CIMVERSION_H +#define IEC61970CIMVERSION_H /////////////////////////////////////////////////////////// // IEC61970CIMVersion.h // Implementation of the Class IEC61970CIMVersion /////////////////////////////////////////////////////////// -#ifndef IEC61970CIMVERSION_H -#define IEC61970CIMVERSION_H - -#include "BaseClass.hpp" #include "Date.hpp" #include "String.hpp" namespace CIMPP { - class IEC61970CIMVersion : public BaseClass + class IEC61970CIMVersion { public: - IEC61970CIMVersion(); - virtual ~IEC61970CIMVersion(); - /** - * Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. - */ - static const Date date; - /** - * Form is IEC61970CIMXXvYY where XX is the major CIM package version and the YY - * is the minor version. For example IEC61970CIM13v18. - */ - static const String version; + /** + * Form is YYYY-MM-DD for example for January 5, 2009 it is 2009-01-05. + */ + static const Date date; + /** + * Form is IEC61970CIMXXvYY where XX is the major CIM package version and the YY + * is the minor version. For example IEC61970CIM13v18. + */ + static const String version; }; } #endif // IEC61970CIMVERSION_H diff --git a/static/Integer.cpp b/static/Integer.cpp index 638dd4175..2a1cda438 100644 --- a/static/Integer.cpp +++ b/static/Integer.cpp @@ -1,72 +1,74 @@ #include "Integer.hpp" -#include "CIMExceptions.hpp" -using namespace CIMPP; +#include -Integer::Integer(){} +#include "../src/CIMExceptions.hpp" -Integer::~Integer(){} +using namespace CIMPP; -Integer::Integer(long int value) - : value(value), initialized(true) {} +Integer& Integer::operator=(long int rop) +{ + value = rop; + initialized = true; + return *this; +} -const BaseClassDefiner Integer::declare() { - return BaseClassDefiner(Integer::addConstructToMap, Integer::addPrimitiveAssignFnsToMap, Integer::addClassAssignFnsToMap, Integer::debugName); +Integer::operator long int() +{ + if (!initialized) + { + throw new ReadingUninitializedField(); + } + return value; } const char Integer::debugName[] = "Integer"; -const char* Integer::debugString() { +const char* Integer::debugString() const +{ return Integer::debugName; } -void Integer::addConstructToMap(std::unordered_map& factory_map) {} - -void Integer::addPrimitiveAssignFnsToMap(std::unordered_map& assign_map) {} - -void Integer::addClassAssignFnsToMap(std::unordered_map& assign_map) {} - -namespace CIMPP { - Integer& Integer::operator=(long int &rop){ - value = rop; - initialized = true; - return *this; - } - - Integer& Integer::operator-=(const Integer& rhs){ - value -= rhs.value; - return *this; - } - - Integer& Integer::operator*=(const Integer& rhs){ - value *= rhs.value; - return *this; - } +Integer& Integer::operator+=(const Integer& rhs) +{ + value += rhs.value; + return *this; +} - Integer& Integer::operator/=(const Integer& rhs){ - value /= rhs.value; - return *this; - } +Integer& Integer::operator-=(const Integer& rhs) +{ + value -= rhs.value; + return *this; +} - Integer& Integer::operator+=(const Integer& rhs){ - value += rhs.value; - return *this; - } +Integer& Integer::operator*=(const Integer& rhs) +{ + value *= rhs.value; + return *this; +} - Integer::operator long int(){ - if(!initialized) - { - throw new ReadingUninitializedField(); - } - return value; - } +Integer& Integer::operator/=(const Integer& rhs) +{ + value /= rhs.value; + return *this; +} +namespace CIMPP +{ std::istream& operator>>(std::istream& lop, Integer& rop) { std::string tmp; lop >> tmp; - rop.value = stol(tmp); rop.initialized = true; return lop; } + + std::ostream& operator<<(std::ostream& os, const Integer& obj) + { + if (obj.initialized) + { + os << obj.value; + } + return os; + } } diff --git a/static/Integer.hpp b/static/Integer.hpp index a39f6c814..fab9a715c 100644 --- a/static/Integer.hpp +++ b/static/Integer.hpp @@ -1,41 +1,36 @@ #ifndef INTEGER_H #define INTEGER_H -#include -#include #include +#include -#include "BaseClass.hpp" - -namespace CIMPP { - +namespace CIMPP +{ /** - * An Integer number. The range is unspecified and not limited. - */ + * An Integer number. The range is unspecified and not limited. + */ class Integer { public: - Integer(); - Integer(long int value); - virtual ~Integer(); - static const BaseClassDefiner declare(); - Integer& operator=(long int &rop); - Integer& operator+=(const Integer& rhs); - Integer& operator-=(const Integer& rhs); - Integer& operator*=(const Integer& rhs); - Integer& operator/=(const Integer& rhs); - friend std::istream& operator>>(std::istream& lop, Integer& rop); + Integer() : value(0), initialized(false) {} + Integer(long int value) : value(value), initialized(true) {} + + Integer& operator=(long int rop); operator long int(); - long int value = 0; - bool initialized = false; + long int value; + bool initialized; static const char debugName[]; - virtual const char* debugString(); + const char* debugString() const; - static void addConstructToMap(std::unordered_map& factory_map); - static void addPrimitiveAssignFnsToMap(std::unordered_map&); - static void addClassAssignFnsToMap(std::unordered_map&); + Integer& operator+=(const Integer& rhs); + Integer& operator-=(const Integer& rhs); + Integer& operator*=(const Integer& rhs); + Integer& operator/=(const Integer& rhs); + + friend std::istream& operator>>(std::istream& lop, Integer& rop); + friend std::ostream& operator<<(std::ostream& os, const Integer& obj); }; } #endif // INTEGER_H diff --git a/static/String.hpp b/static/String.hpp deleted file mode 100644 index 9ed603352..000000000 --- a/static/String.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef STRING_H -#define STRING_H - -#include "BaseClass.hpp" -#include "string" - -/* -A string consisting of a sequence of characters. The character encoding is UTF-8. The string length is unspecified and unlimited. -*/ -namespace CIMPP { - - typedef std::string String; -} -#endif diff --git a/static/Task.cpp b/static/Task.cpp index 47f50c291..be10d25a4 100644 --- a/static/Task.cpp +++ b/static/Task.cpp @@ -1,8 +1,9 @@ +#include "Task.hpp" + #include -#include "Folders.hpp" +#include "IdentifiedObject.hpp" #include "CIMClassList.hpp" -#include "Task.hpp" using namespace CIMPP; @@ -30,15 +31,15 @@ bool Task::resolve(std::unordered_map *RDFMap) { std::unordered_map::iterator it_id = RDFMap->find(_Value); if(it_id == RDFMap->end()) { - std::cerr << "Couldn't find " << _CIMAttrName << " with value: " << _Value << " in RDFMap." << std::endl; + std::cerr << "Couldn't find " << _CIMAttrName << " with value: " << _Value << " in RDFMap." << std::endl; return false; } std::unordered_map::iterator it_func = dynamic_switch.find(_CIMAttrName); - if(it_func == dynamic_switch.end()) { - std::cerr << "Couldn't find " << _CIMAttrName << " in dynamic_switch map." << std::endl; - return false; - } + if (it_func == dynamic_switch.end()) { + std::cerr << "Couldn't find " << _CIMAttrName << " in dynamic_switch map." << std::endl; + return false; + } if((*it_func->second)(_CIMObj, it_id->second)) return true; @@ -55,5 +56,3 @@ static std::unordered_map initialize() return object_map; } - - diff --git a/static/UnknownType.cpp b/static/UnknownType.cpp index 1518151d5..fc55a922e 100644 --- a/static/UnknownType.cpp +++ b/static/UnknownType.cpp @@ -129,6 +129,9 @@ void UnknownType::addConstructToMap(std::unordered_map dynamic_switch_factory() return assign_map; } - From 17c14378b568319e4edeae7ce008188b052eec8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=BCnther?= Date: Sun, 27 Oct 2024 21:27:47 +0100 Subject: [PATCH 9/9] Adapt example to new generated String class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Thomas Günther --- examples/src/main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/examples/src/main.cpp b/examples/src/main.cpp index 14e2f2cbf..880f8e3e0 100644 --- a/examples/src/main.cpp +++ b/examples/src/main.cpp @@ -1,12 +1,8 @@ #include #include #include "CIMModel.hpp" -#include "IEC61970.hpp" -#include "CIMExceptions.hpp" - -#ifndef CGMES_BUILD -#include "CIMNamespaces.hpp" -#endif +#include "BaseClass.hpp" +#include "IdentifiedObject.hpp" std::string formatName(std::string name) { if (name.length() > 12) { @@ -53,7 +49,8 @@ int main(int argc, char** argv) { if(CIMPP::IdentifiedObject* IdObj = dynamic_cast(Object)) { - if(!IdObj->name.empty()) { + if (IdObj->name.initialized) + { static unsigned int i = 0; std::string outputName = formatName(IdObj->name); std::cout << outputName;